diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c index 2809828150b..32752672b7f 100644 --- a/sys/amd64/isa/clock.c +++ b/sys/amd64/isa/clock.c @@ -286,6 +286,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(); diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index a67db3173a5..f31c7ea2eea 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(); diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c index a67db3173a5..f31c7ea2eea 100644 --- a/sys/isa/atrtc.c +++ b/sys/isa/atrtc.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();