multi-cpu scheduling WIP
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user