PERFORCE change 87453 for review
Peter Wemm
peter at FreeBSD.org
Tue Nov 29 18:50:08 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=87453
Change 87453 by peter at peter_daintree on 2005/11/29 18:50:05
Use sched_pin on the chance that DELAY() is called with interrupts
enabled. It is cheap and harmless.
Affected files ...
.. //depot/projects/hammer/sys/amd64/isa/clock.c#52 edit
Differences ...
==== //depot/projects/hammer/sys/amd64/isa/clock.c#52 (text+ko) ====
@@ -61,6 +61,7 @@
#include <sys/kernel.h>
#include <sys/limits.h>
#include <sys/module.h>
+#include <sys/sched.h>
#include <sys/sysctl.h>
#include <sys/cons.h>
#include <sys/power.h>
@@ -274,11 +275,13 @@
if (tsc_freq != 0 && !tsc_is_broken) {
uint64_t start, end, now;
+ sched_pin();
start = rdtsc();
end = start + (tsc_freq * n) / 1000000;
do {
now = rdtsc();
- } while (now < end || (now > start && end < start));
+ } while (now < end);
+ sched_unpin();
return;
}
#ifdef DELAYDEBUG
More information about the p4-projects
mailing list