diff options
author | Richard Braun <rbraun@sceen.net> | 2018-07-07 16:15:19 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2018-07-07 16:16:15 +0200 |
commit | b17e3aa862e30b66e93dba70aaf3ece1e5e2ed3f (patch) | |
tree | f36b1c4a93fc6bf6c85ed6e90c90f33e962b5970 | |
parent | 28166f110880bf561283c48c0d721c2eb4e86e1b (diff) |
x86/cpu: turn cpu_delay into a compiler barrier
-rw-r--r-- | arch/x86/machine/cpu.c | 1 | ||||
-rw-r--r-- | arch/x86/machine/cpu.h | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/machine/cpu.c b/arch/x86/machine/cpu.c index 225f6483..5eb9ce2d 100644 --- a/arch/x86/machine/cpu.c +++ b/arch/x86/machine/cpu.c @@ -416,6 +416,7 @@ cpu_delay(unsigned long usecs) diff = count - prev; prev = count; total -= diff; + cpu_pause(); } while (total > 0); } diff --git a/arch/x86/machine/cpu.h b/arch/x86/machine/cpu.h index 78857cdc..b94c149d 100644 --- a/arch/x86/machine/cpu.h +++ b/arch/x86/machine/cpu.h @@ -594,6 +594,8 @@ uint64_t cpu_get_freq(void); /* * Busy-wait for a given amount of time, in microseconds. + * + * Implies a compiler barrier. */ void cpu_delay(unsigned long usecs); |