summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sys/arch/amd64/os/os_proc.c24
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...
*/