Module Name: src
Committed By: snj
Date: Sat Sep 26 18:25:46 UTC 2009
Modified Files:
src/sys/arch/i386/stand/lib [netbsd-5]: pcio.c
Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #928):
sys/arch/i386/stand/lib/pcio.c: revision 1.27
int 15h/AH=86h (WAIT) doesn't work properly on all hardware and emulators, so
for the countdown use the more coarsely grained sleep implementation based
on int 1ah/AH=00h (GET SYSTEM TIME).
ok ad@
To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.8.1 src/sys/arch/i386/stand/lib/pcio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/i386/stand/lib/pcio.c
diff -u src/sys/arch/i386/stand/lib/pcio.c:1.23 src/sys/arch/i386/stand/lib/pcio.c:1.23.8.1
--- src/sys/arch/i386/stand/lib/pcio.c:1.23 Wed May 21 13:36:45 2008
+++ src/sys/arch/i386/stand/lib/pcio.c Sat Sep 26 18:25:46 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: pcio.c,v 1.23 2008/05/21 13:36:45 ad Exp $ */
+/* $NetBSD: pcio.c,v 1.23.8.1 2009/09/26 18:25:46 snj Exp $ */
/*
* Copyright (c) 1996, 1997
@@ -71,6 +71,20 @@
#define POLL_FREQ 10
+static void
+wait(int us)
+{
+ int prev = biosgetsystime();
+ int tgt = prev + (20 * us) / 1000000;
+ int new;
+
+ while ((new = biosgetsystime()) < tgt) {
+ if (new < prev) /* XXX timer wrapped */
+ break;
+ prev = new;
+ }
+}
+
#ifdef SUPPORT_SERIAL
static int
getcomaddr(int idx)
@@ -336,7 +350,7 @@
goto out;
}
if (i--)
- delay(1000000 / POLL_FREQ);
+ wait(1000000 / POLL_FREQ);
else
break;
}