* monitor.h (init_monitor_ops): Declare.
authorStan Shebs <shebs@codesourcery.com>
Thu, 13 Apr 1995 01:23:53 +0000 (01:23 +0000)
committerStan Shebs <shebs@codesourcery.com>
Thu, 13 Apr 1995 01:23:53 +0000 (01:23 +0000)
* rom68k-rom.c: Clarify some comments.
(rom68k_open): Define as static, to match decl.

gdb/ChangeLog
gdb/monitor.h
gdb/rom68k-rom.c

index ad3c11d..0b9154f 100644 (file)
@@ -1,3 +1,9 @@
+Wed Apr 12 16:40:20 1995  Stan Shebs  <shebs@andros.cygnus.com>
+
+       * monitor.h (init_monitor_ops): Declare.
+       * rom68k-rom.c: Clarify some comments.
+       (rom68k_open): Define as static, to match decl.
+
 Wed Apr 12 16:36:44 1995  Jim Kingdon  (kingdon@lioth.cygnus.com)
 
        * gdb.gdb: New file.
index 6d8ae48..e752345 100644 (file)
@@ -167,5 +167,8 @@ extern struct monitor_ops        *current_monitor;
 #define MEM_DIS_CMD            (current_monitor->getmem)
 #define REG_DELIM               (current_monitor->regset.delim)
 
-extern void monitor_open PARAMS ((char *args, struct monitor_ops *ops, int from_tty));
-extern char *monitor_supply_register PARAMS ((int regno, char *valstr));
+extern void init_monitor_ops PARAMS ((struct target_ops *));
+
+extern void monitor_open PARAMS ((char *, struct monitor_ops *, int));
+
+extern char *monitor_supply_register PARAMS ((int, char *));
index b5dfe34..220a049 100644 (file)
@@ -1,7 +1,5 @@
-/* Remote target glue for the rom68k ROM monitor. This was running on a
-Motorola IDP board.
-
-   Copyright 1988, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+/* Remote target glue for the ROM68K ROM monitor.
+   Copyright 1988, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -25,7 +23,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "monitor.h"
 #include "serial.h"
 
-static void rom68k_open PARAMS ((char *args, int from_tty));
+static void rom68k_open PARAMS ((char *, int));
 
 static void
 rom68k_supply_register (regname, regnamelen, val, vallen)
@@ -41,58 +39,59 @@ rom68k_supply_register (regname, regnamelen, val, vallen)
   regno = -1;
 
   if (regnamelen == 2)
-    switch (regname[0])
-      {
-      case 'S':
-       if (regname[1] == 'R')
-         regno = PS_REGNUM;
-       break;
-      case 'P':
-       if (regname[1] == 'C')
-         regno = PC_REGNUM;
-       break;
-      case 'D':
-       if (regname[1] != 'R')
+    {
+      switch (regname[0])
+       {
+       case 'S':
+         if (regname[1] == 'R')
+           regno = PS_REGNUM;
+         break;
+       case 'P':
+         if (regname[1] == 'C')
+           regno = PC_REGNUM;
+         break;
+       case 'D':
+         if (regname[1] != 'R')
+           break;
+         regno = D0_REGNUM;
+         numregs = 8;
          break;
-       regno = D0_REGNUM;
-       numregs = 8;
-       break;
-      case 'A':
-       if (regname[1] != 'R')
+       case 'A':
+         if (regname[1] != 'R')
+           break;
+         regno = A0_REGNUM;
+         numregs = 7;
          break;
-       regno = A0_REGNUM;
-       numregs = 7;
-       break;
-      }
+       }
+    }
   else if (regnamelen == 3)
-    switch (regname[0])
-      {
-      case 'I':
-       if (regname[1] == 'S' && regname[2] == 'P')
-         regno = SP_REGNUM;
-      }
+    {
+      switch (regname[0])
+       {
+       case 'I':
+         if (regname[1] == 'S' && regname[2] == 'P')
+           regno = SP_REGNUM;
+       }
+    }
 
   if (regno >= 0)
     while (numregs-- > 0)
       val = monitor_supply_register (regno++, val);
 }
 
-/*
- * this array of registers need to match the indexes used by GDB. The
- * whole reason this exists is cause the various ROM monitors use
- * different strings than GDB does, and doesn't support all the
- * registers either. So, typing "info reg sp" becomes a "r30".
- */
+/* This array of registers need to match the indexes used by GDB.
+   This exists because the various ROM monitors use different strings
+   than does GDB, and don't necessarily support all the registers
+   either. So, typing "info reg sp" becomes a "r30".  */
+
 static char *rom68k_regnames[NUM_REGS] = {
   "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
   "A0", "A1", "A2", "A3", "A4", "A5", "A6", "ISP",
   "SR", "PC" };
 
-/*
- * Define the monitor command strings. Since these are passed directly
- * through to a printf style function, we need can include formatting
- * strings. We also need a CR or LF on the end.
- */
+/* Define the monitor command strings. Since these are passed directly
+   through to a printf style function, we may include formatting
+   strings. We also need a CR or LF on the end.  */
 
 static struct target_ops rom68k_ops;
 
@@ -158,10 +157,10 @@ static struct monitor_ops rom68k_cmds =
   SERIAL_1_STOPBITS,           /* number of stop bits */
   rom68k_regnames,             /* registers names */
   MONITOR_OPS_MAGIC            /* magic */
-  };
+};
 
-void
-rom68k_open(args, from_tty)
+static void
+rom68k_open (args, from_tty)
      char *args;
      int from_tty;
 {
@@ -181,6 +180,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
 
   add_target (&rom68k_ops);
 
-  /* this is the default, since it's the only baud rate supported by the hardware */
+  /* This is the default, since it's the only baud rate supported by
+     the hardware.  */
   baud_rate = 9600;
 }