59 asm("orrne r1, r1, #1 "); |
59 asm("orrne r1, r1, #1 "); |
60 asm("strne r1, [sp, #80] "); // if THUMB, set bit 0 of return addr |
60 asm("strne r1, [sp, #80] "); // if THUMB, set bit 0 of return addr |
61 |
61 |
62 asm("mov r11, sp "); // save stack pointer |
62 asm("mov r11, sp "); // save stack pointer |
63 |
63 |
64 #if 0 /* IMK: Temorarily deleting these __EH_FRAME calls to discover if the suspect |
|
65 GCCE definitions of them are behind a kernel panic. */ |
|
66 |
|
67 // The frame starts 84 bytes (up) from r11 i.e. CFA is r11 + 84 |
64 // The frame starts 84 bytes (up) from r11 i.e. CFA is r11 + 84 |
68 __EH_FRAME_ADDRESS(sp, 84) // Reg needs to be sp (=r11) here for gcce |
65 __EH_FRAME_ADDRESS(sp, 84) // Reg needs to be sp (=r11) here for gcce |
69 // we can only restore callee-save values, but that's what we want if we 'leave' |
66 // we can only restore callee-save values, but that's what we want if we 'leave' |
70 // saved link is -8 bytes from CFA (= r11 + 0x24 + 0x20 + 0x8) |
67 // saved link is -8 bytes from CFA (= r11 + 0x24 + 0x20 + 0x8) |
71 __EH_FRAME_SAVE1(lr, -8) |
68 __EH_FRAME_SAVE1(lr, -8) |
72 #endif |
|
73 |
69 |
74 // the other callee saves start at -48 from CFA (= r11 + 0x24) |
70 // the other callee saves start at -48 from CFA (= r11 + 0x24) |
75 #if 0 |
71 #if 0 |
76 // would like to say this |
72 // would like to say this |
77 __EH_FRAME_SAVE1(r4-r11, -48) |
73 __EH_FRAME_SAVE1(r4-r11, -48) |
78 // but the macro expansion gives rise to odd code so we do what follows |
74 // but the macro expansion gives rise to odd code so we do what follows |
79 #endif |
75 #endif |
80 #if defined(__ARMCC__) |
76 #if defined(__ARMCC__) |
81 FRAME SAVE {r4-r11}, -48 |
77 FRAME SAVE {r4-r11}, -48 |
82 #elif defined(__GCCE__) |
78 #elif defined(__GCCE__) |
83 #if 0 /* IMK: see above */ |
|
84 __EH_FRAME_SAVE1(r4-r11,-48) |
79 __EH_FRAME_SAVE1(r4-r11,-48) |
85 #endif |
|
86 #else |
80 #else |
87 #error What compiler? |
81 #error What compiler? |
88 #endif |
82 #endif |
89 |
83 |
90 |
84 |
125 |Symbian$$code_seg_base| dcd |Image$$ER_RO$$Base| ; /* RO segment base */ |
119 |Symbian$$code_seg_base| dcd |Image$$ER_RO$$Base| ; /* RO segment base */ |
126 |Symbian$$code_seg_limit| dcd |Image$$ER_RO$$Limit| ;/* RO segment limit */ |
120 |Symbian$$code_seg_limit| dcd |Image$$ER_RO$$Limit| ;/* RO segment limit */ |
127 #endif |
121 #endif |
128 |
122 |
129 #endif |
123 #endif |
|
124 #elif defined(__GCCE__) |
|
125 #ifdef __SUPPORT_CPP_EXCEPTIONS__ |
|
126 |
|
127 |
|
128 /* It is possible no functions included in the image require |
|
129 * a handler table. Therefore make only a weak reference to |
|
130 * the handler table base symbol, which may be absent. |
|
131 */ |
|
132 asm(".weak .ARM.extab$$Base"); |
|
133 asm(".global Symbian$$CPP$$Exception$$Descriptor"); |
|
134 |
|
135 /* Symbian$$CPP$$Exception$$Descriptor is referenced from the Image header. |
|
136 * A pointer to this object can be cached by the unwinder in the UCB |
|
137 * on the assumption that the EHT for the previous frame is likely to be right |
|
138 * for the current frame |
|
139 */ |
|
140 |
|
141 asm("Symbian$$CPP$$Exception$$Descriptor:"); |
|
142 #ifdef __LEAVE_EQUALS_THROW__ |
|
143 asm(".word .ARM.exidx$$Base"); /* index table base */ |
|
144 asm(".word .ARM.exidx$$Limit"); /* index table limit */ |
|
145 #endif |
|
146 asm(".word Image$$ER_RO$$Base + 1"); /* RO segment base + mark as ehabi v2 */ |
|
147 asm(".word Image$$ER_RO$$Limit"); /* RO segment limit */ |
|
148 asm(".word 0"); /* reserved for future use */ |
|
149 #endif |
130 #endif |
150 #endif |
131 |
151 |
132 } |
152 } |
133 void _xxxx_call_user_invariant() { User::Invariant(); } |
153 void _xxxx_call_user_invariant() { User::Invariant(); } |
134 void _xxxx_call_user_handle_exception(void * arg) { User::HandleException(arg); } |
154 void _xxxx_call_user_handle_exception(void * arg) { User::HandleException(arg); } |