diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-06-15 20:58:31 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-06-16 01:22:50 -0400 |
commit | 956f0babcd95bc7b6d2d79ea345abdd6f464e65f (patch) | |
tree | 539e8c9e69c946b736856febfc74d4cae38f4e2d /sim/ppc/std-config.h | |
parent | 1b828ebe530ef113c9e55fad8f7e472cd36dd078 (diff) | |
download | gdb-956f0babcd95bc7b6d2d79ea345abdd6f464e65f.zip gdb-956f0babcd95bc7b6d2d79ea345abdd6f464e65f.tar.gz gdb-956f0babcd95bc7b6d2d79ea345abdd6f464e65f.tar.bz2 |
sim: ppc: 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.
This was done for all the other ports years ago, so catch ppc up.
Diffstat (limited to 'sim/ppc/std-config.h')
-rw-r--r-- | sim/ppc/std-config.h | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/sim/ppc/std-config.h b/sim/ppc/std-config.h index 375ba73..7b8f911 100644 --- a/sim/ppc/std-config.h +++ b/sim/ppc/std-config.h @@ -21,6 +21,7 @@ #ifndef _PSIM_CONFIG_H_ #define _PSIM_CONFIG_H_ +#include "bfd.h" /* endianness of the host/target: @@ -28,29 +29,23 @@ of the host/target it is able to eliminate slower generic endian handling code. - Possible values are 0 (unknown), LITTLE_ENDIAN, BIG_ENDIAN */ - -#ifndef LITTLE_ENDIAN -#define LITTLE_ENDIAN 1234 -#endif -#ifndef BIG_ENDIAN -#define BIG_ENDIAN 4321 -#endif + Possible values are BFD_ENDIAN_UNKNOWN, BFD_ENDIAN_LITTLE, + BFD_ENDIAN_BIG. */ #ifdef WORDS_BIGENDIAN -# define HOST_BYTE_ORDER BIG_ENDIAN +# define HOST_BYTE_ORDER BFD_ENDIAN_BIG #else -# define HOST_BYTE_ORDER LITTLE_ENDIAN +# define HOST_BYTE_ORDER BFD_ENDIAN_LITTLE #endif #ifndef WITH_TARGET_BYTE_ORDER -#define WITH_TARGET_BYTE_ORDER 0 /*unknown*/ +#define WITH_TARGET_BYTE_ORDER BFD_ENDIAN_UNKNOWN #endif -extern int current_target_byte_order; -#define CURRENT_TARGET_BYTE_ORDER (WITH_TARGET_BYTE_ORDER \ - ? WITH_TARGET_BYTE_ORDER \ - : current_target_byte_order) +extern enum bfd_endian current_target_byte_order; +#define CURRENT_TARGET_BYTE_ORDER \ + (WITH_TARGET_BYTE_ORDER != BFD_ENDIAN_UNKNOWN \ + ? WITH_TARGET_BYTE_ORDER : current_target_byte_order) /* PowerPC XOR endian. |