{
/* Main routine of the process manager. */
- int result, proc_nr;
+ int result, s, proc_nr;
struct mproc *rmp;
pm_init(); /* initialize process manager tables */
* 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) {
- if (send(proc_nr, &rmp->mp_reply) != OK)
+ if ((rmp->mp_flags & IN_USE) &&
+ (rmp->mp_flags & (REPLY | ONSWAP)) == REPLY) {
+ if ((s=send(proc_nr, &rmp->mp_reply)) != OK) {
+ printf("Warning, PM send failed: %d, ", s);
panic("PM can't reply to", proc_nr);
+ }
rmp->mp_flags &= ~REPLY;
}
}
tell_fs(REBOOT,0,0,0); /* tell FS to prepare for shutdown */
check_sig(-1, SIGKILL); /* kill all processes except init */
+ /* Ask the kernel to abort. All system services, including the PM, will
+ * get a HARD_STOP notification. Await the notification in the main loop.
+ */
sys_abort(m_in.reboot_flag, PM_PROC_NR, monitor_code, m_in.reboot_size);
- sys_exit(0);
}
/*=====================================================================*