Spinlock save cpu flags

This commit is contained in:
2026-03-12 22:48:34 +01:00
parent 19793e9126
commit 4760818118
50 changed files with 704 additions and 461 deletions

View File

@@ -11,8 +11,10 @@
#include <sys/mm.h>
#include <sys/smp.h>
void do_sched (struct proc* proc, spin_lock_t* cpu_lock) {
spin_lock (&proc->lock);
void do_sched (struct proc* proc, spin_lock_t* cpu_lock, uint64_t lockflags) {
uint64_t fp;
spin_lock (&proc->lock, &fp);
thiscpu->tss.rsp0 = proc->pdata.kernel_stack;
thiscpu->syscall_kernel_stack = proc->pdata.kernel_stack;
@@ -25,8 +27,8 @@ void do_sched (struct proc* proc, spin_lock_t* cpu_lock) {
fx_restore (proc->pdata.fx_env);
spin_unlock (&proc->lock);
spin_unlock (cpu_lock);
spin_unlock (&proc->lock, fp);
spin_unlock (cpu_lock, lockflags);
do_sched1 ((void*)&regs, cr3);
}