add a big kernel lock for SMP

Guards the scheduler and IPC; held across the context switch.
This commit is contained in:
Daniel Samson
2026-07-08 12:35:30 +01:00
parent cf7c6df41c
commit 941ab091db
5 changed files with 129 additions and 21 deletions
+8
View File
@@ -282,3 +282,11 @@ pub fn readCr2() u64 {
pub fn halt() noreturn {
while (true) asm volatile ("hlt");
}
/// Spin-wait hint (`pause`). Emitted in the body of a spinlock's busy-wait: it
/// relaxes the core while it polls a contended lock — yielding pipeline resources
/// to a hyperthread sibling and easing the cache-coherency traffic on the lock
/// line. Purely a performance/power hint; correct to omit, but kinder on the bus.
pub fn cpuRelax() void {
asm volatile ("pause");
}