aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/reboot_64.c20
-rw-r--r--include/asm-x86/emergency-restart.h9
2 files changed, 22 insertions, 7 deletions
diff --git a/arch/x86/kernel/reboot_64.c b/arch/x86/kernel/reboot_64.c
index 307f996a3933..d6bdf93ffca9 100644
--- a/arch/x86/kernel/reboot_64.c
+++ b/arch/x86/kernel/reboot_64.c
@@ -9,6 +9,7 @@
9#include <linux/pm.h> 9#include <linux/pm.h>
10#include <linux/kdebug.h> 10#include <linux/kdebug.h>
11#include <linux/sched.h> 11#include <linux/sched.h>
12#include <linux/efi.h>
12#include <acpi/reboot.h> 13#include <acpi/reboot.h>
13#include <asm/io.h> 14#include <asm/io.h>
14#include <asm/delay.h> 15#include <asm/delay.h>
@@ -28,20 +29,17 @@ void (*pm_power_off)(void);
28EXPORT_SYMBOL(pm_power_off); 29EXPORT_SYMBOL(pm_power_off);
29 30
30static long no_idt[3]; 31static long no_idt[3];
31static enum { 32enum reboot_type reboot_type = BOOT_KBD;
32 BOOT_TRIPLE = 't',
33 BOOT_KBD = 'k',
34 BOOT_ACPI = 'a'
35} reboot_type = BOOT_KBD;
36static int reboot_mode = 0; 33static int reboot_mode = 0;
37int reboot_force; 34int reboot_force;
38 35
39/* reboot=t[riple] | k[bd] [, [w]arm | [c]old] 36/* reboot=t[riple] | k[bd] | e[fi] [, [w]arm | [c]old]
40 warm Don't set the cold reboot flag 37 warm Don't set the cold reboot flag
41 cold Set the cold reboot flag 38 cold Set the cold reboot flag
42 triple Force a triple fault (init) 39 triple Force a triple fault (init)
43 kbd Use the keyboard controller. cold reset (default) 40 kbd Use the keyboard controller. cold reset (default)
44 acpi Use the RESET_REG in the FADT 41 acpi Use the RESET_REG in the FADT
42 efi Use efi reset_system runtime service
45 force Avoid anything that could hang. 43 force Avoid anything that could hang.
46 */ 44 */
47static int __init reboot_setup(char *str) 45static int __init reboot_setup(char *str)
@@ -60,6 +58,7 @@ static int __init reboot_setup(char *str)
60 case 'a': 58 case 'a':
61 case 'b': 59 case 'b':
62 case 'k': 60 case 'k':
61 case 'e':
63 reboot_type = *str; 62 reboot_type = *str;
64 break; 63 break;
65 case 'f': 64 case 'f':
@@ -155,7 +154,14 @@ void machine_emergency_restart(void)
155 acpi_reboot(); 154 acpi_reboot();
156 reboot_type = BOOT_KBD; 155 reboot_type = BOOT_KBD;
157 break; 156 break;
158 } 157
158 case BOOT_EFI:
159 if (efi_enabled)
160 efi.reset_system(reboot_mode ? EFI_RESET_WARM : EFI_RESET_COLD,
161 EFI_SUCCESS, 0, NULL);
162 reboot_type = BOOT_KBD;
163 break;
164 }
159 } 165 }
160} 166}
161 167
diff --git a/include/asm-x86/emergency-restart.h b/include/asm-x86/emergency-restart.h
index 680c39563345..54189084462a 100644
--- a/include/asm-x86/emergency-restart.h
+++ b/include/asm-x86/emergency-restart.h
@@ -1,6 +1,15 @@
1#ifndef _ASM_EMERGENCY_RESTART_H 1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H 2#define _ASM_EMERGENCY_RESTART_H
3 3
4enum reboot_type {
5 BOOT_TRIPLE = 't',
6 BOOT_KBD = 'k',
7 BOOT_ACPI = 'a',
8 BOOT_EFI = 'e'
9};
10
11extern enum reboot_type reboot_type;
12
4extern void machine_emergency_restart(void); 13extern void machine_emergency_restart(void);
5 14
6#endif /* _ASM_EMERGENCY_RESTART_H */ 15#endif /* _ASM_EMERGENCY_RESTART_H */