mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 05:47:26 +08:00
sim cris: Unbreak --disable-sim-hardware builds
With --disable-sim-hardware (--enable-sim-hardware=no), whose default was changed to --enable-sim-hardware(=yes) in commit 34cf51120683, building for cris-elf fails as sim_hw_parse then doesn't exist. A cris-elf simulator configured for --enable-sim-hardware (or the default after to the mentioned commit) runs about 2.5x slower than one configured --disable-sim-hardware. A further 2-5% performance regression was not investigated. When sim_hw_parse doesn't exist, --cris-900000xx can't be supported. The best action here is to remove it completely, so its absence can be identified through --help, but avoiding littering the code with "#if WITH_HW". sim/cris: * sim-if.c (cris_options) [WITH_HW]: Conditionalize support of option --cris-900000xx. (sim_open) [WITH_HW]: Conditionalize sim_hw_parse call.
This commit is contained in:

committed by
Hans-Peter Nilsson

parent
6f62dbfb12
commit
e7e980c6fa
@ -100,9 +100,11 @@ static const OPTION cris_options[] =
|
|||||||
{ {"cris-naked", no_argument, NULL, OPTION_CRIS_NAKED},
|
{ {"cris-naked", no_argument, NULL, OPTION_CRIS_NAKED},
|
||||||
'\0', NULL, "Don't set up stack and environment",
|
'\0', NULL, "Don't set up stack and environment",
|
||||||
cris_option_handler, NULL },
|
cris_option_handler, NULL },
|
||||||
|
#if WITH_HW
|
||||||
{ {"cris-900000xx", no_argument, NULL, OPTION_CRIS_900000XXIF},
|
{ {"cris-900000xx", no_argument, NULL, OPTION_CRIS_900000XXIF},
|
||||||
'\0', NULL, "Define addresses at 0x900000xx with simulator semantics",
|
'\0', NULL, "Define addresses at 0x900000xx with simulator semantics",
|
||||||
cris_option_handler, NULL },
|
cris_option_handler, NULL },
|
||||||
|
#endif
|
||||||
{ {"cris-unknown-syscall", required_argument, NULL,
|
{ {"cris-unknown-syscall", required_argument, NULL,
|
||||||
OPTION_CRIS_UNKNOWN_SYSCALL},
|
OPTION_CRIS_UNKNOWN_SYSCALL},
|
||||||
'\0', "stop|enosys|enosys-quiet", "Action at an unknown system call",
|
'\0', "stop|enosys|enosys-quiet", "Action at an unknown system call",
|
||||||
@ -891,8 +893,14 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
|
|||||||
startmem, endmem - startmem);
|
startmem, endmem - startmem);
|
||||||
|
|
||||||
/* Allocate simulator I/O managed memory if none specified by user. */
|
/* Allocate simulator I/O managed memory if none specified by user. */
|
||||||
|
#if WITH_HW
|
||||||
if (cris_have_900000xxif)
|
if (cris_have_900000xxif)
|
||||||
sim_hw_parse (sd, "/core/%s/reg %#x %i", "cris_900000xx", 0x90000000, 0x100);
|
sim_hw_parse (sd, "/core/%s/reg %#x %i", "cris_900000xx", 0x90000000, 0x100);
|
||||||
|
#else
|
||||||
|
/* With the option disabled, nothing should be able to set this variable.
|
||||||
|
We should "use" it, though, and why not assert that it isn't set. */
|
||||||
|
ASSERT (! cris_have_900000xxif);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Establish any remaining configuration options. */
|
/* Establish any remaining configuration options. */
|
||||||
if (sim_config (sd) != SIM_RC_OK)
|
if (sim_config (sd) != SIM_RC_OK)
|
||||||
|
Reference in New Issue
Block a user