summaryrefslogtreecommitdiff
path: root/libunwind/src/Unwind-EHABI.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
commitcfca06d7963fa0909f90483b42a6d7d194d01e08 (patch)
tree209fb2a2d68f8f277793fc8df46c753d31bc853b /libunwind/src/Unwind-EHABI.cpp
parent706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff)
Notes
Diffstat (limited to 'libunwind/src/Unwind-EHABI.cpp')
-rw-r--r--libunwind/src/Unwind-EHABI.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/libunwind/src/Unwind-EHABI.cpp b/libunwind/src/Unwind-EHABI.cpp
index a23ba2cc7e0e..32b5cbc3be92 100644
--- a/libunwind/src/Unwind-EHABI.cpp
+++ b/libunwind/src/Unwind-EHABI.cpp
@@ -31,10 +31,12 @@ namespace {
// signinficant byte.
uint8_t getByte(const uint32_t* data, size_t offset) {
const uint8_t* byteData = reinterpret_cast<const uint8_t*>(data);
-#ifdef __LITTLE_ENDIAN__
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
return byteData[(offset & ~(size_t)0x03) + (3 - (offset & (size_t)0x03))];
-#else
+#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
return byteData[offset];
+#else
+#error "Unable to determine endianess"
#endif
}
@@ -481,8 +483,8 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
// If there is a personality routine, ask it if it will want to stop at
// this frame.
if (frameInfo.handler != 0) {
- __personality_routine p =
- (__personality_routine)(long)(frameInfo.handler);
+ _Unwind_Personality_Fn p =
+ (_Unwind_Personality_Fn)(long)(frameInfo.handler);
_LIBUNWIND_TRACE_UNWINDING(
"unwind_phase1(ex_ojb=%p): calling personality function %p",
static_cast<void *>(exception_object),
@@ -597,8 +599,8 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor
// If there is a personality routine, tell it we are unwinding.
if (frameInfo.handler != 0) {
- __personality_routine p =
- (__personality_routine)(long)(frameInfo.handler);
+ _Unwind_Personality_Fn p =
+ (_Unwind_Personality_Fn)(long)(frameInfo.handler);
struct _Unwind_Context *context = (struct _Unwind_Context *)(cursor);
// EHABI #7.2
exception_object->pr_cache.fnstart = frameInfo.start_ip;
@@ -943,10 +945,12 @@ _Unwind_VRS_Pop(_Unwind_Context *context, _Unwind_VRS_RegClass regclass,
// SP is only 32-bit aligned so don't copy 64-bit at a time.
uint64_t w0 = *sp++;
uint64_t w1 = *sp++;
-#ifdef __LITTLE_ENDIAN__
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
uint64_t value = (w1 << 32) | w0;
-#else
+#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
uint64_t value = (w0 << 32) | w1;
+#else
+#error "Unable to determine endianess"
#endif
if (_Unwind_VRS_Set(context, regclass, i, representation, &value) !=
_UVRSR_OK)