1
0
Fork 0
forked from len0rd/rockbox

Atomic mutexes on SH1.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14121 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2007-08-01 18:57:48 +00:00
parent 291c9f8a4e
commit 39357e9235

View file

@ -169,6 +169,20 @@ struct core_entry {
); \ ); \
old; \ old; \
}) })
#elif CONFIG_CPU == SH7034
#define test_and_set(x_, v_) \
({ \
uint32_t old; \
asm volatile ( \
"tas.b @%[x] \r\n" \
"mov #-1, %[old] \r\n" \
"negc %[old], %[old] \r\n" \
: [old]"=r"(old) \
: [v]"M"((uint32_t)v_), /* Value of v_ must be 1 */ \
[x]"r"((uint8_t *)x_) \
); \
old; \
})
#else #else
/* default for no asm version */ /* default for no asm version */
#define test_and_set(x_, v_) \ #define test_and_set(x_, v_) \