1 |
+ |
/* Define usage of "reserved" registers */ |
2 |
+ |
#if defined(__linux__) |
3 |
+ |
#define SYSTEM_CLOBBERS_R2 1 /* Pointer to Thread Local Storage */ |
4 |
+ |
#define SYSTEM_CLOBBERS_R13 1 /* Pointer to .sdata section */ |
5 |
+ |
#endif |
6 |
+ |
|
7 |
+ |
#ifdef __ASSEMBLY__ |
8 |
+ |
/* Helper macros */ |
9 |
+ |
#ifdef SYSTEM_CLOBBERS_R2 |
10 |
+ |
#define RESTORE_SYSTEM_R2 lwz r2,XLM_TOC(0) |
11 |
+ |
#define SAVE_SYSTEM_R2 stw r2,XLM_TOC(0) |
12 |
+ |
#else |
13 |
+ |
#define RESTORE_SYSTEM_R2 |
14 |
+ |
#define SAVE_SYSTEM_R2 |
15 |
+ |
#endif |
16 |
+ |
#ifdef SYSTEM_CLOBBERS_R13 |
17 |
+ |
#define RESTORE_SYSTEM_R13 lwz r13,XLM_R13(0) |
18 |
+ |
#define SAVE_SYSTEM_R13 stw r13,XLM_R13(0) |
19 |
+ |
#else |
20 |
+ |
#define RESTORE_SYSTEM_R13 |
21 |
+ |
#define SAVE_SYSTEM_R13 |
22 |
+ |
#endif |
23 |
+ |
|
24 |
+ |
/* Apple assembler perticularities */ |
25 |
|
#if (defined(__APPLE__) && defined(__MACH__)) |
26 |
|
#define C_SYMBOL_NAME(NAME) _ ## NAME |
27 |
|
#define ASM_MACRO_END .endmacro |
111 |
|
#define f30 30 |
112 |
|
#define f31 31 |
113 |
|
#endif |
114 |
+ |
#endif |