patch-2.4.22 linux-2.4.22/arch/x86_64/kernel/smp.c

Next file: linux-2.4.22/arch/x86_64/kernel/suspend.c
Previous file: linux-2.4.22/arch/x86_64/kernel/setup64.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/arch/x86_64/kernel/smp.c linux-2.4.22/arch/x86_64/kernel/smp.c
@@ -488,7 +488,7 @@
 	return 0;
 }
 
-static void stop_this_cpu (void * dummy)
+void smp_stop_cpu(void)
 {
 	/*
 	 * Remove this CPU:
@@ -496,8 +496,14 @@
 	clear_bit(smp_processor_id(), &cpu_online_map);
 	__cli();
 	disable_local_APIC();
-	for(;;) __asm__("hlt");
-	for (;;);
+	__sti(); 
+}
+
+static void smp_really_stop_cpu(void *dummy)
+{
+	smp_stop_cpu(); 
+	for (;;) 
+		asm("hlt"); 
 }
 
 /*
@@ -506,12 +512,8 @@
 
 void smp_send_stop(void)
 {
-	smp_call_function(stop_this_cpu, NULL, 1, 0);
-	smp_num_cpus = 1;
-
-	__cli();
-	disable_local_APIC();
-	__sti();
+	smp_call_function(smp_really_stop_cpu, NULL, 1, 0);
+	smp_stop_cpu();
 }
 
 /*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)