diff options
author | Ian Moffett <ian@osmora.org> | 2025-08-20 00:56:31 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-08-20 00:56:31 -0400 |
commit | c921000af6782a6a35da8e3b3482b3737c49ac23 (patch) | |
tree | 4a01f1d0ff8ada6b334f2bfbf8d3da733c02747c /sys/arch/amd64 | |
parent | 0972694abb1fe2137eeed3c0bdfa70eb31327c8f (diff) |
kernel: exit: Panic if core is not preemptable
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/proc_machdep.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/arch/amd64/amd64/proc_machdep.c b/sys/arch/amd64/amd64/proc_machdep.c index 11b1901..82b4e4f 100644 --- a/sys/arch/amd64/amd64/proc_machdep.c +++ b/sys/arch/amd64/amd64/proc_machdep.c @@ -281,6 +281,18 @@ sched_preempt_set(bool enable) ci->preempt = enable; } +bool +sched_preemptable(void) +{ + struct cpu_info *ci = this_cpu(); + + if (ci == NULL) { + return false; + } + + return ci->preempt; +} + /* * Perform a context switch. */ |