interrupt: set proper intstatus on isr return

This commit is contained in:
Matheus
2023-04-28 22:27:56 -03:00
parent 5d33fe828f
commit 1bcf8dfcf3
2 changed files with 5 additions and 1 deletions
+3
View File
@@ -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
+2 -1
View File
@@ -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) {