diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-01-03 00:36:13 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-01-03 00:52:51 -0500 |
commit | 0cb8d8513cf44a102953ff5cf93e9dd399f42e9a (patch) | |
tree | 670e19c289dea5ba0a821d97709073078fc24e6d /sim/common | |
parent | 1ac72f0659d64d6a14da862242db0d841d2878d0 (diff) | |
download | gdb-0cb8d8513cf44a102953ff5cf93e9dd399f42e9a.zip gdb-0cb8d8513cf44a102953ff5cf93e9dd399f42e9a.tar.gz gdb-0cb8d8513cf44a102953ff5cf93e9dd399f42e9a.tar.bz2 |
sim: drop host endian configure option
The --enable-sim-hostendian flag was purely so people had an escape route
for when cross-compiling. This is because historically, AC_C_BIGENDIAN
did not work in those cases. That was fixed a while ago though, so we can
require that macro everywhere now and simplify a good bit of code.
Diffstat (limited to 'sim/common')
-rw-r--r-- | sim/common/ChangeLog | 28 | ||||
-rw-r--r-- | sim/common/Make-common.in | 2 | ||||
-rw-r--r-- | sim/common/acinclude.m4 | 32 | ||||
-rw-r--r-- | sim/common/config.in | 15 | ||||
-rwxr-xr-x | sim/common/configure | 230 | ||||
-rw-r--r-- | sim/common/sim-config.c | 22 | ||||
-rw-r--r-- | sim/common/sim-config.h | 27 | ||||
-rw-r--r-- | sim/common/sim-endian.c | 8 | ||||
-rw-r--r-- | sim/common/sim-n-core.h | 4 | ||||
-rw-r--r-- | sim/common/sim-n-endian.h | 14 |
10 files changed, 295 insertions, 87 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 6991786..d931834 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,31 @@ +2016-01-03 Mike Frysinger <vapier@gentoo.org> + + (CONFIG_CFLAGS): Delte $(SIM_HOSTENDIAN). + * acinclude.m4 (SIM_AC_COMMON): Call AC_C_BIGENDIAN. + (SIM_AC_OPTION_HOSTENDIAN): Delete. + * config.in, configure: Regenerate. + * Make-common.in (SIM_HOSTENDIAN): Delete. + * sim-config.c (current_host_byte_order): Delete. + (sim_config): Delete current_host_byte_order assignments and + CURRENT_HOST_BYTE_ORDER checks. + (print_sim_config): Change WITH_HOST_BYTE_ORDER to HOST_BYTE_ORDER. + * sim-config.h (WITH_HOST_BYTE_ORDER): Change to ... + (HOST_BYTE_ORDER): ... this. Define based on WORDS_BIGENDIAN. + (current_host_byte_order): Delete. + (CURRENT_HOST_BYTE_ORDER): Likewise. + * sim-endian.c (WITH_HOST_BYTE_ORDER): Rename to ... + (HOST_BYTE_ORDER): ... this. + (sim_endian_split_16): Change WITH_HOST_BYTE_ORDER to + HOST_BYTE_ORDER. + (sim_endian_join_16): Likewise. + * sim-n-core.h (sim_core_read_misaligned_N): Change + CURRENT_HOST_BYTE_ORDER to HOST_BYTE_ORDER. + (sim_core_write_misaligned_N): Likewise. + * sim-n-endian.h (endian_t2h_N): Likewise. + (endian_h2t_N, endian_h2be_N, endian_be2h_N, endian_h2le_N, + endian_le2h_N): Likewise. + (offset_N): Change WITH_HOST_BYTE_ORDER to HOST_BYTE_ORDER. + 2016-01-02 Mike Frysinger <vapier@gentoo.org> * acinclude.m4 (SIM_AC_OPTION_ENDIAN): Change BIG_ENDIAN to diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index 579e187..36497e7 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -91,7 +91,6 @@ SIM_FLOAT = @sim_float@ SIM_HW_CFLAGS = @sim_hw_cflags@ SIM_HW_OBJS = @sim_hw_objs@ SIM_HW = @sim_hw@ -SIM_HOSTENDIAN = @sim_hostendian@ SIM_INLINE = @sim_inline@ SIM_PACKAGES = @sim_packages@ SIM_REGPARM = @sim_regparm@ @@ -243,7 +242,6 @@ CONFIG_CFLAGS = \ $(SIM_ENVIRONMENT) \ $(SIM_FLOAT) \ $(SIM_HW_CFLAGS) \ - $(SIM_HOSTENDIAN) \ $(SIM_INLINE) \ $(SIM_PACKAGES) \ $(SIM_REGPARM) \ diff --git a/sim/common/acinclude.m4 b/sim/common/acinclude.m4 index 2af6d5d..9529337 100644 --- a/sim/common/acinclude.m4 +++ b/sim/common/acinclude.m4 @@ -36,6 +36,7 @@ AC_REQUIRE([AC_PROG_CC]) AC_CONFIG_HEADER(ifelse([$1],,config.h,[$1]):config.in) AC_CANONICAL_SYSTEM AC_USE_SYSTEM_EXTENSIONS +AC_C_BIGENDIAN AC_ARG_PROGRAM AC_PROG_INSTALL @@ -489,37 +490,6 @@ fi])dnl AC_SUBST(sim_endian) -dnl --enable-sim-hostendian is for users of the simulator when -dnl they find that AC_C_BIGENDIAN does not function correctly -dnl (for instance in a canadian cross) -AC_DEFUN([SIM_AC_OPTION_HOSTENDIAN], -[ -AC_ARG_ENABLE(sim-hostendian, -[AS_HELP_STRING([--enable-sim-hostendian=end], - [Specify host byte endian orientation])], -[case "${enableval}" in - no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BFD_ENDIAN_UNKNOWN";; - b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BFD_ENDIAN_BIG";; - l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BFD_ENDIAN_LITTLE";; - *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";; -esac -if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then - echo "Setting hostendian flags = $sim_hostendian" 6>&1 -fi],[ -if test "x$cross_compiling" = "xno"; then - AC_C_BIGENDIAN - if test $ac_cv_c_bigendian = yes; then - sim_hostendian="-DWITH_HOST_BYTE_ORDER=BFD_ENDIAN_BIG" - else - sim_hostendian="-DWITH_HOST_BYTE_ORDER=BFD_ENDIAN_LITTLE" - fi -else - sim_hostendian="-DWITH_HOST_BYTE_ORDER=BFD_ENDIAN_UNKNOWN" -fi])dnl -]) -AC_SUBST(sim_hostendian) - - dnl --enable-sim-float is for developers of the simulator dnl It specifies the presence of hardware floating point dnl And optionally the bitsize of the floating point register. diff --git a/sim/common/config.in b/sim/common/config.in index 4f3c89f..f24eb3b 100644 --- a/sim/common/config.in +++ b/sim/common/config.in @@ -1,5 +1,8 @@ /* config.in. Generated from configure.ac by autoheader. */ +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS @@ -198,6 +201,18 @@ #endif +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + /* Define to 1 if on MINIX. */ #undef _MINIX diff --git a/sim/common/configure b/sim/common/configure index d58935d..3ab1c63 100755 --- a/sim/common/configure +++ b/sim/common/configure @@ -736,7 +736,6 @@ sim_hw_cflags sim_default_model sim_scache sim_float -sim_hostendian sim_endian sim_bitsize sim_assert @@ -6439,6 +6438,230 @@ ac_config_headers="$ac_config_headers cconfig.h:config.in" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + @@ -10562,7 +10785,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10565 "configure" +#line 10788 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10668,7 +10891,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10671 "configure" +#line 10894 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11525,6 +11748,7 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs + if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then as_fn_error "conditional \"GMAKE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/sim/common/sim-config.c b/sim/common/sim-config.c index 8e9b1dd..d9036e1 100644 --- a/sim/common/sim-config.c +++ b/sim/common/sim-config.c @@ -25,7 +25,6 @@ #include "bfd.h" -enum bfd_endian current_host_byte_order = BFD_ENDIAN_UNKNOWN; enum bfd_endian current_target_byte_order = BFD_ENDIAN_UNKNOWN; int current_stdio; @@ -155,23 +154,6 @@ sim_config (SIM_DESC sd) ? BFD_ENDIAN_LITTLE : BFD_ENDIAN_BIG); - /* set the host byte order */ - current_host_byte_order = 1; - if (*(char*)(¤t_host_byte_order)) - current_host_byte_order = BFD_ENDIAN_LITTLE; - else - current_host_byte_order = BFD_ENDIAN_BIG; - - /* verify the host byte order */ - if (CURRENT_HOST_BYTE_ORDER != current_host_byte_order) - { - sim_io_eprintf (sd, "host (%s) and configured (%s) byte order in conflict", - config_byte_order_to_a (current_host_byte_order), - config_byte_order_to_a (CURRENT_HOST_BYTE_ORDER)); - return SIM_RC_FAIL; - } - - /* set the target byte order */ #if (WITH_TREE_PROPERTIES) if (current_target_byte_order == BFD_ENDIAN_UNKNOWN) @@ -326,8 +308,8 @@ print_sim_config (SIM_DESC sd) sim_io_printf (sd, "WITH_DEFAULT_TARGET_BYTE_ORDER = %s\n", config_byte_order_to_a (WITH_DEFAULT_TARGET_BYTE_ORDER)); - sim_io_printf (sd, "WITH_HOST_BYTE_ORDER = %s\n", - config_byte_order_to_a (WITH_HOST_BYTE_ORDER)); + sim_io_printf (sd, "HOST_BYTE_ORDER = %s\n", + config_byte_order_to_a (HOST_BYTE_ORDER)); sim_io_printf (sd, "WITH_STDIO = %s\n", config_stdio_to_a (WITH_STDIO)); diff --git a/sim/common/sim-config.h b/sim/common/sim-config.h index fbd9b25..4dfc723 100644 --- a/sim/common/sim-config.h +++ b/sim/common/sim-config.h @@ -29,13 +29,16 @@ The CPP below defines information about the compilation host. In particular it defines the macro's: - WITH_HOST_BYTE_ORDER The byte order of the host. Could - be any of BFD_ENDIAN_LITTLE, BFD_ENDIAN_BIG, - or BFD_ENDIAN_UNKNOWN. Those macro's also - need to be defined. + HOST_BYTE_ORDER The byte order of the host. Could be BFD_ENDIAN_LITTLE + or BFD_ENDIAN_BIG. */ +#ifdef WORDS_BIGENDIAN +# define HOST_BYTE_ORDER BFD_ENDIAN_BIG +#else +# define HOST_BYTE_ORDER BFD_ENDIAN_LITTLE +#endif #if (defined (__i486__) || defined (__i586__) || defined (__i686__)) && defined(__GNUC__) && WITH_BSWAP #undef htonl @@ -49,17 +52,9 @@ #define WITH_TREE_PROPERTIES 0 -/* endianness of the host/target: - - If the build process is aware (at compile time) of the endianness - of the host/target it is able to eliminate slower generic endian - handling code. +/* Endianness of the target. - Possible values are BFD_ENDIAN_UNKNOWN, BFD_ENDIAN_LITTLE, BFD_ENDIAN_BIG. */ - -#ifndef WITH_HOST_BYTE_ORDER -#define WITH_HOST_BYTE_ORDER BFD_ENDIAN_UNKNOWN -#endif + Possible values are BFD_ENDIAN_UNKNOWN, BFD_ENDIAN_LITTLE, or BFD_ENDIAN_BIG. */ #ifndef WITH_TARGET_BYTE_ORDER #define WITH_TARGET_BYTE_ORDER BFD_ENDIAN_UNKNOWN @@ -69,10 +64,6 @@ #define WITH_DEFAULT_TARGET_BYTE_ORDER BFD_ENDIAN_UNKNOWN #endif -extern enum bfd_endian current_host_byte_order; -#define CURRENT_HOST_BYTE_ORDER \ - (WITH_HOST_BYTE_ORDER != BFD_ENDIAN_UNKNOWN \ - ? WITH_HOST_BYTE_ORDER : current_host_byte_order) extern enum bfd_endian current_target_byte_order; #define CURRENT_TARGET_BYTE_ORDER \ (WITH_TARGET_BYTE_ORDER != BFD_ENDIAN_UNKNOWN \ diff --git a/sim/common/sim-endian.c b/sim/common/sim-endian.c index e8ef534..884b8b7 100644 --- a/sim/common/sim-endian.c +++ b/sim/common/sim-endian.c @@ -31,7 +31,7 @@ #define _SWAP_1(SET,RAW) SET (RAW) #endif -#if !defined(_SWAP_2) && (WITH_HOST_BYTE_ORDER == BFD_ENDIAN_LITTLE) && defined(htons) +#if !defined(_SWAP_2) && (HOST_BYTE_ORDER == BFD_ENDIAN_LITTLE) && defined(htons) #define _SWAP_2(SET,RAW) SET htons (RAW) #endif @@ -39,7 +39,7 @@ #define _SWAP_2(SET,RAW) SET (((RAW) >> 8) | ((RAW) << 8)) #endif -#if !defined(_SWAP_4) && (WITH_HOST_BYTE_ORDER == BFD_ENDIAN_LITTLE) && defined(htonl) +#if !defined(_SWAP_4) && (HOST_BYTE_ORDER == BFD_ENDIAN_LITTLE) && defined(htonl) #define _SWAP_4(SET,RAW) SET htonl (RAW) #endif @@ -93,7 +93,7 @@ INLINE_SIM_ENDIAN\ (unsigned_8) sim_endian_split_16 (unsigned_16 word, int w) { - if (CURRENT_HOST_BYTE_ORDER == BFD_ENDIAN_LITTLE) + if (HOST_BYTE_ORDER == BFD_ENDIAN_LITTLE) { return word.a[1 - w]; } @@ -110,7 +110,7 @@ sim_endian_join_16 (unsigned_8 h, unsigned_8 l) { unsigned_16 word; - if (CURRENT_HOST_BYTE_ORDER == BFD_ENDIAN_LITTLE) + if (HOST_BYTE_ORDER == BFD_ENDIAN_LITTLE) { word.a[0] = l; word.a[1] = h; diff --git a/sim/common/sim-n-core.h b/sim/common/sim-n-core.h index 0c1cb7a..30611c7 100644 --- a/sim/common/sim-n-core.h +++ b/sim/common/sim-n-core.h @@ -248,7 +248,7 @@ sim_core_read_misaligned_N(sim_cpu *cpu, if (sim_core_xor_read_buffer (CPU_STATE (cpu), cpu, map, &val, addr, N) != N) SIM_CORE_SIGNAL (CPU_STATE (cpu), cpu, cia, map, N, addr, read_transfer, sim_core_unaligned_signal); - if (CURRENT_HOST_BYTE_ORDER != CURRENT_TARGET_BYTE_ORDER) + if (HOST_BYTE_ORDER != CURRENT_TARGET_BYTE_ORDER) val = SWAP_M (val); if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) val >>= (M - N) * 8; @@ -368,7 +368,7 @@ sim_core_write_misaligned_N(sim_cpu *cpu, unsigned_M data = val; if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) data <<= (M - N) * 8; - if (CURRENT_HOST_BYTE_ORDER != CURRENT_TARGET_BYTE_ORDER) + if (HOST_BYTE_ORDER != CURRENT_TARGET_BYTE_ORDER) data = SWAP_M (data); if (sim_core_xor_write_buffer (CPU_STATE (cpu), cpu, map, &data, addr, N) != N) SIM_CORE_SIGNAL (CPU_STATE (cpu), cpu, cia, map, N, addr, diff --git a/sim/common/sim-n-endian.h b/sim/common/sim-n-endian.h index ef7d2ce..a0f8d2f 100644 --- a/sim/common/sim-n-endian.h +++ b/sim/common/sim-n-endian.h @@ -44,7 +44,7 @@ INLINE_SIM_ENDIAN\ (unsigned_N) endian_t2h_N(unsigned_N raw_in) { - if (CURRENT_TARGET_BYTE_ORDER == CURRENT_HOST_BYTE_ORDER) { + if (CURRENT_TARGET_BYTE_ORDER == HOST_BYTE_ORDER) { return raw_in; } else { @@ -58,7 +58,7 @@ INLINE_SIM_ENDIAN\ (unsigned_N) endian_h2t_N(unsigned_N raw_in) { - if (CURRENT_TARGET_BYTE_ORDER == CURRENT_HOST_BYTE_ORDER) { + if (CURRENT_TARGET_BYTE_ORDER == HOST_BYTE_ORDER) { return raw_in; } else { @@ -81,7 +81,7 @@ INLINE_SIM_ENDIAN\ (unsigned_N) endian_h2be_N(unsigned_N raw_in) { - if (CURRENT_HOST_BYTE_ORDER == BFD_ENDIAN_BIG) { + if (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 == BFD_ENDIAN_BIG) { + if (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 == BFD_ENDIAN_LITTLE) { + if (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 == BFD_ENDIAN_LITTLE) { + if (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 == BFD_ENDIAN_LITTLE) + if (HOST_BYTE_ORDER == BFD_ENDIAN_LITTLE) { out = in + sizeof (unsigned_N) - offset - sizeof_word; } |