Fix user CPU context saving
All checks were successful
Build documentation / build-and-deploy (push) Successful in 31s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 31s
This commit is contained in:
@@ -294,7 +294,7 @@ static void proc_reap (void) {
|
||||
}
|
||||
|
||||
void proc_sched (void) {
|
||||
spin_lock_ctx_t ctxcpu, ctxpr;
|
||||
spin_lock_ctx_t ctxcpu;
|
||||
|
||||
int s_cycles = atomic_fetch_add (&sched_cycles, 1);
|
||||
|
||||
@@ -306,15 +306,8 @@ void proc_sched (void) {
|
||||
|
||||
spin_lock (&cpu->lock, &ctxcpu);
|
||||
|
||||
struct proc* prev = cpu->proc_current;
|
||||
next = proc_find_sched (cpu);
|
||||
|
||||
if (prev != NULL) {
|
||||
spin_lock (&prev->lock, &ctxpr);
|
||||
memcpy (&prev->pdata.regs, &cpu->regs, sizeof (struct saved_regs));
|
||||
spin_unlock (&prev->lock, &ctxpr);
|
||||
}
|
||||
|
||||
if (next) {
|
||||
cpu->proc_current = next;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user