aboutsummaryrefslogtreecommitdiff
path: root/gdb/ser-go32.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1992-09-02 08:51:17 +0000
committerJohn Gilmore <gnu@cygnus>1992-09-02 08:51:17 +0000
commitb52373a2b12f6dfeda4d9b63b33458c8776c01ac (patch)
treea226394736904b7569d4ef79dede51b288a91cd8 /gdb/ser-go32.c
parente1313d24bc39a7854b88274d2a6700085d2723a4 (diff)
downloadgdb-b52373a2b12f6dfeda4d9b63b33458c8776c01ac.zip
gdb-b52373a2b12f6dfeda4d9b63b33458c8776c01ac.tar.gz
gdb-b52373a2b12f6dfeda4d9b63b33458c8776c01ac.tar.bz2
* ser-termios.c, ser-go32.c: Remove DEFUN crap, clean up.
* serial.h (EXFUN): Remove all uses, convert to PARAMS. * config/sun4os4.mh: Include ser-termios.o. FIXME, all .mh files should include a ser-XXX.o module. * dbxread.c (elfstab_build_psymtabs): Remove DEFUN crap. * defs.h, i960-pinsn.c, remote-hms.c: Replace CONST with simple const. * configure.in: Map unrecognized sun 68k's, sun sparcs, into known suns in configure.in, rather than mapping them to unique config files that happen to duplicate other config files. * config/sun3.{mh,mt}: Remove (use identical sun3os4.*). * config/sun4.{mh,mt}: Remove (use identical sun4os4.*).
Diffstat (limited to 'gdb/ser-go32.c')
-rw-r--r--gdb/ser-go32.c90
1 files changed, 51 insertions, 39 deletions
diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c
index 419f8ff..3e446aa 100644
--- a/gdb/ser-go32.c
+++ b/gdb/ser-go32.c
@@ -1,4 +1,4 @@
-/* Remote serial interface for GO32
+/* Remote serial interface for GO32, for GDB, the GNU Debugger.
Copyright 1992 Free Software Foundation, Inc.
This file is part of GDB.
@@ -17,6 +17,9 @@ 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+/* This file shows most of the obvious problems of code written for
+ the IBM PC. FIXME. -- gnu@cygnus.com, Sep92 */
+
#include "defs.h"
#include "serial.h"
@@ -57,13 +60,17 @@ static int iov;
#define com_lsr iov+5
#define com_msr iov+6
+static int fd;
+
+
#if MONO
#include <sys/pc.h>
static int mono_pos=0;
#define mono_rx 0x07
#define mono_tx 0x70
-void mono_put(char byte, char attr)
+void
+mono_put(char byte, char attr)
{
ScreenSecondary[320+mono_pos+80] = 0x0720;
ScreenSecondary[320+mono_pos] = (attr<<8) | (byte&0xff);
@@ -72,7 +79,8 @@ void mono_put(char byte, char attr)
#endif
-static char far *aptr(short p)
+static char far *
+aptr(short p)
{
#ifdef __GNUC__
return (char *)((unsigned)async - OFFSET + p);
@@ -81,7 +89,8 @@ static char far *aptr(short p)
#endif
}
-static ASYNC_STRUCT far *getivec(int which)
+static ASYNC_STRUCT far *
+getivec(int which)
{
ASYNC_STRUCT far *a;
@@ -100,7 +109,8 @@ static ASYNC_STRUCT far *getivec(int which)
return a;
}
-int dos_async_init()
+int
+dos_async_init()
{
int i;
ASYNC_STRUCT far *a1;
@@ -145,6 +155,7 @@ C> gdb \n");
return 2;
}
+void
dos_async_tx(char c)
{
dprintf("dos_async_tx: enter %x - with IOV %x", c, com_lsr);
@@ -157,12 +168,14 @@ dos_async_tx(char c)
dprintf("exit\n");
}
-int dos_async_ready()
+int
+dos_async_ready()
{
return (async->getp != async->putp);
}
-int dos_async_rx()
+int
+dos_async_rx()
{
char rv;
dprintf("dos_async_rx: enter - ");
@@ -185,12 +198,14 @@ int dos_async_rx()
return rv;
}
-int dos_kb_ready()
+int
+dos_kb_ready()
{
return (peek(0x40,0x1a) != peek(0x40,0x1c));
}
-int dos_kb_rx()
+int
+dos_kb_rx()
{
#ifdef __GNUC__
return getkey();
@@ -199,7 +214,8 @@ int dos_kb_rx()
#endif
}
-int dosasync_read(int fd, char *buffer, int length, int timeout)
+int
+dosasync_read (int fd, char *buffer, int length, int timeout)
{
long now, then;
int l = length;
@@ -226,7 +242,8 @@ int dosasync_read(int fd, char *buffer, int length, int timeout)
return length;
}
-int dosasync_write(int fd, CONST char *buffer, int length)
+int
+dosasync_write(int fd, const char *buffer, int length)
{
int l = length;
while (l--)
@@ -236,7 +253,8 @@ int dosasync_write(int fd, CONST char *buffer, int length)
-char *strlwr(char *s)
+char *
+strlwr(char *s)
{
char *p = s;
while (*s)
@@ -248,30 +266,27 @@ char *strlwr(char *s)
return p;
}
-sigsetmask() {
+sigsetmask()
+{
}
-
-
-
-static int fd;
-
-CONST char *
-DEFUN_VOID(serial_default_name)
+
+const char *
+serial_default_name ()
{
return "com1";
}
void
-DEFUN_VOID(serial_raw)
+serial_raw ()
{
-/* Always in raw mode */
+ /* Always in raw mode */
}
int
-DEFUN(serial_open,(name),
- CONST char *name)
+serial_open (name)
+ const char *name;
{
fd = dos_async_init();
if (fd) return 1;
@@ -279,12 +294,12 @@ DEFUN(serial_open,(name),
}
int
-DEFUN(serial_timedreadchar,(to, ok),
- int to AND
- int *ok)
+serial_timedreadchar (to, ok)
+ int to;
+ int *ok;
{
char buf;
- if ( dosasync_read(fd, &buf, 1, to))
+ if (dosasync_read(fd, &buf, 1, to))
{
*ok = 1;
}
@@ -296,31 +311,28 @@ DEFUN(serial_timedreadchar,(to, ok),
}
int
-DEFUN(serial_setbaudrate,(rate),
- int rate)
+serial_setbaudrate (rate)
+ int rate;
{
return 0;
}
int
-DEFUN(serial_nextbaudrate,(rate),
- int rate)
+serial_nextbaudrate (rate)
+ int rate;
{
return 0;
}
int
-DEFUN(serial_write,(str, len),
- CONST char *str AND
- int len)
+serial_write (str, len)
+ const char *str;
+ int len;
{
dosasync_write(fd, str, len);
}
int
-DEFUN_VOID(serial_close)
+serial_close ()
{
-
-
}
-