Add turnstiles, more sched fixes

This commit is contained in:
2026-10-20 23:13:29 +02:00
parent a8bf7d7a28
commit 05c0920998
12 changed files with 1072 additions and 83 deletions
+10
View File
@@ -6,6 +6,7 @@
#include <zinnia/pmap.h>
#include <zinnia/print.h>
#include <zinnia/sched.h>
#include <zinnia/timer.h>
#include <zinnia/usercopy.h>
#include <zinnia/utils.h>
#include <zinnia/vma.h>
@@ -98,6 +99,15 @@ void interrupt_handler(struct arch_context* ctx) {
lapic_eoi(&arch_cpu->lapic);
pmap_shootdown_handle();
break;
case IDT_TIMER:
lapic_eoi(&arch_cpu->lapic);
timer_interrupt();
if (cpu->sched.need_resched) {
arch_sched_preempt_disable();
if (arch_sched_preempt_enable())
sched_reschedule(&cpu->sched);
}
break;
default:
if (isr < 0x20)
panic("Unhandled exception %lu at %#lx, error: %#lx\n", isr, ctx->rip, ctx->error);