*===========================================================================*/
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);
/* 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;
}
/* 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 */
}