bfd/
[deliverable/binutils-gdb.git] / gdb / ser-e7kpc.c
index 5f35baedf0ec9d35a3b161fa55a7bc3f98050e58..fd3252db83034ecedd5cb260e239daf807031772 100644 (file)
@@ -1,5 +1,6 @@
-/* Remote serial interface using Hitachi E7000 PC ISA card in a PC
-   Copyright 1994, 1999 Free Software Foundation, Inc.
+/* Remote serial interface using Renesas E7000 PC ISA card in a PC
+   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
 
-#if defined __GO32__ || defined _WIN32
 #include "defs.h"
+#if defined __GO32__ || defined _WIN32
 #include "serial.h"
 #include "gdb_string.h"
 
-/* MSVC uses strnicmp instead of strncasecmp */
-#ifdef _MSC_VER
-#define strncasecmp strnicmp
-#define WIN32_LEAN_AND_MEAN
-#endif
-
 #ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #endif
 
 #include <sys/dos.h>
 #endif
 
-static int e7000pc_open PARAMS ((serial_t scb, const char *name));
-static void e7000pc_raw PARAMS ((serial_t scb));
-static int e7000pc_readchar PARAMS ((serial_t scb, int timeout));
-static int e7000pc_setbaudrate PARAMS ((serial_t scb, int rate));
-static int e7000pc_write PARAMS ((serial_t scb, const char *str, int len));
-static void e7000pc_close PARAMS ((serial_t scb));
-static serial_ttystate e7000pc_get_tty_state PARAMS ((serial_t scb));
-static int e7000pc_set_tty_state PARAMS ((serial_t scb, serial_ttystate state));
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
+
+static int e7000pc_open (struct serial *scb, const char *name);
+static void e7000pc_raw (struct serial *scb);
+static int e7000pc_readchar (struct serial *scb, int timeout);
+static int e7000pc_setbaudrate (struct serial *scb, int rate);
+static int e7000pc_write (struct serial *scb, const char *str, int len);
+static void e7000pc_close (struct serial *scb);
+static serial_ttystate e7000pc_get_tty_state (struct serial *scb);
+static int e7000pc_set_tty_state (struct serial *scb, serial_ttystate state);
 
 #define OFF_DPD        0x0000
 #define OFF_DDP        0x1000
@@ -128,39 +128,10 @@ sigs[] =
     0
 };
 
-#ifdef _MSC_VER
-/* Get the base of the data segment.  This is needed to calculate the offset
-   between data segment addresses and the base of linear memory, which is where
-   device registers reside.  Note that this is really only necessary for
-   Win32s, since Win95 and NT keep the data segment at linear 0.  */
-
-static unsigned long
-get_ds_base (void)
-{
-  unsigned short dsval;
-  LDT_ENTRY ldt;
-  unsigned long dsbase;
-
-  __asm
-  {
-    mov dsval, ds
-  }
-
-  dsbase = 0;
-
-  GetThreadSelectorEntry (GetCurrentThread (), dsval, &ldt);
-
-  dsbase = ldt.HighWord.Bits.BaseHi << 24 | ldt.HighWord.Bits.BaseMid << 16
-    | ldt.BaseLow;
-
-  return dsbase;
-}
-#else /* !_MSC_VER */
 #define get_ds_base() 0
-#endif /* _MSC_VER */
 
 static int
-e7000pc_init ()
+e7000pc_init (void)
 {
   int try;
   unsigned long dsbase;
@@ -197,16 +168,16 @@ e7000pc_init ()
                               sigs[try].addr);
              return 1;
            }
-         error ("The E7000 PC board is working, but the E7000 is turned off.\n");
+         error (_("The E7000 PC board is working, but the E7000 is turned off."));
          return 0;
        }
     }
 
-  error ("GDB cannot connect to the E7000 PC board, check that it is installed\n\
+  error (_("GDB cannot connect to the E7000 PC board, check that it is installed\n\
 and that the switch settings are correct.  Some other DOS programs can \n\
 stop the board from working.  Try starting from a very minimal boot, \n\
 perhaps you need to disable EMM386 over the region where the board has\n\
-its I/O space, remove other unneeded cards, etc etc\n");
+its I/O space, remove other unneeded cards, etc etc\n"));
   return 0;
 
 }
@@ -255,12 +226,7 @@ e7000_get (void)
    that TIMEOUT == 0 is a poll, and TIMEOUT == -1 means wait forever. */
 
 static int
-dosasync_read (fd, buf, len, timeout)
-     int fd;
-     char *buf;
-     int len;
-     int timeout;
-
+dosasync_read (int fd, char *buf, int len, int timeout)
 {
   long now;
   long then;
@@ -301,10 +267,7 @@ dosasync_read (fd, buf, len, timeout)
 
 
 static int
-dosasync_write (fd, buf, len)
-     int fd;
-     const char *buf;
-     int len;
+dosasync_write (int fd, const char *buf, int len)
 {
   int i;
   char dummy[1000];
@@ -332,9 +295,7 @@ dosasync_write (fd, buf, len)
 }
 
 static int
-e7000pc_open (scb, name)
-     serial_t scb;
-     const char *name;
+e7000pc_open (struct serial *scb, const char *name)
 {
   if (strncasecmp (name, "pc", 2) != 0)
     {
@@ -351,23 +312,19 @@ e7000pc_open (scb, name)
 }
 
 static int
-e7000pc_noop (scb)
-     serial_t scb;
+e7000pc_noop (struct serial *scb)
 {
   return 0;
 }
 
 static void
-e7000pc_raw (scb)
-     serial_t scb;
+e7000pc_raw (struct serial *scb)
 {
   /* Always in raw mode */
 }
 
 static int
-e7000pc_readchar (scb, timeout)
-     serial_t scb;
-     int timeout;
+e7000pc_readchar (struct serial *scb, int timeout)
 {
   char buf;
 
@@ -392,8 +349,7 @@ struct e7000pc_ttystate
    vector.  Someday, they may do something real... */
 
 static serial_ttystate
-e7000pc_get_tty_state (scb)
-     serial_t scb;
+e7000pc_get_tty_state (struct serial *scb)
 {
   struct e7000pc_ttystate *state;
 
@@ -403,44 +359,42 @@ e7000pc_get_tty_state (scb)
 }
 
 static int
-e7000pc_set_tty_state (scb, ttystate)
-     serial_t scb;
-     serial_ttystate ttystate;
+e7000pc_set_tty_state (struct serial *scb, serial_ttystate ttystate)
 {
   return 0;
 }
 
 static int
-e7000pc_noflush_set_tty_state (scb, new_ttystate, old_ttystate)
-     serial_t scb;
-     serial_ttystate new_ttystate;
-     serial_ttystate old_ttystate;
+e7000pc_noflush_set_tty_state (struct serial *scb,
+                              serial_ttystate new_ttystate,
+                              serial_ttystate old_ttystate)
 {
   return 0;
 }
 
 static void
-e7000pc_print_tty_state (scb, ttystate)
-     serial_t scb;
-     serial_ttystate ttystate;
+e7000pc_print_tty_state (struct serial *scb,
+                        serial_ttystate ttystate,
+                        struct ui_file *stream)
 {
   /* Nothing to print.  */
   return;
 }
 
 static int
-e7000pc_setbaudrate (scb, rate)
-     serial_t scb;
-     int rate;
+e7000pc_setbaudrate (struct serial *scb, int rate)
 {
   return 0;
 }
 
 static int
-e7000pc_write (scb, str, len)
-     serial_t scb;
-     const char *str;
-     int len;
+e7000pc_setstopbits (struct serial *scb, int rate)
+{
+  return 0;
+}
+
+static int
+e7000pc_write (struct serial *scb, const char *str, int len)
 {
   dosasync_write (scb->fd, str, len);
 
@@ -448,8 +402,7 @@ e7000pc_write (scb, str, len)
 }
 
 static void
-e7000pc_close (scb)
-     serial_t scb;
+e7000pc_close (struct serial *scb)
 {
 }
 
@@ -470,19 +423,18 @@ static struct serial_ops e7000pc_ops =
   e7000pc_print_tty_state,
   e7000pc_noflush_set_tty_state,
   e7000pc_setbaudrate,
+  e7000pc_setstopbits,
   e7000pc_noop,                        /* wait for output to drain */
 };
 
-void
-_initialize_ser_e7000pc ()
-{
-  serial_add_interface (&e7000pc_ops);
-}
-#else
+#endif /*_WIN32 or __GO32__*/
+
+extern initialize_file_ftype _initialize_ser_e7000pc; /* -Wmissing-prototypes */
 
 void
-_initialize_ser_e7000pc ()
+_initialize_ser_e7000pc (void)
 {
-
+#if defined __GO32__ || defined _WIN32
+  serial_add_interface (&e7000pc_ops);
+#endif  
 }
-#endif
This page took 0.027896 seconds and 4 git commands to generate.