1 /* ===-- arm-ehabi-helpers.h - Supplementary ARM EHABI declarations --------===
3 * The LLVM Compiler Infrastructure
5 * This file is dual licensed under the MIT and the University of Illinois Open
6 * Source Licenses. See LICENSE.TXT for details.
8 * ===--------------------------------------------------------------------=== */
10 #ifndef UNWIND_EHABI_HELPERS_H
11 #define UNWIND_EHABI_HELPERS_H
14 /* NOTE: see reasoning for this inclusion below */
17 #if !defined(__ARM_EABI_UNWINDER__)
20 * NOTE: _URC_OK, _URC_FAILURE must be present as preprocessor tokens. This
21 * allows for a substitution of a constant which can be cast into the
22 * appropriate enumerated type. This header is expected to always be included
23 * AFTER unwind.h (which is why it is forcefully included above). This ensures
24 * that we do not overwrite the token for the enumeration. Subsequent uses of
25 * the token would be clean to rewrite with constant values.
27 * The typedef redeclaration should be safe. Due to the protection granted to
28 * us by the `__ARM_EABI_UNWINDER__` above, we are guaranteed that we are in a
29 * header not vended by gcc. The HP unwinder (being an itanium unwinder) does
30 * not support EHABI, and the GNU unwinder, derived from the HP unwinder, also
31 * does not support EHABI as of the introduction of this header. As such, we
32 * are fairly certain that we are in the LLVM case. Here, _Unwind_State is a
33 * typedef, and so we can get away with a redeclaration.
35 * Guarded redefinitions of the needed unwind state prevent the redefinition of
40 #define _URC_FAILURE 9
42 typedef uint32_t _Unwind_State;
44 #if !defined(_US_UNWIND_FRAME_STARTING)
45 #define _US_UNWIND_FRAME_STARTING ((_Unwind_State)1)
48 #if !defined(_US_ACTION_MASK)
49 #define _US_ACTION_MASK ((_Unwind_State)3)