multi-cpu scheduling WIP

This commit is contained in:
2026-01-25 15:54:00 +01:00
parent 7bb3b77ede
commit 95f590fb3b
23 changed files with 103 additions and 61 deletions

View File

@@ -5,12 +5,18 @@
#include <proc/proc.h>
#include <sys/mm.h>
#include <sys/smp.h>
#include <sync/spin_lock.h>
void do_sched (struct proc* proc) {
__asm__ volatile ("cli");
void do_sched (struct proc* proc, spin_lock_t* cpu_lock, spin_lock_ctx_t* ctxcpu) {
spin_lock_ctx_t ctxpr;
spin_lock (&proc->lock, &ctxpr);
thiscpu->tss.rsp0 = proc->pdata.kernel_stack;
thiscpu->syscall_kernel_stack = proc->pdata.kernel_stack;
spin_unlock (&proc->lock, &ctxpr);
spin_unlock (cpu_lock, ctxcpu);
amd64_do_sched ((void*)&proc->pdata.regs, (void*)proc->pd->cr3_paddr);
}