Add the operand encoding types for the new Armv8.2-a back-ported instructions. These...
[deliverable/binutils-gdb.git] / sim / common / sim-module.c
index d686182a34bc10a68b01dc305923ce1767dda19f..3096641e531c532e462661f4be835f5e274b3841 100644 (file)
@@ -1,7 +1,6 @@
 /* Module support.
 
-   Copyright 1996, 1997, 1998, 2003, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright 1996-2017 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support.
 
@@ -20,6 +19,7 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include "config.h"
 #include "sim-main.h"
 #include "sim-io.h"
 #include "sim-options.h"
@@ -29,41 +29,37 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "sim-hw.h"
 #endif
 
+#ifdef HAVE_DV_SOCKSER
+/* TODO: Shouldn't have device models here.  */
+#include "dv-sockser.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
-#if WITH_TRACE
+#if WITH_TRACE_ANY_P
   trace_install,
 #endif
 #if WITH_PROFILE
   profile_install,
 #endif
   sim_core_install,
-#ifndef SIM_HAVE_FLATMEM
-  /* FIXME: should handle flatmem as well FLATMEM */
   sim_memopt_install,
-#endif
-#if WITH_WATCHPOINTS
   sim_watchpoint_install,
-#endif
 #if WITH_SCACHE
   scache_install,
 #endif
 #if WITH_HW
   sim_hw_install,
 #endif
-  /* Configured in [simulator specific] additional modules.  */
-#ifdef MODULE_LIST
-  MODULE_LIST
+#ifdef HAVE_DV_SOCKSER
+  /* TODO: Shouldn't have device models here.  */
+  dv_sockser_install,
 #endif
   0
 };
@@ -78,9 +74,7 @@ sim_pre_argv_init (SIM_DESC sd, const char *myname)
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
   SIM_ASSERT (STATE_MODULES (sd) == NULL);
 
-  STATE_MY_NAME (sd) = myname + strlen (myname);
-  while (STATE_MY_NAME (sd) > myname && STATE_MY_NAME (sd)[-1] != '/')
-    --STATE_MY_NAME (sd);
+  STATE_MY_NAME (sd) = lbasename (myname);
 
   /* Set the cpu names to default values.  */
   {
@@ -88,7 +82,8 @@ sim_pre_argv_init (SIM_DESC sd, const char *myname)
     for (i = 0; i < MAX_NR_PROCESSORS; ++i)
       {
        char *name;
-       asprintf (&name, "cpu%d", i);
+       if (asprintf (&name, "cpu%d", i) < 0)
+         return SIM_RC_FAIL;
        CPU_NAME (STATE_CPU (sd, i)) = name;
       }
   }
@@ -227,7 +222,7 @@ sim_module_uninstall (SIM_DESC sd)
     for (d = modules->init_list; d != NULL; d = n)
       {
        n = d->next;
-       zfree (d);
+       free (d);
       }
   }
 
@@ -237,7 +232,7 @@ sim_module_uninstall (SIM_DESC sd)
     for (d = modules->resume_list; d != NULL; d = n)
       {
        n = d->next;
-       zfree (d);
+       free (d);
       }
   }
 
@@ -247,7 +242,7 @@ sim_module_uninstall (SIM_DESC sd)
     for (d = modules->suspend_list; d != NULL; d = n)
       {
        n = d->next;
-       zfree (d);
+       free (d);
       }
   }
 
@@ -257,7 +252,7 @@ sim_module_uninstall (SIM_DESC sd)
     for (d = modules->uninstall_list; d != NULL; d = n)
       {
        n = d->next;
-       zfree (d);
+       free (d);
       }
   }
 
@@ -267,11 +262,11 @@ sim_module_uninstall (SIM_DESC sd)
     for (d = modules->info_list; d != NULL; d = n)
       {
        n = d->next;
-       zfree (d);
+       free (d);
       }
   }
 
-  zfree (modules);
+  free (modules);
   STATE_MODULES (sd) = NULL;
 }
 
This page took 0.024261 seconds and 4 git commands to generate.