Changeset View
Changeset View
Standalone View
Standalone View
head/sys/arm/arm/stdatomic.c
Show All 26 Lines | |||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/stdatomic.h> | #include <sys/stdatomic.h> | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <machine/acle-compat.h> | #include <machine/acle-compat.h> | ||||
#include <machine/atomic.h> | |||||
#include <machine/cpufunc.h> | #include <machine/cpufunc.h> | ||||
#include <machine/sysarch.h> | #include <machine/sysarch.h> | ||||
/* | /* | ||||
* Executing statements with interrupts disabled. | * Executing statements with interrupts disabled. | ||||
*/ | */ | ||||
#if defined(_KERNEL) && !defined(SMP) | #if defined(_KERNEL) && !defined(SMP) | ||||
Show All 19 Lines | |||||
#if defined(_KERNEL) && !defined(SMP) | #if defined(_KERNEL) && !defined(SMP) | ||||
static inline void | static inline void | ||||
do_sync(void) | do_sync(void) | ||||
{ | { | ||||
__asm volatile ("" : : : "memory"); | __asm volatile ("" : : : "memory"); | ||||
} | } | ||||
#elif __ARM_ARCH >= 7 | |||||
static inline void | |||||
do_sync(void) | |||||
{ | |||||
__asm volatile ("dmb" : : : "memory"); | |||||
} | |||||
#elif __ARM_ARCH >= 6 | #elif __ARM_ARCH >= 6 | ||||
static inline void | static inline void | ||||
do_sync(void) | do_sync(void) | ||||
{ | { | ||||
__asm volatile ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory"); | dmb(); | ||||
} | } | ||||
#endif | #endif | ||||
#if defined(__CLANG_ATOMICS) || defined(__GNUC_ATOMICS) | #if defined(__CLANG_ATOMICS) || defined(__GNUC_ATOMICS) | ||||
/* | /* | ||||
* New C11 __atomic_* API. | * New C11 __atomic_* API. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 790 Lines • Show Last 20 Lines |