diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2006-12-05 01:52:36 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-12-07 23:55:54 -0500 |
commit | 0332c2d447a7a20a4d744ba3814a349d0c1c6405 (patch) | |
tree | 5929c942c011f8a978788a9dd1d02c265cd06148 /arch | |
parent | a081e126e12f78651499ba0f9944a7df1e9b06b6 (diff) |
[POWERPC] Move rtas_stop_self() into platforms/pseries/hotplug-cpu.c
As the first step in consolidating the pseries hotplug cpu code,
create platforms/pseries/hotplug-cpu.c and move rtas_stop_self()
into it. Do the rtas token initialisation in a new initcall, rather
than rtas_initialize().
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/rtas.c | 29 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/hotplug-cpu.c | 58 |
3 files changed, 60 insertions, 29 deletions
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index 387ed0d9ad61..952f4c2fc1eb 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c | |||
@@ -810,32 +810,6 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs) | |||
810 | return 0; | 810 | return 0; |
811 | } | 811 | } |
812 | 812 | ||
813 | #ifdef CONFIG_HOTPLUG_CPU | ||
814 | /* This version can't take the spinlock, because it never returns */ | ||
815 | static struct rtas_args rtas_stop_self_args = { | ||
816 | /* The token is initialized for real in setup_system() */ | ||
817 | .token = RTAS_UNKNOWN_SERVICE, | ||
818 | .nargs = 0, | ||
819 | .nret = 1, | ||
820 | .rets = &rtas_stop_self_args.args[0], | ||
821 | }; | ||
822 | |||
823 | void rtas_stop_self(void) | ||
824 | { | ||
825 | struct rtas_args *rtas_args = &rtas_stop_self_args; | ||
826 | |||
827 | local_irq_disable(); | ||
828 | |||
829 | BUG_ON(rtas_args->token == RTAS_UNKNOWN_SERVICE); | ||
830 | |||
831 | printk("cpu %u (hwid %u) Ready to die...\n", | ||
832 | smp_processor_id(), hard_smp_processor_id()); | ||
833 | enter_rtas(__pa(rtas_args)); | ||
834 | |||
835 | panic("Alas, I survived.\n"); | ||
836 | } | ||
837 | #endif | ||
838 | |||
839 | /* | 813 | /* |
840 | * Call early during boot, before mem init or bootmem, to retrieve the RTAS | 814 | * Call early during boot, before mem init or bootmem, to retrieve the RTAS |
841 | * informations from the device-tree and allocate the RMO buffer for userland | 815 | * informations from the device-tree and allocate the RMO buffer for userland |
@@ -880,9 +854,6 @@ void __init rtas_initialize(void) | |||
880 | #endif | 854 | #endif |
881 | rtas_rmo_buf = lmb_alloc_base(RTAS_RMOBUF_MAX, PAGE_SIZE, rtas_region); | 855 | rtas_rmo_buf = lmb_alloc_base(RTAS_RMOBUF_MAX, PAGE_SIZE, rtas_region); |
882 | 856 | ||
883 | #ifdef CONFIG_HOTPLUG_CPU | ||
884 | rtas_stop_self_args.token = rtas_token("stop-self"); | ||
885 | #endif /* CONFIG_HOTPLUG_CPU */ | ||
886 | #ifdef CONFIG_RTAS_ERROR_LOGGING | 857 | #ifdef CONFIG_RTAS_ERROR_LOGGING |
887 | rtas_last_error_token = rtas_token("rtas-last-error"); | 858 | rtas_last_error_token = rtas_token("rtas-last-error"); |
888 | #endif | 859 | #endif |
diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile index 997243a91be8..69590fbf83da 100644 --- a/arch/powerpc/platforms/pseries/Makefile +++ b/arch/powerpc/platforms/pseries/Makefile | |||
@@ -10,6 +10,8 @@ obj-$(CONFIG_XICS) += xics.o | |||
10 | obj-$(CONFIG_SCANLOG) += scanlog.o | 10 | obj-$(CONFIG_SCANLOG) += scanlog.o |
11 | obj-$(CONFIG_EEH) += eeh.o eeh_cache.o eeh_driver.o eeh_event.o | 11 | obj-$(CONFIG_EEH) += eeh.o eeh_cache.o eeh_driver.o eeh_event.o |
12 | 12 | ||
13 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug-cpu.o | ||
14 | |||
13 | obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o | 15 | obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o |
14 | obj-$(CONFIG_HVCS) += hvcserver.o | 16 | obj-$(CONFIG_HVCS) += hvcserver.o |
15 | obj-$(CONFIG_HCALL_STATS) += hvCall_inst.o | 17 | obj-$(CONFIG_HCALL_STATS) += hvCall_inst.o |
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c new file mode 100644 index 000000000000..6e21ebdfcef7 --- /dev/null +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * pseries CPU Hotplug infrastructure. | ||
3 | * | ||
4 | * Split out from arch/powerpc/kernel/rtas.c | ||
5 | * | ||
6 | * Peter Bergner, IBM March 2001. | ||
7 | * Copyright (C) 2001 IBM. | ||
8 | * | ||
9 | * Copyright (C) 2006 Michael Ellerman, IBM Corporation | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or | ||
12 | * modify it under the terms of the GNU General Public License | ||
13 | * as published by the Free Software Foundation; either version | ||
14 | * 2 of the License, or (at your option) any later version. | ||
15 | */ | ||
16 | |||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/delay.h> | ||
19 | #include <linux/cpu.h> | ||
20 | #include <asm/system.h> | ||
21 | #include <asm/prom.h> | ||
22 | #include <asm/rtas.h> | ||
23 | #include <asm/firmware.h> | ||
24 | #include <asm/machdep.h> | ||
25 | #include <asm/vdso_datapage.h> | ||
26 | #include <asm/pSeries_reconfig.h> | ||
27 | #include "xics.h" | ||
28 | |||
29 | /* This version can't take the spinlock, because it never returns */ | ||
30 | static struct rtas_args rtas_stop_self_args = { | ||
31 | .token = RTAS_UNKNOWN_SERVICE, | ||
32 | .nargs = 0, | ||
33 | .nret = 1, | ||
34 | .rets = &rtas_stop_self_args.args[0], | ||
35 | }; | ||
36 | |||
37 | void rtas_stop_self(void) | ||
38 | { | ||
39 | struct rtas_args *args = &rtas_stop_self_args; | ||
40 | |||
41 | local_irq_disable(); | ||
42 | |||
43 | BUG_ON(args->token == RTAS_UNKNOWN_SERVICE); | ||
44 | |||
45 | printk("cpu %u (hwid %u) Ready to die...\n", | ||
46 | smp_processor_id(), hard_smp_processor_id()); | ||
47 | enter_rtas(__pa(args)); | ||
48 | |||
49 | panic("Alas, I survived.\n"); | ||
50 | } | ||
51 | |||
52 | static int __init pseries_cpu_hotplug_init(void) | ||
53 | { | ||
54 | rtas_stop_self_args.token = rtas_token("stop-self"); | ||
55 | |||
56 | return 0; | ||
57 | } | ||
58 | arch_initcall(pseries_cpu_hotplug_init); | ||