File indexing completed on 2026-05-10 08:57:06
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef __ARM_EHABI_UNWIND_H__
0014 #define __ARM_EHABI_UNWIND_H__
0015
0016 typedef uint32_t _Unwind_State;
0017
0018 static const _Unwind_State _US_VIRTUAL_UNWIND_FRAME = 0;
0019 static const _Unwind_State _US_UNWIND_FRAME_STARTING = 1;
0020 static const _Unwind_State _US_UNWIND_FRAME_RESUME = 2;
0021 static const _Unwind_State _US_ACTION_MASK = 3;
0022
0023 static const _Unwind_State _US_FORCE_UNWIND = 8;
0024
0025 typedef uint32_t _Unwind_EHT_Header;
0026
0027 struct _Unwind_Control_Block;
0028 typedef struct _Unwind_Control_Block _Unwind_Control_Block;
0029 #define _Unwind_Exception _Unwind_Control_Block
0030 typedef uint8_t _Unwind_Exception_Class[8];
0031
0032 struct _Unwind_Control_Block {
0033 _Unwind_Exception_Class exception_class;
0034 void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block*);
0035
0036
0037 struct {
0038 uint32_t reserved1;
0039 uint32_t reserved2;
0040 uint32_t reserved3;
0041 uint32_t reserved4;
0042 uint32_t reserved5;
0043 } unwinder_cache;
0044
0045
0046 struct {
0047 uint32_t sp;
0048 uint32_t bitpattern[5];
0049 } barrier_cache;
0050
0051
0052 struct {
0053 uint32_t bitpattern[4];
0054 } cleanup_cache;
0055
0056
0057 struct {
0058 uint32_t fnstart;
0059 _Unwind_EHT_Header* ehtp;
0060 uint32_t additional;
0061 uint32_t reserved1;
0062 } pr_cache;
0063
0064 long long int :0;
0065 } __attribute__((__aligned__(8)));
0066
0067 typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)(
0068 _Unwind_State state, _Unwind_Exception *exceptionObject,
0069 struct _Unwind_Context *context);
0070
0071 #ifdef __cplusplus
0072 extern "C" {
0073 #endif
0074
0075
0076
0077
0078 #ifdef __USING_SJLJ_EXCEPTIONS__
0079 extern _Unwind_Reason_Code
0080 _Unwind_SjLj_RaiseException(_Unwind_Exception *exception_object);
0081 extern void _Unwind_SjLj_Resume(_Unwind_Exception *exception_object);
0082 #else
0083 extern _Unwind_Reason_Code
0084 _Unwind_RaiseException(_Unwind_Exception *exception_object);
0085 extern void _Unwind_Resume(_Unwind_Exception *exception_object);
0086 #endif
0087 extern void _Unwind_DeleteException(_Unwind_Exception *exception_object);
0088
0089 typedef enum {
0090 _UVRSC_CORE = 0,
0091 _UVRSC_VFP = 1,
0092 _UVRSC_WMMXD = 3,
0093 _UVRSC_WMMXC = 4,
0094 _UVRSC_PSEUDO = 5
0095 } _Unwind_VRS_RegClass;
0096
0097 typedef enum {
0098 _UVRSD_UINT32 = 0,
0099 _UVRSD_VFPX = 1,
0100 _UVRSD_UINT64 = 3,
0101 _UVRSD_FLOAT = 4,
0102 _UVRSD_DOUBLE = 5
0103 } _Unwind_VRS_DataRepresentation;
0104
0105 typedef enum {
0106 _UVRSR_OK = 0,
0107 _UVRSR_NOT_IMPLEMENTED = 1,
0108 _UVRSR_FAILED = 2
0109 } _Unwind_VRS_Result;
0110
0111 extern void _Unwind_Complete(_Unwind_Exception* exception_object);
0112
0113 extern _Unwind_VRS_Result
0114 _Unwind_VRS_Get(_Unwind_Context *context, _Unwind_VRS_RegClass regclass,
0115 uint32_t regno, _Unwind_VRS_DataRepresentation representation,
0116 void *valuep);
0117
0118 extern _Unwind_VRS_Result
0119 _Unwind_VRS_Set(_Unwind_Context *context, _Unwind_VRS_RegClass regclass,
0120 uint32_t regno, _Unwind_VRS_DataRepresentation representation,
0121 void *valuep);
0122
0123 extern _Unwind_VRS_Result
0124 _Unwind_VRS_Pop(_Unwind_Context *context, _Unwind_VRS_RegClass regclass,
0125 uint32_t discriminator,
0126 _Unwind_VRS_DataRepresentation representation);
0127
0128 #if defined(_LIBUNWIND_UNWIND_LEVEL1_EXTERNAL_LINKAGE)
0129 #define _LIBUNWIND_EXPORT_UNWIND_LEVEL1 extern
0130 #else
0131 #define _LIBUNWIND_EXPORT_UNWIND_LEVEL1 static __inline__
0132 #endif
0133
0134
0135
0136
0137
0138
0139
0140
0141 _LIBUNWIND_EXPORT_UNWIND_LEVEL1
0142 uintptr_t _Unwind_GetGR(struct _Unwind_Context *context, int index) {
0143 uintptr_t value = 0;
0144 _Unwind_VRS_Get(context, _UVRSC_CORE, (uint32_t)index, _UVRSD_UINT32, &value);
0145 return value;
0146 }
0147
0148 _LIBUNWIND_EXPORT_UNWIND_LEVEL1
0149 void _Unwind_SetGR(struct _Unwind_Context *context, int index,
0150 uintptr_t value) {
0151 _Unwind_VRS_Set(context, _UVRSC_CORE, (uint32_t)index, _UVRSD_UINT32, &value);
0152 }
0153
0154 _LIBUNWIND_EXPORT_UNWIND_LEVEL1
0155 uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {
0156
0157 return _Unwind_GetGR(context, 15) & (~(uintptr_t)0x1);
0158 }
0159
0160 _LIBUNWIND_EXPORT_UNWIND_LEVEL1
0161 void _Unwind_SetIP(struct _Unwind_Context *context, uintptr_t value) {
0162 uintptr_t thumb_bit = _Unwind_GetGR(context, 15) & ((uintptr_t)0x1);
0163 _Unwind_SetGR(context, 15, value | thumb_bit);
0164 }
0165
0166 #ifdef __cplusplus
0167 }
0168 #endif
0169
0170 #endif