[PATCH 9/23] x86_64: Implemenent machine_emergency_restart

From: Eric W. Biederman
Date: Tue Jul 26 2005 - 12:50:50 EST



It is not safe to call set_cpus_allowed() in interrupt
context and disabling the apics is complicated code.
So unconditionally skip machine_shutdown in machine_emergency_reboot
on x86_64.

Signed-off-by: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>
---

arch/x86_64/kernel/reboot.c | 18 +++++++++++-------
include/asm-x86_64/emergency-restart.h | 2 +-
2 files changed, 12 insertions(+), 8 deletions(-)

c274d84d274bd40c63be01cd6a4ba26ae2be135a
diff --git a/arch/x86_64/kernel/reboot.c b/arch/x86_64/kernel/reboot.c
--- a/arch/x86_64/kernel/reboot.c
+++ b/arch/x86_64/kernel/reboot.c
@@ -109,16 +109,10 @@ void machine_shutdown(void)
local_irq_enable();
}

-void machine_restart(char * __unused)
+void machine_emergency_restart(void)
{
int i;

- printk("machine restart\n");
-
- if (!reboot_force) {
- machine_shutdown();
- }
-
/* Tell the BIOS if we want cold or warm reboot */
*((unsigned short *)__va(0x472)) = reboot_mode;

@@ -143,6 +137,16 @@ void machine_restart(char * __unused)
}
}

+void machine_restart(char * __unused)
+{
+ printk("machine restart\n");
+
+ if (!reboot_force) {
+ machine_shutdown();
+ }
+ machine_emergency_restart();
+}
+
void machine_halt(void)
{
}
diff --git a/include/asm-x86_64/emergency-restart.h b/include/asm-x86_64/emergency-restart.h
--- a/include/asm-x86_64/emergency-restart.h
+++ b/include/asm-x86_64/emergency-restart.h
@@ -1,6 +1,6 @@
#ifndef _ASM_EMERGENCY_RESTART_H
#define _ASM_EMERGENCY_RESTART_H

-#include <asm-generic/emergency-restart.h>
+extern void machine_emergency_restart(void);

#endif /* _ASM_EMERGENCY_RESTART_H */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/