Disable kernel preemption, fix requesting rescheduling
All checks were successful
Build documentation / build-and-deploy (push) Successful in 29s

This commit is contained in:
2026-01-22 19:32:15 +01:00
parent c26fd3cb2b
commit 7bb3b77ede
11 changed files with 32 additions and 27 deletions

View File

@@ -165,10 +165,15 @@ static void amd64_intr_exception (struct saved_regs* regs) {
/* Handle incoming interrupt, dispatch IRQ handlers. */
void amd64_intr_handler (void* stack_ptr) {
spin_lock_ctx_t ctxcpu;
amd64_load_kernel_cr3 ();
struct saved_regs* regs = stack_ptr;
spin_lock (&thiscpu->lock, &ctxcpu);
memcpy (&thiscpu->regs, regs, sizeof (struct saved_regs));
spin_unlock (&thiscpu->lock, &ctxcpu);
if (regs->trap <= 31) {
amd64_intr_exception (regs);
} else {
@@ -177,13 +182,7 @@ void amd64_intr_handler (void* stack_ptr) {
struct irq* irq = irq_find (regs->trap);
if (irq != NULL) {
if ((irq->flags & IRQ_INTERRUPT_SAFE))
__asm__ volatile ("sti");
irq->func (irq->arg, stack_ptr);
if ((irq->flags & IRQ_INTERRUPT_SAFE))
__asm__ volatile ("cli");
}
}
}