summaryrefslogtreecommitdiffstats
path: root/sys/pc98/cbus/pcrtc.c
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2003-09-11 14:05:06 +0000
committernyan <nyan@FreeBSD.org>2003-09-11 14:05:06 +0000
commit66714cf37a00f967460d0965d46c29f42991f4b2 (patch)
treeb55a6798a22ab925652feb83dd3e7f236a9e6abf /sys/pc98/cbus/pcrtc.c
parentda6d9ab61ee74e84b092090a13c431bf5d32f6ea (diff)
downloadFreeBSD-src-66714cf37a00f967460d0965d46c29f42991f4b2.zip
FreeBSD-src-66714cf37a00f967460d0965d46c29f42991f4b2.tar.gz
MFi386: revision 1.204.
Diffstat (limited to 'sys/pc98/cbus/pcrtc.c')
-rw-r--r--sys/pc98/cbus/pcrtc.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/pc98/cbus/pcrtc.c b/sys/pc98/cbus/pcrtc.c
index f71b18d..bc4cf6b 100644
--- a/sys/pc98/cbus/pcrtc.c
+++ b/sys/pc98/cbus/pcrtc.c
@@ -299,8 +299,18 @@ DELAY(int n)
* takes about 1.5 usec for each of the i/o's in getit(). The loop
* takes about 6 usec on a 486/33 and 13 usec on a 386/20. The
* multiplications and divisions to scale the count take a while).
+ *
+ * However, if ddb is active then use a fake counter since reading
+ * the i8254 counter involves acquiring a lock. ddb must not go
+ * locking for many reasons, but it calls here for at least atkbd
+ * input.
*/
- prev_tick = getit();
+#ifdef DDB
+ if (db_active)
+ prev_tick = 0;
+ else
+#endif
+ prev_tick = getit();
n -= 0; /* XXX actually guess no initial overhead */
/*
* Calculate (n * (timer_freq / 1e6)) without using floating point
@@ -327,7 +337,13 @@ DELAY(int n)
/ 1000000;
while (ticks_left > 0) {
- tick = getit();
+#ifdef DDB
+ if (db_active) {
+ outb(0x5f, 0);
+ tick = prev_tick + 1;
+ } else
+#endif
+ tick = getit();
#ifdef DELAYDEBUG
++getit_calls;
#endif
OpenPOWER on IntegriCloud