Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/asm/atomic.h
Show First 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | while (!atomic_fcmpset_64((volatile u64 *)(ptr), \ | ||||
__ret.u64, __new.u64[0]) && __ret.val == (old)) \ | __ret.u64, __new.u64[0]) && __ret.val == (old)) \ | ||||
; \ | ; \ | ||||
break; \ | break; \ | ||||
) \ | ) \ | ||||
} \ | } \ | ||||
__ret.val; \ | __ret.val; \ | ||||
}) | }) | ||||
#define cmpxchg64(...) cmpxchg(__VA_ARGS__) | |||||
hselasky: It's only defined for selected platforms. And will compile time assert if not present!
Should… | |||||
Not Done Inline ActionsYes indeed. manu: Yes indeed. | |||||
#define cmpxchg_relaxed(...) cmpxchg(__VA_ARGS__) | #define cmpxchg_relaxed(...) cmpxchg(__VA_ARGS__) | ||||
#define xchg(ptr, new) ({ \ | #define xchg(ptr, new) ({ \ | ||||
union { \ | union { \ | ||||
__typeof(*(ptr)) val; \ | __typeof(*(ptr)) val; \ | ||||
u8 u8[0]; \ | u8 u8[0]; \ | ||||
u16 u16[0]; \ | u16 u16[0]; \ | ||||
u32 u32[0]; \ | u32 u32[0]; \ | ||||
▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines |
It's only defined for selected platforms. And will compile time assert if not present!
Should be OK.