From 1ac72f0659d64d6a14da862242db0d841d2878d0 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 2 Jan 2016 17:46:16 -0500 Subject: sim: convert to bfd_endian Rather than re-invent endian defines, as well as maintain our own list of OS & arch-specific includes, punt all that logic in favor of the bfd ones already set up and maintained elsewhere. We already rely on the bfd library, so leveraging the endian aspect should be fine. --- sim/common/sim-n-endian.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sim/common/sim-n-endian.h') diff --git a/sim/common/sim-n-endian.h b/sim/common/sim-n-endian.h index 4cfb925..ef7d2ce 100644 --- a/sim/common/sim-n-endian.h +++ b/sim/common/sim-n-endian.h @@ -81,7 +81,7 @@ INLINE_SIM_ENDIAN\ (unsigned_N) endian_h2be_N(unsigned_N raw_in) { - if (CURRENT_HOST_BYTE_ORDER == BIG_ENDIAN) { + if (CURRENT_HOST_BYTE_ORDER == BFD_ENDIAN_BIG) { return raw_in; } else { @@ -95,7 +95,7 @@ INLINE_SIM_ENDIAN\ (unsigned_N) endian_be2h_N(unsigned_N raw_in) { - if (CURRENT_HOST_BYTE_ORDER == BIG_ENDIAN) { + if (CURRENT_HOST_BYTE_ORDER == BFD_ENDIAN_BIG) { return raw_in; } else { @@ -109,7 +109,7 @@ INLINE_SIM_ENDIAN\ (unsigned_N) endian_h2le_N(unsigned_N raw_in) { - if (CURRENT_HOST_BYTE_ORDER == LITTLE_ENDIAN) { + if (CURRENT_HOST_BYTE_ORDER == BFD_ENDIAN_LITTLE) { return raw_in; } else { @@ -123,7 +123,7 @@ INLINE_SIM_ENDIAN\ (unsigned_N) endian_le2h_N(unsigned_N raw_in) { - if (CURRENT_HOST_BYTE_ORDER == LITTLE_ENDIAN) { + if (CURRENT_HOST_BYTE_ORDER == BFD_ENDIAN_LITTLE) { return raw_in; } else { @@ -145,7 +145,7 @@ offset_N (unsigned_N *x, ASSERT (offset + sizeof_word <= sizeof(unsigned_N)); ASSERT (word < (sizeof (unsigned_N) / sizeof_word)); ASSERT ((sizeof (unsigned_N) % sizeof_word) == 0); - if (WITH_HOST_BYTE_ORDER == LITTLE_ENDIAN) + if (WITH_HOST_BYTE_ORDER == BFD_ENDIAN_LITTLE) { out = in + sizeof (unsigned_N) - offset - sizeof_word; } -- cgit v1.1