summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2009-08-27 16:45:20 +0000
committerjsg <jsg@openbsd.org>2009-08-27 16:45:20 +0000
commit6775374cbf496dd8fe6512fc61cb6d19032b9148 (patch)
tree4a60a85581a88c636d289925271e81dd01a1daff
parentAppease gcc2 (I wish people would write in C, rather than "latest crap (diff)
downloadwireguard-openbsd-6775374cbf496dd8fe6512fc61cb6d19032b9148.tar.xz
wireguard-openbsd-6775374cbf496dd8fe6512fc61cb6d19032b9148.zip
Bring in NetBSD's rev 1.45 by Matthias Drochner
'Reduce polling of the keyboard controller status by a factor of 1000. While on real hardware hardware a poll cycle takes time in the microsecond order of magnitude, a "legacy-free" system which emulates the KBC in BIOS code takes milliseconds -- I'm seeing a multi-minute delay in booting where the KBC is probed. So poll less and use delay() to compensate so that the total wait time stays about the same.' Noticeably helps some machines that do SMM based pckbc. Tested by miod on alpha glass console. ok miod@
-rw-r--r--sys/dev/ic/pckbc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c
index 36c2599570c..6171b156fc6 100644
--- a/sys/dev/ic/pckbc.c
+++ b/sys/dev/ic/pckbc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pckbc.c,v 1.19 2009/08/25 19:16:36 miod Exp $ */
+/* $OpenBSD: pckbc.c,v 1.20 2009/08/27 16:45:20 jsg Exp $ */
/* $NetBSD: pckbc.c,v 1.5 2000/06/09 04:58:35 soda Exp $ */
/*
@@ -142,8 +142,8 @@ pckbc_poll_data1(iot, ioh_d, ioh_c, slot, checkaux)
int i;
u_char stat;
- /* if 1 port read takes 1us (?), this polls for 100ms */
- for (i = 100000; i; i--) {
+ /* polls for ~100ms */
+ for (i = 100; i; i--, delay(1000)) {
stat = bus_space_read_1(iot, ioh_c, 0);
if (stat & KBS_DIB) {
register u_char c;