aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms/pseries/hotplug-cpu.c
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2006-12-05 17:52:37 +1100
committerPaul Mackerras <paulus@samba.org>2006-12-08 15:55:55 +1100
commit04da6af960194ecdee4c29cd3f86e766903418ca (patch)
tree310338d736b94f4665880aac81ef455873bb8c63 /arch/powerpc/platforms/pseries/hotplug-cpu.c
parent0332c2d447a7a20a4d744ba3814a349d0c1c6405 (diff)
downloadlinaro-lsk-04da6af960194ecdee4c29cd3f86e766903418ca.tar.gz
[POWERPC] Move pSeries_mach_cpu_die() into platforms/pseries/hotplug-cpu.c
Move pSeries_mach_cpu_die() into platforms/pseries/hotplug-cpu.c, this allows rtas_stop_self() to be static so remove the prototype. Wire up pSeries_mach_cpu_die() in the initcall, rather than statically in setup.c, the initcall will still run prior to the cpu hotplug code being callable, so there should be no change in behaviour. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/hotplug-cpu.c')
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-cpu.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 6e21ebdfcef..9e9b6b159fa 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -1,7 +1,8 @@
/*
* pseries CPU Hotplug infrastructure.
*
- * Split out from arch/powerpc/kernel/rtas.c
+ * Split out from arch/powerpc/platforms/pseries/setup.c and
+ * arch/powerpc/kernel/rtas.c
*
* Peter Bergner, IBM March 2001.
* Copyright (C) 2001 IBM.
@@ -34,7 +35,7 @@ static struct rtas_args rtas_stop_self_args = {
.rets = &rtas_stop_self_args.args[0],
};
-void rtas_stop_self(void)
+static void rtas_stop_self(void)
{
struct rtas_args *args = &rtas_stop_self_args;
@@ -49,10 +50,23 @@ void rtas_stop_self(void)
panic("Alas, I survived.\n");
}
+static void pSeries_mach_cpu_die(void)
+{
+ local_irq_disable();
+ idle_task_exit();
+ xics_teardown_cpu(0);
+ rtas_stop_self();
+ /* Should never get here... */
+ BUG();
+ for(;;);
+}
+
static int __init pseries_cpu_hotplug_init(void)
{
rtas_stop_self_args.token = rtas_token("stop-self");
+ ppc_md.cpu_die = pSeries_mach_cpu_die;
+
return 0;
}
arch_initcall(pseries_cpu_hotplug_init);