]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* h8300s now new target, not alias of h8300h
authorAndrey Volkov <avolkov@transas.com>
Fri, 17 May 2002 19:09:13 +0000 (19:09 +0000)
committerAndrey Volkov <avolkov@transas.com>
Fri, 17 May 2002 19:09:13 +0000 (19:09 +0000)
sim/common/ChangeLog
sim/common/run.c
sim/common/sim-options.c
sim/h8300/ChangeLog
sim/h8300/compile.c
sim/h8300/inst.h

index 6935b013c79e36ad1c5d7d895615507386266c45..ee6bd719325b9e2e76f3278fbb903d60cc73d268 100644 (file)
@@ -1,3 +1,9 @@
+2002-05-17  Andrey Volkov  <avolkov@transas.com>
+
+       * run.c: Made h8300s as new target, not h8300h alias.
+       Added new option -S (h8300s target)
+       * sim-options.c: Ditto.
+       
 2002-05-01  Chris Demetriou  <cgd@broadcom.com>
 
        * callback.c: Use 'deprecated' rather than 'depreciated.'
index c34d5e6a12402727b19e8dba0544364c17e191b3..6a21586bf69c4def33c229e23bdbf2efaca89f02 100644 (file)
@@ -115,7 +115,7 @@ main (ac, av)
      do all argv processing.  */
 
 #ifdef SIM_H8300 /* FIXME: quick hack */
-  while ((i = getopt (ac, av, "a:c:m:op:s:htv")) != EOF) 
+  while ((i = getopt (ac, av, "a:c:m:op:s:hStv")) != EOF) 
 #else
   while ((i = getopt (ac, av, "a:c:m:op:s:tv")) != EOF) 
 #endif
@@ -173,8 +173,11 @@ main (ac, av)
        /* FIXME: Quick hack, to be replaced by more general facility.  */
 #ifdef SIM_H8300
       case 'h':
-       set_h8300h (1);
+       set_h8300h (1,0);
        break;
+      case 'S':
+       set_h8300h (1,1);
+        break;
 #endif
       default:
        usage ();
@@ -318,7 +321,8 @@ usage ()
   fprintf (stderr, "-c size         Set simulator cache size to `size'.\n");
 #endif
 #ifdef SIM_H8300
-  fprintf (stderr, "-h              Executable is for H8/300H or H8/S.\n");
+  fprintf (stderr, "-h              Executable is for h8/300h.\n");
+  fprintf (stderr, "-S              Executable is for h8/300s.\n");
 #endif
   fprintf (stderr, "-m size         Set memory size of simulator, in bytes.\n");
 #ifdef SIM_HAVE_ENVIRONMENT
index 9ccc51dc3d9d3c87bb0658c54064954c79319675..aae0245613e83068227a91733583bdd250106c52 100644 (file)
@@ -110,6 +110,7 @@ typedef enum {
   OPTION_HELP,
 #ifdef SIM_H8300 /* FIXME: Should be movable to h8300 dir.  */
   OPTION_H8300,
+  OPTION_H8300S,
 #endif
   OPTION_LOAD_LMA,
   OPTION_LOAD_VMA,
@@ -152,7 +153,10 @@ static const OPTION standard_options[] =
 
 #ifdef SIM_H8300 /* FIXME: Should be movable to h8300 dir.  */
   { {"h8300h", no_argument, NULL, OPTION_H8300},
-      'h', NULL, "Indicate the CPU is h8/300h or h8/300s",
+      'h', NULL, "Indicate the CPU is h8/300h",
+      standard_option_handler },
+  { {"h8300s", no_argument, NULL, OPTION_H8300S},
+      'S', NULL, "Indicate the CPU is h8/300s",
       standard_option_handler },
 #endif
 
@@ -354,7 +358,10 @@ standard_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
 
 #ifdef SIM_H8300 /* FIXME: Can be moved to h8300 dir.  */
     case OPTION_H8300:
-      set_h8300h (1);
+      set_h8300h (1,0);
+      break;
+    case OPTION_H8300S:
+      set_h8300h (1,1);
       break;
 #endif
 
index 1e3487d0fb503d6ef8e66417e3d0856896b72f57..f3266927fd884209462c147e4cc60764f9d32e06 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-17  Andrey Volkov  (avolkov@transas.com)
+
+       * compile.c: Made h8300s as new target, not h8300h alias.
+       * inst.h: Ditto.
+               
 2002-05-17  Andrey Volkov  (avolkov@transas.com)
 
        * compile.c: Add additional CCR flags (I,UI,H,U) 
index d5f72f787e8f1cbbec2f06115fcc643a8bc2f23f..87a083207796e1d6136fd83364d38681ede317dd 100644 (file)
@@ -704,7 +704,9 @@ init_pointers ()
       init = 1;
       littleendian.i = 1;
 
-      if (h8300hmode)
+      if (h8300smode)
+       memory_size = H8300S_MSIZE;
+      else if (h8300hmode)
        memory_size = H8300H_MSIZE;
       else
        memory_size = H8300_MSIZE;
@@ -2008,13 +2010,14 @@ sim_info (sd, verbose)
    FLAG is non-zero for the H8/300H.  */
 
 void
-set_h8300h (flag)
-     int flag;
+set_h8300h (h_flag, s_flag)
+     int h_flag, s_flag;
 {
   /* FIXME: Much of the code in sim_load can be moved to sim_open.
      This function being replaced by a sim_open:ARGV configuration
      option.  */
-  h8300hmode = flag;
+  h8300hmode = h_flag;
+  h8300smode = s_flag;
 }
 
 SIM_DESC
@@ -2069,8 +2072,8 @@ sim_load (sd, prog, abfd, from_tty)
       if (bfd_check_format (prog_bfd, bfd_object))
        {
          unsigned long mach = bfd_get_mach (prog_bfd);
-         set_h8300h (mach == bfd_mach_h8300h
-                     || mach == bfd_mach_h8300s);
+         set_h8300h (mach == bfd_mach_h8300h || mach == bfd_mach_h8300s,
+                     mach == bfd_mach_h8300s);
        }
     }
 
@@ -2088,7 +2091,10 @@ sim_load (sd, prog, abfd, from_tty)
      so we just reallocate memory now; this will also allow us to handle
      switching between H8/300 and H8/300H programs without exiting
      gdb.  */
-  if (h8300hmode)
+
+  if (h8300smode)
+    memory_size = H8300S_MSIZE;
+  else if (h8300hmode)
     memory_size = H8300H_MSIZE;
   else
     memory_size = H8300_MSIZE;
index ce930c3a7fd3f1d7e28b5e0af53443aa755c2326..51db285962356fabca9fff172d76accb08142c3e 100644 (file)
    can only happen when simulating H8/300H programs).  We make no attempt
    to catch overlapping addresses, wrapped addresses, etc etc.  */
 #define H8300_MSIZE (1<<16)
-#define H8300H_MSIZE (1<<18)
+
+/* avolkov: 
+   Next 2 macros are ugly for any workstation, but while they're work.
+   Memory size MUST be configurable.
+ */
+#define H8300H_MSIZE (1<<18) 
+#define H8300S_MSIZE (1<<24) 
 
 #define CSIZE 1000