Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04da6af9 authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras
Browse files

[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: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 0332c2d4
Loading
Loading
Loading
Loading
+16 −2
Original line number Original line Diff line number Diff line
/*
/*
 * pseries CPU Hotplug infrastructure.
 * pseries CPU Hotplug infrastructure.
 *
 *
 * Split out from arch/powerpc/kernel/rtas.c
 * Split out from arch/powerpc/platforms/pseries/setup.c and
 *  arch/powerpc/kernel/rtas.c
 *
 *
 * Peter Bergner, IBM	March 2001.
 * Peter Bergner, IBM	March 2001.
 * Copyright (C) 2001 IBM.
 * Copyright (C) 2001 IBM.
@@ -34,7 +35,7 @@ static struct rtas_args rtas_stop_self_args = {
	.rets = &rtas_stop_self_args.args[0],
	.rets = &rtas_stop_self_args.args[0],
};
};


void rtas_stop_self(void)
static void rtas_stop_self(void)
{
{
	struct rtas_args *args = &rtas_stop_self_args;
	struct rtas_args *args = &rtas_stop_self_args;


@@ -49,10 +50,23 @@ void rtas_stop_self(void)
	panic("Alas, I survived.\n");
	panic("Alas, I survived.\n");
}
}


static void pSeries_mach_cpu_die(void)
{
	local_irq_disable();
	idle_task_exit();
	xics_teardown_cpu(0);
	rtas_stop_self();
	/* Should never get here... */
	BUG();
	for(;;);
}

static int __init pseries_cpu_hotplug_init(void)
static int __init pseries_cpu_hotplug_init(void)
{
{
	rtas_stop_self_args.token = rtas_token("stop-self");
	rtas_stop_self_args.token = rtas_token("stop-self");


	ppc_md.cpu_die = pSeries_mach_cpu_die;

	return 0;
	return 0;
}
}
arch_initcall(pseries_cpu_hotplug_init);
arch_initcall(pseries_cpu_hotplug_init);
+0 −16
Original line number Original line Diff line number Diff line
@@ -347,21 +347,6 @@ static int __init pSeries_init_panel(void)
}
}
arch_initcall(pSeries_init_panel);
arch_initcall(pSeries_init_panel);


#ifdef CONFIG_HOTPLUG_CPU
static void pSeries_mach_cpu_die(void)
{
	local_irq_disable();
	idle_task_exit();
	xics_teardown_cpu(0);
	rtas_stop_self();
	/* Should never get here... */
	BUG();
	for(;;);
}
#else
#define pSeries_mach_cpu_die NULL
#endif

static int pseries_set_dabr(unsigned long dabr)
static int pseries_set_dabr(unsigned long dabr)
{
{
	return plpar_hcall_norets(H_SET_DABR, dabr);
	return plpar_hcall_norets(H_SET_DABR, dabr);
@@ -561,7 +546,6 @@ define_machine(pseries) {
	.power_off		= rtas_power_off,
	.power_off		= rtas_power_off,
	.halt			= rtas_halt,
	.halt			= rtas_halt,
	.panic			= rtas_os_term,
	.panic			= rtas_os_term,
	.cpu_die		= pSeries_mach_cpu_die,
	.get_boot_time		= rtas_get_boot_time,
	.get_boot_time		= rtas_get_boot_time,
	.get_rtc_time		= rtas_get_rtc_time,
	.get_rtc_time		= rtas_get_rtc_time,
	.set_rtc_time		= rtas_set_rtc_time,
	.set_rtc_time		= rtas_set_rtc_time,
+0 −2
Original line number Original line Diff line number Diff line
@@ -221,8 +221,6 @@ extern int rtas_get_error_log_max(void);
extern spinlock_t rtas_data_buf_lock;
extern spinlock_t rtas_data_buf_lock;
extern char rtas_data_buf[RTAS_DATA_BUF_SIZE];
extern char rtas_data_buf[RTAS_DATA_BUF_SIZE];


extern void rtas_stop_self(void);

/* RMO buffer reserved for user-space RTAS use */
/* RMO buffer reserved for user-space RTAS use */
extern unsigned long rtas_rmo_buf;
extern unsigned long rtas_rmo_buf;