X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/1c79356b52d46aa6b508fb032f5ae709b1f2897b..9bccf70c0258c7cac2dcb80011b2a964d884c552:/bsd/kern/kern_shutdown.c diff --git a/bsd/kern/kern_shutdown.c b/bsd/kern/kern_shutdown.c index e9a2a2c52..45697a58d 100644 --- a/bsd/kern/kern_shutdown.c +++ b/bsd/kern/kern_shutdown.c @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #if NCPUS > 1 #include @@ -70,11 +70,12 @@ boot(paniced, howto, command) int hostboot_option=0; int funnel_state; - static void proc_shutdown(); + static void proc_shutdown(); + extern void md_prepare_for_shutdown(int paniced, int howto, char * command); funnel_state = thread_funnel_set(kernel_flock, TRUE); - /* md_prepare_for_shutdown(paniced, howto, command); */ + md_prepare_for_shutdown(paniced, howto, command); if ((howto&RB_NOSYNC)==0 && waittime < 0) { int iter, nbusy; @@ -161,7 +162,7 @@ proc_shutdown() /* * Kill as many procs as we can. (Except ourself...) */ - self = (struct proc *)(get_bsdtask_info(current_task())); + self = (struct proc *)current_proc(); /* * Suspend /etc/init @@ -170,13 +171,6 @@ proc_shutdown() if (p && p != self) task_suspend(p->task); /* stop init */ - /* - * Suspend mach_init - */ - p = pfind(2); - if (p && p != self) - task_suspend(p->task); /* stop mach_init */ - printf("Killing all processes "); /* @@ -250,12 +244,13 @@ proc_shutdown() * XXX */ if (p->exit_thread) { /* someone already doing it */ - thread_block(0);/* give him a chance */ + /* give him a chance */ + thread_block(THREAD_CONTINUE_NULL); } else { p->exit_thread = current_thread(); printf("."); - exit1(p, 1); + exit1(p, 1, (int *)NULL); } p = allproc.lh_first; }