Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
cmpxchg.h File Reference
#include <linux/compiler.h>
#include <linux/types.h>
#include <asm/cmpxchg-irq.h>

Go to the source code of this file.

Macros

#define __xchg(ptr, x, size)
 
#define xchg(ptr, x)   ((__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr))))
 
#define __HAVE_ARCH_CMPXCHG   1
 
#define cmpxchg(ptr, o, n)
 

Functions

void __xchg_called_with_bad_pointer (void)
 
void __cmpxchg_called_with_bad_pointer (void)
 

Macro Definition Documentation

#define __HAVE_ARCH_CMPXCHG   1

Definition at line 49 of file cmpxchg.h.

#define __xchg (   ptr,
  x,
  size 
)
Value:
({ \
unsigned long __xchg__res; \
volatile void *__xchg_ptr = (ptr); \
switch (size) { \
case 4: \
__xchg__res = xchg_u32(__xchg_ptr, x); \
break; \
case 1: \
__xchg__res = xchg_u8(__xchg_ptr, x); \
break; \
default: \
__xchg_called_with_bad_pointer(); \
__xchg__res = x; \
break; \
} \
\
__xchg__res; \
})

Definition at line 22 of file cmpxchg.h.

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

Definition at line 62 of file cmpxchg.h.

#define xchg (   ptr,
  x 
)    ((__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr))))

Definition at line 42 of file cmpxchg.h.

Function Documentation

void __cmpxchg_called_with_bad_pointer ( void  )
void __xchg_called_with_bad_pointer ( void  )