/* Remote serial interface for local (hardwired) serial ports for GO32.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2020 Free Software Foundation, Inc.
Contributed by Nigel Stephens, Algorithmics Ltd. (nigel@algor.co.uk).
}
\f
+/* Implementation of the serial_ops flush_output method. */
static int
-dos_noop (struct serial *scb)
+dos_flush_output (struct serial *scb)
+{
+ return 0;
+}
+
+/* Implementation of the serial_ops setparity method. */
+
+static int
+dos_setparity (struct serial *scb, int parity)
+{
+ return 0;
+}
+
+/* Implementation of the serial_ops drain_output method. */
+
+static int
+dos_drain_output (struct serial *scb)
{
return 0;
}
then = rawclock () + (timeout * RAWHZ);
while ((c = dos_getc (port)) < 0)
{
+ QUIT;
+
if (timeout >= 0 && (rawclock () - then) >= 0)
return SERIAL_TIMEOUT;
}
/* We've never heard about this port. We should fail this call,
unless they are asking about one of the 3 standard handles,
in which case we pretend the handle was open by us if it is
- connected to a terminal device. This is beacuse Unix
+ connected to a terminal device. This is because Unix
terminals use the serial interface, so GDB expects the
standard handles to go through here. */
if (scb->fd >= 3 || !isatty (scb->fd))
return 0;
}
-static int
-dos_noflush_set_tty_state (struct serial *scb, serial_ttystate new_ttystate,
- serial_ttystate old_ttystate)
-{
- struct dos_ttystate *state;
-
- state = (struct dos_ttystate *) new_ttystate;
- dos_setbaudrate (scb, state->baudrate);
- return 0;
-}
-
static int
dos_flush_input (struct serial *scb)
{
size_t fifosize = port->fifo ? 16 : 1;
long then;
size_t cnt;
- const char *str = buf;
+ const char *str = (const char *) buf;
while (count > 0)
{
+ QUIT;
+
/* Send the data, fifosize bytes at a time. */
cnt = fifosize > count ? count : fifosize;
port->txbusy = 1;
NULL, /* fdopen, not implemented */
dos_readchar,
dos_write,
- dos_noop, /* flush output */
+ dos_flush_output,
dos_flush_input,
dos_sendbreak,
dos_raw,
dos_copy_tty_state,
dos_set_tty_state,
dos_print_tty_state,
- dos_noflush_set_tty_state,
dos_setbaudrate,
dos_setstopbits,
- dos_noop,
- dos_noop, /* Wait for output to drain. */
+ dos_setparity,
+ dos_drain_output,
(void (*)(struct serial *, int))NULL /* Change into async mode. */
};
}
static void
-dos_info (char *arg, int from_tty)
+info_serial_command (const char *arg, int from_tty)
{
struct dos_ttystate *port;
#ifdef DOS_STATS
#endif
}
-/* -Wmissing-prototypes */
-extern initialize_file_ftype _initialize_ser_dos;
-
void
_initialize_ser_dos (void)
{
NULL, /* FIXME: i18n: */
&setlist, &showlist);
- add_info ("serial", dos_info,
+ add_info ("serial", info_serial_command,
_("Print DOS serial port status."));
}