X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu%2Fuatomic_arch_x86.h;fp=urcu%2Fuatomic_arch_x86.h;h=fccea8e2d350321ebe9cbf4517a68866e4b5fa19;hp=43de9e6be5543bb90811f373007b0fa88b6f1af6;hb=7d413817f09b2d17b1a79ea012590609ffab5eb6;hpb=64c4cafd597aff7423be003dcf41735904126f66 diff --git a/urcu/uatomic_arch_x86.h b/urcu/uatomic_arch_x86.h index 43de9e6..fccea8e 100644 --- a/urcu/uatomic_arch_x86.h +++ b/urcu/uatomic_arch_x86.h @@ -397,4 +397,20 @@ void _uatomic_dec(void *addr, int len) #define uatomic_dec(addr) (_uatomic_dec((addr), sizeof(*(addr)))) +#if (BITS_PER_LONG == 64) +#define URCU_CAS_AVAIL() 1 +#define compat_uatomic_cmpxchg(ptr, old, _new) uatomic_cmpxchg(ptr, old, _new) +#else +extern int __urcu_cas_avail; +#define URCU_CAS_AVAIL() __urcu_cas_avail + +extern unsigned long _compat_uatomic_cmpxchg(void *addr, unsigned long old, + unsigned long _new, int len); + +#define compat_uatomic_cmpxchg(addr, old, _new) \ + ((__typeof__(*(addr))) _uatomic_cmpxchg((addr), (unsigned long)(old),\ + (unsigned long)(_new), \ + sizeof(*(addr)))) +#endif + #endif /* _URCU_ARCH_UATOMIC_X86_H */