summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2001-08-08 22:42:12 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2001-08-08 22:42:12 +0000
commit43e12b2191ee8f7acd37cb5494b95b57dad3c605 (patch)
treec37ed6b07a1bf7072e961e462146942766087fd2
parent3a8dffa1d4c28ee6992df283cf943e232cdbb587 (diff)
New timeouts.
-rw-r--r--sys/arch/sun3/dev/kbd.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/arch/sun3/dev/kbd.c b/sys/arch/sun3/dev/kbd.c
index 74e6b399004..2cab0c9f067 100644
--- a/sys/arch/sun3/dev/kbd.c
+++ b/sys/arch/sun3/dev/kbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kbd.c,v 1.6 2001/06/27 05:44:51 nate Exp $ */
+/* $OpenBSD: kbd.c,v 1.7 2001/08/08 22:42:11 miod Exp $ */
/* $NetBSD: kbd.c,v 1.8 1996/05/17 19:32:06 gwr Exp $ */
/*
@@ -116,6 +116,7 @@
struct kbd_softc {
struct device k_dev; /* required first: base device */
struct zs_chanstate *k_cs;
+ struct timeout k_tmo;
/* Flags to communicate with kbd_softint() */
volatile int k_intr_flags;
@@ -284,6 +285,8 @@ kbd_attach(parent, self, aux)
k->k_magic1 = KBD_L1;
k->k_magic2 = KBD_A;
+ timeout_set(&k->k_tmo, kbd_repeat, k);
+
/* Now attach the (kd) pseudo-driver. */
kd_init(kbd_unit);
}
@@ -329,7 +332,7 @@ kbdopen(dev, flags, mode, p)
if (k->k_repeating) {
k->k_repeating = 0;
- untimeout(kbd_repeat, k);
+ timeout_del(&k->k_tmo);
}
return (0);
@@ -842,7 +845,7 @@ kbd_repeat(void *arg)
if (k->k_repeating && k->k_repeatsym >= 0) {
kbd_input_keysym(k, k->k_repeatsym);
- timeout(kbd_repeat, k, k->k_repeat_step);
+ timeout_add(&k->k_tmo, k->k_repeat_step);
}
splx(s);
}
@@ -912,7 +915,7 @@ kbd_input_raw(k, c)
/* Any input stops auto-repeat (i.e. key release). */
if (k->k_repeating) {
k->k_repeating = 0;
- untimeout(kbd_repeat, k);
+ timeout_del(&k->k_tmo);
}
/* Translate this code to a keysym */
@@ -928,7 +931,7 @@ kbd_input_raw(k, c)
/* Setup for auto-repeat after initial delay. */
k->k_repeating = 1;
k->k_repeatsym = keysym;
- timeout(kbd_repeat, k, k->k_repeat_start);
+ timeout_add(&k->k_tmo, k->k_repeat_start);
return;
}