summaryrefslogtreecommitdiff
path: root/src/aarch64
diff options
context:
space:
mode:
authorStephen Webb <swebb@blackberry.com>2020-06-11 17:52:49 -0400
committerDave Watson <dade.watson@gmail.com>2020-06-18 13:42:19 -0700
commit12e70a59df9a2e1c436c79c1dba941ca555db843 (patch)
treed0f9cc95ba9c54d22f8de5fbbf731f076ebadd5c /src/aarch64
parent77dfbd60e715399f06b3e823fdffa5d9c658caf2 (diff)
downloadlibunwind-12e70a59df9a2e1c436c79c1dba941ca555db843.tar.gz
Rationalize endianness macros
Extend the endianness macros to support systems that define them in <sys/param.h> and replace the use of names that violate ISO/IEC 9899. Rename endianness macros used in code to use properly-namespaced macros for portability and cross-hosting compatibility. Add inline functions to perform common operations with the macros.
Diffstat (limited to 'src/aarch64')
-rw-r--r--src/aarch64/Gcreate_addr_space.c5
-rw-r--r--src/aarch64/Ginit.c2
2 files changed, 3 insertions, 4 deletions
diff --git a/src/aarch64/Gcreate_addr_space.c b/src/aarch64/Gcreate_addr_space.c
index f217adc7..ac2b85e2 100644
--- a/src/aarch64/Gcreate_addr_space.c
+++ b/src/aarch64/Gcreate_addr_space.c
@@ -37,8 +37,7 @@ unw_create_addr_space (unw_accessors_t *a, int byte_order)
unw_addr_space_t as;
/* AArch64 supports little-endian and big-endian. */
- if (byte_order != 0 && byte_order != __LITTLE_ENDIAN
- && byte_order != __BIG_ENDIAN)
+ if (byte_order != 0 && byte_order_is_valid(byte_order) == 0)
return NULL;
as = malloc (sizeof (*as));
@@ -50,7 +49,7 @@ unw_create_addr_space (unw_accessors_t *a, int byte_order)
as->acc = *a;
/* Default to little-endian for AArch64. */
- if (byte_order == 0 || byte_order == __LITTLE_ENDIAN)
+ if (byte_order == 0 || byte_order == UNW_LITTLE_ENDIAN)
as->big_endian = 0;
else
as->big_endian = 1;
diff --git a/src/aarch64/Ginit.c b/src/aarch64/Ginit.c
index 35389762..a3b933b6 100644
--- a/src/aarch64/Ginit.c
+++ b/src/aarch64/Ginit.c
@@ -182,7 +182,7 @@ aarch64_local_addr_space_init (void)
local_addr_space.acc.access_fpreg = access_fpreg;
local_addr_space.acc.resume = aarch64_local_resume;
local_addr_space.acc.get_proc_name = get_static_proc_name;
- local_addr_space.big_endian = (__BYTE_ORDER == __BIG_ENDIAN);
+ local_addr_space.big_endian = target_is_big_endian();
unw_flush_cache (&local_addr_space, 0, 0);
}