ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/Unix/ppc_asm.tmpl
(Generate patch)

Comparing SheepShaver/src/Unix/ppc_asm.tmpl (file contents):
Revision 1.4 by gbeauche, 2005-02-20T18:08:50Z vs.
Revision 1.8 by asvitkine, 2009-08-18T18:26:11Z

# Line 1 | Line 1
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 + /* Helper macros */
25 + #define xglue(x, y)             x ## y
26 + #define glue(x, y)              xglue(x, y)
27 +
28 + /* Apple assembler perticularities */
29   #if (defined(__APPLE__) && defined(__MACH__))
30 < #define C_SYMBOL_NAME(NAME)     _ ## NAME
30 > #define C_SYMBOL_NAME(NAME)     glue(_, NAME)
31 > #define ASM_TYPE(NAME, TYPE)    /* nothing */
32 > #define ASM_ALIGN_2(EXP)        EXP
33 > #define ASM_HA16(VAR)           ha16(VAR)
34 > #define ASM_LO16(VAR)           lo16(VAR)
35   #define ASM_MACRO_END           .endmacro
36 + #define ASM_MACRO_ARG_SEP       ,
37 + #define ASM_MACRO_ARG0_DEF      /* nothing! */
38 + #define ASM_MACRO_ARG0          $0
39 + #define ASM_MACRO_ARG1_DEF      /* nothing! */
40 + #define ASM_MACRO_ARG1          $1
41 + #define ASM_MACRO_ARG2_DEF      /* nothing! */
42 + #define ASM_MACRO_ARG2          $2
43 + #define ASM_MACRO_ARG3_DEF      /* nothing! */
44 + #define ASM_MACRO_ARG3          $3
45   #endif
46  
47   /* Defaults for GNU assembler */
48 + #ifndef ASM_TYPE
49 + #define ASM_TYPE(NAME, TYPE)    .type NAME, TYPE
50 + #endif
51 + #ifndef ASM_ALIGN_2
52 + #define ASM_ALIGN_2(EXP)        (1 << (EXP))
53 + #endif
54 + #ifndef ASM_HA16
55 + #define ASM_HA16(VAR)           VAR@ha
56 + #endif
57 + #ifndef ASM_LO16
58 + #define ASM_LO16(VAR)           VAR@l
59 + #endif
60   #ifndef ASM_MACRO_START
61   #define ASM_MACRO_START         .macro
62   #endif
63   #ifndef ASM_MACRO_END
64   #define ASM_MACRO_END           .endm
65   #endif
66 + #ifndef ASM_MACRO_ARG_SEP
67 + #define ASM_MACRO_ARG_SEP
68 + #endif
69 + #ifndef ASM_MACRO_ARG0_DEF
70 + #define ASM_MACRO_ARG0_DEF      __asm_macro_arg0
71 + #define ASM_MACRO_ARG0          \__asm_macro_arg0
72 + #define ASM_MACRO_ARG1_DEF      , __asm_macro_arg1
73 + #define ASM_MACRO_ARG1          \__asm_macro_arg1
74 + #define ASM_MACRO_ARG2_DEF      , __asm_macro_arg2
75 + #define ASM_MACRO_ARG2          \__asm_macro_arg2
76 + #define ASM_MACRO_ARG3_DEF      , __asm_macro_arg3
77 + #define ASM_MACRO_ARG3          \__asm_macro_arg3
78 + #endif
79   #ifndef C_SYMBOL_NAME
80   #define C_SYMBOL_NAME(NAME)     NAME
81   #endif
# Line 87 | Line 153
153   #define f30     30
154   #define f31     31
155   #endif
156 + #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines