Date: Tue, 29 Nov 2005 18:50:06 GMT From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 87453 for review Message-ID: <200511291850.jATIo6XJ021546@repoman.freebsd.org>
index | next in thread | raw e-mail
http://perforce.freebsd.org/chv.cgi?CH=87453 Change 87453 by peter@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 DELAYDEBUGhelp
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200511291850.jATIo6XJ021546>
