mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Use cpu_spinwait() (i.e., "pause") when spinning on rdtsc during DELAY().
MFC after: 1 week
This commit is contained in:
parent
6634dbbde4
commit
c05655bfda
3 changed files with 3 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue