public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] sim: hw: localize init callback
@ 2021-05-05  1:52 Michael Frysinger
  0 siblings, 0 replies; only message in thread
From: Michael Frysinger @ 2021-05-05  1:52 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2849d28d96718c6d2c0c9513745a45a02404bc91

commit 2849d28d96718c6d2c0c9513745a45a02404bc91
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sat May 1 23:37:35 2021 -0400

    sim: hw: localize init callback
    
    Now that we don't need to hardcode the module init list in a single
    place, move the hw init logic out to the sim-hw file.

Diff:
---
 sim/common/ChangeLog    | 8 ++++++++
 sim/common/sim-hw.c     | 6 +++++-
 sim/common/sim-hw.h     | 6 ------
 sim/common/sim-module.c | 7 -------
 4 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index b2466c225a9..d96faee1899 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,11 @@
+2021-05-04  Mike Frysinger  <vapier@gentoo.org>
+
+	* sim-hw.c (sim_hw_install): Rename to ...
+	(sim_install_hw): ... this.  New prototype.
+	* sim-hw.h (sim_hw_install): Delete.
+	* sim-module.c: Delete sim-hw.h include.
+	(early_modules): Delete sim_hw_install.
+
 2021-05-04  Tom Tromey  <tromey@adacore.com>
 
 	* Make-common.in (generated_files): Add config.h.
diff --git a/sim/common/sim-hw.c b/sim/common/sim-hw.c
index 11d3abdbbfb..984817f25fd 100644
--- a/sim/common/sim-hw.c
+++ b/sim/common/sim-hw.c
@@ -288,8 +288,12 @@ hw_option_handler (struct sim_state *sd, sim_cpu *cpu, int opt,
 static MODULE_INIT_FN sim_hw_init;
 static MODULE_UNINSTALL_FN sim_hw_uninstall;
 
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+SIM_RC sim_install_hw (struct sim_state *sd);
+
+/* Establish this object.  */
 SIM_RC
-sim_hw_install (struct sim_state *sd)
+sim_install_hw (struct sim_state *sd)
 {
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
   sim_add_option_table (sd, NULL, hw_options);
diff --git a/sim/common/sim-hw.h b/sim/common/sim-hw.h
index 976a2200716..82c404a0d6d 100644
--- a/sim/common/sim-hw.h
+++ b/sim/common/sim-hw.h
@@ -21,12 +21,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #define SIM_HW_H
 
 
-/* Establish this object */
-
-SIM_RC sim_hw_install
-(struct sim_state *sd);
-
-
 /* Parse a hardware definition */
 
 struct hw *sim_hw_parse
diff --git a/sim/common/sim-module.c b/sim/common/sim-module.c
index 2557697fff2..3bb7db0df76 100644
--- a/sim/common/sim-module.c
+++ b/sim/common/sim-module.c
@@ -25,10 +25,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "sim-options.h"
 #include "sim-assert.h"
 
-#if WITH_HW
-#include "sim-hw.h"
-#endif
-
 #include "libiberty.h"
 
 #include <stdlib.h>
@@ -52,9 +48,6 @@ static MODULE_INSTALL_FN * const early_modules[] = {
 #if WITH_SCACHE
   scache_install,
 #endif
-#if WITH_HW
-  sim_hw_install,
-#endif
 };
 static int early_modules_len = ARRAY_SIZE (early_modules);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-05  1:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-05  1:52 [binutils-gdb] sim: hw: localize init callback Michael Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).