#include <linux/types.h>
#include <asm-generic/cmpxchg-local.h>
Go to the source code of this file.
|
#define | xchg(ptr, x) |
|
#define | tas(ptr) (xchg((ptr), 1)) |
|
#define | cmpxchg(ptr, test, new) |
|
#define | cmpxchg_local(ptr, o, n) |
|
#define | cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) |
|
#define cmpxchg64_local |
( |
|
ptr, |
|
|
|
o, |
|
|
|
n |
|
) |
| __cmpxchg64_local_generic((ptr), (o), (n)) |
#define cmpxchg_local |
( |
|
ptr, |
|
|
|
o, |
|
|
|
n |
|
) |
| |
Value:({ \
__typeof__(
ptr) __xg_ptr = (
ptr); \
__typeof__(*(ptr)) __xg_orig; \
\
switch (
sizeof(__xg_orig)) { \
case 4: \
asm volatile( \
"swap%I0 %M0,%1" \
: "+m"(*__xg_ptr), "=r"(__xg_orig) \
: "memory" \
); \
break; \
\
default: \
__xg_orig = (__typeof__(__xg_orig))0; \
asm volatile("break"); \
break; \
} \
\
__xg_orig; \
})
Definition at line 27 of file cmpxchg.h.