daily update
[deliverable/binutils-gdb.git] / sim / common / sim-module.c
index 297b13335089688917bf1bd77d035db2e920ba61..8f01723318526860ccf93029129d8e958851b17c 100644 (file)
@@ -1,5 +1,7 @@
 /* Module support.
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+
+   Copyright 1996, 1997, 1998, 2003 Free Software Foundation, Inc.
+
    Contributed by Cygnus Support.
 
 This file is part of GDB, the GNU debugger.
@@ -23,12 +25,19 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "sim-options.h"
 #include "sim-assert.h"
 
+#if WITH_HW
+#include "sim-hw.h"
+#endif
+
 #include "libiberty.h"
 
 /* List of all modules.  */
 static MODULE_INSTALL_FN * const modules[] = {
   standard_install,
   sim_events_install,
+#ifdef SIM_HAVE_MODEL
+  sim_model_install,
+#endif
 #if WITH_ENGINE
   sim_engine_install,
 #endif
@@ -49,11 +58,8 @@ static MODULE_INSTALL_FN * const modules[] = {
 #if WITH_SCACHE
   scache_install,
 #endif
-#ifdef SIM_HAVE_MODEL
-  model_install,
-#endif
-#ifdef SIM_HAVE_BREAKPOINTS
-  sim_break_install,
+#if WITH_HW
+  sim_hw_install,
 #endif
   /* Configured in [simulator specific] additional modules.  */
 #ifdef MODULE_LIST
@@ -87,6 +93,8 @@ sim_pre_argv_init (SIM_DESC sd, const char *myname)
       }
   }
 
+  sim_config_default (sd);
+
   /* Install all configured in modules.  */
   if (sim_module_install (sd) != SIM_RC_OK)
     return SIM_RC_FAIL;
@@ -103,12 +111,15 @@ sim_post_argv_init (SIM_DESC sd)
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
   SIM_ASSERT (STATE_MODULES (sd) != NULL);
 
-  if (sim_module_init (sd) != SIM_RC_OK)
-    return SIM_RC_FAIL;
-
   /* Set the cpu->state backlinks for each cpu.  */
   for (i = 0; i < MAX_NR_PROCESSORS; ++i)
-    CPU_STATE (STATE_CPU (sd, i)) = sd;
+    {
+      CPU_STATE (STATE_CPU (sd, i)) = sd;
+      CPU_INDEX (STATE_CPU (sd, i)) = i;
+    }
+
+  if (sim_module_init (sd) != SIM_RC_OK)
+    return SIM_RC_FAIL;
 
   return SIM_RC_OK;
 }
This page took 0.024621 seconds and 4 git commands to generate.