00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef UNWIND_ARM_H
00033 #define UNWIND_ARM_H
00034
00035 #define __ARM_EABI_UNWINDER__ 1
00036
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040 typedef unsigned _Unwind_Word __attribute__((__mode__(__word__)));
00041 typedef signed _Unwind_Sword __attribute__((__mode__(__word__)));
00042 typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
00043 typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__)));
00044 typedef _Unwind_Word _uw;
00045 typedef unsigned _uw64 __attribute__((mode(__DI__)));
00046 typedef unsigned _uw16 __attribute__((mode(__HI__)));
00047 typedef unsigned _uw8 __attribute__((mode(__QI__)));
00048
00049 typedef enum
00050 {
00051 _URC_OK = 0,
00052 _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
00053 _URC_END_OF_STACK = 5,
00054 _URC_HANDLER_FOUND = 6,
00055 _URC_INSTALL_CONTEXT = 7,
00056 _URC_CONTINUE_UNWIND = 8,
00057 _URC_FAILURE = 9
00058 }
00059 _Unwind_Reason_Code;
00060
00061 typedef enum
00062 {
00063 _US_VIRTUAL_UNWIND_FRAME = 0,
00064 _US_UNWIND_FRAME_STARTING = 1,
00065 _US_UNWIND_FRAME_RESUME = 2,
00066 _US_ACTION_MASK = 3,
00067 _US_FORCE_UNWIND = 8,
00068 _US_END_OF_STACK = 16
00069 }
00070 _Unwind_State;
00071
00072
00073 typedef int _Unwind_Action;
00074 #define _UA_SEARCH_PHASE 1
00075 #define _UA_CLEANUP_PHASE 2
00076 #define _UA_HANDLER_FRAME 4
00077 #define _UA_FORCE_UNWIND 8
00078 #define _UA_END_OF_STACK 16
00079 #define _URC_NO_REASON _URC_OK
00080
00081 typedef struct _Unwind_Control_Block _Unwind_Control_Block;
00082 typedef struct _Unwind_Context _Unwind_Context;
00083 typedef _uw _Unwind_EHT_Header;
00084
00085
00086
00087
00088 struct _Unwind_Control_Block
00089 {
00090 char exception_class[8];
00091 void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *);
00092
00093 struct
00094 {
00095 _uw reserved1;
00096 _uw reserved2;
00097 _uw reserved3;
00098 _uw reserved4;
00099 _uw reserved5;
00100 }
00101 unwinder_cache;
00102
00103 struct
00104 {
00105 _uw sp;
00106 _uw bitpattern[5];
00107 }
00108 barrier_cache;
00109
00110 struct
00111 {
00112 _uw bitpattern[4];
00113 }
00114 cleanup_cache;
00115
00116 struct
00117 {
00118 _uw fnstart;
00119 _Unwind_EHT_Header *ehtp;
00120 _uw additional;
00121 _uw reserved1;
00122 }
00123 pr_cache;
00124 long long int :0;
00125 };
00126
00127
00128
00129 typedef enum
00130 {
00131 _UVRSC_CORE = 0,
00132 _UVRSC_VFP = 1,
00133 _UVRSC_FPA = 2,
00134 _UVRSC_WMMXD = 3,
00135 _UVRSC_WMMXC = 4
00136 }
00137 _Unwind_VRS_RegClass;
00138
00139 typedef enum
00140 {
00141 _UVRSD_UINT32 = 0,
00142 _UVRSD_VFPX = 1,
00143 _UVRSD_FPAX = 2,
00144 _UVRSD_UINT64 = 3,
00145 _UVRSD_FLOAT = 4,
00146 _UVRSD_DOUBLE = 5
00147 }
00148 _Unwind_VRS_DataRepresentation;
00149
00150 typedef enum
00151 {
00152 _UVRSR_OK = 0,
00153 _UVRSR_NOT_IMPLEMENTED = 1,
00154 _UVRSR_FAILED = 2
00155 }
00156 _Unwind_VRS_Result;
00157
00158
00159 typedef struct
00160 {
00161
00162 _uw data;
00163
00164 _uw *next;
00165
00166 _uw8 bytes_left;
00167
00168 _uw8 words_left;
00169 }
00170 __gnu_unwind_state;
00171
00172 typedef _Unwind_Reason_Code (*personality_routine) (_Unwind_State,
00173 _Unwind_Control_Block *, _Unwind_Context *);
00174
00175 _Unwind_VRS_Result _Unwind_VRS_Set(_Unwind_Context *, _Unwind_VRS_RegClass,
00176 _uw, _Unwind_VRS_DataRepresentation,
00177 void *);
00178
00179 _Unwind_VRS_Result _Unwind_VRS_Get(_Unwind_Context *, _Unwind_VRS_RegClass,
00180 _uw, _Unwind_VRS_DataRepresentation,
00181 void *);
00182
00183 _Unwind_VRS_Result _Unwind_VRS_Pop(_Unwind_Context *, _Unwind_VRS_RegClass,
00184 _uw, _Unwind_VRS_DataRepresentation);
00185
00186
00187
00188 #define _Unwind_Exception _Unwind_Control_Block
00189 typedef char _Unwind_Exception_Class[8];
00190
00191 void * _Unwind_GetLanguageSpecificData (_Unwind_Context *);
00192 _Unwind_Ptr _Unwind_GetRegionStart (_Unwind_Context *);
00193
00194
00195 _Unwind_Ptr _Unwind_GetDataRelBase (_Unwind_Context *);
00196 _Unwind_Ptr _Unwind_GetTextRelBase (_Unwind_Context *);
00197
00198
00199 _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Control_Block *ucbp);
00200 void __attribute__((noreturn)) _Unwind_Resume(_Unwind_Control_Block *ucbp);
00201 _Unwind_Reason_Code _Unwind_Resume_or_Rethrow (_Unwind_Control_Block *ucbp);
00202
00203 typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
00204 (int, _Unwind_Action, _Unwind_Exception_Class,
00205 _Unwind_Control_Block *, struct _Unwind_Context *, void *);
00206 _Unwind_Reason_Code _Unwind_ForcedUnwind (_Unwind_Control_Block *,
00207 _Unwind_Stop_Fn, void *);
00208 _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
00209 void _Unwind_Complete(_Unwind_Control_Block *ucbp);
00210 void _Unwind_DeleteException (_Unwind_Exception *);
00211
00212 _Unwind_Reason_Code __gnu_unwind_frame (_Unwind_Control_Block *,
00213 _Unwind_Context *);
00214 _Unwind_Reason_Code __gnu_unwind_execute (_Unwind_Context *,
00215 __gnu_unwind_state *);
00216
00217
00218 static inline _Unwind_Word
00219 _Unwind_decode_target2 (_Unwind_Word ptr)
00220 {
00221 _Unwind_Word tmp;
00222
00223 tmp = *(_Unwind_Word *) ptr;
00224
00225 if (!tmp)
00226 return 0;
00227
00228 #if defined(linux) || defined(__NetBSD__)
00229
00230 tmp += ptr;
00231 tmp = *(_Unwind_Word *) tmp;
00232 #elif defined(__symbian__)
00233
00234 #else
00235
00236 tmp += ptr;
00237 #endif
00238 return tmp;
00239 }
00240
00241 static inline _Unwind_Word
00242 _Unwind_GetGR (_Unwind_Context *context, int regno)
00243 {
00244 _uw val;
00245 _Unwind_VRS_Get (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val);
00246 return val;
00247 }
00248
00249
00250 #define _Unwind_GetIP(context) \
00251 (_Unwind_GetGR (context, 15) & ~(_Unwind_Word)1)
00252
00253 #define _Unwind_GetIPInfo(context, ip_before_insn) \
00254 (*ip_before_insn = 0, _Unwind_GetGR (context, 15) & ~(_Unwind_Word)1)
00255
00256 static inline void
00257 _Unwind_SetGR (_Unwind_Context *context, int regno, _Unwind_Word val)
00258 {
00259 _Unwind_VRS_Set (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val);
00260 }
00261
00262
00263
00264 #define _Unwind_SetIP(context, val) \
00265 _Unwind_SetGR (context, 15, val | (_Unwind_GetGR (context, 15) & 1))
00266
00267 #ifdef __cplusplus
00268 }
00269 #endif
00270
00271 #endif