Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
cmpxchg_32.h File Reference

Go to the source code of this file.

Macros

#define cmpxchg(ptr, o, n)
 
#define cmpxchg_local(ptr, o, n)
 
#define cmpxchg64(ptr, o, n)
 
#define cmpxchg64_local(ptr, o, n)
 
#define system_has_cmpxchg_double()   cpu_has_cx8
 

Functions

unsigned long cmpxchg_386_u8 (volatile void *, u8, u8)
 
unsigned long cmpxchg_386_u16 (volatile void *, u16, u16)
 
unsigned long cmpxchg_386_u32 (volatile void *, u32, u32)
 

Macro Definition Documentation

#define cmpxchg (   ptr,
  o,
  n 
)
Value:
({ \
__typeof__(*(ptr)) __ret; \
__ret = (__typeof__(*(ptr)))__cmpxchg((ptr), \
(unsigned long)(o), (unsigned long)(n), \
sizeof(*(ptr))); \
else \
__ret = (__typeof__(*(ptr)))cmpxchg_386((ptr), \
(unsigned long)(o), (unsigned long)(n), \
sizeof(*(ptr))); \
__ret; \
})

Definition at line 101 of file cmpxchg_32.h.

#define cmpxchg64 (   ptr,
  o,
  n 
)
Value:
({ \
__typeof__(*(ptr)) __ret; \
__typeof__(*(ptr)) __old = (o); \
__typeof__(*(ptr)) __new = (n); \
"call cmpxchg8b_emu", \
"lock; cmpxchg8b (%%esi)" , \
"=A" (__ret), \
"S" ((ptr)), "0" (__old), \
"b" ((unsigned int)__new), \
"c" ((unsigned int)(__new>>32)) \
: "memory"); \
__ret; })

Definition at line 135 of file cmpxchg_32.h.

#define cmpxchg64_local (   ptr,
  o,
  n 
)
Value:
({ \
__typeof__(*(ptr)) __ret; \
__typeof__(*(ptr)) __old = (o); \
__typeof__(*(ptr)) __new = (n); \
"cmpxchg8b (%%esi)" , \
"=A" (__ret), \
"S" ((ptr)), "0" (__old), \
"b" ((unsigned int)__new), \
"c" ((unsigned int)(__new>>32)) \
: "memory"); \
__ret; })

Definition at line 152 of file cmpxchg_32.h.

#define cmpxchg_local (   ptr,
  o,
  n 
)
Value:
({ \
__typeof__(*(ptr)) __ret; \
__ret = (__typeof__(*(ptr)))__cmpxchg_local((ptr), \
(unsigned long)(o), (unsigned long)(n), \
sizeof(*(ptr))); \
else \
__ret = (__typeof__(*(ptr)))cmpxchg_386((ptr), \
(unsigned long)(o), (unsigned long)(n), \
sizeof(*(ptr))); \
__ret; \
})

Definition at line 114 of file cmpxchg_32.h.

#define system_has_cmpxchg_double ( )    cpu_has_cx8

Definition at line 169 of file cmpxchg_32.h.

Function Documentation

unsigned long cmpxchg_386_u16 ( volatile void ,
u16  ,
u16   
)

Definition at line 25 of file cmpxchg.c.

unsigned long cmpxchg_386_u32 ( volatile void ,
u32  ,
u32   
)

Definition at line 40 of file cmpxchg.c.

unsigned long cmpxchg_386_u8 ( volatile void ,
u8  ,
u8   
)

Definition at line 10 of file cmpxchg.c.