Changeset View
Changeset View
Standalone View
Standalone View
head/sys/powerpc/include/atomic.h
Show First 20 Lines • Show All 721 Lines • ▼ Show 20 Lines | #define ATOMIC_CMPSET_ACQ_REL(type) \ | ||||
return (atomic_cmpset_##type(p, cmpval, newval));\ | return (atomic_cmpset_##type(p, cmpval, newval));\ | ||||
}\ | }\ | ||||
struct hack | struct hack | ||||
ATOMIC_CMPSET_ACQ_REL(int); | ATOMIC_CMPSET_ACQ_REL(int); | ||||
ATOMIC_CMPSET_ACQ_REL(long); | ATOMIC_CMPSET_ACQ_REL(long); | ||||
#ifdef ISA_206_ATOMICS | |||||
#define atomic_cmpset_8 atomic_cmpset_char | #define atomic_cmpset_8 atomic_cmpset_char | ||||
#endif | |||||
#define atomic_cmpset_acq_8 atomic_cmpset_acq_char | #define atomic_cmpset_acq_8 atomic_cmpset_acq_char | ||||
#define atomic_cmpset_rel_8 atomic_cmpset_rel_char | #define atomic_cmpset_rel_8 atomic_cmpset_rel_char | ||||
#ifdef ISA_206_ATOMICS | |||||
#define atomic_cmpset_16 atomic_cmpset_short | #define atomic_cmpset_16 atomic_cmpset_short | ||||
#endif | |||||
#define atomic_cmpset_acq_16 atomic_cmpset_acq_short | #define atomic_cmpset_acq_16 atomic_cmpset_acq_short | ||||
#define atomic_cmpset_rel_16 atomic_cmpset_rel_short | #define atomic_cmpset_rel_16 atomic_cmpset_rel_short | ||||
#define atomic_cmpset_32 atomic_cmpset_int | #define atomic_cmpset_32 atomic_cmpset_int | ||||
#define atomic_cmpset_acq_32 atomic_cmpset_acq_int | #define atomic_cmpset_acq_32 atomic_cmpset_acq_int | ||||
#define atomic_cmpset_rel_32 atomic_cmpset_rel_int | #define atomic_cmpset_rel_32 atomic_cmpset_rel_int | ||||
#ifdef __powerpc64__ | #ifdef __powerpc64__ | ||||
▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | #define ATOMIC_FCMPSET_ACQ_REL(type) \ | ||||
__ATOMIC_REL();\ | __ATOMIC_REL();\ | ||||
return (atomic_fcmpset_##type(p, cmpval, newval));\ | return (atomic_fcmpset_##type(p, cmpval, newval));\ | ||||
}\ | }\ | ||||
struct hack | struct hack | ||||
ATOMIC_FCMPSET_ACQ_REL(int); | ATOMIC_FCMPSET_ACQ_REL(int); | ||||
ATOMIC_FCMPSET_ACQ_REL(long); | ATOMIC_FCMPSET_ACQ_REL(long); | ||||
#ifdef ISA_206_ATOMICS | |||||
#define atomic_fcmpset_8 atomic_fcmpset_char | #define atomic_fcmpset_8 atomic_fcmpset_char | ||||
#endif | |||||
#define atomic_fcmpset_acq_8 atomic_fcmpset_acq_char | #define atomic_fcmpset_acq_8 atomic_fcmpset_acq_char | ||||
#define atomic_fcmpset_rel_8 atomic_fcmpset_rel_char | #define atomic_fcmpset_rel_8 atomic_fcmpset_rel_char | ||||
#ifdef ISA_206_ATOMICS | |||||
#define atomic_fcmpset_16 atomic_fcmpset_short | #define atomic_fcmpset_16 atomic_fcmpset_short | ||||
#endif | |||||
#define atomic_fcmpset_acq_16 atomic_fcmpset_acq_short | #define atomic_fcmpset_acq_16 atomic_fcmpset_acq_short | ||||
#define atomic_fcmpset_rel_16 atomic_fcmpset_rel_short | #define atomic_fcmpset_rel_16 atomic_fcmpset_rel_short | ||||
#define atomic_fcmpset_32 atomic_fcmpset_int | #define atomic_fcmpset_32 atomic_fcmpset_int | ||||
#define atomic_fcmpset_acq_32 atomic_fcmpset_acq_int | #define atomic_fcmpset_acq_32 atomic_fcmpset_acq_int | ||||
#define atomic_fcmpset_rel_32 atomic_fcmpset_rel_int | #define atomic_fcmpset_rel_32 atomic_fcmpset_rel_int | ||||
#ifdef __powerpc64__ | #ifdef __powerpc64__ | ||||
▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | |||||
atomic_thread_fence_seq_cst(void) | atomic_thread_fence_seq_cst(void) | ||||
{ | { | ||||
__asm __volatile("sync" : : : "memory"); | __asm __volatile("sync" : : : "memory"); | ||||
} | } | ||||
#ifndef ISA_206_ATOMICS | #ifndef ISA_206_ATOMICS | ||||
#include <sys/_atomic_subword.h> | #include <sys/_atomic_subword.h> | ||||
#define atomic_cmpset_char atomic_cmpset_8 | |||||
#define atomic_cmpset_short atomic_cmpset_16 | |||||
#define atomic_fcmpset_char atomic_fcmpset_8 | |||||
#define atomic_fcmpset_short atomic_fcmpset_16 | |||||
#endif | #endif | ||||
/* These need sys/_atomic_subword.h on non-ISA-2.06-atomic platforms. */ | /* These need sys/_atomic_subword.h on non-ISA-2.06-atomic platforms. */ | ||||
ATOMIC_CMPSET_ACQ_REL(char); | ATOMIC_CMPSET_ACQ_REL(char); | ||||
ATOMIC_CMPSET_ACQ_REL(short); | ATOMIC_CMPSET_ACQ_REL(short); | ||||
ATOMIC_FCMPSET_ACQ_REL(char); | ATOMIC_FCMPSET_ACQ_REL(char); | ||||
ATOMIC_FCMPSET_ACQ_REL(short); | ATOMIC_FCMPSET_ACQ_REL(short); | ||||
#undef __ATOMIC_REL | #undef __ATOMIC_REL | ||||
#undef __ATOMIC_ACQ | #undef __ATOMIC_ACQ | ||||
#endif /* ! _MACHINE_ATOMIC_H_ */ | #endif /* ! _MACHINE_ATOMIC_H_ */ |