]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/kern/kern_shutdown.c
xnu-344.tar.gz
[apple/xnu.git] / bsd / kern / kern_shutdown.c
index e9a2a2c524efb05651ceb686cc6413406cb0b121..45697a58db7c60164b3a29d0a48055b4a0598aaa 100644 (file)
@@ -45,7 +45,7 @@
 #include <sys/signal.h>
 #include <sys/tty.h>
 #include <kern/task.h>
-#include <ufs/ufs/quota.h>
+#include <sys/quota.h>
 #include <ufs/ufs/inode.h>
 #if    NCPUS > 1
 #include <kern/processor.h>
@@ -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;
                }