X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu%2Fuatomic%2Fx86.h;h=ce1ce5e9b48b75f193d9c80f81977c2005888492;hb=d0bbd9c2e8322f036e0a0a70091cae98cad7e390;hp=afe6e37a9d7bf455694077fcbbe3cb2c2dd3a8cb;hpb=e56d99bf2046a163875df80bab5195f38606dfde;p=urcu.git diff --git a/urcu/uatomic/x86.h b/urcu/uatomic/x86.h index afe6e37..ce1ce5e 100644 --- a/urcu/uatomic/x86.h +++ b/urcu/uatomic/x86.h @@ -95,8 +95,10 @@ unsigned long __uatomic_cmpxchg(void *addr, unsigned long old, } #endif } - /* generate an illegal instruction. Cannot catch this with linker tricks - * when optimizations are disabled. */ + /* + * generate an illegal instruction. Cannot catch this with + * linker tricks when optimizations are disabled. + */ __asm__ __volatile__("ud2"); return 0; } @@ -157,8 +159,10 @@ unsigned long __uatomic_exchange(void *addr, unsigned long val, int len) } #endif } - /* generate an illegal instruction. Cannot catch this with linker tricks - * when optimizations are disabled. */ + /* + * generate an illegal instruction. Cannot catch this with + * linker tricks when optimizations are disabled. + */ __asm__ __volatile__("ud2"); return 0; } @@ -222,8 +226,10 @@ unsigned long __uatomic_add_return(void *addr, unsigned long val, } #endif } - /* generate an illegal instruction. Cannot catch this with linker tricks - * when optimizations are disabled. */ + /* + * generate an illegal instruction. Cannot catch this with + * linker tricks when optimizations are disabled. + */ __asm__ __volatile__("ud2"); return 0; } @@ -278,8 +284,10 @@ void __uatomic_and(void *addr, unsigned long val, int len) } #endif } - /* generate an illegal instruction. Cannot catch this with linker tricks - * when optimizations are disabled. */ + /* + * generate an illegal instruction. Cannot catch this with + * linker tricks when optimizations are disabled. + */ __asm__ __volatile__("ud2"); return; } @@ -332,8 +340,10 @@ void __uatomic_or(void *addr, unsigned long val, int len) } #endif } - /* generate an illegal instruction. Cannot catch this with linker tricks - * when optimizations are disabled. */ + /* + * generate an illegal instruction. Cannot catch this with + * linker tricks when optimizations are disabled. + */ __asm__ __volatile__("ud2"); return; } @@ -386,8 +396,10 @@ void __uatomic_add(void *addr, unsigned long val, int len) } #endif } - /* generate an illegal instruction. Cannot catch this with linker tricks - * when optimizations are disabled. */ + /* + * generate an illegal instruction. Cannot catch this with + * linker tricks when optimizations are disabled. + */ __asm__ __volatile__("ud2"); return; } @@ -494,8 +506,10 @@ void __uatomic_dec(void *addr, int len) } #endif } - /* generate an illegal instruction. Cannot catch this with linker tricks - * when optimizations are disabled. */ + /* + * generate an illegal instruction. Cannot catch this with + * linker tricks when optimizations are disabled. + */ __asm__ __volatile__("ud2"); return; } @@ -576,16 +590,31 @@ extern unsigned long _compat_uatomic_add_return(void *addr, UATOMIC_COMPAT(cmpxchg(addr, old, _new)) #define uatomic_xchg(addr, v) \ UATOMIC_COMPAT(xchg(addr, v)) + #define uatomic_and(addr, v) \ UATOMIC_COMPAT(and(addr, v)) +#define cmm_smp_mb__before_uatomic_and() cmm_barrier() +#define cmm_smp_mb__after_uatomic_and() cmm_barrier() + #define uatomic_or(addr, v) \ UATOMIC_COMPAT(or(addr, v)) +#define cmm_smp_mb__before_uatomic_or() cmm_barrier() +#define cmm_smp_mb__after_uatomic_or() cmm_barrier() + #define uatomic_add_return(addr, v) \ UATOMIC_COMPAT(add_return(addr, v)) #define uatomic_add(addr, v) UATOMIC_COMPAT(add(addr, v)) +#define cmm_smp_mb__before_uatomic_add() cmm_barrier() +#define cmm_smp_mb__after_uatomic_add() cmm_barrier() + #define uatomic_inc(addr) UATOMIC_COMPAT(inc(addr)) +#define cmm_smp_mb__before_uatomic_inc() cmm_barrier() +#define cmm_smp_mb__after_uatomic_inc() cmm_barrier() + #define uatomic_dec(addr) UATOMIC_COMPAT(dec(addr)) +#define cmm_smp_mb__before_uatomic_dec() cmm_barrier() +#define cmm_smp_mb__after_uatomic_dec() cmm_barrier() #ifdef __cplusplus }