aboutsummaryrefslogtreecommitdiff
path: root/sim/mips
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-01-02 17:46:16 -0500
committerMike Frysinger <vapier@gentoo.org>2016-01-03 00:18:07 -0500
commit1ac72f0659d64d6a14da862242db0d841d2878d0 (patch)
treed7d792ba2df8227b99240650e99087e1f6008813 /sim/mips
parent987f8739051ff368ecaf6ca1e0fc966c974381a1 (diff)
downloadgdb-1ac72f0659d64d6a14da862242db0d841d2878d0.zip
gdb-1ac72f0659d64d6a14da862242db0d841d2878d0.tar.gz
gdb-1ac72f0659d64d6a14da862242db0d841d2878d0.tar.bz2
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.
Diffstat (limited to 'sim/mips')
-rw-r--r--sim/mips/ChangeLog7
-rwxr-xr-xsim/mips/configure52
-rw-r--r--sim/mips/configure.ac16
-rw-r--r--sim/mips/sim-main.h2
4 files changed, 42 insertions, 35 deletions
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
index a77058e..ba0a50b 100644
--- a/sim/mips/ChangeLog
+++ b/sim/mips/ChangeLog
@@ -1,5 +1,12 @@
2016-01-02 Mike Frysinger <vapier@gentoo.org>
+ * configure.ac (mips_endian): Change LITTLE_ENDIAN to LITTLE.
+ (default_endian): Likewise. Change BIG_ENDIAN to BIG.
+ * configure: Regenerate.
+ * sim-main.h (BigEndianMem): Change BIG_ENDIAN to BFD_ENDIAN_BIG.
+
+2016-01-02 Mike Frysinger <vapier@gentoo.org>
+
* dv-tx3904cpu.c (CPU, SD): Delete.
2015-12-30 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/mips/configure b/sim/mips/configure
index 6f1d136..c31d65e 100755
--- a/sim/mips/configure
+++ b/sim/mips/configure
@@ -13037,9 +13037,9 @@ fi
# Check whether --enable-sim-hostendian was given.
if test "${enable_sim_hostendian+set}" = set; then :
enableval=$enable_sim_hostendian; case "${enableval}" in
- no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
- b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
- l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
+ 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";;
*) as_fn_error "\"Unknown value $enableval for --enable-sim-hostendian\"" "$LINENO" 5; sim_hostendian="";;
esac
if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
@@ -13273,12 +13273,12 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
esac
if test $ac_cv_c_bigendian = yes; then
- sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
+ sim_hostendian="-DWITH_HOST_BYTE_ORDER=BFD_ENDIAN_BIG"
else
- sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
+ sim_hostendian="-DWITH_HOST_BYTE_ORDER=BFD_ENDIAN_LITTLE"
fi
else
- sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
+ sim_hostendian="-DWITH_HOST_BYTE_ORDER=BFD_ENDIAN_UNKNOWN"
fi
fi
@@ -13426,14 +13426,14 @@ esac
mips_endian=
default_endian=
case "${target}" in
- mips64el*-*-*) mips_endian=LITTLE_ENDIAN ;;
- mips64vr*el-*-*) default_endian=LITTLE_ENDIAN ;;
- mips64*-*-*) default_endian=BIG_ENDIAN ;;
- mips16*-*-*) default_endian=BIG_ENDIAN ;;
- mipsisa32*-*-*) default_endian=BIG_ENDIAN ;;
- mipsisa64*-*-*) default_endian=BIG_ENDIAN ;;
- mips*-*-*) default_endian=BIG_ENDIAN ;;
- *) default_endian=BIG_ENDIAN ;;
+ mips64el*-*-*) mips_endian=LITTLE ;;
+ mips64vr*el-*-*) default_endian=LITTLE ;;
+ mips64*-*-*) default_endian=BIG ;;
+ mips16*-*-*) default_endian=BIG ;;
+ mipsisa32*-*-*) default_endian=BIG ;;
+ mipsisa64*-*-*) default_endian=BIG ;;
+ mips*-*-*) default_endian=BIG ;;
+ *) default_endian=BIG ;;
esac
wire_endian="$mips_endian"
@@ -13441,26 +13441,26 @@ default_endian="$default_endian"
# Check whether --enable-sim-endian was given.
if test "${enable_sim_endian+set}" = set; then :
enableval=$enable_sim_endian; case "${enableval}" in
- b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
- l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
+ b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_BIG";;
+ l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_LITTLE";;
yes) if test x"$wire_endian" != x; then
- sim_endian="-DWITH_TARGET_BYTE_ORDER=${wire_endian}"
+ sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_${wire_endian}"
else
- if test x"$default_endian" != x; then
- sim_endian="-DWITH_TARGET_BYTE_ORDER=${default_endian}"
+ if test x"$default_endian" != x; then
+ sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_${default_endian}"
else
echo "No hard-wired endian for target $target" 1>&6
- sim_endian="-DWITH_TARGET_BYTE_ORDER=0"
+ sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_UNKNOWN"
fi
fi;;
no) if test x"$default_endian" != x; then
- sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${default_endian}"
+ sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=BFD_ENDIAN_${default_endian}"
else
if test x"$wire_endian" != x; then
- sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${wire_endian}"
+ sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=BFD_ENDIAN_${wire_endian}"
else
echo "No default endian for target $target" 1>&6
- sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=0"
+ sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=BFD_ENDIAN_UNKNOWN"
fi
fi;;
*) as_fn_error "\"Unknown value $enableval for --enable-sim-endian\"" "$LINENO" 5; sim_endian="";;
@@ -13470,10 +13470,10 @@ if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
fi
else
if test x"$default_endian" != x; then
- sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${default_endian}"
+ sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=BFD_ENDIAN_${default_endian}"
else
if test x"$wire_endian" != x; then
- sim_endian="-DWITH_TARGET_BYTE_ORDER=${wire_endian}"
+ sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_${wire_endian}"
else
sim_endian=
fi
@@ -13769,7 +13769,7 @@ if test ${sim_gen} = MULTI; then
cat << __EOF__ > multi-run.c
/* Main entry point for MULTI simulators.
- Copyright (C) 2003-2015 Free Software Foundation, Inc.
+ Copyright (C) 2003-2016 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sim/mips/configure.ac b/sim/mips/configure.ac
index 7f04473..91e7b0c 100644
--- a/sim/mips/configure.ac
+++ b/sim/mips/configure.ac
@@ -37,14 +37,14 @@ AC_SUBST(SIM_SUBTARGET)
mips_endian=
default_endian=
case "${target}" in
- mips64el*-*-*) mips_endian=LITTLE_ENDIAN ;;
- mips64vr*el-*-*) default_endian=LITTLE_ENDIAN ;;
- mips64*-*-*) default_endian=BIG_ENDIAN ;;
- mips16*-*-*) default_endian=BIG_ENDIAN ;;
- mipsisa32*-*-*) default_endian=BIG_ENDIAN ;;
- mipsisa64*-*-*) default_endian=BIG_ENDIAN ;;
- mips*-*-*) default_endian=BIG_ENDIAN ;;
- *) default_endian=BIG_ENDIAN ;;
+ mips64el*-*-*) mips_endian=LITTLE ;;
+ mips64vr*el-*-*) default_endian=LITTLE ;;
+ mips64*-*-*) default_endian=BIG ;;
+ mips16*-*-*) default_endian=BIG ;;
+ mipsisa32*-*-*) default_endian=BIG ;;
+ mipsisa64*-*-*) default_endian=BIG ;;
+ mips*-*-*) default_endian=BIG ;;
+ *) default_endian=BIG ;;
esac
SIM_AC_OPTION_ENDIAN($mips_endian,$default_endian)
diff --git a/sim/mips/sim-main.h b/sim/mips/sim-main.h
index b7e3072..0ea1234 100644
--- a/sim/mips/sim-main.h
+++ b/sim/mips/sim-main.h
@@ -592,7 +592,7 @@ struct sim_state {
/* Hardware configuration. Affects endianness of LoadMemory and
StoreMemory and the endianness of Kernel and Supervisor mode
execution. The value is 0 for little-endian; 1 for big-endian. */
-#define BigEndianMem (CURRENT_TARGET_BYTE_ORDER == BIG_ENDIAN)
+#define BigEndianMem (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
/*(state & simBE) ? 1 : 0)*/
/* ReverseEndian */