* [PATCH 1/4] sim: move engine init to dynamic modules.c
@ 2021-06-30 15:13 Mike Frysinger
2021-06-30 15:13 ` [PATCH 2/4] sim: move trace " Mike Frysinger
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Mike Frysinger @ 2021-06-30 15:13 UTC (permalink / raw)
To: gdb-patches
Use the new modules.c framework to find & initialize this module.
---
sim/common/sim-engine.c | 4 +++-
sim/common/sim-engine.h | 4 ----
sim/common/sim-module.c | 1 -
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/sim/common/sim-engine.c b/sim/common/sim-engine.c
index 83f41f07deb7..2a0fb72d7503 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 3ebf8acbaccc..1feb8a6d40bb 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 97d619c4aedd..f4b74fcfe3a2 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.31.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/4] sim: move trace init to dynamic modules.c
2021-06-30 15:13 [PATCH 1/4] sim: move engine init to dynamic modules.c Mike Frysinger
@ 2021-06-30 15:13 ` Mike Frysinger
2021-06-30 15:13 ` [PATCH 3/4] sim: move profile " Mike Frysinger
2021-06-30 15:13 ` [PATCH 4/4] sim: move scache " Mike Frysinger
2 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2021-06-30 15:13 UTC (permalink / raw)
To: gdb-patches
Use the new modules.c framework to find & initialize this module.
---
sim/common/sim-module.c | 3 ---
sim/common/sim-trace.c | 6 ++++--
sim/common/sim-trace.h | 3 ---
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/sim/common/sim-module.c b/sim/common/sim-module.c
index f4b74fcfe3a2..d9d08043828d 100644
--- a/sim/common/sim-module.c
+++ b/sim/common/sim-module.c
@@ -37,9 +37,6 @@ static MODULE_INSTALL_FN * const early_modules[] = {
standard_install,
sim_events_install,
sim_model_install,
-#if WITH_TRACE_ANY_P
- trace_install,
-#endif
#if WITH_PROFILE
profile_install,
#endif
diff --git a/sim/common/sim-trace.c b/sim/common/sim-trace.c
index 2c3798933db3..9ebb86d70e2e 100644
--- a/sim/common/sim-trace.c
+++ b/sim/common/sim-trace.c
@@ -436,10 +436,12 @@ trace_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
return SIM_RC_OK;
}
\f
-/* Install tracing support. */
+/* Provide a prototype to silence -Wmissing-prototypes. */
+SIM_RC sim_install_trace (SIM_DESC sd);
+/* Install tracing support. */
SIM_RC
-trace_install (SIM_DESC sd)
+sim_install_trace (SIM_DESC sd)
{
int i;
diff --git a/sim/common/sim-trace.h b/sim/common/sim-trace.h
index c89084e94401..c73dc6d367da 100644
--- a/sim/common/sim-trace.h
+++ b/sim/common/sim-trace.h
@@ -142,9 +142,6 @@ enum {
#define WITH_TRACE_SYSCALL_P WITH_TRACE_P (TRACE_SYSCALL_IDX)
#define WITH_TRACE_REGISTER_P WITH_TRACE_P (TRACE_REGISTER_IDX)
#define WITH_TRACE_DEBUG_P WITH_TRACE_P (TRACE_DEBUG_IDX)
-
-/* Tracing install handler. */
-MODULE_INSTALL_FN trace_install;
\f
/* Struct containing all system and cpu trace data.
--
2.31.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 3/4] sim: move profile init to dynamic modules.c
2021-06-30 15:13 [PATCH 1/4] sim: move engine init to dynamic modules.c Mike Frysinger
2021-06-30 15:13 ` [PATCH 2/4] sim: move trace " Mike Frysinger
@ 2021-06-30 15:13 ` Mike Frysinger
2021-06-30 15:13 ` [PATCH 4/4] sim: move scache " Mike Frysinger
2 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2021-06-30 15:13 UTC (permalink / raw)
To: gdb-patches
Use the new modules.c framework to find & initialize this module.
---
sim/common/sim-module.c | 3 ---
sim/common/sim-profile.c | 6 ++++--
sim/common/sim-profile.h | 3 ---
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/sim/common/sim-module.c b/sim/common/sim-module.c
index d9d08043828d..120785e76906 100644
--- a/sim/common/sim-module.c
+++ b/sim/common/sim-module.c
@@ -37,9 +37,6 @@ static MODULE_INSTALL_FN * const early_modules[] = {
standard_install,
sim_events_install,
sim_model_install,
-#if WITH_PROFILE
- profile_install,
-#endif
sim_core_install,
sim_memopt_install,
sim_watchpoint_install,
diff --git a/sim/common/sim-profile.c b/sim/common/sim-profile.c
index f2d65e093030..3a8ed1f2567f 100644
--- a/sim/common/sim-profile.c
+++ b/sim/common/sim-profile.c
@@ -1216,10 +1216,12 @@ profile_info (SIM_DESC sd, int verbose)
}
\f
-/* Install profiling support in the simulator. */
+/* Provide a prototype to silence -Wmissing-prototypes. */
+SIM_RC sim_install_profile (SIM_DESC sd);
+/* Install profiling support in the simulator. */
SIM_RC
-profile_install (SIM_DESC sd)
+sim_install_profile (SIM_DESC sd)
{
int i;
diff --git a/sim/common/sim-profile.h b/sim/common/sim-profile.h
index 17017c469a4a..06cdd355557e 100644
--- a/sim/common/sim-profile.h
+++ b/sim/common/sim-profile.h
@@ -102,9 +102,6 @@ SIM_RC sim_profile_set_option (SIM_DESC sd_, const char *name_, int idx_,
#define WITH_PROFILE_MEMORY_P 0
#endif
-/* Profiling install handler. */
-MODULE_INSTALL_FN profile_install;
-
/* Output format macros. */
#ifndef PROFILE_HISTOGRAM_WIDTH
#define PROFILE_HISTOGRAM_WIDTH 40
--
2.31.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 4/4] sim: move scache init to dynamic modules.c
2021-06-30 15:13 [PATCH 1/4] sim: move engine init to dynamic modules.c Mike Frysinger
2021-06-30 15:13 ` [PATCH 2/4] sim: move trace " Mike Frysinger
2021-06-30 15:13 ` [PATCH 3/4] sim: move profile " Mike Frysinger
@ 2021-06-30 15:13 ` Mike Frysinger
2 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2021-06-30 15:13 UTC (permalink / raw)
To: gdb-patches
Use the new modules.c framework to find & initialize this module.
---
sim/common/cgen-scache.c | 6 +++++-
sim/common/cgen-scache.h | 3 ---
sim/common/sim-module.c | 3 ---
3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/sim/common/cgen-scache.c b/sim/common/cgen-scache.c
index f1c757148402..c14d5d22c6d6 100644
--- a/sim/common/cgen-scache.c
+++ b/sim/common/cgen-scache.c
@@ -175,8 +175,12 @@ scache_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
return SIM_RC_OK;
}
+/* Provide a prototype to silence -Wmissing-prototypes. */
+SIM_RC sim_install_scache (SIM_DESC sd);
+
+/* Install the simulator cache into the simulator. */
SIM_RC
-scache_install (SIM_DESC sd)
+sim_install_scache (SIM_DESC sd)
{
sim_add_option_table (sd, NULL, scache_options);
sim_module_add_init_fn (sd, scache_init);
diff --git a/sim/common/cgen-scache.h b/sim/common/cgen-scache.h
index b197922bbc07..b43528101abe 100644
--- a/sim/common/cgen-scache.h
+++ b/sim/common/cgen-scache.h
@@ -109,9 +109,6 @@ typedef struct cpu_scache {
/* Non-zero if cache is in use. */
#define USING_SCACHE_P(sd) (STATE_SCACHE_SIZE (sd) > 0)
-/* Install the simulator cache into the simulator. */
-MODULE_INSTALL_FN scache_install;
-
/* Lookup a PC value in the scache [compilation only]. */
extern SCACHE * scache_lookup (SIM_CPU *, IADDR);
/* Return a pointer to at least N buffers. */
diff --git a/sim/common/sim-module.c b/sim/common/sim-module.c
index 120785e76906..d2b220ab3fb2 100644
--- a/sim/common/sim-module.c
+++ b/sim/common/sim-module.c
@@ -40,9 +40,6 @@ static MODULE_INSTALL_FN * const early_modules[] = {
sim_core_install,
sim_memopt_install,
sim_watchpoint_install,
-#if WITH_SCACHE
- scache_install,
-#endif
};
static int early_modules_len = ARRAY_SIZE (early_modules);
--
2.31.1
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-06-30 15:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-30 15:13 [PATCH 1/4] sim: move engine init to dynamic modules.c Mike Frysinger
2021-06-30 15:13 ` [PATCH 2/4] sim: move trace " Mike Frysinger
2021-06-30 15:13 ` [PATCH 3/4] sim: move profile " Mike Frysinger
2021-06-30 15:13 ` [PATCH 4/4] sim: move scache " Mike 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).