diff options
Diffstat (limited to 'sys/arm/include/atomic.h')
-rw-r--r-- | sys/arm/include/atomic.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/arm/include/atomic.h b/sys/arm/include/atomic.h index 4275010..1170847 100644 --- a/sys/arm/include/atomic.h +++ b/sys/arm/include/atomic.h @@ -77,8 +77,10 @@ static __inline uint32_t __swp(uint32_t val, volatile uint32_t *ptr) { - __asm __volatile("swp %0, %1, [%2]" - : "=&r" (val) : "r" (val) , "r" (ptr) : "memory"); + __asm __volatile("swp %0, %2, [%3]" + : "=&r" (val), "=m" (*ptr) + : "r" (val) , "r" (ptr), "m" (*ptr) + : "memory"); return (val); } |