sim: delete SIM_HAVE_FLATMEM support
authorMike Frysinger <vapier@gentoo.org>
Thu, 24 Dec 2015 21:41:55 +0000 (16:41 -0500)
committerMike Frysinger <vapier@gentoo.org>
Fri, 25 Dec 2015 00:52:13 +0000 (19:52 -0500)
No target has used this, and it's a cheap hack in place in using the
common memory module.  We want everyone using that though, so drop
support for flatmem entirely.

sim/common/ChangeLog
sim/common/sim-base.h
sim/common/sim-module.c
sim/common/sim-options.c
sim/mips/ChangeLog
sim/mips/interp.c

index 10ad02930baa96a2fd72a0e6c8e55cd16351756a..80fc1644c6afba4661962a677e21fe8c8adc3032 100644 (file)
@@ -1,3 +1,12 @@
+2015-12-24  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-base.h [SIM_HAVE_FLATMEM] (sim_state_base): Delete flatmem code.
+       * sim-module.c [SIM_HAVE_FLATMEM] (modules): Always call
+       sim_memopt_install.
+       * sim-options.c (OPTION_MEM_SIZE): Delete.
+       [SIM_HAVE_FLATMEM] (standard_options): Delete flatmem code.
+       (standard_option_handler): Likewise.
+
 2015-12-24  Mike Frysinger  <vapier@gentoo.org>
 
        * tconfig.h (SIM_HAVE_SIMCACHE): Delete.
index 21f61f4dc1f8a21ee85b5d424207274a983e7291..cfef6ecddc08ce0420f0525a34e02ec3d87d6f22 100644 (file)
@@ -202,16 +202,6 @@ typedef struct {
   unsigned int scache_size;
 #define STATE_SCACHE_SIZE(sd) ((sd)->base.scache_size)
 
-  /* FIXME: Move to top level sim_state struct (as some struct)?  */
-#ifdef SIM_HAVE_FLATMEM
-  unsigned int mem_size;
-#define STATE_MEM_SIZE(sd) ((sd)->base.mem_size)
-  unsigned int mem_base;
-#define STATE_MEM_BASE(sd) ((sd)->base.mem_base)
-  unsigned char *memory;
-#define STATE_MEMORY(sd) ((sd)->base.memory)
-#endif
-
   /* core memory bus */
 #define STATE_CORE(sd) (&(sd)->base.core)
   sim_core core;
index 2d8e7dc3729396c742e2b9a04f8c98ee47259e00..afadb07b79659a1e1b26daa46173991c6c6beb59 100644 (file)
@@ -53,10 +53,7 @@ static MODULE_INSTALL_FN * const modules[] = {
   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
index f8231430441867e896b114e2d62b558f9fe03647..5e04573e0c66145bf6d3d3a62d6e9e6b5a2c259f 100644 (file)
@@ -102,9 +102,6 @@ typedef enum {
   OPTION_VERBOSE,
   OPTION_ENDIAN,
   OPTION_DEBUG,
-#ifdef SIM_HAVE_FLATMEM
-  OPTION_MEM_SIZE,
-#endif
   OPTION_HELP,
   OPTION_VERSION,
 #ifdef SIM_H8300 /* FIXME: Should be movable to h8300 dir.  */
@@ -162,12 +159,6 @@ static const OPTION standard_options[] =
       standard_option_handler },
 #endif
 
-#ifdef SIM_HAVE_FLATMEM
-  { {"mem-size", required_argument, NULL, OPTION_MEM_SIZE},
-     'm', "<size>[in bytes, Kb (k suffix), Mb (m suffix) or Gb (g suffix)]",
-     "Specify memory size", standard_option_handler },
-#endif
-
   { {"do-command", required_argument, NULL, OPTION_DO_COMMAND},
       '\0', "COMMAND", ""/*undocumented*/,
       standard_option_handler },
@@ -376,35 +367,6 @@ standard_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
       break;
 #endif
 
-#ifdef SIM_HAVE_FLATMEM
-    case OPTION_MEM_SIZE:
-      {
-       char * endp;
-       unsigned long ul = strtol (arg, &endp, 0);
-
-       switch (* endp)
-         {
-         case 'k': case 'K': size <<= 10; break;
-         case 'm': case 'M': size <<= 20; break;
-         case 'g': case 'G': size <<= 30; break;
-         case ' ': case '\0': case '\t':  break;
-         default:
-           if (ul > 0)
-             sim_io_eprintf (sd, "Ignoring strange character at end of memory size: %c\n", * endp);
-           break;
-         }
-
-       /* 16384: some minimal amount */
-       if (! isdigit (arg[0]) || ul < 16384)
-         {
-           sim_io_eprintf (sd, "Invalid memory size `%s'", arg);
-           return SIM_RC_FAIL;
-         }
-       STATE_MEM_SIZE (sd) = ul;
-      }
-      break;
-#endif
-
     case OPTION_DO_COMMAND:
       sim_do_command (sd, arg);
       break;
index b48f69f38bb9c676ea06a0ecb14e59c0e47b6727..34ab06d0442b1a52528d70544456a093846bfdbd 100644 (file)
@@ -1,3 +1,7 @@
+2015-12-24  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c [SIM_HAVE_FLATMEM] (sim_open): Delete flatmem code.
+
 2015-12-24  Mike Frysinger  <vapier@gentoo.org>
 
        * tconfig.h (SIM_HAVE_SIMCACHE): Delete.
index 8a584d3cd244f2e3bd51489b0fc78bc807a0180e..524f5bec8e46235138dbbc2bd365dc40a2087011 100644 (file)
@@ -399,9 +399,6 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
 
       /* Look for largest memory region defined on command-line at
         phys address 0. */
-#ifdef SIM_HAVE_FLATMEM
-      mem_size = STATE_MEM_SIZE (sd);
-#endif
       for (entry = STATE_MEMOPT (sd); entry != NULL; entry = entry->next)
        {
          /* If we find an entry at address 0, then we will end up
This page took 0.033316 seconds and 4 git commands to generate.