/* Handle the request. */
if ((unsigned) m.m_type < NR_SYS_CALLS) {
result = (*call_vec[m.m_type])(&m); /* do system call */
+ } else if(m.NOTIFY_TYPE == KSIG_PENDING) {
+ message pmm;
+ pmm.NOTIFY_TYPE = KSIG_PENDING;
+ lock_notify(PM_PROC_NR, &pmm);
+ continue;
} else {
kprintf("Warning, illegal SYSTASK request from %d.\n", m.m_source);
result = EBADREQUEST; /* illegal message type */
if (rp->p_rts_flags == 0) lock_unready(rp); /* make not ready */
rp->p_rts_flags |= SIGNALED | SIG_PENDING; /* update flags */
m.NOTIFY_TYPE = KSIG_PENDING;
- lock_notify(PM_PROC_NR, &m);
+ lock_notify(SYSTASK, &m);
}
}
}
* the call just made above. The processes must not be swapped out.
*/
for (proc_nr=0, rmp=mproc; proc_nr < NR_PROCS; proc_nr++, rmp++) {
- if ((rmp->mp_flags & (REPLY | ONSWAP)) == REPLY) {
+ /* In the meantime, the process may have been killed by a
+ * signal (e.g. if a lethal pending signal was unblocked)
+ * without the PM realizing it. If the slot is no longer in
+ * use or just a zombie, don't try to reply.
+ */
+ if ((rmp->mp_flags & (REPLY | ONSWAP | IN_USE | ZOMBIE)) ==
+ (REPLY | IN_USE)) {
if ((s=send(proc_nr, &rmp->mp_reply)) != OK) {
panic(__FILE__,"PM can't reply to", proc_nr);
}