aboutsummaryrefslogtreecommitdiff
path: root/gdb/ser-go32.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1995-03-07 09:03:37 +0000
committerStu Grossman <grossman@cygnus>1995-03-07 09:03:37 +0000
commit85c8b135fe413021e644dbd69a56ae7abe455f2e (patch)
treef034a40857e4f3eff1176ea6664b8967e6674051 /gdb/ser-go32.c
parent7baea9460866303161d1598eddb93a936973ef1d (diff)
downloadgdb-85c8b135fe413021e644dbd69a56ae7abe455f2e.zip
gdb-85c8b135fe413021e644dbd69a56ae7abe455f2e.tar.gz
gdb-85c8b135fe413021e644dbd69a56ae7abe455f2e.tar.bz2
* serial.h ser-go32.c ser-go32-para.c ser-mac.c ser-tcp.c
ser-unix.c: Add SERIAL_SETSTOPBITS to set the number of stopbits (needed for IDP board?!?!?).
Diffstat (limited to 'gdb/ser-go32.c')
-rw-r--r--gdb/ser-go32.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c
index b4a7591..775ef70 100644
--- a/gdb/ser-go32.c
+++ b/gdb/ser-go32.c
@@ -719,6 +719,7 @@ dos_setbaudrate (scb, rate)
if (port->baudrate != rate)
{
int x;
+ unsigned char cfcr;
x = dos_baudconv (rate);
if (x <= 0)
@@ -729,10 +730,12 @@ dos_setbaudrate (scb, rate)
}
disable ();
+ cfcr = inb (port, com_cfcr);
+
outb(port, com_cfcr, CFCR_DLAB);
outb(port, com_dlbl, x & 0xff);
outb(port, com_dlbh, x >> 8);
- outb(port, com_cfcr, CFCR_8BITS);
+ outb(port, com_cfcr, cfcr);
port->baudrate = rate;
enable ();
}
@@ -740,6 +743,34 @@ dos_setbaudrate (scb, rate)
return 0;
}
+static int
+dos_setstopbits (scb, num)
+ serial_t scb;
+ int num;
+{
+ struct dos_ttystate *port = &ports[scb->fd];
+ unsigned char cfcr;
+
+ disable ();
+ cfcr = inb (port, com_cfcr);
+
+ switch (num)
+ {
+ case SERIAL_1_STOPBITS:
+ outb (port, com_cfcr, cfcr & ~CFCR_STOPB);
+ break;
+ case SERIAL_1_AND_A_HALF_STOPBITS:
+ case SERIAL_2_STOPBITS:
+ outb (port, com_cfcr, cfcr | CFCR_STOPB);
+ break;
+ default:
+ enable ();
+ return 1;
+ }
+ enable ();
+
+ return 0;
+}
static int
dos_write (scb, str, len)
@@ -816,6 +847,7 @@ static struct serial_ops dos_ops =
dos_print_tty_state,
dos_noflush_set_tty_state,
dos_setbaudrate,
+ dos_setstopbits,
};