adapt to changed <dev/ic/i8042reg.h>

This commit is contained in:
drochner 1998-01-18 14:45:10 +00:00
parent 2562f77567
commit 32d94859ea
4 changed files with 45 additions and 53 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pckbd.c,v 1.21 1998/01/12 10:21:08 thorpej Exp $ */
/* $NetBSD: pckbd.c,v 1.22 1998/01/18 14:51:29 drochner Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995 Charles Hannum. All rights reserved.
@ -45,7 +45,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: pckbd.c,v 1.21 1998/01/12 10:21:08 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: pckbd.c,v 1.22 1998/01/18 14:51:29 drochner Exp $");
#include <sys/param.h>
#include <sys/ioctl.h>
@ -70,15 +70,7 @@ __KERNEL_RCSID(0, "$NetBSD: pckbd.c,v 1.21 1998/01/12 10:21:08 thorpej Exp $");
#include <alpha/wscons/wsconsvar.h>
#include "wscons.h"
#undef KBDATAP
#undef KBOUTP
#undef KBSTATP
#undef KBCMDP
#undef PITAUX_PORT
#define KBDATAP 0x0 /* kbd data port (I) */
#define KBOUTP 0x0 /* kbd data port (O) */
#define KBSTATP 0x4 /* kbd controller status port (I) */
#define KBCMDP 0x4 /* kbd controller port (O) */
#define PITAUX_PORT 0x1 /* port B of PPI */
static volatile u_char ack, nak; /* Don't ask. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: pccons.c,v 1.4 1998/01/12 18:18:08 thorpej Exp $ */
/* $NetBSD: pccons.c,v 1.5 1998/01/18 14:50:11 drochner Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995 Charles Hannum. All rights reserved.
@ -195,7 +195,7 @@ kbd_wait_output()
u_int i;
for (i = 100000; i; i--)
if ((isa_inb(KBSTATP) & KBS_IBF) == 0) {
if ((isa_inb(IO_KBD + KBSTATP) & KBS_IBF) == 0) {
KBD_DELAY;
return 1;
}
@ -208,7 +208,7 @@ kbd_wait_input()
u_int i;
for (i = 100000; i; i--)
if ((isa_inb(KBSTATP) & KBS_DIB) != 0) {
if ((isa_inb(IO_KBD + KBSTATP) & KBS_DIB) != 0) {
KBD_DELAY;
return 1;
}
@ -221,10 +221,10 @@ kbd_flush_input()
u_int i;
for (i = 10; i; i--) {
if ((isa_inb(KBSTATP) & KBS_DIB) == 0)
if ((isa_inb(IO_KBD + KBSTATP) & KBS_DIB) == 0)
return;
KBD_DELAY;
(void) isa_inb(KBDATAP);
(void) isa_inb(IO_KBD + KBDATAP);
}
}
@ -238,10 +238,10 @@ kbc_get8042cmd()
if (!kbd_wait_output())
return -1;
isa_outb(KBCMDP, K_RDCMDBYTE);
isa_outb(IO_KBD + KBCMDP, K_RDCMDBYTE);
if (!kbd_wait_input())
return -1;
return isa_inb(KBDATAP);
return isa_inb(IO_KBD + KBDATAP);
}
#endif
@ -255,10 +255,10 @@ kbc_put8042cmd(val)
if (!kbd_wait_output())
return 0;
isa_outb(KBCMDP, K_LDCMDBYTE);
isa_outb(IO_KBD + KBCMDP, K_LDCMDBYTE);
if (!kbd_wait_output())
return 0;
isa_outb(KBOUTP, val);
isa_outb(IO_KBD + KBOUTP, val);
return 1;
}
@ -277,14 +277,14 @@ kbd_cmd(val, polling)
if (!kbd_wait_output())
return 0;
ack = nak = 0;
isa_outb(KBOUTP, val);
isa_outb(IO_KBD + KBOUTP, val);
if (polling)
for (i = 100000; i; i--) {
if (isa_inb(KBSTATP) & KBS_DIB) {
if (isa_inb(IO_KBD + KBSTATP) & KBS_DIB) {
register u_char c;
KBD_DELAY;
c = isa_inb(KBDATAP);
c = isa_inb(IO_KBD + KBDATAP);
if (c == KBR_ACK || c == KBR_ECHO) {
ack = 1;
return 1;
@ -300,7 +300,7 @@ kbd_cmd(val, polling)
}
else
for (i = 100000; i; i--) {
(void) isa_inb(KBSTATP);
(void) isa_inb(IO_KBD + KBSTATP);
if (ack)
return 1;
if (nak)
@ -438,11 +438,11 @@ pcprobe(parent, match, aux)
goto lose;
}
for (i = 600000; i; i--)
if ((isa_inb(KBSTATP) & KBS_DIB) != 0) {
if ((isa_inb(IO_KBD + KBSTATP) & KBS_DIB) != 0) {
KBD_DELAY;
break;
}
if (i == 0 || isa_inb(KBDATAP) != KBR_RSTDONE) {
if (i == 0 || isa_inb(IO_KBD + KBDATAP) != KBR_RSTDONE) {
printf("pcprobe: reset error %d\n", 2);
goto lose;
}
@ -626,7 +626,7 @@ pcintr(arg)
register struct tty *tp = sc->sc_tty;
u_char *cp;
if ((isa_inb(KBSTATP) & KBS_DIB) == 0)
if ((isa_inb(IO_KBD + KBSTATP) & KBS_DIB) == 0)
return 0;
if (polling)
return 1;
@ -638,7 +638,7 @@ pcintr(arg)
do
(*linesw[tp->t_line].l_rint)(*cp++, tp);
while (*cp);
} while (isa_inb(KBSTATP) & KBS_DIB);
} while (isa_inb(IO_KBD + KBSTATP) & KBS_DIB);
return 1;
}
@ -810,7 +810,7 @@ pccngetc(dev)
do {
/* wait for byte */
while ((isa_inb(KBSTATP) & KBS_DIB) == 0);
while ((isa_inb(IO_KBD + KBSTATP) & KBS_DIB) == 0);
/* see if it's worthwhile */
cp = sget();
} while (!cp);
@ -1469,7 +1469,7 @@ sget()
top:
KBD_DELAY;
dt = isa_inb(KBDATAP);
dt = isa_inb(IO_KBD + KBDATAP);
switch (dt) {
case KBR_ACK:
@ -1666,7 +1666,7 @@ top:
extended = 0;
loop:
if ((isa_inb(KBSTATP) & KBS_DIB) == 0)
if ((isa_inb(IO_KBD + KBSTATP) & KBS_DIB) == 0)
return 0;
goto top;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.272 1998/01/15 22:25:57 thorpej Exp $ */
/* $NetBSD: machdep.c,v 1.273 1998/01/18 14:48:55 drochner Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -1943,9 +1943,9 @@ cpu_reset()
* connected to the RESET pin on the CPU in many PCs. We tell the
* keyboard controller to pulse this line a couple of times.
*/
outb(KBCMDP, KBC_PULSE0);
outb(IO_KBD + KBCMDP, KBC_PULSE0);
delay(100000);
outb(KBCMDP, KBC_PULSE0);
outb(IO_KBD + KBCMDP, KBC_PULSE0);
delay(100000);
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: pccons.c,v 1.118 1998/01/12 18:59:16 thorpej Exp $ */
/* $NetBSD: pccons.c,v 1.119 1998/01/18 14:45:10 drochner Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995 Charles Hannum. All rights reserved.
@ -211,7 +211,7 @@ kbd_wait_output()
u_int i;
for (i = 100000; i; i--)
if ((inb(KBSTATP) & KBS_IBF) == 0) {
if ((inb(IO_KBD + KBSTATP) & KBS_IBF) == 0) {
KBD_DELAY;
return (1);
}
@ -224,7 +224,7 @@ kbd_wait_input()
u_int i;
for (i = 100000; i; i--)
if ((inb(KBSTATP) & KBS_DIB) != 0) {
if ((inb(IO_KBD + KBSTATP) & KBS_DIB) != 0) {
KBD_DELAY;
return (1);
}
@ -237,10 +237,10 @@ kbd_flush_input()
u_int i;
for (i = 10; i; i--) {
if ((inb(KBSTATP) & KBS_DIB) == 0)
if ((inb(IO_KBD + KBSTATP) & KBS_DIB) == 0)
return;
KBD_DELAY;
(void) inb(KBDATAP);
(void) inb(IO_KBD + KBDATAP);
}
}
@ -254,10 +254,10 @@ kbc_get8042cmd()
if (!kbd_wait_output())
return (-1);
outb(KBCMDP, K_RDCMDBYTE);
outb(IO_KBD + KBCMDP, K_RDCMDBYTE);
if (!kbd_wait_input())
return (-1);
return (inb(KBDATAP));
return (inb(IO_KBD + KBDATAP));
}
#endif
@ -271,10 +271,10 @@ kbc_put8042cmd(val)
if (!kbd_wait_output())
return (0);
outb(KBCMDP, K_LDCMDBYTE);
outb(IO_KBD + KBCMDP, K_LDCMDBYTE);
if (!kbd_wait_output())
return (0);
outb(KBOUTP, val);
outb(IO_KBD + KBOUTP, val);
return (1);
}
@ -293,14 +293,14 @@ kbd_cmd(val, polling)
if (!kbd_wait_output())
return (0);
ack = nak = 0;
outb(KBOUTP, val);
outb(IO_KBD + KBOUTP, val);
if (polling)
for (i = 100000; i; i--) {
if (inb(KBSTATP) & KBS_DIB) {
if (inb(IO_KBD + KBSTATP) & KBS_DIB) {
register u_char c;
KBD_DELAY;
c = inb(KBDATAP);
c = inb(IO_KBD + KBDATAP);
if (c == KBR_ACK || c == KBR_ECHO) {
ack = 1;
return (1);
@ -316,7 +316,7 @@ kbd_cmd(val, polling)
}
else
for (i = 100000; i; i--) {
(void) inb(KBSTATP);
(void) inb(IO_KBD + KBSTATP);
if (ack)
return (1);
if (nak)
@ -454,11 +454,11 @@ pcprobe(parent, match, aux)
goto lose;
}
for (i = 600000; i; i--)
if ((inb(KBSTATP) & KBS_DIB) != 0) {
if ((inb(IO_KBD + KBSTATP) & KBS_DIB) != 0) {
KBD_DELAY;
break;
}
if (i == 0 || inb(KBDATAP) != KBR_RSTDONE) {
if (i == 0 || inb(IO_KBD + KBDATAP) != KBR_RSTDONE) {
printf("pcprobe: reset error %d\n", 2);
goto lose;
}
@ -661,7 +661,7 @@ pcintr(arg)
register struct tty *tp = sc->sc_tty;
u_char *cp;
if ((inb(KBSTATP) & KBS_DIB) == 0)
if ((inb(IO_KBD + KBSTATP) & KBS_DIB) == 0)
return (0);
if (polling)
return (1);
@ -673,7 +673,7 @@ pcintr(arg)
do
(*linesw[tp->t_line].l_rint)(*cp++, tp);
while (*cp);
} while (inb(KBSTATP) & KBS_DIB);
} while (inb(IO_KBD + KBSTATP) & KBS_DIB);
return (1);
}
@ -840,7 +840,7 @@ pccngetc(dev)
do {
/* wait for byte */
while ((inb(KBSTATP) & KBS_DIB) == 0);
while ((inb(IO_KBD + KBSTATP) & KBS_DIB) == 0);
/* see if it's worthwhile */
cp = sget();
} while (!cp);
@ -2087,7 +2087,7 @@ sget()
top:
KBD_DELAY;
dt = inb(KBDATAP);
dt = inb(IO_KBD + KBDATAP);
switch (dt) {
case KBR_ACK:
@ -2309,7 +2309,7 @@ top:
extended = 0;
loop:
if ((inb(KBSTATP) & KBS_DIB) == 0)
if ((inb(IO_KBD + KBSTATP) & KBS_DIB) == 0)
return (0);
goto top;
}