Commit 59586e5a authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Linus Torvalds
Browse files

[PATCH] Don't export machine_restart, machine_halt, or machine_power_off.



machine_restart, machine_halt and machine_power_off are machine
specific hooks deep into the reboot logic, that modules
have no business messing with.  Usually code should be calling
kernel_restart, kernel_halt, kernel_power_off, or
emergency_restart. So don't export machine_restart,
machine_halt, and machine_power_off so we can catch buggy users.

Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 16dcb4bb
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -165,7 +165,6 @@ machine_restart(char *restart_cmd)
	common_shutdown(LINUX_REBOOT_CMD_RESTART, restart_cmd);
}

EXPORT_SYMBOL(machine_restart);

void
machine_halt(void)
@@ -173,7 +172,6 @@ machine_halt(void)
	common_shutdown(LINUX_REBOOT_CMD_HALT, NULL);
}

EXPORT_SYMBOL(machine_halt);

void
machine_power_off(void)
@@ -181,7 +179,6 @@ machine_power_off(void)
	common_shutdown(LINUX_REBOOT_CMD_POWER_OFF, NULL);
}

EXPORT_SYMBOL(machine_power_off);

/* Used by sysrq-p, among others.  I don't believe r9-r15 are ever
   saved in the context it's used.  */
+0 −4
Original line number Diff line number Diff line
@@ -131,7 +131,6 @@ void machine_halt(void)
{
}

EXPORT_SYMBOL(machine_halt);

void machine_power_off(void)
{
@@ -139,7 +138,6 @@ void machine_power_off(void)
		pm_power_off();
}

EXPORT_SYMBOL(machine_power_off);

void machine_restart(char * __unused)
{
@@ -169,8 +167,6 @@ void machine_restart(char * __unused)
	while (1);
}

EXPORT_SYMBOL(machine_restart);

void __show_regs(struct pt_regs *regs)
{
	unsigned long flags = condition_codes(regs);
+0 −5
Original line number Diff line number Diff line
@@ -103,9 +103,6 @@ void machine_power_off(void)
{
}

EXPORT_SYMBOL(machine_halt);
EXPORT_SYMBOL(machine_power_off);

void machine_restart(char * __unused)
{
	/*
@@ -136,8 +133,6 @@ void machine_restart(char * __unused)
	while (1);
}

EXPORT_SYMBOL(machine_restart);

void show_regs(struct pt_regs * regs)
{
	unsigned long flags;
+0 −6
Original line number Diff line number Diff line
@@ -214,8 +214,6 @@ void machine_restart(char *cmd)
	hard_reset_now();
}

EXPORT_SYMBOL(machine_restart);

/*
 * Similar to machine_power_off, but don't shut off power.  Add code
 * here to freeze the system for e.g. post-mortem debug purpose when
@@ -226,16 +224,12 @@ void machine_halt(void)
{
}

EXPORT_SYMBOL(machine_halt);

/* If or when software power-off is implemented, add code here.  */

void machine_power_off(void)
{
}

EXPORT_SYMBOL(machine_power_off);

/*
 * When a process does an "exec", machine state like FPU and debug
 * registers need to be reset.  This is a hook function for that.
+0 −6
Original line number Diff line number Diff line
@@ -90,8 +90,6 @@ void machine_restart(char * __unused)
	__asm__("jmp @@0"); 
}

EXPORT_SYMBOL(machine_restart);

void machine_halt(void)
{
	local_irq_disable();
@@ -99,8 +97,6 @@ void machine_halt(void)
	for (;;);
}

EXPORT_SYMBOL(machine_halt);

void machine_power_off(void)
{
	local_irq_disable();
@@ -108,8 +104,6 @@ void machine_power_off(void)
	for (;;);
}

EXPORT_SYMBOL(machine_power_off);

void show_regs(struct pt_regs * regs)
{
	printk("\nPC: %08lx  Status: %02x",
Loading