From 95da567859183162bcbb171ffdda4f1d94bc3536 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Mon, 13 Oct 2025 14:47:15 -0400 Subject: kern/amd64: Try to continue if no proc on switch Signed-off-by: Ian Moffett --- src/sys/arch/amd64/os/os_proc.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'src/sys') 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,22 +195,20 @@ 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... -- cgit v1.2.3