Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/include/atomic.h
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
#define dsb(opt) __asm __volatile("dsb " __STRING(opt) : : : "memory") | #define dsb(opt) __asm __volatile("dsb " __STRING(opt) : : : "memory") | ||||
#define dmb(opt) __asm __volatile("dmb " __STRING(opt) : : : "memory") | #define dmb(opt) __asm __volatile("dmb " __STRING(opt) : : : "memory") | ||||
#define mb() dmb(sy) /* Full system memory barrier all */ | #define mb() dmb(sy) /* Full system memory barrier all */ | ||||
#define wmb() dmb(st) /* Full system memory barrier store */ | #define wmb() dmb(st) /* Full system memory barrier store */ | ||||
#define rmb() dmb(ld) /* Full system memory barrier load */ | #define rmb() dmb(ld) /* Full system memory barrier load */ | ||||
#ifdef _KERNEL | |||||
extern bool lse_supported; | |||||
andrew: Why is this needed? | |||||
Done Inline ActionsWe still want to build sys/arm64/arm64/support_ifunc.c, but otherwise the symbol's only declared here in the !sanitizer branch below. kevans: We still want to build sys/arm64/arm64/support_ifunc.c, but otherwise the symbol's only… | |||||
#endif | |||||
Not Done Inline ActionsA problem with this is that we rely on the sys/types.h include in atomic_common.h/atomic_san.h to provide a typedef for bool. This appears to break at least linux_mmap.c. One workaround is to define it as a _Bool instead. markj: A problem with this is that we rely on the sys/types.h include in atomic_common.h/atomic_san.h… | |||||
Done Inline ActionsIn the interest of not adding any arch-specific header pollution, I've staged the change to _Bool locally for push or to roll into another revision. kevans: In the interest of not adding any arch-specific header pollution, I've staged the change to… | |||||
#if defined(SAN_NEEDS_INTERCEPTORS) && !defined(SAN_RUNTIME) | #if defined(SAN_NEEDS_INTERCEPTORS) && !defined(SAN_RUNTIME) | ||||
#include <sys/atomic_san.h> | #include <sys/atomic_san.h> | ||||
#else | #else | ||||
#include <sys/atomic_common.h> | #include <sys/atomic_common.h> | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
extern bool lse_supported; | |||||
#ifdef LSE_ATOMICS | #ifdef LSE_ATOMICS | ||||
#define _ATOMIC_LSE_SUPPORTED 1 | #define _ATOMIC_LSE_SUPPORTED 1 | ||||
#else | #else | ||||
#define _ATOMIC_LSE_SUPPORTED lse_supported | #define _ATOMIC_LSE_SUPPORTED lse_supported | ||||
#endif | #endif | ||||
#else | #else | ||||
#define _ATOMIC_LSE_SUPPORTED 0 | #define _ATOMIC_LSE_SUPPORTED 0 | ||||
▲ Show 20 Lines • Show All 598 Lines • Show Last 20 Lines |
Why is this needed?