Commit ba044d2f authored by He Sheng's avatar He Sheng Committed by guzitao
Browse files

sw64: guard hotplug cpu specific code

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I56OLG



--------------------------------

Add #ifdef guard around hotplug cpu specific code.

It also moves arch_cpu_idle_dead into smp.c because HOTPLUG_CPU
depends on SMP.

Signed-off-by: default avatarHe Sheng <hesheng@wxiat.com>
Reviewed-by: default avatarCui Wei <cuiwei@wxiat.com>
Signed-off-by: default avatarGu Zitao <guzitao@wxiat.com>
parent 9d6511bf
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -78,7 +78,6 @@ extern int __rcid_to_cpu[NR_CPUS];
#define cpu_physical_id(cpu)    __cpu_to_rcid[cpu]

extern unsigned long tidle_pcb[NR_CPUS];
extern void play_dead(void);
extern void arch_send_call_function_single_ipi(int cpu);
extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);

@@ -88,10 +87,6 @@ void __cpu_die(unsigned int cpu);
#endif /* CONFIG_HOTPLUG_CPU */

#else /* CONFIG_SMP */
static inline void play_dead(void)
{
	BUG(); /*Fixed me*/
}
#define hard_smp_processor_id()		0
#define smp_call_function_on_cpu(func, info, wait, cpu)    ({ 0; })
#define cpu_to_rcid(cpu)	((int)whami())
+0 −7
Original line number Diff line number Diff line
@@ -9,13 +9,6 @@
#include <asm/idle.h>
#include <asm/asm-offsets.h>

#ifdef CONFIG_HOTPLUG_CPU
void arch_cpu_idle_dead(void)
{
	play_dead();
}
#endif

void cpu_idle(void)
{
	local_irq_enable();
+3 −3
Original line number Diff line number Diff line
@@ -537,6 +537,7 @@ void flush_tlb_kernel_range(unsigned long start, unsigned long end)
}
EXPORT_SYMBOL(flush_tlb_kernel_range);

#ifdef CONFIG_HOTPLUG_CPU
int __cpu_disable(void)
{
	int cpu = smp_processor_id();
@@ -566,14 +567,12 @@ void __cpu_die(unsigned int cpu)
	pr_err("CPU %u didn't die...\n", cpu);
}

void play_dead(void)
void arch_cpu_idle_dead(void)
{
	idle_task_exit();
	mb();
	__this_cpu_write(cpu_state, CPU_DEAD);
#ifdef CONFIG_HOTPLUG_CPU
	fixup_irqs();
#endif
	local_irq_disable();

	if (is_in_guest()) {
@@ -602,3 +601,4 @@ void play_dead(void)
	asm volatile("halt");
#endif
}
#endif