diff options
author | jhb <jhb@FreeBSD.org> | 2008-01-17 18:59:38 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2008-01-17 18:59:38 +0000 |
commit | a114208c341bc5a712d49fcc016cf27f4651f212 (patch) | |
tree | 3c99a002d20f9c0c3ae39a1f03e4eb826f36bb6e /sys/i386/isa/clock.c | |
parent | 7f5a9c7a3602de0c7b5c5157690e605889c07dac (diff) | |
download | FreeBSD-src-a114208c341bc5a712d49fcc016cf27f4651f212.zip FreeBSD-src-a114208c341bc5a712d49fcc016cf27f4651f212.tar.gz |
Use cpu_spinwait() (i.e., "pause") when spinning on rdtsc during DELAY().
MFC after: 1 week
Diffstat (limited to 'sys/i386/isa/clock.c')
-rw-r--r-- | sys/i386/isa/clock.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index a67db31..f31c7ea 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -291,6 +291,7 @@ DELAY(int n) start = rdtsc(); end = start + (tsc_freq * n) / 1000000; do { + cpu_spinwait(); now = rdtsc(); } while (now < end || (now > start && end < start)); sched_unpin(); |