aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorRobin Holt <holt@sgi.com>2013-07-08 19:01:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-09 13:33:29 -0400
commitedf2b1394611fef7806d4af72179dc3ac101f275 (patch)
tree1dfe9b606bc1f72bc46da264b12a277d74e2caf7 /arch/x86
parent972ee83df88a7fd84c228a31b4f9611299898984 (diff)
reboot: x86: prepare reboot_mode for moving to generic kernel code
Prepare for the moving the parsing of reboot= to the generic kernel code by making reboot_mode into a more generic form. Signed-off-by: Robin Holt <holt@sgi.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Miguel Boton <mboton.lkml@gmail.com> Cc: Russ Anderson <rja@sgi.com> Cc: Robin Holt <holt@sgi.com> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Acked-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/reboot.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 76fa1e9a2b39..f7703401d6cb 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -36,7 +36,7 @@ void (*pm_power_off)(void);
36EXPORT_SYMBOL(pm_power_off); 36EXPORT_SYMBOL(pm_power_off);
37 37
38static const struct desc_ptr no_idt = {}; 38static const struct desc_ptr no_idt = {};
39static int reboot_mode; 39static enum reboot_mode reboot_mode;
40enum reboot_type reboot_type = BOOT_ACPI; 40enum reboot_type reboot_type = BOOT_ACPI;
41int reboot_force; 41int reboot_force;
42 42
@@ -88,11 +88,11 @@ static int __init reboot_setup(char *str)
88 88
89 switch (*str) { 89 switch (*str) {
90 case 'w': 90 case 'w':
91 reboot_mode = 0x1234; 91 reboot_mode = REBOOT_WARM;
92 break; 92 break;
93 93
94 case 'c': 94 case 'c':
95 reboot_mode = 0; 95 reboot_mode = REBOOT_COLD;
96 break; 96 break;
97 97
98#ifdef CONFIG_SMP 98#ifdef CONFIG_SMP
@@ -536,6 +536,7 @@ static void native_machine_emergency_restart(void)
536 int i; 536 int i;
537 int attempt = 0; 537 int attempt = 0;
538 int orig_reboot_type = reboot_type; 538 int orig_reboot_type = reboot_type;
539 unsigned short mode;
539 540
540 if (reboot_emergency) 541 if (reboot_emergency)
541 emergency_vmx_disable_all(); 542 emergency_vmx_disable_all();
@@ -543,7 +544,8 @@ static void native_machine_emergency_restart(void)
543 tboot_shutdown(TB_SHUTDOWN_REBOOT); 544 tboot_shutdown(TB_SHUTDOWN_REBOOT);
544 545
545 /* Tell the BIOS if we want cold or warm reboot */ 546 /* Tell the BIOS if we want cold or warm reboot */
546 *((unsigned short *)__va(0x472)) = reboot_mode; 547 mode = reboot_mode == REBOOT_WARM ? 0x1234 : 0;
548 *((unsigned short *)__va(0x472)) = mode;
547 549
548 for (;;) { 550 for (;;) {
549 /* Could also try the reset bit in the Hammer NB */ 551 /* Could also try the reset bit in the Hammer NB */
@@ -585,7 +587,7 @@ static void native_machine_emergency_restart(void)
585 587
586 case BOOT_EFI: 588 case BOOT_EFI:
587 if (efi_enabled(EFI_RUNTIME_SERVICES)) 589 if (efi_enabled(EFI_RUNTIME_SERVICES))
588 efi.reset_system(reboot_mode ? 590 efi.reset_system(reboot_mode == REBOOT_WARM ?
589 EFI_RESET_WARM : 591 EFI_RESET_WARM :
590 EFI_RESET_COLD, 592 EFI_RESET_COLD,
591 EFI_SUCCESS, 0, NULL); 593 EFI_SUCCESS, 0, NULL);