summaryrefslogtreecommitdiff
path: root/sys/arch/mac68k/dev/adb.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2001-08-15 22:06:38 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2001-08-15 22:06:38 +0000
commitc3b36884f3b9b5687ae57908037c76f3cb2a6c82 (patch)
tree521f430363108c7672dec35097c9e6b06bac334f /sys/arch/mac68k/dev/adb.c
parent9bb656f0f3c06e55ac9d2d02d53c3115439ea727 (diff)
New timeouts, tested by beck@.
Diffstat (limited to 'sys/arch/mac68k/dev/adb.c')
-rw-r--r--sys/arch/mac68k/dev/adb.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/arch/mac68k/dev/adb.c b/sys/arch/mac68k/dev/adb.c
index 19e6f237e93..b5facce434a 100644
--- a/sys/arch/mac68k/dev/adb.c
+++ b/sys/arch/mac68k/dev/adb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adb.c,v 1.10 1998/03/03 04:29:44 ryker Exp $ */
+/* $OpenBSD: adb.c,v 1.11 2001/08/15 22:06:37 miod Exp $ */
/* $NetBSD: adb.c,v 1.13 1996/12/16 16:17:02 scottr Exp $ */
/*-
@@ -40,6 +40,7 @@ e* notice, this list of conditions and the following disclaimer in the
#include <sys/signalvar.h>
#include <sys/systm.h>
#include <sys/time.h>
+#include <sys/timeout.h>
#include <machine/autoconf.h>
#include <machine/keyboard.h>
@@ -95,6 +96,8 @@ struct cfdriver adb_cd = {
NULL, "adb", DV_DULL
};
+struct timeout repeat_timeout;
+
static int
adbmatch(parent, vcf, aux)
struct device *parent;
@@ -169,7 +172,8 @@ adb_autorepeat(keyp)
adb_handoff(&adb_rptevent); /* do key down */
if (adb_repeating == key) {
- timeout(adb_autorepeat, keyp, adb_rptinterval);
+ timeout_set(&repeat_timeout, adb_autorepeat, keyp);
+ timeout_add(&repeat_timeout, adb_rptinterval);
}
}
@@ -186,18 +190,17 @@ adb_dokeyupdown(event)
keyboard[event->u.k.key & 0x7f][0] != 0) {
/* ignore shift & control */
if (adb_repeating != -1) {
- untimeout(adb_autorepeat,
- (void *) adb_rptevent.u.k.key);
+ timeout_del(&repeat_timeout);
}
adb_rptevent = *event;
adb_repeating = adb_key;
- timeout(adb_autorepeat,
- (void *) adb_key, adb_rptdelay);
+ timeout_set(&repeat_timeout, adb_autorepeat,
+ (caddr_t)adb_key);
+ timeout_add(&repeat_timeout, adb_rptdelay);
} else {
if (adb_repeating != -1) {
adb_repeating = -1;
- untimeout(adb_autorepeat,
- (void *) adb_rptevent.u.k.key);
+ timeout_del(&repeat_timeout);
}
adb_rptevent = *event;
}