Make sure gcc doesn't generate something such as swp r3, r4, [r3] for __swp,

as it has unpredictable results.
This commit is contained in:
cognet 2004-12-18 17:43:01 +00:00
parent b0de3be535
commit 5b61dc111e

View File

@ -75,7 +75,7 @@ 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");
: "=&r" (val) : "r" (val) , "r" (ptr) : "memory");
return (val);
}