Go to the documentation of this file. 1 #ifndef _ASM_X86_ATOMIC_H
2 #define _ASM_X86_ATOMIC_H
4 #include <linux/compiler.h>
5 #include <linux/types.h>
6 #include <asm/processor.h>
8 #include <asm/cmpxchg.h>
15 #define ATOMIC_INIT(i) { (i) }
25 return (*(
volatile int *)&(v)->
counter);
83 :
"ir" (
i) :
"memory");
162 :
"ir" (
i) :
"memory");
206 #define atomic_inc_return(v) (atomic_add_return(1, v))
207 #define atomic_dec_return(v) (atomic_sub_return(1, v))
250 static inline short int atomic_inc_short(
short int *v)
265 static inline void atomic_or_long(
unsigned long *
v1,
unsigned long v2)
272 #define atomic_clear_mask(mask, addr) \
273 asm volatile(LOCK_PREFIX "andl %0,%1" \
274 : : "r" (~(mask)), "m" (*(addr)) : "memory")
276 #define atomic_set_mask(mask, addr) \
277 asm volatile(LOCK_PREFIX "orl %0,%1" \
278 : : "r" ((unsigned)(mask)), "m" (*(addr)) \
282 #define smp_mb__before_atomic_dec() barrier()
283 #define smp_mb__after_atomic_dec() barrier()
284 #define smp_mb__before_atomic_inc() barrier()
285 #define smp_mb__after_atomic_inc() barrier()