Allow WAITING->RUNNING_S transition
authorBarret Rhoden <brho@cs.berkeley.edu>
Sun, 5 May 2013 21:25:43 +0000 (14:25 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Sun, 5 May 2013 22:30:23 +0000 (15:30 -0700)
Used by the proc_yield SCP path.  In this case, we're not involving the
ksched in the fake wakeup process.  Also note that the MCP yield code
doesn't need this, since it doesn't synchronize based on the process's
state (it uses the vcore's state).

kern/src/process.c

index 1983cef..385c64a 100644 (file)
@@ -96,6 +96,7 @@ int __proc_set_state(struct proc *p, uint32_t state)
         * RGS -> W
         * RGM -> W
         * W   -> RBS
+        * W   -> RGS
         * W   -> RBM
         * RGS -> RBM
         * RBM -> RGM
@@ -124,7 +125,7 @@ int __proc_set_state(struct proc *p, uint32_t state)
                                panic("Invalid State Transition! PROC_RUNNING_S to %02x", state);
                        break;
                case PROC_WAITING:
-                       if (!(state & (PROC_RUNNABLE_S | PROC_RUNNABLE_M)))
+                       if (!(state & (PROC_RUNNABLE_S | PROC_RUNNING_S | PROC_RUNNABLE_M)))
                                panic("Invalid State Transition! PROC_WAITING to %02x", state);
                        break;
                case PROC_DYING: