Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | static __inline Lock *lock_for_pointer(void *ptr) { | ||||
return locks + (hash & SPINLOCK_MASK); | return locks + (hash & SPINLOCK_MASK); | ||||
} | } | ||||
/// Macros for determining whether a size is lock free. | /// Macros for determining whether a size is lock free. | ||||
#define IS_LOCK_FREE_1 __c11_atomic_is_lock_free(1) | #define IS_LOCK_FREE_1 __c11_atomic_is_lock_free(1) | ||||
#define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) | #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) | ||||
#define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) | #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) | ||||
/// 32 bit PowerPC doesn't support 8-byte lock_free atomics | /// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics | ||||
#if !defined(__powerpc64__) && defined(__powerpc__) | #if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__)) | ||||
#define IS_LOCK_FREE_8 0 | #define IS_LOCK_FREE_8 0 | ||||
#else | #else | ||||
#define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) | #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) | ||||
#endif | #endif | ||||
/// Clang can not yet codegen __atomic_is_lock_free(16), so for now we assume | /// Clang can not yet codegen __atomic_is_lock_free(16), so for now we assume | ||||
/// 16-byte values are not lock free. | /// 16-byte values are not lock free. | ||||
#define IS_LOCK_FREE_16 0 | #define IS_LOCK_FREE_16 0 | ||||
▲ Show 20 Lines • Show All 215 Lines • Show Last 20 Lines |