|
1 /* unwinder.h |
|
2 * |
|
3 * Copyright 2002-2005 ARM Limited. All rights reserved. |
|
4 * |
|
5 * Your rights to use this code are set out in the accompanying licence |
|
6 * text file LICENCE.txt (ARM contract number LEC-ELA-00080 v2.0). |
|
7 */ |
|
8 /* |
|
9 * RCS $Revision: 91721 $ |
|
10 * Checkin $Date: 2005-08-08 19:30:07 +0100 (Mon, 08 Aug 2005) $ |
|
11 * Revising $Author: drodgman $ |
|
12 */ |
|
13 |
|
14 /* Language-independent unwinder header public defines */ |
|
15 |
|
16 #ifndef UNWINDER_H |
|
17 #define UNWINDER_H |
|
18 |
|
19 #ifdef __cplusplus |
|
20 extern "C" { |
|
21 #endif |
|
22 |
|
23 typedef enum { |
|
24 _URC_OK = 0, /* operation completed successfully */ |
|
25 _URC_FOREIGN_EXCEPTION_CAUGHT = 1, |
|
26 _URC_HANDLER_FOUND = 6, |
|
27 _URC_INSTALL_CONTEXT = 7, |
|
28 _URC_CONTINUE_UNWIND = 8, |
|
29 _URC_FAILURE = 9 /* unspecified failure of some kind */ |
|
30 } _Unwind_Reason_Code; |
|
31 |
|
32 typedef enum { |
|
33 _US_VIRTUAL_UNWIND_FRAME = 0, |
|
34 _US_UNWIND_FRAME_STARTING = 1, |
|
35 _US_UNWIND_FRAME_RESUME = 2 |
|
36 } _Unwind_State; |
|
37 |
|
38 typedef struct _Unwind_Control_Block _Unwind_Control_Block; |
|
39 typedef struct _Unwind_Context _Unwind_Context; |
|
40 typedef uint32_t _Unwind_EHT_Header; |
|
41 |
|
42 |
|
43 /* UCB: */ |
|
44 |
|
45 struct _Unwind_Control_Block { |
|
46 char exception_class[8]; |
|
47 void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *); |
|
48 /* Unwinder cache, private fields for the unwinder's use */ |
|
49 struct { |
|
50 uint32_t reserved1; /* init reserved1 to 0, then don't touch */ |
|
51 uint32_t reserved2; |
|
52 uint32_t reserved3; |
|
53 uint32_t reserved4; |
|
54 uint32_t reserved5; |
|
55 } unwinder_cache; |
|
56 /* Propagation barrier cache (valid after phase 1): */ |
|
57 struct { |
|
58 uint32_t sp; |
|
59 uint32_t bitpattern[5]; |
|
60 } barrier_cache; |
|
61 /* Cleanup cache (preserved over cleanup): */ |
|
62 struct { |
|
63 uint32_t bitpattern[4]; |
|
64 } cleanup_cache; |
|
65 /* Pr cache (for pr's benefit): */ |
|
66 struct { |
|
67 uint32_t fnstart; /* function start address */ |
|
68 _Unwind_EHT_Header *ehtp; /* pointer to EHT entry header word */ |
|
69 uint32_t additional; /* additional data */ |
|
70 uint32_t reserved1; |
|
71 } pr_cache; |
|
72 long long int :0; /* Force alignment of next item to 8-byte boundary */ |
|
73 }; |
|
74 |
|
75 /* Interface functions: */ |
|
76 |
|
77 _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Control_Block *ucbp); |
|
78 NORETURNDECL void _Unwind_Resume(_Unwind_Control_Block *ucbp); |
|
79 void _Unwind_Complete(_Unwind_Control_Block *ucbp); |
|
80 void _Unwind_DeleteException(_Unwind_Control_Block *ucbp); |
|
81 |
|
82 /* Virtual Register Set*/ |
|
83 |
|
84 typedef enum { |
|
85 _UVRSC_CORE = 0, /* integer register */ |
|
86 _UVRSC_VFP = 1, /* vfp */ |
|
87 /* 2: was fpa (obsolete) */ |
|
88 _UVRSC_WMMXD = 3, /* Intel WMMX data register */ |
|
89 _UVRSC_WMMXC = 4 /* Intel WMMX control register */ |
|
90 } _Unwind_VRS_RegClass; |
|
91 |
|
92 typedef enum { |
|
93 _UVRSD_UINT32 = 0, |
|
94 _UVRSD_VFPX = 1, |
|
95 /* 2: was fpa (obsolete) */ |
|
96 _UVRSD_UINT64 = 3, |
|
97 _UVRSD_FLOAT = 4, |
|
98 _UVRSD_DOUBLE = 5 |
|
99 } _Unwind_VRS_DataRepresentation; |
|
100 |
|
101 typedef enum { |
|
102 _UVRSR_OK = 0, |
|
103 _UVRSR_NOT_IMPLEMENTED = 1, |
|
104 _UVRSR_FAILED = 2 |
|
105 } _Unwind_VRS_Result; |
|
106 |
|
107 IMPORT_C _Unwind_VRS_Result _Unwind_VRS_Set(_Unwind_Context *context, |
|
108 _Unwind_VRS_RegClass regclass, |
|
109 uint32_t regno, |
|
110 _Unwind_VRS_DataRepresentation representation, |
|
111 void *valuep); |
|
112 |
|
113 IMPORT_C _Unwind_VRS_Result _Unwind_VRS_Get(_Unwind_Context *context, |
|
114 _Unwind_VRS_RegClass regclass, |
|
115 uint32_t regno, |
|
116 _Unwind_VRS_DataRepresentation representation, |
|
117 void *valuep); |
|
118 |
|
119 IMPORT_C _Unwind_VRS_Result _Unwind_VRS_Pop(_Unwind_Context *context, |
|
120 _Unwind_VRS_RegClass regclass, |
|
121 uint32_t descriminator, |
|
122 _Unwind_VRS_DataRepresentation representation); |
|
123 |
|
124 #ifdef __cplusplus |
|
125 } /* extern "C" */ |
|
126 #endif |
|
127 |
|
128 #endif /* defined UNWINDER_H */ |