diff options
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) { |
