Commit a1996f88 authored by Zwane Mwaikambo's avatar Zwane Mwaikambo Committed by Linus Torvalds

[PATCH] ppc64: Move hotplug cpu functions to smp_ops

This should allow for easier adding of hotplug cpu support for other PPC64
subarchs.  The patch is untested but does compile with and without hotplug
cpu on pSeries and G5 configs.  What can get slightly confusing is the fact
that both ppc_md and smp_ops have cpu_die members.
Signed-off-by: default avatarZwane Mwaikambo <zwane@arm.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 17636ba6
......@@ -87,7 +87,7 @@ static int query_cpu_stopped(unsigned int pcpu)
#ifdef CONFIG_HOTPLUG_CPU
int __cpu_disable(void)
int pSeries_cpu_disable(void)
{
/* FIXME: go put this in a header somewhere */
extern void xics_migrate_irqs_away(void);
......@@ -103,7 +103,7 @@ int __cpu_disable(void)
return 0;
}
void __cpu_die(unsigned int cpu)
void pSeries_cpu_die(unsigned int cpu)
{
int tries;
int cpu_status;
......@@ -352,6 +352,11 @@ void __init smp_init_pSeries(void)
else
smp_ops = &pSeries_xics_smp_ops;
#ifdef CONFIG_HOTPLUG_CPU
smp_ops->cpu_disable = pSeries_cpu_disable;
smp_ops->cpu_die = pSeries_cpu_die;
#endif
/* Start secondary threads on SMT systems; primary threads
* are already in the running state.
*/
......
......@@ -551,3 +551,19 @@ void __init smp_cpus_done(unsigned int max_cpus)
*/
cpu_present_map = cpu_possible_map;
}
#ifdef CONFIG_HOTPLUG_CPU
int __cpu_disable(void)
{
if (smp_ops->cpu_disable)
return smp_ops->cpu_disable();
return -ENOSYS;
}
void __cpu_die(unsigned int cpu)
{
if (smp_ops->cpu_die)
smp_ops->cpu_die(cpu);
}
#endif
......@@ -31,6 +31,8 @@ struct smp_ops_t {
void (*late_setup_cpu)(int nr);
void (*take_timebase)(void);
void (*give_timebase)(void);
int (*cpu_disable)(void);
void (*cpu_die)(unsigned int nr);
};
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment