Redesign reschedule points, allow one operation to reschedule many cpus at once
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m12s

This commit is contained in:
2026-02-18 23:16:03 +01:00
parent ae0a6024da
commit f103bdd739
39 changed files with 376 additions and 223 deletions

View File

@@ -2,6 +2,7 @@
#include <amd64/msr.h>
#include <amd64/sched.h>
#include <libk/std.h>
#include <libk/string.h>
#include <proc/proc.h>
#include <sync/spin_lock.h>
#include <sys/mm.h>
@@ -14,8 +15,12 @@ void do_sched (struct proc* proc, spin_lock_t* cpu_lock) {
thiscpu->syscall_kernel_stack = proc->pdata.kernel_stack;
amd64_wrmsr (MSR_FS_BASE, proc->pdata.fs_base);
void* cr3 = (void*)proc->procgroup->pd.cr3_paddr;
struct saved_regs regs;
memcpy (&regs, &proc->pdata.regs, sizeof (regs));
spin_unlock (&proc->lock);
spin_unlock (cpu_lock);
amd64_do_sched ((void*)&proc->pdata.regs, (void*)proc->procgroup->pd.cr3_paddr);
amd64_do_sched ((void*)&regs, cr3);
}