Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/include/atomic-v6.h
Show First 20 Lines • Show All 762 Lines • ▼ Show 20 Lines | __asm __volatile( | ||||
: [ret] "=&r" (ret), | : [ret] "=&r" (ret), | ||||
[exf] "=&r" (exflag) | [exf] "=&r" (exflag) | ||||
: [val] "r" (v), | : [val] "r" (v), | ||||
[ptr] "r" (p) | [ptr] "r" (p) | ||||
: "cc", "memory"); | : "cc", "memory"); | ||||
return (ret); | return (ret); | ||||
} | } | ||||
static __inline u_long | |||||
atomic_swap_long(volatile u_long *p, u_long v) | |||||
{ | |||||
return (atomic_swap_32((volatile uint32_t *)p, v)); | |||||
} | |||||
kib: I think you can put this function into arm/include/atomic.h and avoid writing it twice. | |||||
static __inline uint64_t | static __inline uint64_t | ||||
atomic_swap_64(volatile uint64_t *p, uint64_t v) | atomic_swap_64(volatile uint64_t *p, uint64_t v) | ||||
{ | { | ||||
uint64_t ret; | uint64_t ret; | ||||
uint32_t exflag; | uint32_t exflag; | ||||
__asm __volatile( | __asm __volatile( | ||||
"1: ldrexd %Q[ret], %R[ret], [%[ptr]] \n" | "1: ldrexd %Q[ret], %R[ret], [%[ptr]] \n" | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |
I think you can put this function into arm/include/atomic.h and avoid writing it twice.