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:
parent
291c9f8a4e
commit
39357e9235
1 changed files with 14 additions and 0 deletions
|
@ -169,6 +169,20 @@ struct core_entry {
|
|||
); \
|
||||
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
|
||||
/* default for no asm version */
|
||||
#define test_and_set(x_, v_) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue