diff --git a/kernel/proc.c b/kernel/proc.c index 286feb473..2635d299d 100755 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -680,7 +680,9 @@ timer_t *tp; /* watchdog timer pointer */ unlock(5); } } +#if DEBUG kprintf("ticks_added: %d\n", ticks_added); +#endif /* Now schedule a new watchdog timer to balance the queues again. The * period depends on the total amount of quantum ticks added. diff --git a/servers/pm/misc.c b/servers/pm/misc.c index b71adfa95..b4a50ca2c 100644 --- a/servers/pm/misc.c +++ b/servers/pm/misc.c @@ -171,10 +171,10 @@ PUBLIC int do_getprocnr() *===========================================================================*/ PUBLIC int do_reboot() { - char monitor_code[32*sizeof(char *)]; + static char *monitor_code = "delay;boot"; vir_bytes code_addr; int code_size; - int abort_flag; + int abort_flag, abort_proc_e; /* Check permission to abort the system. */ if (mp->mp_effuid != SUPER_USER) return(EPERM); @@ -182,7 +182,13 @@ PUBLIC int do_reboot() /* See how the system should be aborted. */ abort_flag = (unsigned) m_in.reboot_flag; if (abort_flag >= RBT_INVALID) return(EINVAL); - if (RBT_MONITOR == abort_flag) { + abort_proc_e = who_e; + if (RBT_REBOOT == abort_flag) { + abort_flag = RBT_MONITOR; + abort_proc_e = PM_PROC_NR; + code_addr = (vir_bytes) monitor_code; + code_size = strlen(monitor_code)+1; + } else if (RBT_MONITOR == abort_flag) { code_addr = (vir_bytes) m_in.reboot_code; code_size = m_in.reboot_strlen + 1; } @@ -203,7 +209,7 @@ PUBLIC int do_reboot() /* 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(abort_flag, who_e, code_addr, code_size); + sys_abort(abort_flag, abort_proc_e, code_addr, code_size); return(SUSPEND); /* don't reply to caller */ }