projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2004-02-07 Elena Zannoni <ezannoni@redhat.com>
[deliverable/binutils-gdb.git]
/
gdb
/
xmodem.c
diff --git
a/gdb/xmodem.c
b/gdb/xmodem.c
index 8257ea806bff84d1d2c862b79ce157c88455e78e..7b8d77d105521673543c5779f98fc256b4199933 100644
(file)
--- a/
gdb/xmodem.c
+++ b/
gdb/xmodem.c
@@
-1,5
+1,5
@@
/* XMODEM support for GDB, the GNU debugger.
/* XMODEM support for GDB, the GNU debugger.
- Copyright 1995 Free Software Foundation, Inc.
+ Copyright 1995
, 2000, 2001
Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
@@
-36,13
+36,11
@@
static int blknum; /* XMODEM block number */
static int crcflag; /* Sez we are using CRC's instead of cksums */
static int
static int crcflag; /* Sez we are using CRC's instead of cksums */
static int
-readchar (desc, timeout)
- serial_t desc;
- int timeout;
+readchar (struct serial *desc, int timeout)
{
int c;
{
int c;
- c =
SERIAL_READCHAR
(desc, timeout);
+ c =
serial_readchar
(desc, timeout);
if (remote_debug > 0)
fputc_unfiltered (c, gdb_stdlog);
if (remote_debug > 0)
fputc_unfiltered (c, gdb_stdlog);
@@
-63,7
+61,7
@@
static unsigned short *crctab;
/* Call this to init the fast CRC-16 calculation table. */
static void
/* Call this to init the fast CRC-16 calculation table. */
static void
-crcinit ()
+crcinit (
void
)
{
static int crctab_inited = 0;
int val;
{
static int crctab_inited = 0;
int val;
@@
-97,9
+95,7
@@
crcinit ()
/* Calculate a CRC-16 for the LEN byte message pointed at by P. */
static unsigned short
/* Calculate a CRC-16 for the LEN byte message pointed at by P. */
static unsigned short
-docrc (p, len)
- unsigned char *p;
- int len;
+docrc (unsigned char *p, int len)
{
unsigned short crc = 0;
{
unsigned short crc = 0;
@@
-113,8
+109,7
@@
docrc (p, len)
send NAK or CRC request. */
int
send NAK or CRC request. */
int
-xmodem_init_xfer (desc)
- serial_t desc;
+xmodem_init_xfer (struct serial *desc)
{
int c;
int i;
{
int c;
int i;
@@
-165,11
+160,7
@@
xmodem_init_xfer (desc)
*/
void
*/
void
-xmodem_send_packet (desc, packet, len, hashmark)
- 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;
{
int i;
int retries;
@@
-194,7
+185,7
@@
xmodem_send_packet (desc, packet, len, hashmark)
datasize = XMODEM_1KDATASIZE;
}
else
datasize = XMODEM_1KDATASIZE;
}
else
-
abort (
); /* Packet way too large */
+
internal_error (__FILE__, __LINE__, "failed internal consistency check"
); /* Packet way too large */
/* Add ^Z padding if packet < 128 (or 1024) bytes */
/* Add ^Z padding if packet < 128 (or 1024) bytes */
@@
-226,7
+217,7
@@
xmodem_send_packet (desc, packet, len, hashmark)
{
int c;
{
int c;
-
SERIAL_WRITE
(desc, packet, pktlen);
+
serial_write
(desc, packet, pktlen);
c = readchar (desc, 3);
switch (c)
c = readchar (desc, 3);
switch (c)
@@
-247,7
+238,7
@@
xmodem_send_packet (desc, packet, len, hashmark)
}
}
}
}
-
SERIAL_WRITE
(desc, "\004", 1); /* Send an EOT */
+
serial_write
(desc, "\004", 1); /* Send an EOT */
error ("xmodem_send_packet: Excessive retries.");
}
error ("xmodem_send_packet: Excessive retries.");
}
@@
-255,8
+246,7
@@
xmodem_send_packet (desc, packet, len, hashmark)
/* Finish off the transfer. Send out the EOT, and wait for an ACK. */
void
/* Finish off the transfer. Send out the EOT, and wait for an ACK. */
void
-xmodem_finish_xfer (desc)
- serial_t desc;
+xmodem_finish_xfer (struct serial *desc)
{
int retries;
{
int retries;
@@
-264,7
+254,7
@@
xmodem_finish_xfer (desc)
{
int c;
{
int c;
-
SERIAL_WRITE
(desc, "\004", 1); /* Send an EOT */
+
serial_write
(desc, "\004", 1); /* Send an EOT */
c = readchar (desc, 3);
switch (c)
c = readchar (desc, 3);
switch (c)
This page took
0.026223 seconds
and
4
git commands to generate.