From: Mike Frysinger Date: Mon, 14 Jun 2021 02:45:02 +0000 (-0400) Subject: sim: move scache init to dynamic modules.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6cf75d895ad992f4f99f94bdcf469afe0482f8fa;p=binutils-gdb.git sim: move scache init to dynamic modules.c Use the new modules.c framework to find & initialize this module. --- diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index c3c7d3e7b54..c6fa33ce5ee 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,10 @@ +2021-06-30 Mike Frysinger + + * cgen-scache.c (scache_install): Rename to ... + (sim_install_scache): ... this. New prototype. + * cgen-scache.h (scache_install): Delete. + * sim-module.c (early_modules): Delete scache_install. + 2021-06-30 Mike Frysinger * sim-module.c (early_modules): Delete profile_install. diff --git a/sim/common/cgen-scache.c b/sim/common/cgen-scache.c index f1c75714840..c14d5d22c6d 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 b197922bbc0..b43528101ab 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 120785e7690..d2b220ab3fb 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);