diff options
author | Michael Neuling <mikey@neuling.org> | 2010-04-28 09:39:41 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-05-06 02:49:25 -0400 |
commit | f8b67691828321f5c85bb853283aa101ae673130 (patch) | |
tree | 0938bf959cb7d830547d76bc8a40c33dd03c1d2a /arch/powerpc/platforms/pseries/smp.c | |
parent | a32fe93daf9c6b6ffbab1d9b9e2a8e4c335bda5c (diff) |
powerpc/pseries: Make query_cpu_stopped callable outside hotplug cpu
This moves query_cpu_stopped() out of the hotplug cpu code and into
smp.c so it can called in other places and renames it to
smp_query_cpu_stopped().
It also cleans up the return values by adding some #defines
Cc: <stable@kernel.org>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/smp.c')
-rw-r--r-- | arch/powerpc/platforms/pseries/smp.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index 4e7f89a8456..20b694280a6 100644 --- a/arch/powerpc/platforms/pseries/smp.c +++ b/arch/powerpc/platforms/pseries/smp.c | |||
@@ -57,6 +57,28 @@ | |||
57 | */ | 57 | */ |
58 | static cpumask_t of_spin_map; | 58 | static cpumask_t of_spin_map; |
59 | 59 | ||
60 | /* Query where a cpu is now. Return codes #defined in plpar_wrappers.h */ | ||
61 | int smp_query_cpu_stopped(unsigned int pcpu) | ||
62 | { | ||
63 | int cpu_status, status; | ||
64 | int qcss_tok = rtas_token("query-cpu-stopped-state"); | ||
65 | |||
66 | if (qcss_tok == RTAS_UNKNOWN_SERVICE) { | ||
67 | printk(KERN_INFO "Firmware doesn't support " | ||
68 | "query-cpu-stopped-state\n"); | ||
69 | return QCSS_HARDWARE_ERROR; | ||
70 | } | ||
71 | |||
72 | status = rtas_call(qcss_tok, 1, 2, &cpu_status, pcpu); | ||
73 | if (status != 0) { | ||
74 | printk(KERN_ERR | ||
75 | "RTAS query-cpu-stopped-state failed: %i\n", status); | ||
76 | return status; | ||
77 | } | ||
78 | |||
79 | return cpu_status; | ||
80 | } | ||
81 | |||
60 | /** | 82 | /** |
61 | * smp_startup_cpu() - start the given cpu | 83 | * smp_startup_cpu() - start the given cpu |
62 | * | 84 | * |