]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
feat: IPI reschedule infrastructure (SMP Phase 4)
authorTulio A M Mendes <[email protected]>
Mon, 16 Feb 2026 19:14:42 +0000 (16:14 -0300)
committerTulio A M Mendes <[email protected]>
Mon, 16 Feb 2026 19:14:42 +0000 (16:14 -0300)
commitab231fa2fb3fcc7ad679613661af563b6f249d81
tree6e9d6a9359990e1e2b48d78064895998286fa2ad
parentda6ce662266f54c673350e20087c0ba6db8c2383
feat: IPI reschedule infrastructure (SMP Phase 4)

Add inter-processor interrupt (IPI) reschedule mechanism:

- IPI vector 0xFD (253) registered in IDT + ISR assembly stub
- isr_handler dispatches vector 253: sends LAPIC EOI then calls
  schedule() on the receiving CPU
- sched_ipi_resched() sends IPI to wake a remote idle CPU when
  work is enqueued to its runqueue (avoids waking self)
- sched_enqueue_ready() sends IPI after enqueuing to remote CPU
- sched_pcpu_inc_load() called when enqueuing new kernel threads

All processes still dispatched to CPU 0 — per-CPU TSS is needed
before user processes can run on APs.  The IPI + load tracking
infrastructure is ready for when per-CPU TSS is added.

83/83 smoke tests pass (8s), cppcheck clean.
include/arch/x86/lapic.h
src/arch/x86/idt.c
src/arch/x86/interrupts.S
src/kernel/scheduler.c