Browse Source

sim: move scache init to dynamic modules.c

Use the new modules.c framework to find & initialize this module.
binutils-2_37-branch
Mike Frysinger 5 years ago
parent
commit
6cf75d895a
  1. 7
      sim/common/ChangeLog
  2. 6
      sim/common/cgen-scache.c
  3. 3
      sim/common/cgen-scache.h
  4. 3
      sim/common/sim-module.c

7
sim/common/ChangeLog

@ -1,3 +1,10 @@
2021-06-30 Mike Frysinger <vapier@gentoo.org>
* 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 <vapier@gentoo.org>
* sim-module.c (early_modules): Delete profile_install.

6
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);

3
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. */

3
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);

Loading…
Cancel
Save