diff options
author | joerg <joerg@FreeBSD.org> | 1997-03-06 22:34:24 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1997-03-06 22:34:24 +0000 |
commit | 70864abe498fed77a9760b6cbd5a7aad13d14ccd (patch) | |
tree | 93c06f535ef17c023e8ae9f2dea053b1a9bc6905 /sys/i386/isa/pcvt/pcvt_drv.c | |
parent | 14893dc54adf8220f897480d08384e372762301c (diff) | |
download | FreeBSD-src-70864abe498fed77a9760b6cbd5a7aad13d14ccd.zip FreeBSD-src-70864abe498fed77a9760b6cbd5a7aad13d14ccd.tar.gz |
Move pcvt towards using kbdio (finally!).
Warning: this won't work yet with PCVT_SCANSET=2 along in early
console mode (boot -c, or boot -d).
A big thanks to Kazutaka, and a word of apologies for delaying the
review for that long time...
Submitted by: yokota@zodiac.mech.utsunomiya-u.ac.jp (Kazutaka YOKOTA)
Diffstat (limited to 'sys/i386/isa/pcvt/pcvt_drv.c')
-rw-r--r-- | sys/i386/isa/pcvt/pcvt_drv.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c index 3b216f0..13d6ede 100644 --- a/sys/i386/isa/pcvt/pcvt_drv.c +++ b/sys/i386/isa/pcvt/pcvt_drv.c @@ -143,6 +143,11 @@ pcprobe(struct isa_device *dev) #endif /* PCVT_NETBSD > 9 */ #endif /* PCVT_NETBSD > 100 */ { +#ifdef _I386_ISA_KBDIO_H_ + kbdc = kbdc_open(IO_KBD); + reset_keyboard = 1; /* it's now safe to do kbd reset */ +#endif /* _I386_ISA_KBDIO_H_ */ + kbd_code_init(); #if PCVT_NETBSD > 9 @@ -829,6 +834,10 @@ pcrint(int unit) int s; # endif +# ifdef _I386_ISA_KBDIO_H_ + int c; +# endif + #else /* !PCVT_KBD_FIFO */ u_char *cp; #endif /* PCVT_KBD_FIFO */ @@ -844,6 +853,7 @@ pcrint(int unit) return; } +# ifndef _I386_ISA_KBDIO_H_ while (inb(CONTROLLER_CTRL) & STATUS_OUTPBF) /* check 8042 buffer */ { ret = 1; /* got something */ @@ -851,6 +861,12 @@ pcrint(int unit) PCVT_KBD_DELAY(); /* 7 us delay */ dt = inb(CONTROLLER_DATA); /* get it 8042 data */ +# else + while ((c = read_kbd_data_no_wait(kbdc)) != -1) + { + ret = 1; /* got something */ + dt = c; +# endif /* _I386_ISA_KBDIO_H_ */ if (pcvt_kbd_count >= PCVT_KBD_FIFO_SZ) /* fifo overflow ? */ { @@ -1069,6 +1085,15 @@ pccnprobe(struct consdev *cp) { struct isa_device *dvp; +#ifdef _I386_ISA_KBDIO_H_ + kbdc = kbdc_open(IO_KBD); + /* + * Don't reset the keyboard via `kbdio' just yet. + * The system clock has not been calibrated... + */ + reset_keyboard = 0; +#endif /* _I386_ISA_KBDIO_H_ */ + /* * Take control if we are the highest priority enabled display device. */ @@ -1437,6 +1462,8 @@ pcvt_xmode_set(int on, struct proc *p) vsp->Crtat = vsp->Memory; /* operate in memory now */ +#ifndef _I386_ISA_KBDIO_H_ + #if PCVT_SCANSET == 2 /* put keyboard to return ancient PC scan codes */ kbc_8042cmd(CONTR_WRITE); @@ -1449,6 +1476,16 @@ pcvt_xmode_set(int on, struct proc *p) #endif /* PCVT_USEKBDSEC */ #endif /* PCVT_SCANSET == 2 */ +#else /* _I386_ISA_KBDIO_H_ */ + +#if PCVT_SCANSET == 2 + /* put keyboard to return ancient PC scan codes */ + set_controller_command_byte(kbdc, + KBD_TRANSLATION, KBD_TRANSLATION); +#endif /* PCVT_SCANSET == 2 */ + +#endif /* !_I386_ISA_KBDIO_H_ */ + #if PCVT_NETBSD > 9 fp->tf_eflags |= PSL_IOPL; #else @@ -1484,6 +1521,8 @@ pcvt_xmode_set(int on, struct proc *p) pcvt_set_scrnsv_tmo(saved_scrnsv_tmo); #endif /* PCVT_SCREENSAVER */ +#ifndef _I386_ISA_KBDIO_H_ + #if PCVT_SCANSET == 2 kbc_8042cmd(CONTR_WRITE); #if PCVT_USEKBDSEC /* security enabled */ @@ -1495,6 +1534,14 @@ pcvt_xmode_set(int on, struct proc *p) #endif /* PCVT_USEKBDSEC */ #endif /* PCVT_SCANSET == 2 */ +#else /* _I386_ISA_KBDIO_H_ */ + +#if PCVT_SCANSET == 2 + set_controller_command_byte(kbdc, KBD_TRANSLATION, 0); +#endif /* PCVT_SCANSET == 2 */ + +#endif /* !_I386_ISA_KBDIO_H_ */ + if(adaptor_type == MDA_ADAPTOR) { /* |