From 05d54a045c77ae24cf46327d3680a7c38b469351 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 13 Jun 2021 22:40:09 -0400 Subject: [PATCH] sim: move engine init to dynamic modules.c Use the new modules.c framework to find & initialize this module. --- sim/common/ChangeLog | 7 +++++++ sim/common/sim-engine.c | 4 +++- sim/common/sim-engine.h | 4 ---- sim/common/sim-module.c | 1 - 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index e18d06bf01a..5211321b949 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,10 @@ +2021-06-30 Mike Frysinger + + * sim-engine.c (sim_engine_install): Rename to ... + (sim_install_engine): ... this. New prototype. + * sim-engine.h (sim_engine_install): Delete. + * sim-module.c (early_modules): Delete sim_engine_install. + 2021-06-30 Mike Frysinger * sim-config.h (WITH_MODEL): Delete. diff --git a/sim/common/sim-engine.c b/sim/common/sim-engine.c index 83f41f07deb..2a0fb72d750 100644 --- a/sim/common/sim-engine.c +++ b/sim/common/sim-engine.c @@ -208,9 +208,11 @@ sim_engine_init (SIM_DESC sd) return SIM_RC_OK; } +/* Provide a prototype to silence -Wmissing-prototypes. */ +SIM_RC sim_install_engine (SIM_DESC sd); SIM_RC -sim_engine_install (SIM_DESC sd) +sim_install_engine (SIM_DESC sd) { SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER); sim_module_add_init_fn (sd, sim_engine_init); diff --git a/sim/common/sim-engine.h b/sim/common/sim-engine.h index 3ebf8acbacc..1feb8a6d40b 100644 --- a/sim/common/sim-engine.h +++ b/sim/common/sim-engine.h @@ -153,8 +153,4 @@ extern int sim_engine_last_cpu_nr (SIM_DESC sd); extern int sim_engine_nr_cpus (SIM_DESC sd); -/* Establish the simulator engine */ -MODULE_INSTALL_FN sim_engine_install; - - #endif diff --git a/sim/common/sim-module.c b/sim/common/sim-module.c index 97d619c4aed..f4b74fcfe3a 100644 --- a/sim/common/sim-module.c +++ b/sim/common/sim-module.c @@ -37,7 +37,6 @@ static MODULE_INSTALL_FN * const early_modules[] = { standard_install, sim_events_install, sim_model_install, - sim_engine_install, #if WITH_TRACE_ANY_P trace_install, #endif -- 2.30.2