diff options
author | Ian Moffett <ian@osmora.org> | 2025-10-13 14:47:15 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-10-13 14:47:15 -0400 |
commit | 95da567859183162bcbb171ffdda4f1d94bc3536 (patch) | |
tree | 14495e6c2689dcb85b900b3512bd33518d174757 /src/sys/arch/amd64/os/os_proc.c | |
parent | 4eb75eeebce41e2b770ffb150dcf8edd04ece9f8 (diff) |
kern/amd64: Try to continue if no proc on switch
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/arch/amd64/os/os_proc.c')
-rw-r--r-- | src/sys/arch/amd64/os/os_proc.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/sys/arch/amd64/os/os_proc.c b/src/sys/arch/amd64/os/os_proc.c index 2f01ffd..befeb34 100644 --- a/src/sys/arch/amd64/os/os_proc.c +++ b/src/sys/arch/amd64/os/os_proc.c @@ -195,23 +195,21 @@ md_sched_switch(struct trapframe *tf) } /* Don't switch if no self */ - if ((self = core->curproc) == NULL) { - md_proc_yield(); - } + if ((self = core->curproc) != NULL) { + error = sched_enq(&core->scq, self); + if (error < 0) { + goto done; + } - error = sched_enq(&core->scq, self); - if (error < 0) { - goto done; + /* + * Save the current trapframe to our process control + * block as we'll want it later when we're back. + */ + pcbp = &self->pcb; + memcpy(&pcbp->tf, tf, sizeof(*tf)); } /* - * Save the current trapframe to our process control - * block as we'll want it later when we're back. - */ - pcbp = &self->pcb; - memcpy(&pcbp->tf, tf, sizeof(*tf)); - - /* * Grab the next process. If we cannot find any, assume * we are the only one and continue on... */ |