#if (BITS_PER_LONG == 64)
case 8:
{
- unsigned int result = old;
+ unsigned long result = old;
__asm__ __volatile__(
"lock; cmpxchgq %2, %1"
: "+a"(result), "+m"(*__hp(addr))
#define do_test(ptr) \
do { \
- __typeof__(*ptr) v; \
+ __typeof__(*(ptr)) v; \
\
atomic_add(ptr, 10); \
- assert(*ptr == 10); \
- atomic_add(ptr, -11); \
- assert(*ptr == (__typeof__(*ptr))-1U); \
- v = cmpxchg(ptr, -1, 22); \
- assert(*ptr == 22); \
- assert(v == (__typeof__(*ptr))-1U); \
+ assert(*(ptr) == 10); \
+ atomic_add(ptr, -11UL); \
+ assert(*(ptr) == (__typeof__(*(ptr)))-1UL); \
+ v = cmpxchg(ptr, -1UL, 22); \
+ assert(*(ptr) == 22); \
+ assert(v == (__typeof__(*(ptr)))-1UL); \
v = cmpxchg(ptr, 33, 44); \
- assert(*ptr == 22); \
+ assert(*(ptr) == 22); \
assert(v == 22); \
v = xchg(ptr, 55); \
- assert(*ptr == 55); \
+ assert(*(ptr) == 55); \
assert(v == 22); \
} while (0)