Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/include/atomic-v6.h
Show First 20 Lines • Show All 239 Lines • ▼ Show 20 Lines | |||||
static __inline int | static __inline int | ||||
atomic_fcmpset_8(volatile uint8_t *_ptr, uint8_t *_old, uint8_t _new) | atomic_fcmpset_8(volatile uint8_t *_ptr, uint8_t *_old, uint8_t _new) | ||||
{ | { | ||||
int ret; | int ret; | ||||
ATOMIC_FCMPSET_CODE(ret, uint8_t, "b"); | ATOMIC_FCMPSET_CODE(ret, uint8_t, "b"); | ||||
return (ret); | return (ret); | ||||
} | } | ||||
#define atomic_fcmpset_8 atomic_fcmpset_8 | |||||
static __inline int | static __inline int | ||||
atomic_fcmpset_acq_8(volatile uint8_t *_ptr, uint8_t *_old, uint8_t _new) | atomic_fcmpset_acq_8(volatile uint8_t *_ptr, uint8_t *_old, uint8_t _new) | ||||
{ | { | ||||
int ret; | int ret; | ||||
ATOMIC_FCMPSET_CODE(ret, uint8_t, "b"); | ATOMIC_FCMPSET_CODE(ret, uint8_t, "b"); | ||||
dmb(); | dmb(); | ||||
Show All 13 Lines | |||||
static __inline int | static __inline int | ||||
atomic_fcmpset_16(volatile uint16_t *_ptr, uint16_t *_old, uint16_t _new) | atomic_fcmpset_16(volatile uint16_t *_ptr, uint16_t *_old, uint16_t _new) | ||||
{ | { | ||||
int ret; | int ret; | ||||
ATOMIC_FCMPSET_CODE(ret, uint16_t, "h"); | ATOMIC_FCMPSET_CODE(ret, uint16_t, "h"); | ||||
return (ret); | return (ret); | ||||
} | } | ||||
#define atomic_fcmpset_16 atomic_fcmpset_16 | |||||
static __inline int | static __inline int | ||||
atomic_fcmpset_acq_16(volatile uint16_t *_ptr, uint16_t *_old, uint16_t _new) | atomic_fcmpset_acq_16(volatile uint16_t *_ptr, uint16_t *_old, uint16_t _new) | ||||
{ | { | ||||
int ret; | int ret; | ||||
ATOMIC_FCMPSET_CODE(ret, uint16_t, "h"); | ATOMIC_FCMPSET_CODE(ret, uint16_t, "h"); | ||||
dmb(); | dmb(); | ||||
▲ Show 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | |||||
static __inline int | static __inline int | ||||
atomic_cmpset_8(volatile uint8_t *_ptr, uint8_t _old, uint8_t _new) | atomic_cmpset_8(volatile uint8_t *_ptr, uint8_t _old, uint8_t _new) | ||||
{ | { | ||||
int ret; | int ret; | ||||
ATOMIC_CMPSET_CODE(ret, "b"); | ATOMIC_CMPSET_CODE(ret, "b"); | ||||
return (ret); | return (ret); | ||||
} | } | ||||
#define atomic_cmpset_8 atomic_cmpset_8 | |||||
static __inline int | static __inline int | ||||
atomic_cmpset_acq_8(volatile uint8_t *_ptr, uint8_t _old, uint8_t _new) | atomic_cmpset_acq_8(volatile uint8_t *_ptr, uint8_t _old, uint8_t _new) | ||||
{ | { | ||||
int ret; | int ret; | ||||
ATOMIC_CMPSET_CODE(ret, "b"); | ATOMIC_CMPSET_CODE(ret, "b"); | ||||
dmb(); | dmb(); | ||||
Show All 13 Lines | |||||
static __inline int | static __inline int | ||||
atomic_cmpset_16(volatile uint16_t *_ptr, uint16_t _old, uint16_t _new) | atomic_cmpset_16(volatile uint16_t *_ptr, uint16_t _old, uint16_t _new) | ||||
{ | { | ||||
int ret; | int ret; | ||||
ATOMIC_CMPSET_CODE(ret, "h"); | ATOMIC_CMPSET_CODE(ret, "h"); | ||||
return (ret); | return (ret); | ||||
} | } | ||||
#define atomic_cmpset_16 atomic_cmpset_16 | |||||
static __inline int | static __inline int | ||||
atomic_cmpset_acq_16(volatile uint16_t *_ptr, uint16_t _old, uint16_t _new) | atomic_cmpset_acq_16(volatile uint16_t *_ptr, uint16_t _old, uint16_t _new) | ||||
{ | { | ||||
int ret; | int ret; | ||||
ATOMIC_CMPSET_CODE(ret, "h"); | ATOMIC_CMPSET_CODE(ret, "h"); | ||||
dmb(); | dmb(); | ||||
▲ Show 20 Lines • Show All 416 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static __inline int | static __inline int | ||||
atomic_testandset_long(volatile u_long *p, u_int v) | atomic_testandset_long(volatile u_long *p, u_int v) | ||||
{ | { | ||||
return (atomic_testandset_32((volatile uint32_t *)p, v)); | return (atomic_testandset_32((volatile uint32_t *)p, v)); | ||||
} | } | ||||
#define atomic_testandset_long atomic_testandset_long | |||||
static __inline int | static __inline int | ||||
atomic_testandset_64(volatile uint64_t *p, u_int v) | atomic_testandset_64(volatile uint64_t *p, u_int v) | ||||
{ | { | ||||
volatile uint32_t *p32; | volatile uint32_t *p32; | ||||
p32 = (volatile uint32_t *)p; | p32 = (volatile uint32_t *)p; | ||||
/* Assume little-endian */ | /* Assume little-endian */ | ||||
▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines |