diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2006-12-05 01:52:37 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-12-07 23:55:55 -0500 |
commit | 04da6af960194ecdee4c29cd3f86e766903418ca (patch) | |
tree | 310338d736b94f4665880aac81ef455873bb8c63 | |
parent | 0332c2d447a7a20a4d744ba3814a349d0c1c6405 (diff) |
[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>
-rw-r--r-- | arch/powerpc/platforms/pseries/hotplug-cpu.c | 18 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/setup.c | 16 | ||||
-rw-r--r-- | include/asm-powerpc/rtas.h | 2 |
3 files changed, 16 insertions, 20 deletions
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c index 6e21ebdfcef7..9e9b6b159fab 100644 --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c | |||
@@ -1,7 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * pseries CPU Hotplug infrastructure. | 2 | * pseries CPU Hotplug infrastructure. |
3 | * | 3 | * |
4 | * Split out from arch/powerpc/kernel/rtas.c | 4 | * Split out from arch/powerpc/platforms/pseries/setup.c and |
5 | * arch/powerpc/kernel/rtas.c | ||
5 | * | 6 | * |
6 | * Peter Bergner, IBM March 2001. | 7 | * Peter Bergner, IBM March 2001. |
7 | * Copyright (C) 2001 IBM. | 8 | * Copyright (C) 2001 IBM. |
@@ -34,7 +35,7 @@ static struct rtas_args rtas_stop_self_args = { | |||
34 | .rets = &rtas_stop_self_args.args[0], | 35 | .rets = &rtas_stop_self_args.args[0], |
35 | }; | 36 | }; |
36 | 37 | ||
37 | void rtas_stop_self(void) | 38 | static void rtas_stop_self(void) |
38 | { | 39 | { |
39 | struct rtas_args *args = &rtas_stop_self_args; | 40 | struct rtas_args *args = &rtas_stop_self_args; |
40 | 41 | ||
@@ -49,10 +50,23 @@ void rtas_stop_self(void) | |||
49 | panic("Alas, I survived.\n"); | 50 | panic("Alas, I survived.\n"); |
50 | } | 51 | } |
51 | 52 | ||
53 | static void pSeries_mach_cpu_die(void) | ||
54 | { | ||
55 | local_irq_disable(); | ||
56 | idle_task_exit(); | ||
57 | xics_teardown_cpu(0); | ||
58 | rtas_stop_self(); | ||
59 | /* Should never get here... */ | ||
60 | BUG(); | ||
61 | for(;;); | ||
62 | } | ||
63 | |||
52 | static int __init pseries_cpu_hotplug_init(void) | 64 | static int __init pseries_cpu_hotplug_init(void) |
53 | { | 65 | { |
54 | rtas_stop_self_args.token = rtas_token("stop-self"); | 66 | rtas_stop_self_args.token = rtas_token("stop-self"); |
55 | 67 | ||
68 | ppc_md.cpu_die = pSeries_mach_cpu_die; | ||
69 | |||
56 | return 0; | 70 | return 0; |
57 | } | 71 | } |
58 | arch_initcall(pseries_cpu_hotplug_init); | 72 | arch_initcall(pseries_cpu_hotplug_init); |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 0dc2548ca9bc..6090d753c44c 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -347,21 +347,6 @@ static int __init pSeries_init_panel(void) | |||
347 | } | 347 | } |
348 | arch_initcall(pSeries_init_panel); | 348 | arch_initcall(pSeries_init_panel); |
349 | 349 | ||
350 | #ifdef CONFIG_HOTPLUG_CPU | ||
351 | static void pSeries_mach_cpu_die(void) | ||
352 | { | ||
353 | local_irq_disable(); | ||
354 | idle_task_exit(); | ||
355 | xics_teardown_cpu(0); | ||
356 | rtas_stop_self(); | ||
357 | /* Should never get here... */ | ||
358 | BUG(); | ||
359 | for(;;); | ||
360 | } | ||
361 | #else | ||
362 | #define pSeries_mach_cpu_die NULL | ||
363 | #endif | ||
364 | |||
365 | static int pseries_set_dabr(unsigned long dabr) | 350 | static int pseries_set_dabr(unsigned long dabr) |
366 | { | 351 | { |
367 | return plpar_hcall_norets(H_SET_DABR, dabr); | 352 | return plpar_hcall_norets(H_SET_DABR, dabr); |
@@ -561,7 +546,6 @@ define_machine(pseries) { | |||
561 | .power_off = rtas_power_off, | 546 | .power_off = rtas_power_off, |
562 | .halt = rtas_halt, | 547 | .halt = rtas_halt, |
563 | .panic = rtas_os_term, | 548 | .panic = rtas_os_term, |
564 | .cpu_die = pSeries_mach_cpu_die, | ||
565 | .get_boot_time = rtas_get_boot_time, | 549 | .get_boot_time = rtas_get_boot_time, |
566 | .get_rtc_time = rtas_get_rtc_time, | 550 | .get_rtc_time = rtas_get_rtc_time, |
567 | .set_rtc_time = rtas_set_rtc_time, | 551 | .set_rtc_time = rtas_set_rtc_time, |
diff --git a/include/asm-powerpc/rtas.h b/include/asm-powerpc/rtas.h index 5a0c136c0416..031ef57fb195 100644 --- a/include/asm-powerpc/rtas.h +++ b/include/asm-powerpc/rtas.h | |||
@@ -221,8 +221,6 @@ extern int rtas_get_error_log_max(void); | |||
221 | extern spinlock_t rtas_data_buf_lock; | 221 | extern spinlock_t rtas_data_buf_lock; |
222 | extern char rtas_data_buf[RTAS_DATA_BUF_SIZE]; | 222 | extern char rtas_data_buf[RTAS_DATA_BUF_SIZE]; |
223 | 223 | ||
224 | extern void rtas_stop_self(void); | ||
225 | |||
226 | /* RMO buffer reserved for user-space RTAS use */ | 224 | /* RMO buffer reserved for user-space RTAS use */ |
227 | extern unsigned long rtas_rmo_buf; | 225 | extern unsigned long rtas_rmo_buf; |
228 | 226 | ||