@@ -59,6 +59,8 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
switch (size) {
case 1:
return cmpxchg_emu_u8(ptr, old, new);
+ case 2:
+ return cmpxchg_emu_u16(ptr, old, new);
case 4:
return __cmpxchg_u32(ptr, old, new);
}
@@ -70,8 +72,10 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
({ \
__typeof__(*(ptr)) _o_ = (o); \
__typeof__(*(ptr)) _n_ = (n); \
- (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
- (unsigned long)_n_, sizeof(*(ptr))); \
+ unsigned long _old_ = (unsigned long)(0 ? *ptr : _o_); \
+ unsigned long _new_ = (unsigned long)(0 ? *ptr : _n_); \
+ (__typeof__(*(ptr))) __cmpxchg((ptr), _old_, \
+ _new_, sizeof(*(ptr))); \
})
#include <asm-generic/cmpxchg-local.h>