Added the DYING case to proc_get_vcoreid()
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 13 Apr 2010 01:17:20 +0000 (18:17 -0700)
committerKevin Klues <klueska@cs.berkeley.edu>
Thu, 3 Nov 2011 00:35:42 +0000 (17:35 -0700)
kern/src/process.c

index c90a93c..cad3b75 100644 (file)
@@ -766,7 +766,7 @@ void proc_notify(struct proc *p, unsigned int notif, struct notif_event *ne)
 uint32_t proc_get_vcoreid(struct proc *SAFE p, uint32_t pcoreid)
 {
        uint32_t vcoreid;
-       // TODO: the code currently doesn't track the vcoreid properly for _S
+       // TODO: the code currently doesn't track the vcoreid properly for _S (VC#)
        spin_lock_irqsave(&p->proc_lock);
        switch (p->state) {
                case PROC_RUNNING_S:
@@ -776,6 +776,9 @@ uint32_t proc_get_vcoreid(struct proc *SAFE p, uint32_t pcoreid)
                        vcoreid = get_vcoreid(p, pcoreid);
                        spin_unlock_irqsave(&p->proc_lock);
                        return vcoreid;
+               case PROC_DYING: // death message is on the way
+                       spin_unlock_irqsave(&p->proc_lock);
+                       return 0;
                default:
                        spin_unlock_irqsave(&p->proc_lock);
                        panic("Weird state(%s) in %s()", procstate2str(p->state),