]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kern/machine.c
xnu-344.49.tar.gz
[apple/xnu.git] / osfmk / kern / machine.c
index bb76bcf963ac5352b433cb447a6cd6585330be8f..20f13346e149b3cf3aac1bd08ac7d25b612ff933 100644 (file)
@@ -460,18 +460,17 @@ void
 processor_doshutdown(
        processor_t             processor)
 {
 processor_doshutdown(
        processor_t             processor)
 {
-       register thread_t       old_thread = current_thread();
-       register int            cpu = processor->slot_num;
+       register int    cpu = processor->slot_num;
 
        timer_call_cancel(&processor->quantum_timer);
 
        timer_call_cancel(&processor->quantum_timer);
+       thread_dispatch(current_thread());
        timer_switch(&kernel_timer[cpu]);
        timer_switch(&kernel_timer[cpu]);
-       thread_machine_set_current(processor->idle_thread);
-       thread_dispatch(old_thread);
 
        /*
         *      OK, now exit this cpu.
         */
        PMAP_DEACTIVATE_KERNEL(cpu);
 
        /*
         *      OK, now exit this cpu.
         */
        PMAP_DEACTIVATE_KERNEL(cpu);
+       thread_machine_set_current(processor->idle_thread);
        cpu_down(cpu);
        cpu_sleep();
        panic("zombie processor");
        cpu_down(cpu);
        cpu_sleep();
        panic("zombie processor");