|
1 /* unwinder.h |
|
2 * |
|
3 * Copyright 2002-2003 ARM Limited. |
|
4 */ |
|
5 /* |
|
6 Licence |
|
7 |
|
8 1. Subject to the provisions of clause 2, ARM hereby grants to LICENSEE a |
|
9 perpetual, non-exclusive, nontransferable, royalty free, worldwide licence |
|
10 to use this Example Implementation of Exception Handling solely for the |
|
11 purpose of developing, having developed, manufacturing, having |
|
12 manufactured, offering to sell, selling, supplying or otherwise |
|
13 distributing products which comply with the Exception Handling ABI for the |
|
14 ARM Architecture specification. All other rights are reserved to ARM or its |
|
15 licensors. |
|
16 |
|
17 2. THIS EXAMPLE IMPLEMENTATION OF EXCEPTION HANDLING IS PROVIDED "AS IS" |
|
18 WITH NO WARRANTIES EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED |
|
19 TO ANY WARRANTY OF SATISFACTORY QUALITY, MERCHANTABILITY, NONINFRINGEMENT |
|
20 OR FITNESS FOR A PARTICULAR PURPOSE. |
|
21 */ |
|
22 /* |
|
23 * RCS $Revision: 1.7 $ |
|
24 * Checkin $Date: 2003/09/01 12:45:25 $ |
|
25 * Revising $Author: achapman $ |
|
26 */ |
|
27 |
|
28 /* Language-independent unwinder header public defines */ |
|
29 |
|
30 #ifndef UNWINDER_H |
|
31 #define UNWINDER_H |
|
32 |
|
33 #ifdef __cplusplus |
|
34 extern "C" { |
|
35 #endif |
|
36 |
|
37 typedef enum { |
|
38 _URC_OK = 0, /* operation completed successfully */ |
|
39 _URC_FOREIGN_EXCEPTION_CAUGHT = 1, |
|
40 _URC_HANDLER_FOUND = 6, |
|
41 _URC_INSTALL_CONTEXT = 7, |
|
42 _URC_CONTINUE_UNWIND = 8, |
|
43 _URC_FAILURE = 9 /* unspecified failure of some kind */ |
|
44 } _Unwind_Reason_Code; |
|
45 |
|
46 typedef enum { |
|
47 _US_VIRTUAL_UNWIND_FRAME = 0, |
|
48 _US_UNWIND_FRAME_STARTING = 1, |
|
49 _US_UNWIND_FRAME_RESUME = 2 |
|
50 } _Unwind_State; |
|
51 |
|
52 typedef struct _Unwind_Control_Block _Unwind_Control_Block; |
|
53 typedef struct _Unwind_Context _Unwind_Context; |
|
54 typedef uint32_t _Unwind_EHT_Header; |
|
55 |
|
56 |
|
57 /* UCB: */ |
|
58 |
|
59 struct _Unwind_Control_Block { |
|
60 char exception_class[8]; |
|
61 void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *); |
|
62 /* Unwinder cache, private fields for the unwinder's use */ |
|
63 struct { |
|
64 uint32_t reserved1; /* init reserved1 to 0, then don't touch */ |
|
65 uint32_t reserved2; |
|
66 uint32_t reserved3; |
|
67 uint32_t reserved4; |
|
68 uint32_t reserved5; |
|
69 } unwinder_cache; |
|
70 /* Propagation barrier cache (valid after phase 1): */ |
|
71 struct { |
|
72 uint32_t sp; |
|
73 uint32_t bitpattern[5]; |
|
74 } barrier_cache; |
|
75 /* Cleanup cache (preserved over cleanup): */ |
|
76 struct { |
|
77 uint32_t bitpattern[4]; |
|
78 } cleanup_cache; |
|
79 /* Pr cache (for pr's benefit): */ |
|
80 struct { |
|
81 uint32_t fnstart; /* function start address */ |
|
82 _Unwind_EHT_Header *ehtp; /* pointer to EHT entry header word */ |
|
83 uint32_t additional; /* additional data */ |
|
84 uint32_t reserved1; |
|
85 } pr_cache; |
|
86 long long int :0; /* Force alignment of next item to 8-byte boundary */ |
|
87 }; |
|
88 |
|
89 /* Interface functions: */ |
|
90 |
|
91 _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Control_Block *ucbp); |
|
92 NORETURNDECL void _Unwind_Resume(_Unwind_Control_Block *ucbp); |
|
93 void _Unwind_Complete(_Unwind_Control_Block *ucbp); |
|
94 |
|
95 /* Virtual Register Set*/ |
|
96 |
|
97 typedef enum { |
|
98 _UVRSC_CORE = 0, /* integer register */ |
|
99 _UVRSC_VFP = 1, /* vfp */ |
|
100 _UVRSC_FPA = 2, /* fpa */ |
|
101 _UVRSC_WMMXD = 3, /* Intel WMMX data register */ |
|
102 _UVRSC_WMMXC = 4 /* Intel WMMX control register */ |
|
103 } _Unwind_VRS_RegClass; |
|
104 |
|
105 typedef enum { |
|
106 _UVRSD_UINT32 = 0, |
|
107 _UVRSD_VFPX = 1, |
|
108 _UVRSD_FPAX = 2, |
|
109 _UVRSD_UINT64 = 3, |
|
110 _UVRSD_FLOAT = 4, |
|
111 _UVRSD_DOUBLE = 5 |
|
112 } _Unwind_VRS_DataRepresentation; |
|
113 |
|
114 typedef enum { |
|
115 _UVRSR_OK = 0, |
|
116 _UVRSR_NOT_IMPLEMENTED = 1, |
|
117 _UVRSR_FAILED = 2 |
|
118 } _Unwind_VRS_Result; |
|
119 |
|
120 _Unwind_VRS_Result _Unwind_VRS_Set(_Unwind_Context *context, |
|
121 _Unwind_VRS_RegClass regclass, |
|
122 uint32_t regno, |
|
123 _Unwind_VRS_DataRepresentation representation, |
|
124 void *valuep); |
|
125 |
|
126 _Unwind_VRS_Result _Unwind_VRS_Get(_Unwind_Context *context, |
|
127 _Unwind_VRS_RegClass regclass, |
|
128 uint32_t regno, |
|
129 _Unwind_VRS_DataRepresentation representation, |
|
130 void *valuep); |
|
131 |
|
132 _Unwind_VRS_Result _Unwind_VRS_Pop(_Unwind_Context *context, |
|
133 _Unwind_VRS_RegClass regclass, |
|
134 uint32_t descriminator, |
|
135 _Unwind_VRS_DataRepresentation representation); |
|
136 |
|
137 #ifdef __cplusplus |
|
138 } /* extern "C" */ |
|
139 #endif |
|
140 |
|
141 #endif /* defined UNWINDER_H */ |