+2021-05-01  Mike Frysinger  <vapier@gentoo.org>
+
+       * dv-bfin_mmu.c (bfin_mmu_options): Mark static.
+       (sim_install_bfin_mmu): New function & prototype.
+       * interp.c (e_sim_add_option_table): Delete.
+       * machs.c (bfin_mach_options): Mark static.
+       (sim_install_bfin_mach): New function & prototype.
+
 2021-05-01  Mike Frysinger  <vapier@gentoo.org>
 
        * config.in, configure: Regenerate.
 
   OPTION_MMU_SKIP_TABLES = OPTION_START,
 };
 
-const OPTION bfin_mmu_options[] =
+static const OPTION bfin_mmu_options[] =
 {
   { {"mmu-skip-cplbs", no_argument, NULL, OPTION_MMU_SKIP_TABLES },
       '\0', NULL, "Skip parsing of CPLB tables (big speed increase)",
       return SIM_RC_FAIL;
     }
 }
+
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+extern MODULE_INIT_FN sim_install_bfin_mmu;
+
+SIM_RC
+sim_install_bfin_mmu (SIM_DESC sd)
+{
+  SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
+  return sim_add_option_table (sd, NULL, bfin_mmu_options);
+}
 \f
 #define MMU_STATE(cpu) DV_STATE_CACHED (cpu, mmu)
 
 
   if (STATE_ENVIRONMENT (sd) == ALL_ENVIRONMENT)
     STATE_ENVIRONMENT (sd) = VIRTUAL_ENVIRONMENT;
 
-  /* These options override any module options.
-     Obviously ambiguity should be avoided, however the caller may wish to
-     augment the meaning of an option.  */
-#define e_sim_add_option_table(sd, options) \
-  do { \
-    extern const OPTION options[]; \
-    sim_add_option_table (sd, NULL, options); \
-  } while (0)
-  e_sim_add_option_table (sd, bfin_mmu_options);
-  e_sim_add_option_table (sd, bfin_mach_options);
-
   /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
 
   OPTION_MACH_HW_BOARD_FILE,
 };
 
-const OPTION bfin_mach_options[] =
+static const OPTION bfin_mach_options[] =
 {
   { {"sirev", required_argument, NULL, OPTION_MACH_SIREV },
       '\0', "NUMBER", "Set CPU silicon revision",
       return SIM_RC_FAIL;
     }
 }
+
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+extern MODULE_INIT_FN sim_install_bfin_mach;
+
+SIM_RC
+sim_install_bfin_mach (SIM_DESC sd)
+{
+  SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
+  return sim_add_option_table (sd, NULL, bfin_mach_options);
+}