aboutsummaryrefslogtreecommitdiff
path: root/sys/pc98/cbus/sio.c
diff options
context:
space:
mode:
authorYoshihiro Takahashi <nyan@FreeBSD.org>2002-06-19 13:20:20 +0000
committerYoshihiro Takahashi <nyan@FreeBSD.org>2002-06-19 13:20:20 +0000
commit5463ee36b6e4e557fb0ba8aadea1838d4119b976 (patch)
treea6892d5ba179f097fbbaee67fca83395eaf2c94f /sys/pc98/cbus/sio.c
parent2240ad94a5e1394cc3c598ec55d6b604e729874a (diff)
downloadsrc-5463ee36b6e4e557fb0ba8aadea1838d4119b976.tar.gz
src-5463ee36b6e4e557fb0ba8aadea1838d4119b976.zip
Backout previous change and merge from sys/dev/sio/sio.c revision 1.375.
Notes
Notes: svn path=/head/; revision=98431
Diffstat (limited to 'sys/pc98/cbus/sio.c')
-rw-r--r--sys/pc98/cbus/sio.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c
index 85b073ce3f8a..1f3e8f301e29 100644
--- a/sys/pc98/cbus/sio.c
+++ b/sys/pc98/cbus/sio.c
@@ -435,9 +435,7 @@ SYSCTL_UINT(_machdep, OID_AUTO, gdbspeed, CTLFLAG_RW,
&gdbdefaultrate, GDBSPEED, "");
static u_int com_events; /* input chars + weighted output completions */
static Port_t siocniobase;
-#ifndef __alpha__
-static int siocnunit;
-#endif
+static int siocnunit = -1;
static Port_t siogdbiobase;
static int siogdbunit = -1;
static void *sio_slow_ih;
@@ -4416,6 +4414,7 @@ siocnputc(dev, c)
int s;
struct siocnstate sp;
Port_t iobase;
+ speed_t speed;
if (minor(dev) == siocnunit) {
iobase = siocniobase;
@@ -4445,12 +4444,20 @@ siogdbgetc()
{
int c;
Port_t iobase;
+ speed_t speed;
int s;
struct siocnstate sp;
- iobase = siogdbiobase;
+ if (minor(dev) == siocnunit) {
+ iobase = siocniobase;
+ speed = comdefaultrate;
+ } else {
+ iobase = siogdbiobase;
+ speed = gdbdefaultrate;
+ }
+
s = spltty();
- siocnopen(&sp, iobase, gdbdefaultrate);
+ siocnopen(&sp, iobase, speed);
while (!(inb(iobase + com_lsr) & LSR_RXRDY))
;
c = inb(iobase + com_data);
@@ -4463,11 +4470,21 @@ void
siogdbputc(c)
int c;
{
+ Port_t iobase;
+ speed_t speed;
int s;
struct siocnstate sp;
+ if (minor(dev) == siocnunit) {
+ iobase = siocniobase;
+ speed = comdefaultrate;
+ } else {
+ iobase = siogdbiobase;
+ speed = gdbdefaultrate;
+ }
+
s = spltty();
- siocnopen(&sp, siogdbiobase, gdbdefaultrate);
+ siocnopen(&sp, iobase, speed);
siocntxwait(siogdbiobase);
outb(siogdbiobase + com_data, c);
siocnclose(&sp, siogdbiobase);