diff --git a/firmware/export/thread.h b/firmware/export/thread.h index 81c7c2374f..2915d23207 100644 --- a/firmware/export/thread.h +++ b/firmware/export/thread.h @@ -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_) \