summaryrefslogtreecommitdiff
path: root/gdb/serial.h
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2005-04-21 05:34:33 +0000
committerMark Mitchell <mark@codesourcery.com>2005-04-21 05:34:33 +0000
commitf24c5ad99442811b10baa02db0193cb093fa1596 (patch)
tree2be2cd653c0b267b23e3a95f42600b21e335794c /gdb/serial.h
parent3ddf4d2a110e8d1969da8f9aa45b63b080380f49 (diff)
downloadgdb-f24c5ad99442811b10baa02db0193cb093fa1596.tar.gz
* configure.ac: On MinGW, define USE_WIN32API and link with
-lws2_32. * ser-tcp.c (<winsock2.h>): Include, for Windows. (ETIMEDOUT): Define, for Windows. (ioctl): Likewise. (closesocket): Define, for POSIX. (net_open): Adjust for differences in socket functions between Windows and UNIX. (net_close): Likweise. (net_read_prim): New function. (net_write_prim): Likewise. (_initialize_ser_tcp): Initialize winsock. Fill in read_prim and write_prim. * ser-unix.h (ser_unix_readcchar): Remove. (ser_unix_read_prim): Declare. (ser_unix_write_prim): Likewise. * ser-unix.c (generic_readchar): Move to ser-base.c. (ser_unix_wait_for): Likewise. (do_unix_readchar): Likewise. (ser_unix_readchar): Likewise. (_initialize_ser_hardwire): Initialize read_prim and write_prim. (ser_unix_read_prim): New function. (ser_unix_write_prim): Likewise. * ser-base.h (generic_readchar): Declare. (ser_base_readchar): Likewise. * ser-base.c (<winsock2.h>): Include, for windows. (fd_event): Use the read primitive specified by the serial interface. (ser_base_wait_for): Moved from ser-unix.c (do_ser_base_read_char): Likewise. (generic_readchar): Likewise. (ser_base_readchar): Likewise. (ser_base_write): Use the write primitive specified by the serial interface. * ser-pipe.c (_initialize_ser_pipe): Use ser_base_readchar, not ser_unix_readchar. Initialize read_prim and write_prim. * serial.c (struct serial_ops): Add read_prim and write_prim. * configure: Regenerate.
Diffstat (limited to 'gdb/serial.h')
-rw-r--r--gdb/serial.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/serial.h b/gdb/serial.h
index d83b2011448..89b66b452cf 100644
--- a/gdb/serial.h
+++ b/gdb/serial.h
@@ -232,6 +232,12 @@ struct serial_ops
the specified function when ever there is something
interesting. */
void (*async) (struct serial *scb, int async_p);
+ /* Perform a low-level read operation, reading (at most) COUNT
+ bytes into SCB->BUF. */
+ int (*read_prim)(struct serial *scb, size_t count);
+ /* Perform a low-level write operation, writing (at most) COUNT
+ bytes from BUF. */
+ int (*write_prim)(struct serial *scb, const void *buf, size_t count);
};
/* Add a new serial interface to the interface list */