aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-01-02 10:53:03 -0500
committerMike Frysinger <vapier@gentoo.org>2021-05-01 22:46:46 -0400
commit328e805b5a7d4f27552a1062e25a89477bd89009 (patch)
tree0532236be2a3d105034f3ed30e1e3b818fbc6b91 /sim
parentadbaa7b838d3f6de95ca2ec15d9ca419a383d2d4 (diff)
downloadgdb-328e805b5a7d4f27552a1062e25a89477bd89009.zip
gdb-328e805b5a7d4f27552a1062e25a89477bd89009.tar.gz
gdb-328e805b5a7d4f27552a1062e25a89477bd89009.tar.bz2
sim: dv-sockser: localize init callback
Now that we don't need to hardcode the module init list in a single place, move the dv-sockser logic to the place to the one file.
Diffstat (limited to 'sim')
-rw-r--r--sim/common/ChangeLog8
-rw-r--r--sim/common/dv-sockser.c5
-rw-r--r--sim/common/dv-sockser.h2
-rw-r--r--sim/common/sim-module.c9
4 files changed, 12 insertions, 12 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index d006963..55d684b 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,13 @@
2021-05-01 Mike Frysinger <vapier@gentoo.org>
+ * dv-sockser.c (dv_sockser_install): Rename to ...
+ (sim_install_dv_sockser): ... this.
+ * dv-sockser.h (dv_sockser_install): Delete.
+ * sim-module.c: Delete dv-sockser.h include.
+ (early_modules): Delete dv_sockser_install.
+
+2021-05-01 Mike Frysinger <vapier@gentoo.org>
+
* Make-common.in (LIB_OBJS): Add modules.o.
(generated_files): Add modules.c.
(modules.c): New target.
diff --git a/sim/common/dv-sockser.c b/sim/common/dv-sockser.c
index fc552fa..73c473b 100644
--- a/sim/common/dv-sockser.c
+++ b/sim/common/dv-sockser.c
@@ -222,8 +222,11 @@ dv_sockser_uninstall (SIM_DESC sd)
}
}
+/* Provide a prototype to silence -Wmissing-prototypes. */
+extern MODULE_INIT_FN sim_install_dv_sockser;
+
SIM_RC
-dv_sockser_install (SIM_DESC sd)
+sim_install_dv_sockser (SIM_DESC sd)
{
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
if (sim_add_option_table (sd, NULL, sockser_options) != SIM_RC_OK)
diff --git a/sim/common/dv-sockser.h b/sim/common/dv-sockser.h
index c83ed5a..36ec0a9 100644
--- a/sim/common/dv-sockser.h
+++ b/sim/common/dv-sockser.h
@@ -34,8 +34,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);
-
#else
/* If dv-sockser isn't available, provide stub functions. */
diff --git a/sim/common/sim-module.c b/sim/common/sim-module.c
index a776a08..2557697 100644
--- a/sim/common/sim-module.c
+++ b/sim/common/sim-module.c
@@ -29,11 +29,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "sim-hw.h"
#endif
-#ifdef HAVE_DV_SOCKSER
-/* TODO: Shouldn't have device models here. */
-#include "dv-sockser.h"
-#endif
-
#include "libiberty.h"
#include <stdlib.h>
@@ -60,10 +55,6 @@ static MODULE_INSTALL_FN * const early_modules[] = {
#if WITH_HW
sim_hw_install,
#endif
-#ifdef HAVE_DV_SOCKSER
- /* TODO: Shouldn't have device models here. */
- dv_sockser_install,
-#endif
};
static int early_modules_len = ARRAY_SIZE (early_modules);