Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Jan 1997 15:48:56 -0800
From:      Paul Traina <root@red.jnx.com>
To:        bde@freebsd.org
Cc:        hackers@freebsd.org
Subject:   do you mind if I apply this to 2.2 and 3.0?
Message-ID:  <199701162348.PAA01609@red.jnx.com>

next in thread | raw e-mail | index | archive | help
It turns out that when doing remote gdb, the damn console baud rate switching
code is pretty throughougly broken (yes, it's supposed to change the divisor,
no it doesn't do it right...)

I think the real culprit is that the siocnopen() code is incorrect.
I think that code should always poke both divisor bytes any time either
byte differs,  but who really understands all the sio bugs out there.

This patch definitely fixes remote gdb on devices != 115k and doesn't hurt
anything else (and it gets rid of more stupid magic numbers).

Paul

Index: sio.c
===================================================================
RCS file: /vol/cvs-freebsd/src/sys/i386/isa/sio.c,v
retrieving revision 1.147.2.5
diff -u -r1.147.2.5 sio.c
--- sio.c	1996/12/23 19:59:08	1.147.2.5
+++ sio.c	1997/01/16 23:44:08
@@ -571,10 +571,10 @@
 	 * We don't want to to wait long enough to drain at 2 bps.
 	 */
 	outb(iobase + com_cfcr, CFCR_DLAB | CFCR_8BITS);
-	outb(iobase + com_dlbl, COMBRD(9600) & 0xff);
-	outb(iobase + com_dlbh, (u_int) COMBRD(9600) >> 8);
+	outb(iobase + com_dlbl, COMBRD(CONSPEED) & 0xff);
+	outb(iobase + com_dlbh, (u_int) COMBRD(CONSPEED) >> 8);
 	outb(iobase + com_cfcr, CFCR_8BITS);
-	DELAY((16 + 1) * 1000000 / (9600 / 10));
+	DELAY((16 + 1) * 1000000 / (CONSPEED / 10));
 
 	/*
 	 * Enable the interrupt gate and disable device interupts.  This
@@ -609,7 +609,7 @@
 	 * it's unlikely to do more than allow the null byte out.
 	 */
 	outb(iobase + com_data, 0);
-	DELAY((1 + 2) * 1000000 / (9600 / 10));
+	DELAY((1 + 2) * 1000000 / (CONSPEED / 10));
 
 	/*
 	 * Turn off loopback mode so that the interrupt gate works again



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701162348.PAA01609>