aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/alpha/kernel/process.c5
-rw-r--r--arch/m32r/kernel/process.c4
-rw-r--r--arch/um/kernel/reboot.c2
-rw-r--r--kernel/sys.c6
4 files changed, 17 insertions, 0 deletions
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index a8682612abc0..abb739b88ed1 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -43,6 +43,11 @@
43#include "proto.h" 43#include "proto.h"
44#include "pci_impl.h" 44#include "pci_impl.h"
45 45
46/*
47 * Power off function, if any
48 */
49void (*pm_power_off)(void) = machine_power_off;
50
46void 51void
47cpu_idle(void) 52cpu_idle(void)
48{ 53{
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c
index cc4b571e5db7..3bf55d92933f 100644
--- a/arch/m32r/kernel/process.c
+++ b/arch/m32r/kernel/process.c
@@ -50,6 +50,10 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
50 * Powermanagement idle function, if any.. 50 * Powermanagement idle function, if any..
51 */ 51 */
52void (*pm_idle)(void) = NULL; 52void (*pm_idle)(void) = NULL;
53EXPORT_SYMBOL(pm_idle);
54
55void (*pm_power_off)(void) = NULL;
56EXPORT_SYMBOL(pm_power_off);
53 57
54void disable_hlt(void) 58void disable_hlt(void)
55{ 59{
diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel/reboot.c
index a637e885c583..6f1a3a288117 100644
--- a/arch/um/kernel/reboot.c
+++ b/arch/um/kernel/reboot.c
@@ -12,6 +12,8 @@
12#include "mode.h" 12#include "mode.h"
13#include "choose-mode.h" 13#include "choose-mode.h"
14 14
15void (*pm_power_off)(void);
16
15#ifdef CONFIG_SMP 17#ifdef CONFIG_SMP
16static void kill_idlers(int me) 18static void kill_idlers(int me)
17{ 19{
diff --git a/kernel/sys.c b/kernel/sys.c
index eecf84526afe..d8e49e659027 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -489,6 +489,12 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user
489 magic2 != LINUX_REBOOT_MAGIC2C)) 489 magic2 != LINUX_REBOOT_MAGIC2C))
490 return -EINVAL; 490 return -EINVAL;
491 491
492 /* Instead of trying to make the power_off code look like
493 * halt when pm_power_off is not set do it the easy way.
494 */
495 if ((cmd == LINUX_REBOOT_CMD_POWER_OFF) && !pm_power_off)
496 cmd = LINUX_REBOOT_CMD_HALT;
497
492 lock_kernel(); 498 lock_kernel();
493 switch (cmd) { 499 switch (cmd) {
494 case LINUX_REBOOT_CMD_RESTART: 500 case LINUX_REBOOT_CMD_RESTART: