mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-04 02:40:06 +00:00
Fix a few unused definitions.
This commit is contained in:
parent
6326c93cfd
commit
0a0ee8be8f
@ -121,26 +121,35 @@ typedef uintmax_t uatomic_max_t;
|
|||||||
|
|
||||||
#define atomic_exchange_and_add(mem, value) \
|
#define atomic_exchange_and_add(mem, value) \
|
||||||
({ __typeof (*mem) result; \
|
({ __typeof (*mem) result; \
|
||||||
|
__typeof (value) addval = (value); \
|
||||||
if (sizeof (*mem) == 1) \
|
if (sizeof (*mem) == 1) \
|
||||||
|
{ \
|
||||||
__asm __volatile (LOCK "xaddb %b0, %1" \
|
__asm __volatile (LOCK "xaddb %b0, %1" \
|
||||||
: "=r" (result), "=m" (*mem) \
|
: "=r" (result), "=m" (*mem) \
|
||||||
: "0" (value), "1" (*mem)); \
|
: "0" (addval), "1" (*mem)); \
|
||||||
|
result += addval; \
|
||||||
|
} \
|
||||||
else if (sizeof (*mem) == 2) \
|
else if (sizeof (*mem) == 2) \
|
||||||
|
{ \
|
||||||
__asm __volatile (LOCK "xaddw %w0, %1" \
|
__asm __volatile (LOCK "xaddw %w0, %1" \
|
||||||
: "=r" (result), "=m" (*mem) \
|
: "=r" (result), "=m" (*mem) \
|
||||||
: "0" (value), "1" (*mem)); \
|
: "0" (addval), "1" (*mem)); \
|
||||||
|
result += addval; \
|
||||||
|
} \
|
||||||
else if (sizeof (*mem) == 4) \
|
else if (sizeof (*mem) == 4) \
|
||||||
|
{ \
|
||||||
__asm __volatile (LOCK "xaddl %0, %1" \
|
__asm __volatile (LOCK "xaddl %0, %1" \
|
||||||
: "=r" (result), "=m" (*mem) \
|
: "=r" (result), "=m" (*mem) \
|
||||||
: "0" (value), "1" (*mem)); \
|
: "0" (addval), "1" (*mem)); \
|
||||||
|
result += addval; \
|
||||||
|
} \
|
||||||
else \
|
else \
|
||||||
{ \
|
{ \
|
||||||
__typeof (value) addval = (value); \
|
|
||||||
__typeof (*mem) oldval; \
|
__typeof (*mem) oldval; \
|
||||||
__typeof (mem) memp = (mem); \
|
__typeof (mem) memp = (mem); \
|
||||||
do \
|
do \
|
||||||
result = (oldval = *memp) + addval; \
|
result = (oldval = *memp) + addval; \
|
||||||
while (! __arch_compare_and_exchange_64_acq (memp, result, oldval)); \
|
while (__arch_compare_and_exchange_64_acq (memp, result, oldval)); \
|
||||||
} \
|
} \
|
||||||
result; })
|
result; })
|
||||||
|
|
||||||
@ -169,7 +178,7 @@ typedef uintmax_t uatomic_max_t;
|
|||||||
__typeof (mem) memp = (mem); \
|
__typeof (mem) memp = (mem); \
|
||||||
do \
|
do \
|
||||||
oldval = *memp; \
|
oldval = *memp; \
|
||||||
while (! __arch_compare_and_exchange_64_acq (memp, \
|
while (__arch_compare_and_exchange_64_acq (memp, \
|
||||||
oldval + addval, \
|
oldval + addval, \
|
||||||
oldval)); \
|
oldval)); \
|
||||||
} \
|
} \
|
||||||
@ -233,8 +242,7 @@ typedef uintmax_t uatomic_max_t;
|
|||||||
__typeof (mem) memp = (mem); \
|
__typeof (mem) memp = (mem); \
|
||||||
do \
|
do \
|
||||||
oldval = *memp; \
|
oldval = *memp; \
|
||||||
while (! __arch_compare_and_exchange_64_acq (memp, \
|
while (__arch_compare_and_exchange_64_acq (memp, oldval + 1, \
|
||||||
oldval + 1, \
|
|
||||||
oldval)); \
|
oldval)); \
|
||||||
} \
|
} \
|
||||||
})
|
})
|
||||||
@ -278,8 +286,7 @@ typedef uintmax_t uatomic_max_t;
|
|||||||
__typeof (mem) memp = (mem); \
|
__typeof (mem) memp = (mem); \
|
||||||
do \
|
do \
|
||||||
oldval = *memp; \
|
oldval = *memp; \
|
||||||
while (! __arch_compare_and_exchange_64_acq (memp, \
|
while (__arch_compare_and_exchange_64_acq (memp, oldval - 1, \
|
||||||
oldval - 1, \
|
|
||||||
oldval)); \
|
oldval)); \
|
||||||
} \
|
} \
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user