aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2003-09-22 21:56:48 +0000
committerPeter Wemm <peter@FreeBSD.org>2003-09-22 21:56:48 +0000
commit882554f111268cd77d71a042f728fa64de5d0947 (patch)
treea71d40438c3a8463a71f3248fb752dd3e15f954f /sys
parent795a3f5279a6f89ba5e2182060f5f84490bd1b9a (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/machdep.c2
-rw-r--r--sys/amd64/isa/clock.c20
2 files changed, 19 insertions, 3 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 86fff6c0571a..1f5948bb428b 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1166,7 +1166,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
* under witness.
*/
mutex_init();
- mtx_init(&clock_lock, "clk", NULL, MTX_SPIN | MTX_RECURSE);
+ mtx_init(&clock_lock, "clk", NULL, MTX_SPIN);
mtx_init(&icu_lock, "icu", NULL, MTX_SPIN | MTX_NOWITNESS);
/* exceptions */
diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c
index 2ed15441d84c..c88e488fbacc 100644
--- a/sys/amd64/isa/clock.c
+++ b/sys/amd64/isa/clock.c
@@ -413,8 +413,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
@@ -441,7 +451,13 @@ DELAY(int n)
/ 1000000;
while (ticks_left > 0) {
- tick = getit();
+#ifdef DDB
+ if (db_active) {
+ inb(0x84);
+ tick = prev_tick + 1;
+ } else
+#endif
+ tick = getit();
#ifdef DELAYDEBUG
++getit_calls;
#endif