From patchwork Sun Mar 15 07:06:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 5619 Received: (qmail 2932 invoked by alias); 15 Mar 2015 07:06:38 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 2902 invoked by uid 89); 15 Mar 2015 07:06:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 15 Mar 2015 07:06:34 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id C87A93408AE for ; Sun, 15 Mar 2015 07:06:31 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH] sim: dv-sockser: push module init prototype down Date: Sun, 15 Mar 2015 03:06:29 -0400 Message-Id: <1426403189-1949-1-git-send-email-vapier@gentoo.org> X-IsSubscribed: yes Pull out the duplicated dv_sockser_install prototype from the tconfig.in files and put it in the one place it gets used -- sim-module.c. This is still arguably incorrect, but it's better than the status quo where the tconfig.in has to include header files and duplicate the dv-sockser func. The tconfig header is meant to be simple and contain a target defines. Committed. --- include/gdb/ChangeLog | 4 ++++ include/gdb/remote-sim.h | 3 ++- sim/bfin/ChangeLog | 5 +++++ sim/bfin/tconfig.in | 12 ------------ sim/common/ChangeLog | 8 ++++++++ sim/common/dv-sockser.h | 2 ++ sim/common/sim-module.c | 10 ++++++++++ sim/common/sim-module.h | 1 + sim/cris/ChangeLog | 5 +++++ sim/cris/tconfig.in | 13 +------------ sim/frv/ChangeLog | 4 ++++ sim/frv/tconfig.in | 6 ------ sim/iq2000/ChangeLog | 4 ++++ sim/iq2000/tconfig.in | 6 ------ sim/lm32/ChangeLog | 4 ++++ sim/lm32/Makefile.in | 1 + sim/m32r/ChangeLog | 4 ++++ sim/m32r/tconfig.in | 6 ------ sim/mips/ChangeLog | 5 +++++ sim/mips/tconfig.in | 13 ------------- sim/mn10300/ChangeLog | 4 ++++ sim/mn10300/tconfig.in | 29 ----------------------------- sim/sh64/ChangeLog | 4 ++++ sim/sh64/tconfig.in | 6 ------ 24 files changed, 68 insertions(+), 91 deletions(-) delete mode 100644 sim/mn10300/tconfig.in diff --git a/include/gdb/ChangeLog b/include/gdb/ChangeLog index 694cd5d..88bd15c 100644 --- a/include/gdb/ChangeLog +++ b/include/gdb/ChangeLog @@ -1,3 +1,7 @@ +2015-05-15 Mike Frysinger + + * remote-sim.h (struct host_callback_struct): Define. + 2015-01-31 Doug Evans * section-scripts.h: Remove "future extension" comment. diff --git a/include/gdb/remote-sim.h b/include/gdb/remote-sim.h index 3dca380..bd8ddc0 100644 --- a/include/gdb/remote-sim.h +++ b/include/gdb/remote-sim.h @@ -60,9 +60,10 @@ typedef enum { } SIM_RC; -/* The bfd struct, as an opaque type. */ +/* Some structs, as opaque types. */ struct bfd; +struct host_callback_struct; /* Main simulator entry points. */ diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog index ee5f81c..4e2077d 100644 --- a/sim/bfin/ChangeLog +++ b/sim/bfin/ChangeLog @@ -1,3 +1,8 @@ +2015-03-15 Mike Frysinger + + * tconfig.in: Delete includes. + [HAVE_DV_SOCKSER]: Delete. + 2015-03-14 Mike Frysinger * bfin-sim.c (decode_dsp32alu_0): Change v to bu32. diff --git a/sim/bfin/tconfig.in b/sim/bfin/tconfig.in index 130707a..d28fd8d 100644 --- a/sim/bfin/tconfig.in +++ b/sim/bfin/tconfig.in @@ -7,18 +7,6 @@ Common sim core by default sets hw_system_cpu to NULL for WITH_HW. */ #define WITH_DEVICES 1 -/* FIXME: This is unnecessarily necessary: */ -#include "ansidecl.h" -#include "gdb/callback.h" -#include "gdb/remote-sim.h" -#include "sim-module.h" - -/* FIXME: Revisit. */ -#ifdef HAVE_DV_SOCKSER -MODULE_INSTALL_FN dv_sockser_install; -#define MODULE_LIST dv_sockser_install, -#endif - /* ??? Temporary hack until model support unified. */ #define SIM_HAVE_MODEL diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index cd51d62..08d3b93 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,11 @@ +2015-03-15 Mike Frysinger + + * dv-socker.h (dv_sockser_install): Declare. + * sim-module.c: Include config.h. + [HAVE_DV_SOCKSER]: Include dv-sockser.h. + (modules) [HAVE_DV_SOCKSER]: Add dv_sockser_install. + * sim-module.h: Include gdb/remote-sim.h. + 2015-03-14 Mike Frysinger * Make-common.in (BUILT_SRC_FROM_COMMON): Delete. diff --git a/sim/common/dv-sockser.h b/sim/common/dv-sockser.h index 8ad9981..cc4fd74 100644 --- a/sim/common/dv-sockser.h +++ b/sim/common/dv-sockser.h @@ -30,4 +30,6 @@ int dv_sockser_write (SIM_DESC, unsigned char); int dv_sockser_write_buffer (SIM_DESC, const unsigned char *, unsigned); int dv_sockser_read (SIM_DESC); +SIM_RC dv_sockser_install (SIM_DESC); + #endif /* DV_SOCKSER_H */ diff --git a/sim/common/sim-module.c b/sim/common/sim-module.c index 2f7ac5f..fd9b587 100644 --- a/sim/common/sim-module.c +++ b/sim/common/sim-module.c @@ -19,6 +19,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "config.h" #include "sim-main.h" #include "sim-io.h" #include "sim-options.h" @@ -28,6 +29,11 @@ along with this program. If not, see . */ #include "sim-hw.h" #endif +#ifdef HAVE_DV_SOCKSER +/* TODO: Shouldn't have device models here. */ +#include "dv-sockser.h" +#endif + #include "libiberty.h" /* List of all modules. */ @@ -60,6 +66,10 @@ static MODULE_INSTALL_FN * const modules[] = { #if WITH_HW sim_hw_install, #endif +#ifdef HAVE_DV_SOCKSER + /* TODO: Shouldn't have device models here. */ + dv_sockser_install, +#endif /* Configured in [simulator specific] additional modules. */ #ifdef MODULE_LIST MODULE_LIST diff --git a/sim/common/sim-module.h b/sim/common/sim-module.h index 9979ec0..53b8306 100644 --- a/sim/common/sim-module.h +++ b/sim/common/sim-module.h @@ -30,6 +30,7 @@ along with this program. If not, see . */ TODO: Add facilities for saving/restoring state to/from a file. */ +#include "gdb/remote-sim.h" /* Various function types. */ diff --git a/sim/cris/ChangeLog b/sim/cris/ChangeLog index e1f3f9e..9432e32 100644 --- a/sim/cris/ChangeLog +++ b/sim/cris/ChangeLog @@ -1,3 +1,8 @@ +2015-03-15 Mike Frysinger + + * tconfig.in: Delete most includes. + [HAVE_DV_SOCKSER]: Delete. + 2015-03-14 Mike Frysinger * Makefile.in (SIM_RUN_OBJS): Delete. diff --git a/sim/cris/tconfig.in b/sim/cris/tconfig.in index 7749993..8f82ac7 100644 --- a/sim/cris/tconfig.in +++ b/sim/cris/tconfig.in @@ -20,11 +20,6 @@ along with this program. If not, see . */ #ifndef CRIS_TCONFIG_H #define CRIS_TCONFIG_H -#include "ansidecl.h" -#include "gdb/callback.h" -#include "gdb/remote-sim.h" -#include "sim-module.h" - /* There's basically a a big ??? FIXME: CHECK THIS on everything in this file. I just copied it from m32r, pruned some stuff and added HAVE_MODEL because it seemed useful. */ @@ -35,15 +30,9 @@ along with this program. If not, see . */ /* For MSPR support. FIXME: revisit. */ #define WITH_DEVICES 1 +#include "sim-module.h" extern MODULE_INSTALL_FN cris_option_install; - -/* FIXME: Revisit. */ -#ifdef HAVE_DV_SOCKSER -extern MODULE_INSTALL_FN dv_sockser_install; -#define MODULE_LIST dv_sockser_install, cris_option_install, -#else #define MODULE_LIST cris_option_install, -#endif #define SIM_HAVE_MODEL diff --git a/sim/frv/ChangeLog b/sim/frv/ChangeLog index d54bb94..d178047 100644 --- a/sim/frv/ChangeLog +++ b/sim/frv/ChangeLog @@ -1,3 +1,7 @@ +2015-03-15 Mike Frysinger + + * tconfig.in [HAVE_DV_SOCKSER]: Delete. + 2015-03-14 Mike Frysinger * Makefile.in (SIM_RUN_OBJS): Delete. diff --git a/sim/frv/tconfig.in b/sim/frv/tconfig.in index a53ad23..b31043c 100644 --- a/sim/frv/tconfig.in +++ b/sim/frv/tconfig.in @@ -13,12 +13,6 @@ /* For MSPR support. FIXME: revisit. */ #define WITH_DEVICES 1 -/* FIXME: Revisit. */ -#ifdef HAVE_DV_SOCKSER -MODULE_INSTALL_FN dv_sockser_install; -#define MODULE_LIST dv_sockser_install, -#endif - #if 0 /* Enable watchpoints. */ #define WITH_WATCHPOINTS 1 diff --git a/sim/iq2000/ChangeLog b/sim/iq2000/ChangeLog index 58a8605..b682fac 100644 --- a/sim/iq2000/ChangeLog +++ b/sim/iq2000/ChangeLog @@ -1,3 +1,7 @@ +2015-03-15 Mike Frysinger + + * tconfig.in [HAVE_DV_SOCKSER]: Delete. + 2015-03-14 Mike Frysinger * Makefile.in (SIM_RUN_OBJS): Delete. diff --git a/sim/iq2000/tconfig.in b/sim/iq2000/tconfig.in index 5ab608c..0081bb43 100644 --- a/sim/iq2000/tconfig.in +++ b/sim/iq2000/tconfig.in @@ -13,12 +13,6 @@ /* For MSPR support. FIXME: revisit. */ #define WITH_DEVICES 0 -/* FIXME: Revisit. */ -#ifdef HAVE_DV_SOCKSER -MODULE_INSTALL_FN dv_sockser_install; -#define MODULE_LIST dv_sockser_install, -#endif - #if 0 /* Enable watchpoints. */ #define WITH_WATCHPOINTS 1 diff --git a/sim/lm32/ChangeLog b/sim/lm32/ChangeLog index 8567e61..954cd83 100644 --- a/sim/lm32/ChangeLog +++ b/sim/lm32/ChangeLog @@ -1,3 +1,7 @@ +2015-03-15 Mike Frysinger + + * Makefile.in (SIM_OBJS): Add @SIM_DV_SOCKSER_O@. + 2015-03-14 Mike Frysinger * Makefile.in (SIM_RUN_OBJS): Delete. diff --git a/sim/lm32/Makefile.in b/sim/lm32/Makefile.in index 60420a1..61e4137 100644 --- a/sim/lm32/Makefile.in +++ b/sim/lm32/Makefile.in @@ -12,6 +12,7 @@ SIM_OBJS = \ sim-model.o \ sim-reg.o \ sim-signal.o \ + @SIM_DV_SOCKSER_O@ \ cgen-utils.o cgen-trace.o cgen-scache.o \ cgen-run.o sim-reason.o sim-engine.o sim-stop.o \ sim-if.o arch.o \ diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog index 98f3a8c..ee4d689 100644 --- a/sim/m32r/ChangeLog +++ b/sim/m32r/ChangeLog @@ -1,3 +1,7 @@ +2015-03-15 Mike Frysinger + + * tconfig.in [HAVE_DV_SOCKSER]: Delete. + 2015-03-14 Mike Frysinger * Makefile.in (SIM_RUN_OBJS): Delete. diff --git a/sim/m32r/tconfig.in b/sim/m32r/tconfig.in index 1d159bc..a5c55d5 100644 --- a/sim/m32r/tconfig.in +++ b/sim/m32r/tconfig.in @@ -16,12 +16,6 @@ /* For MSPR support. FIXME: revisit. */ #define WITH_DEVICES 1 -/* FIXME: Revisit. */ -#ifdef HAVE_DV_SOCKSER -MODULE_INSTALL_FN dv_sockser_install; -#define MODULE_LIST dv_sockser_install, -#endif - #if 0 /* Enable watchpoints. */ #define WITH_WATCHPOINTS 1 diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog index 72fbdd2..2be47e0 100644 --- a/sim/mips/ChangeLog +++ b/sim/mips/ChangeLog @@ -1,3 +1,8 @@ +2015-03-15 Mike Frysinger + + * tconfig.in: Delete includes. + [HAVE_DV_SOCKSER]: Delete. + 2015-03-14 Mike Frysinger * Makefile.in (SIM_RUN_OBJS): Delete. diff --git a/sim/mips/tconfig.in b/sim/mips/tconfig.in index a68a5fb..95e66b4 100644 --- a/sim/mips/tconfig.in +++ b/sim/mips/tconfig.in @@ -3,19 +3,6 @@ /* See sim-hload.c. We properly handle LMA. */ #ifdef TARGET_TX3904 #define SIM_HANDLES_LMA 1 - -/* FIXME: This is unnecessarily necessary: */ -#include "ansidecl.h" -#include "gdb/callback.h" -#include "gdb/remote-sim.h" -#include "sim-module.h" - -/* FIXME: Revisit. */ -#ifdef HAVE_DV_SOCKSER -MODULE_INSTALL_FN dv_sockser_install; -#define MODULE_LIST dv_sockser_install, -#endif - #else #define SIM_HANDLES_LMA 0 #endif diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog index b4d84aa..aa9f5f1 100644 --- a/sim/mn10300/ChangeLog +++ b/sim/mn10300/ChangeLog @@ -1,3 +1,7 @@ +2015-03-15 Mike Frysinger + + * tconfig.in: Delete file. + 2015-03-14 Mike Frysinger * Makefile.in (SIM_RUN_OBJS): Delete. diff --git a/sim/mn10300/tconfig.in b/sim/mn10300/tconfig.in deleted file mode 100644 index 1d1237b..0000000 --- a/sim/mn10300/tconfig.in +++ /dev/null @@ -1,29 +0,0 @@ -/* mn10300 target configuration file. */ - -/* FIXME: This is unnecessarily necessary: */ -#include "ansidecl.h" -#include "gdb/callback.h" -#include "gdb/remote-sim.h" -#include "sim-module.h" - -/* FIXME: Revisit. */ -#ifdef HAVE_DV_SOCKSER -MODULE_INSTALL_FN dv_sockser_install; -#define MODULE_LIST dv_sockser_install, -#endif - -/* Define this if the simulator supports profiling. - See the mips simulator for an example. - This enables the `-p foo' and `-s bar' options. - The target is required to provide sim_set_profile{,_size}. */ -/* #define SIM_HAVE_PROFILE */ - -/* Define this if the simulator uses an instruction cache. - See the h8/300 simulator for an example. - This enables the `-c size' option to set the size of the cache. - The target is required to provide sim_set_simcache_size. */ -/* #define SIM_HAVE_SIMCACHE */ - -/* Define this if the target cpu is bi-endian - and the simulator supports it. */ -/* #define SIM_HAVE_BIENDIAN */ diff --git a/sim/sh64/ChangeLog b/sim/sh64/ChangeLog index 43eee86..20da758 100644 --- a/sim/sh64/ChangeLog +++ b/sim/sh64/ChangeLog @@ -1,3 +1,7 @@ +2015-03-15 Mike Frysinger + + * tconfig.in [HAVE_DV_SOCKSER]: Delete. + 2015-03-14 Mike Frysinger * Makefile.in (SIM_RUN_OBJS): Delete. diff --git a/sim/sh64/tconfig.in b/sim/sh64/tconfig.in index bab3f1c..9d64be9 100644 --- a/sim/sh64/tconfig.in +++ b/sim/sh64/tconfig.in @@ -13,12 +13,6 @@ /* For MSPR support. FIXME: revisit. */ #define WITH_DEVICES 0 -/* FIXME: Revisit. */ -#ifdef HAVE_DV_SOCKSER -MODULE_INSTALL_FN dv_sockser_install; -#define MODULE_LIST dv_sockser_install, -#endif - #if 0 /* Enable watchpoints. */ #define WITH_WATCHPOINTS 1