summaryrefslogtreecommitdiff
path: root/sys/arch/i386/isa
diff options
context:
space:
mode:
authorAaron Campbell <aaron@cvs.openbsd.org>2000-10-16 02:25:23 +0000
committerAaron Campbell <aaron@cvs.openbsd.org>2000-10-16 02:25:23 +0000
commitc2496a10353156e6e4e5ef9bfcef2c6cdb2e1e61 (patch)
tree241cddf885bbed09b5123a39a098ca5c5414a2c8 /sys/arch/i386/isa
parentf8bfad23033f826b345f8aa3fc8e6e8aa1155a5e (diff)
Restore conversion to new timeouts (art@'s previous commit). They were
whacked by the initial commit for console mouse support. jbm must have been working with an older revision of PCVT (argh, sorry, should have noticed this long ago).
Diffstat (limited to 'sys/arch/i386/isa')
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_drv.c34
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_kbd.c14
2 files changed, 20 insertions, 28 deletions
diff --git a/sys/arch/i386/isa/pcvt/pcvt_drv.c b/sys/arch/i386/isa/pcvt/pcvt_drv.c
index d5bf32eb623..728da89bb66 100644
--- a/sys/arch/i386/isa/pcvt/pcvt_drv.c
+++ b/sys/arch/i386/isa/pcvt/pcvt_drv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcvt_drv.c,v 1.35 2000/10/07 03:12:45 aaron Exp $ */
+/* $OpenBSD: pcvt_drv.c,v 1.36 2000/10/16 02:25:21 aaron Exp $ */
/*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
*
@@ -97,6 +97,11 @@ void pccnpollc(Dev_t, int);
int pcprobe(struct device *, void *, void *);
void pcattach(struct device *, struct device *, void *);
+#if PCVT_KBD_FIFO
+struct timeout pcvt_to;
+void pcvt_timeout(void *);
+#endif
+
int
pcprobe(struct device *parent, void *match, void *aux)
{
@@ -179,6 +184,10 @@ pcattach(struct device *parent, struct device *self, void *aux)
async_update();
+#if PCVT_KBD_FIFO
+ timeout_set(&pcvt_to, pcvt_timeout, NULL);
+#endif
+
sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
IPL_TTY, pcintr, (void *)0, sc->sc_dev.dv_xname);
@@ -397,16 +406,12 @@ u_char pcvt_kbd_fifo[PCVT_KBD_FIFO_SZ];
int pcvt_kbd_wptr = 0;
int pcvt_kbd_rptr = 0;
short pcvt_kbd_count= 0;
-static u_char pcvt_timeout_scheduled;
-static void
+void
pcvt_timeout(void *arg)
{
- int s;
u_char *cp;
- pcvt_timeout_scheduled = 0;
-
#if PCVT_SCREENSAVER
pcvt_scrnsv_reset();
#endif /* PCVT_SCREENSAVER */
@@ -425,13 +430,6 @@ pcvt_timeout(void *arg)
(*linesw[pcconsp->t_line].l_rint)(*cp++ & 0xff,
pcconsp);
}
-
- s = spltty();
-
- if (!pcvt_kbd_count)
- pcvt_timeout_scheduled = 0;
-
- splx(s);
}
return;
@@ -484,12 +482,8 @@ pcintr(void *arg)
}
if (ret == 1) { /* got data from keyboard ? */
- if (!pcvt_timeout_scheduled) { /* if not already active .. */
- s = spltty();
- pcvt_timeout_scheduled = 1; /* flag active */
- timeout((TIMEOUT_FUNC_T)pcvt_timeout, (caddr_t) 0, 1);
- splx(s);
- }
+ if (!timeout_pending(&pcvt_to)) /* if not already active .. */
+ timeout_add(&pcvt_to, 1);
}
return (ret);
@@ -562,7 +556,7 @@ pcstart(register struct tty *tp)
tp->t_state &= ~TS_BUSY;
tp->t_state |= TS_TIMEOUT;
- timeout(ttrstrt, tp, 1);
+ timeout_add(&tp->t_rstrt_to, 1);
if (tp->t_outq.c_cc <= tp->t_lowat) {
low:
diff --git a/sys/arch/i386/isa/pcvt/pcvt_kbd.c b/sys/arch/i386/isa/pcvt/pcvt_kbd.c
index 705928f2387..e3b7897a227 100644
--- a/sys/arch/i386/isa/pcvt/pcvt_kbd.c
+++ b/sys/arch/i386/isa/pcvt/pcvt_kbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcvt_kbd.c,v 1.38 2000/10/11 21:24:28 aaron Exp $ */
+/* $OpenBSD: pcvt_kbd.c,v 1.39 2000/10/16 02:25:22 aaron Exp $ */
/*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
@@ -169,12 +169,11 @@ do_vgapage(int page)
* get lost other times as well.
*/
-static int lost_intr_timeout_queued = 0;
+struct timeout kbd_led_intr_to;
static void
check_for_lost_intr (void *arg)
{
- lost_intr_timeout_queued = 0;
if (inb(CONTROLLER_CTRL) & STATUS_OUTPBF) {
int opri = spltty();
(void)pcrint();
@@ -244,11 +243,7 @@ update_led(void)
}
#if PCVT_UPDLED_LOSES_INTR
- if (lost_intr_timeout_queued)
- untimeout(check_for_lost_intr, (void *)NULL);
-
- timeout(check_for_lost_intr, (void *)NULL, hz);
- lost_intr_timeout_queued = 1;
+ timeout_add(&kbd_led_intr_to, hz);
#endif /* PCVT_UPDLED_LOSES_INTR */
}
bail:
@@ -581,6 +576,9 @@ kbd_code_init(void)
doreset();
ovlinit(0);
keyboard_is_initialized = 1;
+#if !PCVT_NO_LED_UPDATE && PCVT_UPDLED_LOSES_INTR
+ timeout_set(&kbd_led_intr_to, check_for_lost_intr, NULL);
+#endif
}
/*---------------------------------------------------------------------------*