aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-02-14 18:26:47 -0500
committerIan Moffett <ian@osmora.org>2024-02-14 18:26:47 -0500
commit2440a9d67b0785132e303ed6f12dff8e80baa547 (patch)
treef4a2d3dd72361814db4c2f240c713255e437fd5e /sys/kern
parent34d83987c18df3e06db1528423841376072bb627 (diff)
kernel: cpu: Add hint_spinwait()
This commit introduces a macro that must exist per architecture (even if it does nothing) to ensure it is machine independent. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sched.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c
index da4c6c5..4f17ddf 100644
--- a/sys/kern/kern_sched.c
+++ b/sys/kern/kern_sched.c
@@ -32,6 +32,7 @@
#include <sys/types.h>
#include <sys/cdefs.h>
#include <sys/spinlock.h>
+#include <machine/cpu.h>
#include <assert.h>
/*
@@ -59,17 +60,12 @@ sched_enqueue_ci(struct cpu_info *ci)
/*
* Processor awaiting tasks to be assigned will be here spinning.
- *
- * XXX: We are not using the PAUSE instruction for the sake of
- * ensuring compatibility... PAUSE is F3 90, REP NOP is
- * F3 90... REP NOP will be read as a PAUSE on processors
- * that support it.
*/
__noreturn static void
sched_enter(void)
{
for (;;) {
- __ASMV("rep; nop");
+ hint_spinwait();
}
}