blob: a7c62df7513231762e2416a323c1915139dad09e [file] [log] [blame]
Saleem Abdulrasool675df582015-04-24 19:39:17 +00001//===------------------------- Unwind-EHABI.hpp ---------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//
9//===----------------------------------------------------------------------===//
10
11#ifndef __UNWIND_EHABI_H__
12#define __UNWIND_EHABI_H__
13
Logan Chien61278582015-07-19 15:23:10 +000014#include <__libunwind_config.h>
Saleem Abdulrasool675df582015-04-24 19:39:17 +000015
Logan Chien61278582015-07-19 15:23:10 +000016#if _LIBUNWIND_ARM_EHABI
Saleem Abdulrasool675df582015-04-24 19:39:17 +000017
18#include <stdint.h>
19#include <unwind.h>
20
21// Unable to unwind in the ARM index table (section 5 EHABI).
22#define UNW_EXIDX_CANTUNWIND 0x1
23
24static inline uint32_t signExtendPrel31(uint32_t data) {
25 return data | ((data & 0x40000000u) << 1);
26}
27
28static inline uint32_t readPrel31(const uint32_t *data) {
29 return (((uint32_t)(uintptr_t)data) + signExtendPrel31(*data));
30}
31
32#if defined(__cplusplus)
33extern "C" {
34#endif
35
36extern _Unwind_Reason_Code __aeabi_unwind_cpp_pr0(
37 _Unwind_State state, _Unwind_Control_Block *ucbp, _Unwind_Context *context);
38
39extern _Unwind_Reason_Code __aeabi_unwind_cpp_pr1(
40 _Unwind_State state, _Unwind_Control_Block *ucbp, _Unwind_Context *context);
41
42extern _Unwind_Reason_Code __aeabi_unwind_cpp_pr2(
43 _Unwind_State state, _Unwind_Control_Block *ucbp, _Unwind_Context *context);
44
45#if defined(__cplusplus)
46} // extern "C"
47#endif
48
Logan Chien61278582015-07-19 15:23:10 +000049#endif // _LIBUNWIND_ARM_EHABI
Saleem Abdulrasool675df582015-04-24 19:39:17 +000050
51#endif // __UNWIND_EHABI_H__