ehabi.h revision 1.1.2.2 1 1.1.2.2 rmind /*-
2 1.1.2.2 rmind * Copyright (c) 2013 The NetBSD Foundation, Inc.
3 1.1.2.2 rmind * All rights reserved.
4 1.1.2.2 rmind *
5 1.1.2.2 rmind * This code is derived from software contributed to The NetBSD Foundation
6 1.1.2.2 rmind * by Matt Thomas of 3am Software Foundry.
7 1.1.2.2 rmind *
8 1.1.2.2 rmind * Redistribution and use in source and binary forms, with or without
9 1.1.2.2 rmind * modification, are permitted provided that the following conditions
10 1.1.2.2 rmind * are met:
11 1.1.2.2 rmind * 1. Redistributions of source code must retain the above copyright
12 1.1.2.2 rmind * notice, this list of conditions and the following disclaimer.
13 1.1.2.2 rmind * 2. Redistributions in binary form must reproduce the above copyright
14 1.1.2.2 rmind * notice, this list of conditions and the following disclaimer in the
15 1.1.2.2 rmind * documentation and/or other materials provided with the distribution.
16 1.1.2.2 rmind *
17 1.1.2.2 rmind * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
18 1.1.2.2 rmind * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 1.1.2.2 rmind * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 1.1.2.2 rmind * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21 1.1.2.2 rmind * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 1.1.2.2 rmind * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 1.1.2.2 rmind * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 1.1.2.2 rmind * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 1.1.2.2 rmind * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 1.1.2.2 rmind * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 1.1.2.2 rmind * POSSIBILITY OF SUCH DAMAGE.
28 1.1.2.2 rmind */
29 1.1.2.2 rmind /* $NetBSD: ehabi.h,v 1.1.2.2 2013/08/28 23:59:12 rmind Exp $ */
30 1.1.2.2 rmind
31 1.1.2.2 rmind #ifndef _ARM_EHABI_H_
32 1.1.2.2 rmind #define _ARM_EHABI_H_
33 1.1.2.2 rmind
34 1.1.2.2 rmind #if defined(_KERNEL) || defined(_STANDALONE)
35 1.1.2.2 rmind #include <sys/types.h>
36 1.1.2.2 rmind #else
37 1.1.2.2 rmind #include <inttypes.h>
38 1.1.2.2 rmind #endif
39 1.1.2.2 rmind
40 1.1.2.2 rmind typedef enum {
41 1.1.2.2 rmind _URC_OK = 0, /* operation complete */
42 1.1.2.2 rmind _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
43 1.1.2.2 rmind _URC_HANDLER_FOUND = 6,
44 1.1.2.2 rmind _URC_INSTALL_CONTEXT = 7,
45 1.1.2.2 rmind _URC_CONTINUE_UNWIND = 8,
46 1.1.2.2 rmind _URC_FAILURE = 9, /* unspecified failure */
47 1.1.2.2 rmind } _Unwind_Reason_Code;
48 1.1.2.2 rmind
49 1.1.2.2 rmind typedef enum {
50 1.1.2.2 rmind _UVRSC_CORE = 0, /* integer register */
51 1.1.2.2 rmind _UVRSC_VFP = 1, /* vfp */
52 1.1.2.2 rmind _UVRSC_WMMXD = 3, /* Intel WMMX data register */
53 1.1.2.2 rmind _UVRSC_WMMXC = 4 /* Intel WMMX control register */
54 1.1.2.2 rmind } _Unwind_VRS_RegClass;
55 1.1.2.2 rmind typedef enum {
56 1.1.2.2 rmind _UVRSD_UINT32 = 0,
57 1.1.2.2 rmind _UVRSD_VFPX = 1,
58 1.1.2.2 rmind _UVRSD_UINT64 = 3,
59 1.1.2.2 rmind _UVRSD_FLOAT = 4,
60 1.1.2.2 rmind _UVRSD_DOUBLE = 5
61 1.1.2.2 rmind } _Unwind_VRS_DataRepresentation;
62 1.1.2.2 rmind typedef enum {
63 1.1.2.2 rmind _UVRSR_OK = 0,
64 1.1.2.2 rmind _UVRSR_NOT_IMPLEMENTED = 1,
65 1.1.2.2 rmind _UVRSR_FAILED = 2
66 1.1.2.2 rmind } _Unwind_VRS_Result;
67 1.1.2.2 rmind
68 1.1.2.2 rmind typedef uint32_t _Unwind_State;
69 1.1.2.2 rmind static const _Unwind_State _US_VIRTUAL_UNWIND_FRAME = 0;
70 1.1.2.2 rmind static const _Unwind_State _US_UNWIND_FRAME_STARTING = 1;
71 1.1.2.2 rmind static const _Unwind_State _US_UNWIND_FRAME_RESUME = 2;
72 1.1.2.2 rmind
73 1.1.2.2 rmind typedef struct _Unwind_Control_Block _Unwind_Control_Block;
74 1.1.2.2 rmind typedef struct _Unwind_Context _Unwind_Context;
75 1.1.2.2 rmind typedef uint32_t _Unwind_EHT_Header;
76 1.1.2.2 rmind
77 1.1.2.2 rmind struct _Unwind_Control_Block {
78 1.1.2.2 rmind char exception_class[8];
79 1.1.2.2 rmind void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *);
80 1.1.2.2 rmind /* Unwinder cache, private fields for the unwinder's use */
81 1.1.2.2 rmind struct {
82 1.1.2.2 rmind uint32_t reserved1;
83 1.1.2.2 rmind uint32_t reserved2;
84 1.1.2.2 rmind uint32_t reserved3;
85 1.1.2.2 rmind uint32_t reserved4;
86 1.1.2.2 rmind uint32_t reserved5;
87 1.1.2.2 rmind /* init reserved1 to 0, then don't touch */
88 1.1.2.2 rmind } unwinder_cache;
89 1.1.2.2 rmind /* Propagation barrier cache (valid after phase 1): */
90 1.1.2.2 rmind struct {
91 1.1.2.2 rmind uint32_t sp;
92 1.1.2.2 rmind uint32_t bitpattern[5];
93 1.1.2.2 rmind } barrier_cache;
94 1.1.2.2 rmind /* Cleanup cache (preserved over cleanup): */
95 1.1.2.2 rmind struct {
96 1.1.2.2 rmind uint32_t bitpattern[4];
97 1.1.2.2 rmind } cleanup_cache;
98 1.1.2.2 rmind /* Pr cache (for pr's benefit): */
99 1.1.2.2 rmind struct {
100 1.1.2.2 rmind uint32_t fnstart; /* function start address */
101 1.1.2.2 rmind _Unwind_EHT_Header *ehtp; /* ptr to EHT entry header word */
102 1.1.2.2 rmind uint32_t additional; /* additional data */
103 1.1.2.2 rmind uint32_t reserved1;
104 1.1.2.2 rmind } pr_cache;
105 1.1.2.2 rmind uint64_t : 0; /* Force alignment of next item to 8-byte boundary */
106 1.1.2.2 rmind };
107 1.1.2.2 rmind
108 1.1.2.2 rmind __BEGIN_DECLS
109 1.1.2.2 rmind
110 1.1.2.2 rmind /* Unwinding functions */
111 1.1.2.2 rmind void _Unwind_Resume(_Unwind_Control_Block *);
112 1.1.2.2 rmind void _Unwind_Complete(_Unwind_Control_Block *);
113 1.1.2.2 rmind void _Unwind_DeleteException(_Unwind_Control_Block *);
114 1.1.2.2 rmind _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Control_Block *);
115 1.1.2.2 rmind
116 1.1.2.2 rmind _Unwind_VRS_Result _Unwind_VRS_Set(_Unwind_Context *, _Unwind_VRS_RegClass,
117 1.1.2.2 rmind uint32_t, _Unwind_VRS_DataRepresentation, void *);
118 1.1.2.2 rmind _Unwind_VRS_Result _Unwind_VRS_Get(_Unwind_Context *, _Unwind_VRS_RegClass,
119 1.1.2.2 rmind uint32_t, _Unwind_VRS_DataRepresentation, void *);
120 1.1.2.2 rmind
121 1.1.2.2 rmind _Unwind_VRS_Result _Unwind_VRS_Pop(_Unwind_Context *, _Unwind_VRS_RegClass,
122 1.1.2.2 rmind uint32_t, _Unwind_VRS_DataRepresentation);
123 1.1.2.2 rmind
124 1.1.2.2 rmind _Unwind_Reason_Code __aeabi_unwind_cpp_pr0(_Unwind_State,
125 1.1.2.2 rmind _Unwind_Control_Block *, _Unwind_Context *);
126 1.1.2.2 rmind _Unwind_Reason_Code __aeabi_unwind_cpp_pr1(_Unwind_State ,
127 1.1.2.2 rmind _Unwind_Control_Block *, _Unwind_Context *);
128 1.1.2.2 rmind _Unwind_Reason_Code __aeabi_unwind_cpp_pr2(_Unwind_State ,
129 1.1.2.2 rmind _Unwind_Control_Block *, _Unwind_Context *);
130 1.1.2.2 rmind
131 1.1.2.2 rmind __END_DECLS
132 1.1.2.2 rmind
133 1.1.2.2 rmind #endif /* _ARM_EHABI_H_ */
134