Saleem Abdulrasool | 675df58 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 1 | //===------------------------- 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 Chien | 6127858 | 2015-07-19 15:23:10 +0000 | [diff] [blame] | 14 | #include <__libunwind_config.h> |
Saleem Abdulrasool | 675df58 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 15 | |
Ranjeet Singh | 7d67413 | 2017-03-31 15:28:06 +0000 | [diff] [blame] | 16 | #if defined(_LIBUNWIND_ARM_EHABI) |
Saleem Abdulrasool | 675df58 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 17 | |
| 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 | |
| 24 | static inline uint32_t signExtendPrel31(uint32_t data) { |
| 25 | return data | ((data & 0x40000000u) << 1); |
| 26 | } |
| 27 | |
| 28 | static inline uint32_t readPrel31(const uint32_t *data) { |
| 29 | return (((uint32_t)(uintptr_t)data) + signExtendPrel31(*data)); |
| 30 | } |
| 31 | |
| 32 | #if defined(__cplusplus) |
| 33 | extern "C" { |
| 34 | #endif |
| 35 | |
| 36 | extern _Unwind_Reason_Code __aeabi_unwind_cpp_pr0( |
| 37 | _Unwind_State state, _Unwind_Control_Block *ucbp, _Unwind_Context *context); |
| 38 | |
| 39 | extern _Unwind_Reason_Code __aeabi_unwind_cpp_pr1( |
| 40 | _Unwind_State state, _Unwind_Control_Block *ucbp, _Unwind_Context *context); |
| 41 | |
| 42 | extern _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 | |
Ranjeet Singh | 7d67413 | 2017-03-31 15:28:06 +0000 | [diff] [blame] | 49 | #endif // defined(_LIBUNWIND_ARM_EHABI) |
Saleem Abdulrasool | 675df58 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 50 | |
| 51 | #endif // __UNWIND_EHABI_H__ |