aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/process.c
diff options
context:
space:
mode:
authorIvan Vecera <ivecera@redhat.com>2008-11-11 08:33:44 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-11 08:50:02 -0500
commitd3ec5cae0921611ceae06464ef6291012dd9849f (patch)
tree81a84f184f9047b12895bbd91c1e8b1ff2e076f0 /arch/x86/kernel/process.c
parent3ad4f597058301c97f362e500a32f63f5c950a45 (diff)
x86: call machine_shutdown and stop all CPUs in native_machine_halt
Impact: really halt all CPUs on halt Function machine_halt (resp. native_machine_halt) is empty for x86 architectures. When command 'halt -f' is invoked, the message "System halted." is displayed but this is not really true because all CPUs are still running. There are also similar inconsistencies for other arches (some uses power-off for halt or forever-loop with IRQs enabled/disabled). IMO there should be used the same approach for all architectures OR what does the message "System halted" really mean? This patch fixes it for x86. Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/process.c')
-rw-r--r--arch/x86/kernel/process.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index c622772744d8..a4da7c4b3129 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -8,6 +8,7 @@
8#include <linux/pm.h> 8#include <linux/pm.h>
9#include <linux/clockchips.h> 9#include <linux/clockchips.h>
10#include <asm/system.h> 10#include <asm/system.h>
11#include <asm/apic.h>
11 12
12unsigned long idle_halt; 13unsigned long idle_halt;
13EXPORT_SYMBOL(idle_halt); 14EXPORT_SYMBOL(idle_halt);
@@ -122,6 +123,21 @@ void default_idle(void)
122EXPORT_SYMBOL(default_idle); 123EXPORT_SYMBOL(default_idle);
123#endif 124#endif
124 125
126void stop_this_cpu(void *dummy)
127{
128 local_irq_disable();
129 /*
130 * Remove this CPU:
131 */
132 cpu_clear(smp_processor_id(), cpu_online_map);
133 disable_local_APIC();
134
135 for (;;) {
136 if (hlt_works(smp_processor_id()))
137 halt();
138 }
139}
140
125static void do_nothing(void *unused) 141static void do_nothing(void *unused)
126{ 142{
127} 143}