summaryrefslogtreecommitdiffstats
path: root/sys/pc98/cbus/pcrtc.c
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2004-07-11 13:46:10 +0000
committernyan <nyan@FreeBSD.org>2004-07-11 13:46:10 +0000
commit87af04ca9a197a3c05764a4adc3294db472879fe (patch)
tree2be8d92284029d1042cd01524cdb54ed9e56064d /sys/pc98/cbus/pcrtc.c
parent5a42d7a52219826960475d2ee99936b276d68d23 (diff)
downloadFreeBSD-src-87af04ca9a197a3c05764a4adc3294db472879fe.zip
FreeBSD-src-87af04ca9a197a3c05764a4adc3294db472879fe.tar.gz
MFi386: revision 1.212.
Diffstat (limited to 'sys/pc98/cbus/pcrtc.c')
-rw-r--r--sys/pc98/cbus/pcrtc.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/sys/pc98/cbus/pcrtc.c b/sys/pc98/cbus/pcrtc.c
index d6e57ec..dbb986c 100644
--- a/sys/pc98/cbus/pcrtc.c
+++ b/sys/pc98/cbus/pcrtc.c
@@ -57,6 +57,7 @@
#include <sys/bus.h>
#include <sys/limits.h>
#include <sys/lock.h>
+#include <sys/kdb.h>
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/proc.h>
@@ -377,7 +378,10 @@ getit(void)
{
int high, low;
- mtx_lock_spin(&clock_lock);
+#ifdef KDB
+ if (!kdb_active)
+#endif
+ mtx_lock_spin(&clock_lock);
/* Select timer0 and latch counter value. */
outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH);
@@ -385,7 +389,11 @@ getit(void)
low = inb(TIMER_CNTR0);
high = inb(TIMER_CNTR0);
- mtx_unlock_spin(&clock_lock);
+#ifdef KDB
+ if (!kdb_active)
+#endif
+ mtx_unlock_spin(&clock_lock);
+
return ((high << 8) | low);
}
@@ -426,18 +434,8 @@ 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.
*/
-#ifdef DDB
- if (db_active)
- prev_tick = 0;
- else
-#endif
- prev_tick = getit();
+ prev_tick = getit();
n -= 0; /* XXX actually guess no initial overhead */
/*
* Calculate (n * (timer_freq / 1e6)) without using floating point
OpenPOWER on IntegriCloud