diff options
| author | Ian Moffett <ian@osmora.org> | 2025-11-21 14:20:15 -0500 |
|---|---|---|
| committer | Ian Moffett <ian@osmora.org> | 2025-11-21 14:20:15 -0500 |
| commit | e105fa42d5ddb6ff7bfbbb964c4b93415b22b05a (patch) | |
| tree | 66ee5d020e7cc682ebe365fd2e2aeb6850e4a246 /sys/arch/amd64/cpu/cpu.c | |
| parent | 9600d3df3e1b75cff0e3ecd20ae3ca2fe393eb8b (diff) | |
kern: Improve IRQ mask modification on spinlocks
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/arch/amd64/cpu/cpu.c')
| -rw-r--r-- | sys/arch/amd64/cpu/cpu.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/arch/amd64/cpu/cpu.c b/sys/arch/amd64/cpu/cpu.c index 4edc850..d9093fd 100644 --- a/sys/arch/amd64/cpu/cpu.c +++ b/sys/arch/amd64/cpu/cpu.c @@ -29,11 +29,21 @@ #include <sys/types.h> #include <sys/cdefs.h> +#include <sys/param.h> #include <os/trace.h> #include <mu/cpu.h> #include <md/msr.h> #include <md/lapic.h> +bool +mu_irq_state(void) +{ + uint64_t rflags; + + __asmv("pushfq; pop %0" : "=r" (rflags) :: "memory"); + return ISSET(rflags, BIT(9)) != 0; +} + struct cpu_info * cpu_self(void) { |
