summaryrefslogtreecommitdiff
path: root/firmware/export/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/system.h')
-rw-r--r--firmware/export/system.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/firmware/export/system.h b/firmware/export/system.h
index cfb771d66b..0d601e3d47 100644
--- a/firmware/export/system.h
+++ b/firmware/export/system.h
@@ -49,25 +49,32 @@ extern void system_init(void);
49#define nop \ 49#define nop \
50 asm volatile ("nop") 50 asm volatile ("nop")
51 51
52/* gcc 3.4 changed the format of the constraints */
53#if (__GNUC__ >= 3) && (__GNUC_MINOR__ > 3)
54#define I_CONSTRAINT "I08"
55#else
56#define I_CONSTRAINT "I"
57#endif
58
52#define or_b(mask, address) \ 59#define or_b(mask, address) \
53 asm \ 60 asm \
54 ("or.b\t%0,@(r0,gbr)" \ 61 ("or.b\t%0,@(r0,gbr)" \
55 : \ 62 : \
56 : /* %0 */ "I"((char)(mask)), \ 63 : /* %0 */ I_CONSTRAINT((char)(mask)), \
57 /* %1 */ "z"(address-GBR)) 64 /* %1 */ "z"(address-GBR))
58 65
59#define and_b(mask, address) \ 66#define and_b(mask, address) \
60 asm \ 67 asm \
61 ("and.b\t%0,@(r0,gbr)" \ 68 ("and.b\t%0,@(r0,gbr)" \
62 : \ 69 : \
63 : /* %0 */ "I"((char)(mask)), \ 70 : /* %0 */ I_CONSTRAINT((char)(mask)), \
64 /* %1 */ "z"(address-GBR)) 71 /* %1 */ "z"(address-GBR))
65 72
66#define xor_b(mask, address) \ 73#define xor_b(mask, address) \
67 asm \ 74 asm \
68 ("xor.b\t%0,@(r0,gbr)" \ 75 ("xor.b\t%0,@(r0,gbr)" \
69 : \ 76 : \
70 : /* %0 */ "I"((char)(mask)), \ 77 : /* %0 */ I_CONSTRAINT((char)(mask)), \
71 /* %1 */ "z"(address-GBR)) 78 /* %1 */ "z"(address-GBR))
72 79
73#ifndef SIMULATOR 80#ifndef SIMULATOR