From 9a2619021a39d922e470d301ee58b89cc1cd43e1 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Thu, 27 Aug 2009 16:45:21 +0000 Subject: 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@ --- sys/dev/ic/pckbc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys') 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; -- cgit v1.2.3