target: Fix kref->refcount underflow in transport_cmd_finish_abort
[linux/fpc-iii.git] / arch / sh / include / asm / cmpxchg-cas.h
blobd0d86649e8c1b448c6ee712bfc11ab72349c06d8
1 #ifndef __ASM_SH_CMPXCHG_CAS_H
2 #define __ASM_SH_CMPXCHG_CAS_H
4 static inline unsigned long
5 __cmpxchg_u32(volatile u32 *m, unsigned long old, unsigned long new)
7 __asm__ __volatile__("cas.l %1,%0,@r0"
8 : "+r"(new)
9 : "r"(old), "z"(m)
10 : "t", "memory" );
11 return new;
14 static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val)
16 unsigned long old;
17 do old = *m;
18 while (__cmpxchg_u32(m, old, val) != old);
19 return old;
22 #include <asm/cmpxchg-xchg.h>
24 #endif /* __ASM_SH_CMPXCHG_CAS_H */