mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-21 01:12:26 +08:00
2003-03-27 Roland McGrath <roland@redhat.com>
* sysdeps/powerpc/bits/atomic.h [! __powerpc64__] (__arch_atomic_decrement_if_positive_64): Fix bogus definition.
This commit is contained in:
parent
3e60b5f234
commit
448163bae2
@ -175,7 +175,7 @@ typedef uintmax_t uatomic_max_t;
|
||||
# define __arch_atomic_exchange_and_add_64(mem, value) \
|
||||
({ abort (); (*mem) = (value); })
|
||||
# define __arch_atomic_decrement_if_positive_64(mem) \
|
||||
({ abort (); (*mem) = (value); })
|
||||
({ abort (); (*mem)--; })
|
||||
#endif
|
||||
|
||||
#define __arch_atomic_exchange_32(mem, value) \
|
||||
@ -204,7 +204,7 @@ typedef uintmax_t uatomic_max_t;
|
||||
__val; \
|
||||
})
|
||||
|
||||
#define __arch_atomic_decrement_if_positive_32(mem) \
|
||||
#define __arch_atomic_decrement_if_positive_32(mem) \
|
||||
({ int __val, __tmp; \
|
||||
__asm __volatile ("1: lwarx %0,0,%3\n" \
|
||||
" cmpwi 0,%0,0\n" \
|
||||
@ -246,13 +246,13 @@ typedef uintmax_t uatomic_max_t;
|
||||
|
||||
|
||||
/* Decrement *MEM if it is > 0, and return the old value. */
|
||||
#define atomic_decrement_if_positive(mem) \
|
||||
({ __typeof (*(mem)) __result; \
|
||||
#define atomic_decrement_if_positive(mem) \
|
||||
({ __typeof (*(mem)) __result; \
|
||||
if (sizeof (*mem) == 4) \
|
||||
__result = __arch_atomic_decrement_if_positive_32 (mem); \
|
||||
__result = __arch_atomic_decrement_if_positive_32 (mem); \
|
||||
else if (sizeof (*mem) == 8) \
|
||||
__result = __arch_atomic_decrement_if_positive_64 (mem); \
|
||||
else \
|
||||
__result = __arch_atomic_decrement_if_positive_64 (mem); \
|
||||
else \
|
||||
abort (); \
|
||||
__result; \
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user