diff --git a/kernel-src/include/x86-64/arch/context.h b/kernel-src/include/x86-64/arch/context.h index e4526a40..4220a114 100644 --- a/kernel-src/include/x86-64/arch/context.h +++ b/kernel-src/include/x86-64/arch/context.h @@ -81,4 +81,7 @@ void arch_context_saveandcall(void (*fn)(context_t *context)); wrmsr(MSR_KERNELGSBASE, (t)->extracontext.gsbase); \ wrmsr(MSR_FSBASE, (t)->extracontext.fsbase); +#define ARCH_CONTEXT_INTSTATUS(x) \ + (x)->rflags & 0x200 ? true : false; + #endif diff --git a/kernel-src/sys/interrupt.c b/kernel-src/sys/interrupt.c index 4efbc180..f6f8dc4c 100644 --- a/kernel-src/sys/interrupt.c +++ b/kernel-src/sys/interrupt.c @@ -15,6 +15,7 @@ void interrupt_isr(int vec, context_t *ctx) { long oldipl = interrupt_setipl(isr->priority); isr->func(isr, ctx); + interrupt_set(false); interrupt_setipl(oldipl); } else { @@ -24,7 +25,7 @@ void interrupt_isr(int vec, context_t *ctx) { if (isr->eoi) isr->eoi(isr); - // TODO context interrupt checking for struct + _cpu()->intstatus = ARCH_CONTEXT_INTSTATUS(ctx); } void interrupt_register(int vector, void (*func)(isr_t *self, context_t *ctx), void (*eoi)(isr_t *self), long priority) {