+2001-07-10 Andrew Cagney <ac131313@redhat.com>
+
+ * serial.h (typedef serial_t): Delete. Replace all references to
+ serial_t with `struct serial *'.
+ * serial.c: Update.
+ * nindy-share/ttyflush.c: Update.
+ * nindy-share/ttyflush.c: Update.
+ * nindy-share/Onindy.c: Update.
+ * nindy-share/nindy.c: Update.
+ * remote-rdp.c: Update.
+ * remote-sds.c: Update.
+ * remote-st.c: Update.
+ * remote-nindy.c: Update.
+ * remote-mips.c: Update.
+ * remote-e7000.c: Update.
+ * remote-os9k.c: Update.
+ * remote-nrom.c: Update.
+ * remote-es.c: Update.
+ * remote-array.c: Update.
+ * ocd.c: Update.
+ * mon960-rom.c: Update.
+ * dsrec.c: Update.
+ * inflow.c: Update.
+ * ser-e7kpc.c: Update.
+ * sparclet-rom.c: Update.
+ * srec.h: Update.
+ * ser-tcp.c: Update.
+ * ser-go32.c: Update.
+ * sparcl-tdep.c: Update.
+ * w89k-rom.c: Update.
+ * utils.c: Update.
+ * sh3-rom.c: Update.
+ * remote.c: Update.
+ * ser-pipe.c: Update.
+ * ser-unix.c: Update.
+ * ser-unix.h: Update.
+ * xmodem.c: Update.
+ * xmodem.h: Update.
+
2001-07-11 J.T. Conklin <jtc@redback.com>
From Greg McGary <greg@mcgary.org>:
int flags);
/* Download an executable by converting it to S records. DESC is a
- serial_t to send the data to. FILE is the name of the file to be
- loaded. LOAD_OFFSET is the offset into memory to load data into.
- It is usually specified by the user and is useful with the a.out
- file format. MAXRECSIZE is the length in chars of the largest
- S-record the host can accomodate. This is measured from the
- starting `S' to the last char of the checksum. FLAGS is various
- random flags, and HASHMARK is non-zero to cause a `#' to be
+ `struct serial *' to send the data to. FILE is the name of the
+ file to be loaded. LOAD_OFFSET is the offset into memory to load
+ data into. It is usually specified by the user and is useful with
+ the a.out file format. MAXRECSIZE is the length in chars of the
+ largest S-record the host can accomodate. This is measured from
+ the starting `S' to the last char of the checksum. FLAGS is
+ various random flags, and HASHMARK is non-zero to cause a `#' to be
printed out for each record loaded. WAITACK, if non-NULL, is a
- function that waits for an acknowledgement after each S-record,
- and returns non-zero if the ack is read correctly. */
+ function that waits for an acknowledgement after each S-record, and
+ returns non-zero if the ack is read correctly. */
void
-load_srec (serial_t desc, const char *file, bfd_vma load_offset, int maxrecsize,
+load_srec (struct serial *desc, const char *file, bfd_vma load_offset,
+ int maxrecsize,
int flags, int hashmark, int (*waitack) (void))
{
bfd *abfd;
\f
/* Record terminal status separately for debugger and inferior. */
-static serial_t stdin_serial;
+static struct serial *stdin_serial;
/* TTY state for the inferior. We save it whenever the inferior stops, and
restore it when it resumes. */
#else
static void
-mon960_load (serial_t desc, char *file, int hashmark)
+mon960_load (struct serial *desc, char *file, int hashmark)
{
bfd *abfd;
asection *s;
extern int quiet; /* 1 => stifle unnecessary messages */
/* tty connected to 960/NINDY board. */
-extern serial_t nindy_serial;
+extern struct serial *nindy_serial;
static OninStrGet();
\f
#define TIMEOUT -1
int quiet = 0; /* 1 => stifle unnecessary messages */
-serial_t nindy_serial;
+struct serial *nindy_serial;
static int old_nindy = 0; /* 1 => use old (hex) communication protocol */
static ninStrGet();
static int
try_baudrate (serial, brp)
- serial_t serial;
+ struct serial *serial;
struct baudrate *brp;
{
unsigned char c;
******************************************************************************/
static
autobaud( serial, brp )
- serial_t serial;
+ struct serial *serial;
struct baudrate *brp;
{
int i;
int
tty_flush (serial)
- serial_t serial;
+ struct serial *serial;
{
while (1)
{
/* Descriptor for I/O to remote machine. Initialize it to NULL so that
ocd_open knows that we don't have a file open when the program
starts. */
-static serial_t ocd_desc = NULL;
+static struct serial *ocd_desc = NULL;
\f
void
ocd_error (char *s, int error_code)
* Descriptor for I/O to remote machine. Initialize it to NULL so that
* array_open knows that we don't have a file open when the program starts.
*/
-serial_t array_desc = NULL;
+struct serial *array_desc = NULL;
/*
* this array of registers need to match the indexes used by GDB. The
int old_timeout = timeout;
int result, i;
char c;
- serial_t tty_desc;
+ struct serial *tty_desc;
serial_ttystate ttystate;
debuglogs (1, "array_wait (), printing extraneous text.");
static int e7000_parse_device (char *args, char *dev_name, int baudrate);
/* Variables. */
-static serial_t e7000_desc;
+static struct serial *e7000_desc;
/* Allow user to chose between using hardware breakpoints or memory. */
static int use_hard_breakpoints = 0; /* use sw breakpoints by default */
es1800_open knows that we don't have a file open when the program
starts. */
-static serial_t es1800_desc = NULL;
+static struct serial *es1800_desc = NULL;
#define PBUFSIZ 1000
#define HDRLEN sizeof("@.BAAAAAAAA=$VV\r")
static int mips_need_reply = 0;
/* Handle used to access serial I/O stream. */
-static serial_t mips_desc;
+static struct serial *mips_desc;
/* UDP handle used to download files to target. */
-static serial_t udp_desc;
+static struct serial *udp_desc;
static int udp_in_use;
/* TFTP filename used to download files to DDB board, in the form
/* Open and initialize the serial port. */
mips_desc = SERIAL_OPEN (serial_port_name);
- if (mips_desc == (serial_t) NULL)
+ if (mips_desc == NULL)
perror_with_name (serial_port_name);
if (baud_rate != -1)
#define FALSE 0
/* From nindy-share/nindy.c. */
-extern serial_t nindy_serial;
+extern struct serial *nindy_serial;
static int have_regs = 0; /* 1 iff regs read since i960 last halted */
static int regs_changed = 0; /* 1 iff regs were modified since last read */
struct clean_up_tty_args
{
serial_ttystate state;
- serial_t serial;
+ struct serial *serial;
};
static struct clean_up_tty_args tty_args;
/* We talk to the NetROM over these sockets. */
-static serial_t load_desc = NULL;
-static serial_t ctrl_desc = NULL;
+static struct serial *load_desc = NULL;
+static struct serial *ctrl_desc = NULL;
static int load_port = DEFAULT_NETROM_LOAD_PORT;
static int control_port = DEFAULT_NETROM_CONTROL_PORT;
nrom_close (0);
}
-static serial_t
+static struct serial *
open_socket (char *name, int port)
{
char sockname[100];
- serial_t desc;
+ struct serial *desc;
sprintf (sockname, "%s:%d", name, port);
desc = SERIAL_OPEN (sockname);
static int timeout = 10;
static int is_trace_mode = 0;
/* Descriptor for I/O to remote machine. Initialize it to NULL */
-static serial_t monitor_desc = NULL;
+static struct serial *monitor_desc = NULL;
static CORE_ADDR bufaddr = 0;
static int buflen = 0;
#endif
extern struct target_ops remote_rdp_ops;
-static serial_t io;
+static struct serial *io;
static host_callback *callback = &default_callback;
struct
that sds_open knows that we don't have a file open when the program
starts. */
-static serial_t sds_desc = NULL;
+static struct serial *sds_desc = NULL;
/* This limit comes from the monitor. */
st2000_open knows that we don't have a file open when the program
starts. */
-static serial_t st2000_desc;
+static struct serial *st2000_desc;
/* Send data to stdebug. Works just like printf. */
/* Descriptor for I/O to remote machine. Initialize it to NULL so that
remote_open knows that we don't have a file open when the program
starts. */
-static serial_t remote_desc = NULL;
+static struct serial *remote_desc = NULL;
/* This is set by the target (thru the 'S' message)
to denote that the target is in kernel mode. */
static serial_event_ftype remote_async_serial_handler;
static void
-remote_async_serial_handler (serial_t scb, void *context)
+remote_async_serial_handler (struct serial *scb, void *context)
{
/* Don't propogate error information up to the client. Instead let
the client find out about the error by querying the target. */
#include <sys/dos.h>
#endif
-static int e7000pc_open (serial_t scb, const char *name);
-static void e7000pc_raw (serial_t scb);
-static int e7000pc_readchar (serial_t scb, int timeout);
-static int e7000pc_setbaudrate (serial_t scb, int rate);
-static int e7000pc_write (serial_t scb, const char *str, int len);
-static void e7000pc_close (serial_t scb);
-static serial_ttystate e7000pc_get_tty_state (serial_t scb);
-static int e7000pc_set_tty_state (serial_t scb, serial_ttystate state);
+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
}
static int
-e7000pc_open (serial_t scb, const char *name)
+e7000pc_open (struct serial *scb, const char *name)
{
if (strncasecmp (name, "pc", 2) != 0)
{
}
static int
-e7000pc_noop (serial_t scb)
+e7000pc_noop (struct serial *scb)
{
return 0;
}
static void
-e7000pc_raw (serial_t scb)
+e7000pc_raw (struct serial *scb)
{
/* Always in raw mode */
}
static int
-e7000pc_readchar (serial_t scb, int timeout)
+e7000pc_readchar (struct serial *scb, int timeout)
{
char buf;
vector. Someday, they may do something real... */
static serial_ttystate
-e7000pc_get_tty_state (serial_t scb)
+e7000pc_get_tty_state (struct serial *scb)
{
struct e7000pc_ttystate *state;
}
static int
-e7000pc_set_tty_state (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 (serial_t scb, serial_ttystate new_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 (serial_t scb,
+e7000pc_print_tty_state (struct serial *scb,
serial_ttystate ttystate,
struct ui_file *stream)
{
}
static int
-e7000pc_setbaudrate (serial_t scb, int rate)
+e7000pc_setbaudrate (struct serial *scb, int rate)
{
return 0;
}
static int
-e7000pc_setstopbits (serial_t scb, int rate)
+e7000pc_setstopbits (struct serial *scb, int rate)
{
return 0;
}
static int
-e7000pc_write (serial_t scb, const char *str, int len)
+e7000pc_write (struct serial *scb, const char *str, int len)
{
dosasync_write (scb->fd, str, len);
}
static void
-e7000pc_close (serial_t scb)
+e7000pc_close (struct serial *scb)
{
}
}
};
-static int dos_open (serial_t scb, const char *name);
-static void dos_raw (serial_t scb);
-static int dos_readchar (serial_t scb, int timeout);
-static int dos_setbaudrate (serial_t scb, int rate);
-static int dos_write (serial_t scb, const char *str, int len);
-static void dos_close (serial_t scb);
-static serial_ttystate dos_get_tty_state (serial_t scb);
-static int dos_set_tty_state (serial_t scb, serial_ttystate state);
+static int dos_open (struct serial *scb, const char *name);
+static void dos_raw (struct serial *scb);
+static int dos_readchar (struct serial *scb, int timeout);
+static int dos_setbaudrate (struct serial *scb, int rate);
+static int dos_write (struct serial *scb, const char *str, int len);
+static void dos_close (struct serial *scb);
+static serial_ttystate dos_get_tty_state (struct serial *scb);
+static int dos_set_tty_state (struct serial *scb, serial_ttystate state);
static int dos_baudconv (int rate);
#define inb(p,a) inportb((p)->base + (a))
static int
-dos_open (serial_t scb, const char *name)
+dos_open (struct serial *scb, const char *name)
{
struct dos_ttystate *port;
int fd, i;
static void
-dos_close (serial_t scb)
+dos_close (struct serial *scb)
{
struct dos_ttystate *port;
struct intrupt *intrupt;
static int
-dos_noop (serial_t scb)
+dos_noop (struct serial *scb)
{
return 0;
}
static void
-dos_raw (serial_t scb)
+dos_raw (struct serial *scb)
{
/* Always in raw mode */
}
static int
-dos_readchar (serial_t scb, int timeout)
+dos_readchar (struct serial *scb, int timeout)
{
struct dos_ttystate *port = &ports[scb->fd];
long then;
static serial_ttystate
-dos_get_tty_state (serial_t scb)
+dos_get_tty_state (struct serial *scb)
{
struct dos_ttystate *port = &ports[scb->fd];
struct dos_ttystate *state;
}
static int
-dos_set_tty_state (serial_t scb, serial_ttystate ttystate)
+dos_set_tty_state (struct serial *scb, serial_ttystate ttystate)
{
struct dos_ttystate *state;
}
static int
-dos_noflush_set_tty_state (serial_t scb, serial_ttystate new_ttystate,
+dos_noflush_set_tty_state (struct serial *scb, serial_ttystate new_ttystate,
serial_ttystate old_ttystate)
{
struct dos_ttystate *state;
}
static int
-dos_flush_input (serial_t scb)
+dos_flush_input (struct serial *scb)
{
struct dos_ttystate *port = &ports[scb->fd];
disable ();
}
static void
-dos_print_tty_state (serial_t scb, serial_ttystate ttystate,
+dos_print_tty_state (struct serial *scb, serial_ttystate ttystate,
struct ui_file *stream)
{
/* Nothing to print */
static int
-dos_setbaudrate (serial_t scb, int rate)
+dos_setbaudrate (struct serial *scb, int rate)
{
struct dos_ttystate *port = &ports[scb->fd];
}
static int
-dos_setstopbits (serial_t scb, int num)
+dos_setstopbits (struct serial *scb, int num)
{
struct dos_ttystate *port = &ports[scb->fd];
unsigned char cfcr;
}
static int
-dos_write (serial_t scb, const char *str, int len)
+dos_write (struct serial *scb, const char *str, int len)
{
volatile struct dos_ttystate *port = &ports[scb->fd];
int fifosize = port->fifo ? 16 : 1;
static int
-dos_sendbreak (serial_t scb)
+dos_sendbreak (struct serial *scb)
{
volatile struct dos_ttystate *port = &ports[scb->fd];
unsigned char cfcr;
dos_setbaudrate,
dos_setstopbits,
dos_noop, /* wait for output to drain */
- (void (*)(serial_t, int))NULL /* change into async mode */
+ (void (*)(struct serial *, int))NULL /* change into async mode */
};
#include <signal.h>
-static int pipe_open (serial_t scb, const char *name);
-static void pipe_close (serial_t scb);
+static int pipe_open (struct serial *scb, const char *name);
+static void pipe_close (struct serial *scb);
extern void _initialize_ser_pipe (void);
/* Open up a raw pipe */
static int
-pipe_open (serial_t scb, const char *name)
+pipe_open (struct serial *scb, const char *name)
{
#if !HAVE_SOCKETPAIR
return -1;
}
static void
-pipe_close (serial_t scb)
+pipe_close (struct serial *scb)
{
struct pipe_state *state = scb->state;
if (state != NULL)
#include <signal.h>
#include "gdb_string.h"
-static int tcp_open (serial_t scb, const char *name);
-static void tcp_close (serial_t scb);
+static int tcp_open (struct serial *scb, const char *name);
+static void tcp_close (struct serial *scb);
void _initialize_ser_tcp (void);
/* Open up a raw tcp socket */
static int
-tcp_open (serial_t scb, const char *name)
+tcp_open (struct serial *scb, const char *name)
{
char *port_str;
int port;
}
static void
-tcp_close (serial_t scb)
+tcp_close (struct serial *scb)
{
if (scb->fd < 0)
return;
};
#endif /* sgtty */
-static int hardwire_open (serial_t scb, const char *name);
-static void hardwire_raw (serial_t scb);
-static int wait_for (serial_t scb, int timeout);
-static int hardwire_readchar (serial_t scb, int timeout);
-static int do_hardwire_readchar (serial_t scb, int timeout);
-static int generic_readchar (serial_t scb, int timeout, int (*do_readchar) (serial_t scb, int timeout));
+static int hardwire_open (struct serial *scb, const char *name);
+static void hardwire_raw (struct serial *scb);
+static int wait_for (struct serial *scb, int timeout);
+static int hardwire_readchar (struct serial *scb, int timeout);
+static int do_hardwire_readchar (struct serial *scb, int timeout);
+static int generic_readchar (struct serial *scb, int timeout,
+ int (*do_readchar) (struct serial *scb,
+ int timeout));
static int rate_to_code (int rate);
-static int hardwire_setbaudrate (serial_t scb, int rate);
-static void hardwire_close (serial_t scb);
-static int get_tty_state (serial_t scb, struct hardwire_ttystate * state);
-static int set_tty_state (serial_t scb, struct hardwire_ttystate * state);
-static serial_ttystate hardwire_get_tty_state (serial_t scb);
-static int hardwire_set_tty_state (serial_t scb, serial_ttystate state);
-static int hardwire_noflush_set_tty_state (serial_t, serial_ttystate,
- serial_ttystate);
-static void hardwire_print_tty_state (serial_t, serial_ttystate, struct ui_file *);
-static int hardwire_drain_output (serial_t);
-static int hardwire_flush_output (serial_t);
-static int hardwire_flush_input (serial_t);
-static int hardwire_send_break (serial_t);
-static int hardwire_setstopbits (serial_t, int);
-
-static int do_unix_readchar (serial_t scb, int timeout);
+static int hardwire_setbaudrate (struct serial *scb, int rate);
+static void hardwire_close (struct serial *scb);
+static int get_tty_state (struct serial *scb,
+ struct hardwire_ttystate * state);
+static int set_tty_state (struct serial *scb,
+ struct hardwire_ttystate * state);
+static serial_ttystate hardwire_get_tty_state (struct serial *scb);
+static int hardwire_set_tty_state (struct serial *scb, serial_ttystate state);
+static int hardwire_noflush_set_tty_state (struct serial *, serial_ttystate,
+ serial_ttystate);
+static void hardwire_print_tty_state (struct serial *, serial_ttystate,
+ struct ui_file *);
+static int hardwire_drain_output (struct serial *);
+static int hardwire_flush_output (struct serial *);
+static int hardwire_flush_input (struct serial *);
+static int hardwire_send_break (struct serial *);
+static int hardwire_setstopbits (struct serial *, int);
+
+static int do_unix_readchar (struct serial *scb, int timeout);
static timer_handler_func push_event;
static handler_func fd_event;
-static void reschedule (serial_t scb);
+static void reschedule (struct serial *scb);
void _initialize_ser_hardwire (void);
/* Open up a real live device for serial I/O */
static int
-hardwire_open (serial_t scb, const char *name)
+hardwire_open (struct serial *scb, const char *name)
{
scb->fd = open (name, O_RDWR);
if (scb->fd < 0)
}
static int
-get_tty_state (serial_t scb, struct hardwire_ttystate *state)
+get_tty_state (struct serial *scb, struct hardwire_ttystate *state)
{
#ifdef HAVE_TERMIOS
if (tcgetattr (scb->fd, &state->termios) < 0)
}
static int
-set_tty_state (serial_t scb, struct hardwire_ttystate *state)
+set_tty_state (struct serial *scb, struct hardwire_ttystate *state)
{
#ifdef HAVE_TERMIOS
if (tcsetattr (scb->fd, TCSANOW, &state->termios) < 0)
}
static serial_ttystate
-hardwire_get_tty_state (serial_t scb)
+hardwire_get_tty_state (struct serial *scb)
{
struct hardwire_ttystate *state;
}
static int
-hardwire_set_tty_state (serial_t scb, serial_ttystate ttystate)
+hardwire_set_tty_state (struct serial *scb, serial_ttystate ttystate)
{
struct hardwire_ttystate *state;
}
static int
-hardwire_noflush_set_tty_state (serial_t scb,
+hardwire_noflush_set_tty_state (struct serial *scb,
serial_ttystate new_ttystate,
serial_ttystate old_ttystate)
{
}
static void
-hardwire_print_tty_state (serial_t scb,
+hardwire_print_tty_state (struct serial *scb,
serial_ttystate ttystate,
struct ui_file *stream)
{
/* Wait for the output to drain away, as opposed to flushing (discarding) it */
static int
-hardwire_drain_output (serial_t scb)
+hardwire_drain_output (struct serial *scb)
{
#ifdef HAVE_TERMIOS
return tcdrain (scb->fd);
}
static int
-hardwire_flush_output (serial_t scb)
+hardwire_flush_output (struct serial *scb)
{
#ifdef HAVE_TERMIOS
return tcflush (scb->fd, TCOFLUSH);
}
static int
-hardwire_flush_input (serial_t scb)
+hardwire_flush_input (struct serial *scb)
{
ser_unix_flush_input (scb);
}
static int
-hardwire_send_break (serial_t scb)
+hardwire_send_break (struct serial *scb)
{
#ifdef HAVE_TERMIOS
return tcsendbreak (scb->fd, 0);
}
static void
-hardwire_raw (serial_t scb)
+hardwire_raw (struct serial *scb)
{
struct hardwire_ttystate state;
an overflowed timer is unnecessary. */
static int
-wait_for (serial_t scb, int timeout)
+wait_for (struct serial *scb, int timeout)
{
#ifdef HAVE_SGTTY
while (1)
that. */
static int
-do_hardwire_readchar (serial_t scb, int timeout)
+do_hardwire_readchar (struct serial *scb, int timeout)
{
int status, delta;
int detach = 0;
}
static int
-hardwire_readchar (serial_t scb, int timeout)
+hardwire_readchar (struct serial *scb, int timeout)
{
return generic_readchar (scb, timeout, do_hardwire_readchar);
}
}
static int
-hardwire_setbaudrate (serial_t scb, int rate)
+hardwire_setbaudrate (struct serial *scb, int rate)
{
struct hardwire_ttystate state;
int baud_code = rate_to_code (rate);
}
static int
-hardwire_setstopbits (serial_t scb, int num)
+hardwire_setstopbits (struct serial *scb, int num)
{
struct hardwire_ttystate state;
int newbit;
}
static void
-hardwire_close (serial_t scb)
+hardwire_close (struct serial *scb)
{
if (scb->fd < 0)
return;
/* Generic operations used by all UNIX/FD based serial interfaces. */
serial_ttystate
-ser_unix_nop_get_tty_state (serial_t scb)
+ser_unix_nop_get_tty_state (struct serial *scb)
{
/* allocate a dummy */
return (serial_ttystate) XMALLOC (int);
}
int
-ser_unix_nop_set_tty_state (serial_t scb, serial_ttystate ttystate)
+ser_unix_nop_set_tty_state (struct serial *scb, serial_ttystate ttystate)
{
return 0;
}
void
-ser_unix_nop_raw (serial_t scb)
+ser_unix_nop_raw (struct serial *scb)
{
return; /* Always in raw mode */
}
otherwise SERIAL_TIMEOUT or SERIAL_ERROR. */
int
-ser_unix_wait_for (serial_t scb, int timeout)
+ser_unix_wait_for (struct serial *scb, int timeout)
{
while (1)
{
dead, or -3 for any other error (see errno in that case). */
static int
-do_unix_readchar (serial_t scb, int timeout)
+do_unix_readchar (struct serial *scb, int timeout)
{
int status;
int delta;
will be called. */
static int
-generic_readchar (serial_t scb, int timeout,
- int (do_readchar) (serial_t scb, int timeout))
+generic_readchar (struct serial *scb, int timeout,
+ int (do_readchar) (struct serial *scb, int timeout))
{
int ch;
if (scb->bufcnt > 0)
}
int
-ser_unix_readchar (serial_t scb, int timeout)
+ser_unix_readchar (struct serial *scb, int timeout)
{
return generic_readchar (scb, timeout, do_unix_readchar);
}
int
-ser_unix_nop_noflush_set_tty_state (serial_t scb,
+ser_unix_nop_noflush_set_tty_state (struct serial *scb,
serial_ttystate new_ttystate,
serial_ttystate old_ttystate)
{
}
void
-ser_unix_nop_print_tty_state (serial_t scb,
+ser_unix_nop_print_tty_state (struct serial *scb,
serial_ttystate ttystate,
struct ui_file *stream)
{
}
int
-ser_unix_nop_setbaudrate (serial_t scb, int rate)
+ser_unix_nop_setbaudrate (struct serial *scb, int rate)
{
return 0; /* Never fails! */
}
int
-ser_unix_nop_setstopbits (serial_t scb, int num)
+ser_unix_nop_setstopbits (struct serial *scb, int num)
{
return 0; /* Never fails! */
}
int
-ser_unix_write (serial_t scb, const char *str, int len)
+ser_unix_write (struct serial *scb, const char *str, int len)
{
int cc;
}
int
-ser_unix_nop_flush_output (serial_t scb)
+ser_unix_nop_flush_output (struct serial *scb)
{
return 0;
}
int
-ser_unix_flush_input (serial_t scb)
+ser_unix_flush_input (struct serial *scb)
{
if (scb->bufcnt >= 0)
{
}
int
-ser_unix_nop_send_break (serial_t scb)
+ser_unix_nop_send_break (struct serial *scb)
{
return 0;
}
int
-ser_unix_nop_drain_output (serial_t scb)
+ser_unix_nop_drain_output (struct serial *scb)
{
return 0;
}
scheduled task is only changed when needed. */
static void
-reschedule (serial_t scb)
+reschedule (struct serial *scb)
{
if (SERIAL_IS_ASYNC_P (scb))
{
static void
fd_event (int error, void *context)
{
- serial_t scb = context;
+ struct serial *scb = context;
if (error != 0)
{
scb->bufcnt = SERIAL_ERROR;
static void
push_event (void *context)
{
- serial_t scb = context;
+ struct serial *scb = context;
scb->async_state = NOTHING_SCHEDULED; /* Timers are one-off */
scb->async_handler (scb, scb->async_context);
/* re-schedule */
/* Put the SERIAL device into/out-of ASYNC mode. */
void
-ser_unix_async (serial_t scb,
+ser_unix_async (struct serial *scb,
int async_p)
{
if (async_p)
/* Generic UNIX/FD functions */
-extern int ser_unix_nop_flush_output (serial_t scb);
-extern int ser_unix_flush_input (serial_t scb);
-extern int ser_unix_nop_send_break (serial_t scb);
-extern void ser_unix_nop_raw (serial_t scb);
-extern serial_ttystate ser_unix_nop_get_tty_state (serial_t scb);
-extern int ser_unix_nop_set_tty_state (serial_t scb, serial_ttystate ttystate);
-extern void ser_unix_nop_print_tty_state (serial_t scb, serial_ttystate ttystate, struct ui_file *stream);
-extern int ser_unix_nop_noflush_set_tty_state (serial_t scb, serial_ttystate new_ttystate, serial_ttystate old_ttystate);
-extern int ser_unix_nop_setbaudrate (serial_t scb, int rate);
-extern int ser_unix_nop_setstopbits (serial_t scb, int rate);
-extern int ser_unix_nop_drain_output (serial_t scb);
-
-extern int ser_unix_wait_for (serial_t scb, int timeout);
-extern int ser_unix_readchar (serial_t scb, int timeout);
-
-extern int ser_unix_write (serial_t scb, const char *str, int len);
-
-extern void ser_unix_async (serial_t scb, int async_p);
+extern int ser_unix_nop_flush_output (struct serial *scb);
+extern int ser_unix_flush_input (struct serial *scb);
+extern int ser_unix_nop_send_break (struct serial *scb);
+extern void ser_unix_nop_raw (struct serial *scb);
+extern serial_ttystate ser_unix_nop_get_tty_state (struct serial *scb);
+extern int ser_unix_nop_set_tty_state (struct serial *scb,
+ serial_ttystate ttystate);
+extern void ser_unix_nop_print_tty_state (struct serial *scb,
+ serial_ttystate ttystate,
+ struct ui_file *stream);
+extern int ser_unix_nop_noflush_set_tty_state (struct serial *scb,
+ serial_ttystate new_ttystate,
+ serial_ttystate old_ttystate);
+extern int ser_unix_nop_setbaudrate (struct serial *scb, int rate);
+extern int ser_unix_nop_setstopbits (struct serial *scb, int rate);
+extern int ser_unix_nop_drain_output (struct serial *scb);
+
+extern int ser_unix_wait_for (struct serial *scb, int timeout);
+extern int ser_unix_readchar (struct serial *scb, int timeout);
+
+extern int ser_unix_write (struct serial *scb, const char *str, int len);
+
+extern void ser_unix_async (struct serial *scb, int async_p);
#endif
/* This is the last serial stream opened. Used by connect command. */
-static serial_t last_serial_opened = NULL;
+static struct serial *last_serial_opened = NULL;
/* Pointer to list of scb's. */
-static serial_t scb_base;
+static struct serial *scb_base;
/* Non-NULL gives filename which contains a recording of the remote session,
suitable for playback by gdbserver. */
#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
\f
-
static int serial_current_type = 0;
/* Log char CH of type CHTYPE, with TIMEOUT */
/* Open up a device or a network socket, depending upon the syntax of NAME. */
-serial_t
+struct serial *
serial_open (const char *name)
{
- serial_t scb;
+ struct serial *scb;
struct serial_ops *ops;
const char *open_name = name;
return scb;
}
-serial_t
+struct serial *
serial_fdopen (const int fd)
{
- serial_t scb;
+ struct serial *scb;
struct serial_ops *ops;
for (scb = scb_base; scb; scb = scb->next)
}
static void
-do_serial_close (serial_t scb, int really_close)
+do_serial_close (struct serial *scb, int really_close)
{
- serial_t tmp_scb;
+ struct serial *tmp_scb;
last_serial_opened = NULL;
}
void
-serial_close (serial_t scb)
+serial_close (struct serial *scb)
{
do_serial_close (scb, 1);
}
void
-serial_un_fdopen (serial_t scb)
+serial_un_fdopen (struct serial *scb)
{
do_serial_close (scb, 0);
}
int
-serial_readchar (serial_t scb, int timeout)
+serial_readchar (struct serial *scb, int timeout)
{
int ch;
}
int
-serial_write (serial_t scb, const char *str, int len)
+serial_write (struct serial *scb, const char *str, int len)
{
if (serial_logfp != NULL)
{
}
void
-serial_printf (serial_t desc, const char *format,...)
+serial_printf (struct serial *desc, const char *format,...)
{
va_list args;
char *buf;
}
int
-serial_drain_output (serial_t scb)
+serial_drain_output (struct serial *scb)
{
return scb->ops->drain_output (scb);
}
int
-serial_flush_output (serial_t scb)
+serial_flush_output (struct serial *scb)
{
return scb->ops->flush_output (scb);
}
int
-serial_flush_input (serial_t scb)
+serial_flush_input (struct serial *scb)
{
return scb->ops->flush_input (scb);
}
int
-serial_send_break (serial_t scb)
+serial_send_break (struct serial *scb)
{
if (serial_logfp != NULL)
serial_logchar (serial_logfp, 'w', SERIAL_BREAK, 0);
}
void
-serial_raw (serial_t scb)
+serial_raw (struct serial *scb)
{
scb->ops->go_raw (scb);
}
serial_ttystate
-serial_get_tty_state (serial_t scb)
+serial_get_tty_state (struct serial *scb)
{
return scb->ops->get_tty_state (scb);
}
int
-serial_set_tty_state (serial_t scb, serial_ttystate ttystate)
+serial_set_tty_state (struct serial *scb, serial_ttystate ttystate)
{
return scb->ops->set_tty_state (scb, ttystate);
}
void
-serial_print_tty_state (serial_t scb,
+serial_print_tty_state (struct serial *scb,
serial_ttystate ttystate,
struct ui_file *stream)
{
}
int
-serial_noflush_set_tty_state (serial_t scb,
+serial_noflush_set_tty_state (struct serial *scb,
serial_ttystate new_ttystate,
serial_ttystate old_ttystate)
{
}
int
-serial_setbaudrate (serial_t scb, int rate)
+serial_setbaudrate (struct serial *scb, int rate)
{
return scb->ops->setbaudrate (scb, rate);
}
int
-serial_setstopbits (serial_t scb, int num)
+serial_setstopbits (struct serial *scb, int num)
{
return scb->ops->setstopbits (scb, num);
}
int
-serial_can_async_p (serial_t scb)
+serial_can_async_p (struct serial *scb)
{
return (scb->ops->async != NULL);
}
int
-serial_is_async_p (serial_t scb)
+serial_is_async_p (struct serial *scb)
{
return (scb->ops->async != NULL) && (scb->async_handler != NULL);
}
void
-serial_async (serial_t scb,
+serial_async (struct serial *scb,
serial_event_ftype *handler,
void *context)
{
}
int
-deprecated_serial_fd (serial_t scb)
+deprecated_serial_fd (struct serial *scb)
{
/* FIXME: should this output a warning that deprecated code is being
called? */
}
void
-serial_debug (serial_t scb, int debug_p)
+serial_debug (struct serial *scb, int debug_p)
{
scb->debug_p = debug_p;
}
int
-serial_debug_p (serial_t scb)
+serial_debug_p (struct serial *scb)
{
return scb->debug_p || global_serial_debug_p;
}
#if 0
-/*
- The connect command is #if 0 because I hadn't thought of an elegant
- way to wait for I/O on two serial_t's simultaneously. Two solutions
- came to mind:
+/* The connect command is #if 0 because I hadn't thought of an elegant
+ way to wait for I/O on two `struct serial *'s simultaneously. Two
+ solutions came to mind:
1) Fork, and have have one fork handle the to user direction,
and have the other hand the to target direction. This
the target side can both be waited on via the same
mechanism. This may not be true for DOS, if GDB is
talking to the target via a TCP socket.
- -grossman, 8 Jun 93
- */
+ -grossman, 8 Jun 93 */
/* Connect the user directly to the remote system. This command acts just like
the 'cu' or 'tip' command. Use <CR>~. or <CR>~^D to break out. */
-static serial_t tty_desc; /* Controlling terminal */
+static struct serial *tty_desc; /* Controlling terminal */
static void
cleanup_tty (serial_ttystate ttystate)
int c;
char cur_esc = 0;
serial_ttystate ttystate;
- serial_t port_desc; /* TTY port */
+ struct serial *port_desc; /* TTY port */
dont_repeat ();
typedef void *serial_ttystate;
struct serial;
-typedef struct serial *serial_t;
-/* Try to open NAME. Returns a new serial_t on success, NULL on
- failure. */
+/* Try to open NAME. Returns a new `struct serial *' on success, NULL
+ on failure. */
-extern serial_t serial_open (const char *name);
+extern struct serial *serial_open (const char *name);
#define SERIAL_OPEN(NAME) serial_open(NAME)
/* Open a new serial stream using a file handle. */
-extern serial_t serial_fdopen (const int fd);
+extern struct serial *serial_fdopen (const int fd);
#define SERIAL_FDOPEN(FD) serial_fdopen(FD)
-/* Push out all buffers, close the device and destroy SERIAL_T. */
+/* Push out all buffers, close the device and destroy SCB. */
-extern void serial_close (serial_t);
+extern void serial_close (struct serial *scb);
#define SERIAL_CLOSE(SERIAL_T) serial_close ((SERIAL_T))
-/* Push out all buffers and destroy SERIAL_T without closing the
- device. */
+/* Push out all buffers and destroy SCB without closing the device. */
-extern void serial_un_fdopen (serial_t scb);
+extern void serial_un_fdopen (struct serial *scb);
#define SERIAL_UN_FDOPEN(SERIAL_T) serial_un_fdopen ((SERIAL_T))
/* Read one char from the serial device with TIMEOUT seconds to wait
things like the line dropping dead. */
};
-extern int serial_readchar (serial_t scb, int timeout);
+extern int serial_readchar (struct serial *scb, int timeout);
#define SERIAL_READCHAR(SERIAL_T, TIMEOUT) serial_readchar ((SERIAL_T), (TIMEOUT))
-/* Write LEN chars from STRING to the port SERIAL_T. Returns 0 for
+/* Write LEN chars from STRING to the port SCB. Returns 0 for
success, non-zero for failure. */
-extern int serial_write (serial_t scb, const char *str, int len);
+extern int serial_write (struct serial *scb, const char *str, int len);
#define SERIAL_WRITE(SERIAL_T, STRING,LEN) serial_write (SERIAL_T, STRING, LEN)
/* Write a printf style string onto the serial port. */
-extern void serial_printf (serial_t desc, const char *,...) ATTR_FORMAT (printf, 2, 3);
+extern void serial_printf (struct serial *desc, const char *,...) ATTR_FORMAT (printf, 2, 3);
/* Allow pending output to drain. */
-extern int serial_drain_output (serial_t);
+extern int serial_drain_output (struct serial *);
#define SERIAL_DRAIN_OUTPUT(SERIAL_T) serial_drain_output ((SERIAL_T))
/* Flush (discard) pending output. Might also flush input (if this
system can't flush only output). */
-extern int serial_flush_output (serial_t);
+extern int serial_flush_output (struct serial *);
#define SERIAL_FLUSH_OUTPUT(SERIAL_T) serial_flush_output ((SERIAL_T))
/* Flush pending input. Might also flush output (if this system can't
flush only input). */
-extern int serial_flush_input (serial_t);
+extern int serial_flush_input (struct serial *);
#define SERIAL_FLUSH_INPUT(SERIAL_T) serial_flush_input ((SERIAL_T))
/* Send a break between 0.25 and 0.5 seconds long. */
-extern int serial_send_break (serial_t scb);
+extern int serial_send_break (struct serial *scb);
#define SERIAL_SEND_BREAK(SERIAL_T) serial_send_break (SERIAL_T)
/* Turn the port into raw mode. */
-extern void serial_raw (serial_t scb);
+extern void serial_raw (struct serial *scb);
#define SERIAL_RAW(SERIAL_T) serial_raw ((SERIAL_T))
/* Return a pointer to a newly malloc'd ttystate containing the state
of the tty. */
-extern serial_ttystate serial_get_tty_state (serial_t scb);
+extern serial_ttystate serial_get_tty_state (struct serial *scb);
#define SERIAL_GET_TTY_STATE(SERIAL_T) serial_get_tty_state ((SERIAL_T))
/* Set the state of the tty to TTYSTATE. The change is immediate.
Returns 0 for success, negative value for error (in which case
errno contains the error). */
-extern int serial_set_tty_state (serial_t scb, serial_ttystate ttystate);
+extern int serial_set_tty_state (struct serial *scb, serial_ttystate ttystate);
#define SERIAL_SET_TTY_STATE(SERIAL_T, TTYSTATE) serial_set_tty_state ((SERIAL_T), (TTYSTATE))
/* printf_filtered a user-comprehensible description of ttystate on
the specified STREAM. FIXME: At present this sends output to the
default stream - GDB_STDOUT. */
-extern void serial_print_tty_state (serial_t scb, serial_ttystate ttystate, struct ui_file *);
+extern void serial_print_tty_state (struct serial *scb, serial_ttystate ttystate, struct ui_file *);
#define SERIAL_PRINT_TTY_STATE(SERIAL_T, TTYSTATE, STREAM) serial_print_tty_state ((SERIAL_T), (TTYSTATE), (STREAM))
/* Set the tty state to NEW_TTYSTATE, where OLD_TTYSTATE is the
This means that we never switch in or out of raw mode, even if
NEW_TTYSTATE specifies a switch. */
-extern int serial_noflush_set_tty_state (serial_t scb, serial_ttystate new_ttystate, serial_ttystate old_ttystate);
+extern int serial_noflush_set_tty_state (struct serial *scb, serial_ttystate new_ttystate, serial_ttystate old_ttystate);
#define SERIAL_NOFLUSH_SET_TTY_STATE(SERIAL_T, NEW_TTYSTATE, OLD_TTYSTATE) \
serial_noflush_set_tty_state ((SERIAL_T), (NEW_TTYSTATE), (OLD_TTYSTATE))
/* Set the baudrate to the decimal value supplied. Returns 0 for
success, -1 for failure. */
-extern int serial_setbaudrate (serial_t scb, int rate);
+extern int serial_setbaudrate (struct serial *scb, int rate);
#define SERIAL_SETBAUDRATE(SERIAL_T, RATE) serial_setbaudrate ((SERIAL_T), (RATE))
/* Set the number of stop bits to the value specified. Returns 0 for
#define SERIAL_1_AND_A_HALF_STOPBITS 2 /* 1.5 bits, snicker... */
#define SERIAL_2_STOPBITS 3
-extern int serial_setstopbits (serial_t scb, int num);
+extern int serial_setstopbits (struct serial *scb, int num);
#define SERIAL_SETSTOPBITS(SERIAL_T, NUM) serial_setstopbits ((SERIAL_T), (NUM))
/* Asynchronous serial interface: */
/* Can the serial device support asynchronous mode? */
-extern int serial_can_async_p (serial_t scb);
+extern int serial_can_async_p (struct serial *scb);
#define SERIAL_CAN_ASYNC_P(SERIAL_T) serial_can_async_p ((SERIAL_T))
/* Has the serial device been put in asynchronous mode? */
-extern int serial_is_async_p (serial_t scb);
+extern int serial_is_async_p (struct serial *scb);
#define SERIAL_IS_ASYNC_P(SERIAL_T) serial_is_async_p ((SERIAL_T))
/* For ASYNC enabled devices, register a callback and enable
asynchronous mode. To disable asynchronous mode, register a NULL
callback. */
-typedef void (serial_event_ftype) (serial_t scb, void *context);
-extern void serial_async (serial_t scb, serial_event_ftype *handler, void *context);
+typedef void (serial_event_ftype) (struct serial *scb, void *context);
+extern void serial_async (struct serial *scb, serial_event_ftype *handler, void *context);
#define SERIAL_ASYNC(SERIAL_T, HANDLER, CONTEXT) serial_async ((SERIAL_T), (HANDLER), (CONTEXT))
/* Provide direct access to the underlying FD (if any) used to
deprecated. Will call internal_error() if the operation isn't
applicable to the current serial device. */
-extern int deprecated_serial_fd (serial_t scb);
+extern int deprecated_serial_fd (struct serial *scb);
#define DEPRECATED_SERIAL_FD(SERIAL_T) deprecated_serial_fd ((SERIAL_T))
/* Trace/debug mechanism.
SERIAL_DEBUG() enables/disables internal debugging.
SERIAL_DEBUG_P() indicates the current debug state. */
-extern void serial_debug (serial_t scb, int debug_p);
+extern void serial_debug (struct serial *scb, int debug_p);
#define SERIAL_DEBUG(SERIAL_T, DEBUG_P) serial_debug ((SERIAL_T), (DEBUG_P))
-extern int serial_debug_p (serial_t scb);
+extern int serial_debug_p (struct serial *scb);
#define SERIAL_DEBUG_P(SERIAL_T) serial_debug_p ((SERIAL_T))
still need to wait for this many
more seconds. */
char *name; /* The name of the device or host */
- struct serial *next; /* Pointer to the next serial_t */
+ struct serial *next; /* Pointer to the next `struct serial *' */
int refcnt; /* Number of pointers to this block */
int debug_p; /* Trace this serial devices operation. */
int async_state; /* Async internal state. */
{
char *name;
struct serial_ops *next;
- int (*open) (serial_t, const char *name);
- void (*close) (serial_t);
- int (*readchar) (serial_t, int timeout);
- int (*write) (serial_t, const char *str, int len);
+ int (*open) (struct serial *, const char *name);
+ void (*close) (struct serial *);
+ int (*readchar) (struct serial *, int timeout);
+ int (*write) (struct serial *, const char *str, int len);
/* Discard pending output */
- int (*flush_output) (serial_t);
+ int (*flush_output) (struct serial *);
/* Discard pending input */
- int (*flush_input) (serial_t);
- int (*send_break) (serial_t);
- void (*go_raw) (serial_t);
- serial_ttystate (*get_tty_state) (serial_t);
- int (*set_tty_state) (serial_t, serial_ttystate);
- void (*print_tty_state) (serial_t, serial_ttystate, struct ui_file *);
- int (*noflush_set_tty_state) (serial_t, serial_ttystate, serial_ttystate);
- int (*setbaudrate) (serial_t, int rate);
- int (*setstopbits) (serial_t, int num);
+ int (*flush_input) (struct serial *);
+ int (*send_break) (struct serial *);
+ void (*go_raw) (struct serial *);
+ serial_ttystate (*get_tty_state) (struct serial *);
+ int (*set_tty_state) (struct serial *, serial_ttystate);
+ void (*print_tty_state) (struct serial *, serial_ttystate,
+ struct ui_file *);
+ int (*noflush_set_tty_state) (struct serial *, serial_ttystate,
+ serial_ttystate);
+ int (*setbaudrate) (struct serial *, int rate);
+ int (*setstopbits) (struct serial *, int num);
/* Wait for output to drain */
- int (*drain_output) (serial_t);
+ int (*drain_output) (struct serial *);
/* Change the serial device into/out of asynchronous mode, call
the specified function when ever there is something
interesting. */
- void (*async) (serial_t scb, int async_p);
+ void (*async) (struct serial *scb, int async_p);
};
/* Add a new serial interface to the interface list */
#include "arch-utils.h"
#include "regcache.h"
-static serial_t parallel;
+static struct serial *parallel;
static int parallel_in_use;
static void sh3_open (char *args, int from_tty);
}
static void
-sh3_load (serial_t desc, char *file, int hashmark)
+sh3_load (struct serial *desc, char *file, int hashmark)
{
if (parallel_in_use)
{
static struct target_ops sparclite_ops;
static char *remote_target_name = NULL;
-static serial_t remote_desc = NULL;
+static struct serial *remote_desc = NULL;
static int serial_flag;
#ifdef HAVE_SOCKETS
static int udp_fd = -1;
#endif
-static serial_t open_tty (char *name);
-static int send_resp (serial_t desc, char c);
+static struct serial *open_tty (char *name);
+static int send_resp (struct serial *desc, char c);
static void close_tty (void * ignore);
#ifdef HAVE_SOCKETS
static int recv_udp_buf (int fd, unsigned char *buf, int len, int timeout);
return 0;
}
\f
-static serial_t
+static struct serial *
open_tty (char *name)
{
- serial_t desc;
+ struct serial *desc;
desc = SERIAL_OPEN (name);
if (!desc)
/* Read a single character from the remote end, masking it down to 7 bits. */
static int
-readchar (serial_t desc, int timeout)
+readchar (struct serial *desc, int timeout)
{
int ch;
char s[10];
}
static void
-debug_serial_write (serial_t desc, char *buf, int len)
+debug_serial_write (struct serial *desc, char *buf, int len)
{
char s[10];
static int
-send_resp (serial_t desc, char c)
+send_resp (struct serial *desc, char c)
{
debug_serial_write (desc, &c, 1);
return readchar (desc, remote_timeout);
}
static void
-sparclet_load (serial_t desc, char *file, int hashmark)
+sparclet_load (struct serial *desc, char *file, int hashmark)
{
bfd *abfd;
asection *s;
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-void load_srec (serial_t desc, const char *file, bfd_vma load_offset,
+void load_srec (struct serial *desc, const char *file, bfd_vma load_offset,
int maxrecsize, int flags, int hashmark,
int (*waitack) (void));
void
quit (void)
{
- serial_t gdb_stdout_serial = serial_fdopen (1);
+ struct serial *gdb_stdout_serial = serial_fdopen (1);
target_terminal_ours ();
extern struct monitor_ops w89k_cmds; /* fwd decl */
static void
-w89k_load (serial_t desc, char *file, int hashmark)
+w89k_load (struct serial *desc, char *file, int hashmark)
{
bfd *abfd;
asection *s;
static int crcflag; /* Sez we are using CRC's instead of cksums */
static int
-readchar (serial_t desc, int timeout)
+readchar (struct serial *desc, int timeout)
{
int c;
send NAK or CRC request. */
int
-xmodem_init_xfer (serial_t desc)
+xmodem_init_xfer (struct serial *desc)
{
int c;
int i;
*/
void
-xmodem_send_packet (serial_t desc, unsigned char *packet, int len, int hashmark)
+xmodem_send_packet (struct serial *desc, unsigned char *packet, int len, int hashmark)
{
int i;
int retries;
/* Finish off the transfer. Send out the EOT, and wait for an ACK. */
void
-xmodem_finish_xfer (serial_t desc)
+xmodem_finish_xfer (struct serial *desc)
{
int retries;
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-int xmodem_init_xfer (serial_t desc);
-void send_xmodem_packet (serial_t desc, unsigned char *packet, int len,
+int xmodem_init_xfer (struct serial *desc);
+void send_xmodem_packet (struct serial *desc, unsigned char *packet, int len,
int hashmark);
-void xmodem_finish_xfer (serial_t desc);
+void xmodem_finish_xfer (struct serial *desc);
#define XMODEM_DATASIZE 128 /* The data size is ALWAYS 128 */
#define XMODEM_1KDATASIZE 1024 /* Unless it's 1024!!! */