sim: overhaul & unify endian settings management
The m4 macro has 2 args: the "wire" settings (which represents the hardwired port behavior), and the default settings (which are used if nothing else is specified). If none are specified, the arch is expected to support both, and the value will be probed based on the user runtime options or the input program. Only two arches today set the default value (bpf & mips). We can probably let this go as it only shows up in one scenario: the sim is invoked, but with no inputs, and no user endian selection. This means bpf will not behave like the other arches: an error is shown and forces the user to make a choice. If an input program is used though, we'll still switch the default to that. This allows us to remove the WITH_DEFAULT_TARGET_BYTE_ORDER setting. For the ports that set a "wire" endian, move it to the runtime init of the respective sim_open calls. This allows us to change the WITH_TARGET_BYTE_ORDER to purely a user-selected configure setting if they want to force a specific endianness. With all the endian logic moved to runtime selection, we can move the configure call up to the common dir so we only process it once across all ports. The ppc arch was picking the wire endian based on the target used, but since we weren't doing that for other biendian arches, we can let this go too. We'll rely on the input selecting the endian, or make the user decide.
This commit is contained in:
parent
4470708442
commit
f9a4d54332
151 changed files with 348 additions and 1721 deletions
|
@ -1,3 +1,11 @@
|
|||
2021-06-17 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* Make-common.in (SIM_ENDIAN): Delete.
|
||||
* sim-config.c (sim_config): Delete WITH_DEFAULT_TARGET_BYTE_ORDER.
|
||||
(sim_config_print): Likewise.
|
||||
* sim-config.h (WITH_TARGET_BYTE_ORDER): Delete.
|
||||
(WITH_DEFAULT_TARGET_BYTE_ORDER): Likewise.
|
||||
|
||||
2021-06-17 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* cgen-trace.c: Include sim/callback.h.
|
||||
|
|
|
@ -86,7 +86,6 @@ LDFLAGS = @LDFLAGS@
|
|||
|
||||
SIM_BITSIZE = @sim_bitsize@
|
||||
SIM_DEFAULT_MODEL = @sim_default_model@
|
||||
SIM_ENDIAN = @sim_endian@
|
||||
SIM_FLOAT = @sim_float@
|
||||
SIM_HW_CFLAGS = @sim_hw_cflags@
|
||||
SIM_HW_OBJS = @sim_hw_objs@
|
||||
|
@ -223,7 +222,6 @@ CONFIG_CFLAGS = \
|
|||
-DHAVE_CONFIG_H \
|
||||
$(SIM_DEFAULT_MODEL) \
|
||||
$(SIM_BITSIZE) \
|
||||
$(SIM_ENDIAN) \
|
||||
$(SIM_FLOAT) \
|
||||
$(SIM_HW_CFLAGS) \
|
||||
$(SIM_INLINE) \
|
||||
|
|
|
@ -169,8 +169,6 @@ sim_config (SIM_DESC sd)
|
|||
current_target_byte_order = prefered_target_byte_order;
|
||||
if (current_target_byte_order == BFD_ENDIAN_UNKNOWN)
|
||||
current_target_byte_order = WITH_TARGET_BYTE_ORDER;
|
||||
if (current_target_byte_order == BFD_ENDIAN_UNKNOWN)
|
||||
current_target_byte_order = WITH_DEFAULT_TARGET_BYTE_ORDER;
|
||||
|
||||
/* verify the target byte order */
|
||||
if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_UNKNOWN)
|
||||
|
@ -302,9 +300,6 @@ sim_config_print (SIM_DESC sd)
|
|||
sim_io_printf (sd, "WITH_TARGET_BYTE_ORDER = %s\n",
|
||||
config_byte_order_to_a (WITH_TARGET_BYTE_ORDER));
|
||||
|
||||
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, "HOST_BYTE_ORDER = %s\n",
|
||||
config_byte_order_to_a (HOST_BYTE_ORDER));
|
||||
|
||||
|
|
|
@ -50,14 +50,6 @@
|
|||
|
||||
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
|
||||
#endif
|
||||
|
||||
#ifndef WITH_DEFAULT_TARGET_BYTE_ORDER
|
||||
#define WITH_DEFAULT_TARGET_BYTE_ORDER BFD_ENDIAN_UNKNOWN
|
||||
#endif
|
||||
|
||||
extern enum bfd_endian current_target_byte_order;
|
||||
#define CURRENT_TARGET_BYTE_ORDER \
|
||||
(WITH_TARGET_BYTE_ORDER != BFD_ENDIAN_UNKNOWN \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue