Minor bug fixes in proc.c and utility.c;

Removed debug dumps on panic from main.c;
Return error on exit when other process does IPC to/from exiting process.
This commit is contained in:
Jorrit Herder
2005-10-05 09:51:50 +00:00
parent 71b6f31d4e
commit 32c05f45c6
5 changed files with 51 additions and 54 deletions

View File

@@ -61,21 +61,35 @@ register struct proc *rc; /* slot of process to clean up */
* a normal exit), then it must be removed from the message queues.
*/
if (rc->p_rts_flags & SENDING) {
/* Check all proc slots to see if the exiting process is queued. */
for (rp = BEG_PROC_ADDR; rp < END_PROC_ADDR; rp++) {
if (rp->p_caller_q == NIL_PROC) continue;
/* Make sure that the exiting process is not on the queue. */
xpp = &rp->p_caller_q;
while (*xpp != NIL_PROC) { /* check entire queue */
if (*xpp == rc) { /* process is on the queue */
*xpp = (*xpp)->p_q_link; /* replace by next process */
break;
}
xpp = &(*xpp)->p_q_link; /* proceed to next queued */
xpp = &proc[rc->p_sendto].p_caller_q; /* destination's queue */
while (*xpp != NIL_PROC) { /* check entire queue */
if (*xpp == rc) { /* process is on the queue */
*xpp = (*xpp)->p_q_link; /* replace by next process */
break; /* done, can only send one */
}
xpp = &(*xpp)->p_q_link; /* proceed to next queued */
}
}
/* Likewise, if another process was sending or receive a message to or from
* the exiting process, it must be alerted that process no longer is alive.
* Check all processes.
*/
for (rp = BEG_PROC_ADDR; rp < END_PROC_ADDR; rp++) {
/* Check if process is receiving from exiting process. */
if ((rp->p_rts_flags & RECEIVING) && rp->p_getfrom == proc_nr(rc)) {
rp->p_reg.retreg = EDEADSRCDST; /* report source died */
rp->p_rts_flags &= ~RECEIVING; /* no longer receiving */
lock_enqueue(rp); /* let process run again */
}
else if ((rp->p_rts_flags & SENDING) && rp->p_sendto == proc_nr(rc)) {
rp->p_reg.retreg = EDEADSRCDST; /* report destination died */
rp->p_rts_flags &= ~SENDING; /* no longer sending */
lock_enqueue(rp); /* let process run again */
}
}
/* Check the table with IRQ hooks to see if hooks should be released. */
for (i=0; i < NR_IRQ_HOOKS; i++) {
if (irq_hooks[i].proc_nr == proc_nr(rc)) {