mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
interrupt: set proper intstatus on isr return
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user