summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2c5e5fb)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
#if (BITS_PER_LONG == 64)
case 8:
{
#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))
__asm__ __volatile__(
"lock; cmpxchgq %2, %1"
: "+a"(result), "+m"(*__hp(addr))
#define do_test(ptr) \
do { \
#define do_test(ptr) \
do { \
+ __typeof__(*(ptr)) v; \
- 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); \
v = cmpxchg(ptr, 33, 44); \
+ assert(*(ptr) == 22); \
assert(v == 22); \
v = xchg(ptr, 55); \
assert(v == 22); \
v = xchg(ptr, 55); \
+ assert(*(ptr) == 55); \
assert(v == 22); \
} while (0)
assert(v == 22); \
} while (0)