From 9d90335212595f76b0f29698dfb2468c7318c171 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 23 Apr 2021 21:58:21 -0400 Subject: [PATCH] sim: simplify hardware m4 macro Every port using this sets the 1st arg to yes and the 2nd arg to "". These are the defaults we probably want anyways in order to unify the codebase, so move them to the macro and only allow ports to declare extra hardware models. --- sim/ChangeLog | 6 ++++++ sim/README-HACKING | 2 +- sim/bfin/ChangeLog | 5 +++++ sim/bfin/configure | 8 +------- sim/bfin/configure.ac | 2 +- sim/cris/ChangeLog | 5 +++++ sim/cris/configure | 8 +------- sim/cris/configure.ac | 2 +- sim/frv/ChangeLog | 5 +++++ sim/frv/configure | 8 +------- sim/frv/configure.ac | 2 +- sim/iq2000/ChangeLog | 5 +++++ sim/iq2000/configure | 8 +------- sim/iq2000/configure.ac | 2 +- sim/lm32/ChangeLog | 5 +++++ sim/lm32/configure | 8 +------- sim/lm32/configure.ac | 2 +- sim/m32r/ChangeLog | 5 +++++ sim/m32r/configure | 8 +------- sim/m32r/configure.ac | 2 +- sim/m4/sim_ac_option_hardware.m4 | 14 +++----------- sim/m68hc11/ChangeLog | 5 +++++ sim/m68hc11/configure | 9 ++------- sim/m68hc11/configure.ac | 2 +- sim/mips/ChangeLog | 6 ++++++ sim/mips/configure | 13 +++---------- sim/mips/configure.ac | 5 ++--- sim/mn10300/ChangeLog | 5 +++++ sim/mn10300/configure | 8 +------- sim/mn10300/configure.ac | 2 +- 30 files changed, 78 insertions(+), 89 deletions(-) diff --git a/sim/ChangeLog b/sim/ChangeLog index 47032e0bd53..fdeed7d8f53 100644 --- a/sim/ChangeLog +++ b/sim/ChangeLog @@ -1,3 +1,9 @@ +2021-04-23 Mike Frysinger + + * README-HACKING (SIM_AC_OPTION_HARDWARE): Delete first two args. + * m4/sim_ac_option_hardware.m4 (SIM_AC_OPTION_HARDWARE): Replace [$1] + with yes. Delete test [$2]. Change [$3] to [$1]. Update comments. + 2021-04-22 Tom Tromey * m4/sim_ac_common.m4 (SIM_AC_COMMON): Don't check for sys/time.h diff --git a/sim/README-HACKING b/sim/README-HACKING index 0a1a3b55c1e..78580588bf2 100644 --- a/sim/README-HACKING +++ b/sim/README-HACKING @@ -396,7 +396,7 @@ Hardware Devices The simplest simulator doesn't include hardware device support. Once you're ready to move on to the next level, call the common macro in your configure.ac: -SIM_AC_OPTION_HARDWARE(yes,,devone devtwo devthree) +SIM_AC_OPTION_HARDWARE(devone devtwo devthree) The basic hardware API is documented in common/hw-device.h. diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog index 4473b720ffb..65c96b2f7b9 100644 --- a/sim/bfin/ChangeLog +++ b/sim/bfin/ChangeLog @@ -1,3 +1,8 @@ +2021-04-23 Mike Frysinger + + * configure.ac (SIM_AC_OPTION_HARDWARE): Delete first two args. + * configure: Regenerate. + 2021-04-22 Tom Tromey * configure, config.in: Rebuild. diff --git a/sim/bfin/configure b/sim/bfin/configure index efdeccbdcc2..128621cdbd4 100755 --- a/sim/bfin/configure +++ b/sim/bfin/configure @@ -12081,12 +12081,7 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } fi -if test ""; then - hardware="" -else - hardware="cfi core pal glue" -fi -hardware="$hardware \ +hardware="cfi core pal glue \ bfin_cec \ bfin_ctimer \ bfin_dma \ @@ -12119,7 +12114,6 @@ hardware="$hardware \ bfin_wp \ eth_phy \ " - sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`" diff --git a/sim/bfin/configure.ac b/sim/bfin/configure.ac index cedd9677f56..8fef4d47d00 100644 --- a/sim/bfin/configure.ac +++ b/sim/bfin/configure.ac @@ -8,7 +8,7 @@ SIM_AC_OPTION_ENDIAN(LITTLE) SIM_AC_OPTION_ALIGNMENT(STRICT_ALIGNMENT,STRICT_ALIGNMENT) SIM_AC_OPTION_DEFAULT_MODEL(bf537) SIM_AC_OPTION_WARNINGS -SIM_AC_OPTION_HARDWARE(yes,,\ +SIM_AC_OPTION_HARDWARE(\ bfin_cec \ bfin_ctimer \ bfin_dma \ diff --git a/sim/cris/ChangeLog b/sim/cris/ChangeLog index 07d3086f758..d123611e5f3 100644 --- a/sim/cris/ChangeLog +++ b/sim/cris/ChangeLog @@ -1,3 +1,8 @@ +2021-04-23 Mike Frysinger + + * configure.ac (SIM_AC_OPTION_HARDWARE): Delete first two args. + * configure: Regenerate. + 2021-04-22 Tom Tromey * rvdummy.c: Update includes. diff --git a/sim/cris/configure b/sim/cris/configure index 2a615b1af14..6f0b25e85bf 100755 --- a/sim/cris/configure +++ b/sim/cris/configure @@ -12071,13 +12071,7 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } fi -if test ""; then - hardware="" -else - hardware="cfi core pal glue" -fi -hardware="$hardware rv cris cris_900000xx" - +hardware="cfi core pal glue rv cris cris_900000xx" sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`" diff --git a/sim/cris/configure.ac b/sim/cris/configure.ac index 56afe58331a..f8aa533a063 100644 --- a/sim/cris/configure.ac +++ b/sim/cris/configure.ac @@ -15,7 +15,7 @@ SIM_AC_OPTION_ENDIAN(LITTLE) SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT) SIM_AC_OPTION_SCACHE(16384) SIM_AC_OPTION_WARNINGS(no) -SIM_AC_OPTION_HARDWARE(yes,,rv cris cris_900000xx) +SIM_AC_OPTION_HARDWARE(rv cris cris_900000xx) # The default model shouldn't matter as long as there's a BFD. SIM_AC_OPTION_DEFAULT_MODEL(crisv32) diff --git a/sim/frv/ChangeLog b/sim/frv/ChangeLog index 339a5f0e6fb..bc981ac1d1e 100644 --- a/sim/frv/ChangeLog +++ b/sim/frv/ChangeLog @@ -1,3 +1,8 @@ +2021-04-23 Mike Frysinger + + * configure.ac (SIM_AC_OPTION_HARDWARE): Delete arguments. + * configure: Regenerate. + 2021-04-22 Tom Tromey * configure, config.in: Rebuild. diff --git a/sim/frv/configure b/sim/frv/configure index 52a30ab7a45..30c7c817c13 100755 --- a/sim/frv/configure +++ b/sim/frv/configure @@ -12130,13 +12130,7 @@ fi -if test """"; then - hardware="""" -else - hardware="cfi core pal glue" -fi -hardware="$hardware """ - +hardware="cfi core pal glue " sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`" diff --git a/sim/frv/configure.ac b/sim/frv/configure.ac index b4f5953051f..6588fe5e87e 100644 --- a/sim/frv/configure.ac +++ b/sim/frv/configure.ac @@ -27,6 +27,6 @@ if test x"$silent" != x"yes" && test x"$sim_trapdump" != x""; then fi],[sim_trapdump=""])dnl AC_SUBST(sim_trapdump) -SIM_AC_OPTION_HARDWARE(yes,"","") +SIM_AC_OPTION_HARDWARE SIM_AC_OUTPUT diff --git a/sim/iq2000/ChangeLog b/sim/iq2000/ChangeLog index 9857bda1ad0..addf3c6387c 100644 --- a/sim/iq2000/ChangeLog +++ b/sim/iq2000/ChangeLog @@ -1,3 +1,8 @@ +2021-04-23 Mike Frysinger + + * configure.ac (SIM_AC_OPTION_HARDWARE): Delete arguments. + * configure: Regenerate. + 2021-04-22 Tom Tromey * configure, config.in: Rebuild. diff --git a/sim/iq2000/configure b/sim/iq2000/configure index df5c33d484f..21b500c8079 100755 --- a/sim/iq2000/configure +++ b/sim/iq2000/configure @@ -12109,13 +12109,7 @@ fi -if test """"; then - hardware="""" -else - hardware="cfi core pal glue" -fi -hardware="$hardware """ - +hardware="cfi core pal glue " sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`" diff --git a/sim/iq2000/configure.ac b/sim/iq2000/configure.ac index 1a5dcfb276a..f21bc804bdd 100644 --- a/sim/iq2000/configure.ac +++ b/sim/iq2000/configure.ac @@ -11,6 +11,6 @@ SIM_AC_OPTION_DEFAULT_MODEL(iq2000) SIM_AC_OPTION_WARNINGS(no) SIM_AC_OPTION_CGEN_MAINT -SIM_AC_OPTION_HARDWARE(yes,"","") +SIM_AC_OPTION_HARDWARE SIM_AC_OUTPUT diff --git a/sim/lm32/ChangeLog b/sim/lm32/ChangeLog index f42124274c3..6a3287a0540 100644 --- a/sim/lm32/ChangeLog +++ b/sim/lm32/ChangeLog @@ -1,3 +1,8 @@ +2021-04-23 Mike Frysinger + + * configure.ac (SIM_AC_OPTION_HARDWARE): Delete first two args. + * configure: Regenerate. + 2021-04-22 Tom Tromey * configure, config.in: Rebuild. diff --git a/sim/lm32/configure b/sim/lm32/configure index 43f006fc1bd..4b4b8bc1bd8 100755 --- a/sim/lm32/configure +++ b/sim/lm32/configure @@ -12108,13 +12108,7 @@ fi -if test ""; then - hardware="" -else - hardware="cfi core pal glue" -fi -hardware="$hardware lm32cpu lm32timer lm32uart" - +hardware="cfi core pal glue lm32cpu lm32timer lm32uart" sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`" diff --git a/sim/lm32/configure.ac b/sim/lm32/configure.ac index 83ed5034580..63548874a11 100644 --- a/sim/lm32/configure.ac +++ b/sim/lm32/configure.ac @@ -10,6 +10,6 @@ SIM_AC_OPTION_SCACHE(16384) SIM_AC_OPTION_DEFAULT_MODEL(lm32) SIM_AC_OPTION_WARNINGS(no) SIM_AC_OPTION_CGEN_MAINT -SIM_AC_OPTION_HARDWARE(yes,,lm32cpu lm32timer lm32uart) +SIM_AC_OPTION_HARDWARE(lm32cpu lm32timer lm32uart) SIM_AC_OUTPUT diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog index 6ba7bb44858..7fb4761a1a5 100644 --- a/sim/m32r/ChangeLog +++ b/sim/m32r/ChangeLog @@ -1,3 +1,8 @@ +2021-04-23 Mike Frysinger + + * configure.ac (SIM_AC_OPTION_HARDWARE): Delete first two args. + * configure: Regenerate. + 2021-04-22 Tom Tromey * configure, config.in: Rebuild. diff --git a/sim/m32r/configure b/sim/m32r/configure index fb35163c9cf..983afc6ba76 100755 --- a/sim/m32r/configure +++ b/sim/m32r/configure @@ -12124,13 +12124,7 @@ fi -if test ""; then - hardware="" -else - hardware="cfi core pal glue" -fi -hardware="$hardware m32r_cache m32r_uart" - +hardware="cfi core pal glue m32r_cache m32r_uart" sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`" diff --git a/sim/m32r/configure.ac b/sim/m32r/configure.ac index 2fd7f7265b0..8ab55bc155a 100644 --- a/sim/m32r/configure.ac +++ b/sim/m32r/configure.ac @@ -24,6 +24,6 @@ SIM_AC_OPTION_CGEN_MAINT AC_SUBST(traps_obj) AC_SUBST(sim_extra_cflags) -SIM_AC_OPTION_HARDWARE(yes,,m32r_cache m32r_uart) +SIM_AC_OPTION_HARDWARE(m32r_cache m32r_uart) SIM_AC_OUTPUT diff --git a/sim/m4/sim_ac_option_hardware.m4 b/sim/m4/sim_ac_option_hardware.m4 index cc84fadcc51..75e331eb0b3 100644 --- a/sim/m4/sim_ac_option_hardware.m4 +++ b/sim/m4/sim_ac_option_hardware.m4 @@ -14,18 +14,10 @@ dnl You should have received a copy of the GNU General Public License dnl along with this program. If not, see . dnl dnl --enable-sim-hardware is for users of the simulator -dnl arg[1] Enable sim-hw by default? ("yes" or "no") -dnl arg[2] is a space separated list of devices that override the defaults -dnl arg[3] is a space separated list of extra target specific devices. +dnl arg[1] is a space separated list of extra target specific devices. AC_DEFUN([SIM_AC_OPTION_HARDWARE], [ -if test "[$2]"; then - hardware="[$2]" -else - hardware="cfi core pal glue" -fi -hardware="$hardware [$3]" - +hardware="cfi core pal glue [$1]" sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([[^ ]][[^ ]]*\)/dv-\1.o/g'`" @@ -33,7 +25,7 @@ sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([[^ ]][[^ ]]*\)/ AC_ARG_ENABLE(sim-hardware, [AS_HELP_STRING([--enable-sim-hardware=LIST], [Specify the hardware to be included in the build.])], - ,[enable_sim_hardware="[$1]"]) + ,[enable_sim_hardware="yes"]) case ${enable_sim_hardware} in yes|no) ;; ,*) hardware="${hardware} `echo ${enableval} | sed -e 's/,/ /'`";; diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog index 3da7580f693..788ecfe4434 100644 --- a/sim/m68hc11/ChangeLog +++ b/sim/m68hc11/ChangeLog @@ -1,3 +1,8 @@ +2021-04-23 Mike Frysinger + + * configure.ac (SIM_AC_OPTION_HARDWARE): Delete first two args. + * configure: Regenerate. + 2021-04-22 Tom Tromey * configure, config.in: Rebuild. diff --git a/sim/m68hc11/configure b/sim/m68hc11/configure index 04e56ffd3bb..e2e78f825fe 100755 --- a/sim/m68hc11/configure +++ b/sim/m68hc11/configure @@ -12029,13 +12029,8 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } fi -if test ""; then - hardware="" -else - hardware="cfi core pal glue" -fi -hardware="$hardware m68hc11 m68hc11sio m68hc11eepr m68hc11tim m68hc11spi nvram" - +hardware="cfi core pal glue \ + m68hc11 m68hc11sio m68hc11eepr m68hc11tim m68hc11spi nvram" sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`" diff --git a/sim/m68hc11/configure.ac b/sim/m68hc11/configure.ac index 6148d1dae4e..be52b63c209 100644 --- a/sim/m68hc11/configure.ac +++ b/sim/m68hc11/configure.ac @@ -8,7 +8,7 @@ dnl Options available in this module SIM_AC_OPTION_ENDIAN(BIG) SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT) SIM_AC_OPTION_WARNINGS(no) -SIM_AC_OPTION_HARDWARE(yes,, +SIM_AC_OPTION_HARDWARE(\ m68hc11 m68hc11sio m68hc11eepr m68hc11tim m68hc11spi nvram) SIM_AC_OUTPUT diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog index 2e055ec8e9e..40c9ad5a6cb 100644 --- a/sim/mips/ChangeLog +++ b/sim/mips/ChangeLog @@ -1,3 +1,9 @@ +2021-04-23 Mike Frysinger + + * configure.ac (hw_enabled): Delete. + (SIM_AC_OPTION_HARDWARE): Delete first two args. + * configure: Regenerate. + 2021-04-22 Tom Tromey * configure, config.in: Rebuild. diff --git a/sim/mips/configure b/sim/mips/configure index bdf659dc5df..85e0832a876 100755 --- a/sim/mips/configure +++ b/sim/mips/configure @@ -12575,23 +12575,16 @@ sim_micromips_flags=" -F ${sim_micromips_filter} ${sim_micromips_machine} ${si # # Add simulated hardware devices # -hw_enabled=no +hw_extra_devices="" case "${target}" in mips*tx39*) - hw_enabled=yes hw_extra_devices="tx3904cpu tx3904irc tx3904tmr tx3904sio" ;; *) ;; esac -if test "$hw_devices"; then - hardware="$hw_devices" -else - hardware="cfi core pal glue" -fi -hardware="$hardware $hw_extra_devices" - +hardware="cfi core pal glue $hw_extra_devices" sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`" @@ -12600,7 +12593,7 @@ sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\ if test "${enable_sim_hardware+set}" = set; then : enableval=$enable_sim_hardware; else - enable_sim_hardware="$hw_enabled" + enable_sim_hardware="yes" fi case ${enable_sim_hardware} in diff --git a/sim/mips/configure.ac b/sim/mips/configure.ac index ec45245dc1f..593ee2bb4b0 100644 --- a/sim/mips/configure.ac +++ b/sim/mips/configure.ac @@ -426,16 +426,15 @@ AC_SUBST(sim_multi_obj) # # Add simulated hardware devices # -hw_enabled=no +hw_extra_devices="" case "${target}" in mips*tx39*) - hw_enabled=yes hw_extra_devices="tx3904cpu tx3904irc tx3904tmr tx3904sio" ;; *) ;; esac -SIM_AC_OPTION_HARDWARE($hw_enabled,$hw_devices,$hw_extra_devices) +SIM_AC_OPTION_HARDWARE($hw_extra_devices) # Choose simulator engine diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog index 0ad3257aa39..aa09b2cca14 100644 --- a/sim/mn10300/ChangeLog +++ b/sim/mn10300/ChangeLog @@ -1,3 +1,8 @@ +2021-04-23 Mike Frysinger + + * configure.ac (SIM_AC_OPTION_HARDWARE): Delete first two args. + * configure: Regenerate. + 2021-04-22 Tom Tromey * configure, config.in: Rebuild. diff --git a/sim/mn10300/configure b/sim/mn10300/configure index 4c6ad23b83b..f7e634e8f78 100755 --- a/sim/mn10300/configure +++ b/sim/mn10300/configure @@ -12110,13 +12110,7 @@ fi fi -if test ""; then - hardware="" -else - hardware="cfi core pal glue" -fi -hardware="$hardware mn103cpu mn103int mn103tim mn103ser mn103iop" - +hardware="cfi core pal glue mn103cpu mn103int mn103tim mn103ser mn103iop" sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`" diff --git a/sim/mn10300/configure.ac b/sim/mn10300/configure.ac index f8b8ef8d2b3..55aec73be50 100644 --- a/sim/mn10300/configure.ac +++ b/sim/mn10300/configure.ac @@ -9,6 +9,6 @@ SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT) SIM_AC_OPTION_WARNINGS(no) SIM_AC_OPTION_RESERVED_BITS SIM_AC_OPTION_BITSIZE(32,31) -SIM_AC_OPTION_HARDWARE(yes,,mn103cpu mn103int mn103tim mn103ser mn103iop) +SIM_AC_OPTION_HARDWARE(mn103cpu mn103int mn103tim mn103ser mn103iop) SIM_AC_OUTPUT -- 2.30.2