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