2 #define MODE_CHOICE(x, y) y
4 #define MODE_CHOICE(x, y) x
7 #define machine_choice MODE_CHOICE(ppc7400,ppc64)
9 ; Define some pseudo-opcodes for size-independent load
& store of GPRs
...
10 #define lgu MODE_CHOICE(lwzu, ldu)
11 #define lg MODE_CHOICE(lwz,ld)
12 #define sg MODE_CHOICE(stw,std)
13 #define sgu MODE_CHOICE(stwu,stdu)
15 ;
... and the size of GPRs and their storage indicator.
16 #define GPR_BYTES MODE_CHOICE(4,8)
17 #define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */
18 #define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */
20 ; From the ABI doc
: "Mac OS X ABI Function Call Guide" Version
2009-02-04.
21 #define LINKAGE_SIZE MODE_CHOICE(24,48)
22 #define PARAM_AREA MODE_CHOICE(32,64)
23 #define SAVED_LR_OFFSET MODE_CHOICE(8,16) /* save position for lr */
25 ; The whole stack frame
**MUST
** be 16byte-aligned.
26 #define SAVE_SIZE (LINKAGE_SIZE+PARAM_AREA)
28 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
29 ; We no longer need the pic symbol stub for Darwin
>= 9.
30 #define BLGCP1 _GC_push_one
33 #define BLGCP1 L_GC_push_one$stub
37 .machine machine_choice
39 ; GC_push_regs function. Under some optimization levels GCC will clobber
40 ; some of the non-volatile registers before we get
a chance to save them
41 ; therefore
, this cannot
be inline asm.
50 sg
r0,SAVED_LR_OFFSET
(r1)
96 lg
r0,SAVE_SIZE+SAVED_LR_OFFSET
(r1)
104 ; eh frames
, for those that want
'em.
106 #define EH_DATA_ALIGN_FACT MODE_CHOICE(0x7c,0x78)
107 #define EH_FRAME_OFFSET MODE_CHOICE(0x40,0x70)
109 .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
111 .set L$set$0,LECIE1-LSCIE1
112 .long L$set$0 ; Length of Common Information Entry
114 .long 0 ; CIE Identifier Tag
115 .byte 0x1 ; CIE Version
116 .ascii "zR\0" ; CIE Augmentation
117 .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor
118 .byte EH_DATA_ALIGN_FACT ; sleb128 -4/-8; CIE Data Alignment Factor
119 .byte 0x41 ; CIE RA Column
120 .byte 0x1 ; uleb128 0x1; Augmentation size
121 .byte 0x10 ; FDE Encoding (pcrel)
122 .byte 0xc ; DW_CFA_def_cfa
123 .byte 0x1 ; uleb128 0x1
125 .align LOG2_GPR_BYTES
128 .globl _GC_push_regs.eh
131 .set L$set$1,LEFDE1-LASFDE1
132 .long L$set$1 ; FDE Length
134 .long LASFDE1-EH_frame1 ; FDE CIE offset
135 .g_long _GC_push_regs-. ; FDE initial location
136 .set L$set$2,LFE0-_GC_push_regs
137 .g_long L$set$2 ; FDE address range
138 .byte 0 ; uleb128 0; Augmentation size
139 .byte 0x4 ; DW_CFA_advance_loc4
140 .set L$set$3,L_body-_GC_push_regs
142 .byte 0xe ; DW_CFA_def_cfa_offset
143 .byte EH_FRAME_OFFSET ; uleb128 0x40/0x70
144 .byte 0x11 ; DW_CFA_offset_extended_sf
145 .byte 0x41 ; uleb128 0x41
146 .byte 0x7e ; sleb128 -2
147 .byte 0x4 ; DW_CFA_advance_loc4
148 .set L$set$4,L_epilog-L_body
150 .byte 0xe ; DW_CFA_def_cfa_offset
152 .align LOG2_GPR_BYTES
157 ; PIC stub stuff, generated by GCC
159 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
160 .align LOG2_GPR_BYTES
162 .indirect_symbol _GC_push_one
164 bcl 20,31,L0$_GC_push_one
167 addis r11,r11,ha16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)
169 lgu r12,lo16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)(r11)
175 L_GC_push_one$lazy_ptr:
176 .indirect_symbol _GC_push_one
177 .g_long dyld_stub_binding_helper