diff options
author | Huang, Ying <ying.huang@intel.com> | 2008-01-30 07:31:19 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:19 -0500 |
commit | de18c850af701ac9512b7239e88fa45e4c168771 (patch) | |
tree | 8b0d27a8e8e1908e4ce8c28fe83cba4c67e7f2f9 /arch/x86/kernel/reboot_64.c | |
parent | 5b83683f32b113d07edfb67a33ce389fc624423d (diff) |
x86: EFI runtime service support: EFI runtime services
This patch adds support for several EFI runtime services for EFI x86_64
system.
The EFI support for emergency_restart is added.
Signed-off-by: Chandramouli Narayanan <mouli@linux.intel.com>
Signed-off-by: Huang Ying <ying.huang@intel.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/reboot_64.c')
-rw-r--r-- | arch/x86/kernel/reboot_64.c | 20 |
1 files changed, 13 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); | |||
28 | EXPORT_SYMBOL(pm_power_off); | 29 | EXPORT_SYMBOL(pm_power_off); |
29 | 30 | ||
30 | static long no_idt[3]; | 31 | static long no_idt[3]; |
31 | static enum { | 32 | enum reboot_type reboot_type = BOOT_KBD; |
32 | BOOT_TRIPLE = 't', | ||
33 | BOOT_KBD = 'k', | ||
34 | BOOT_ACPI = 'a' | ||
35 | } reboot_type = BOOT_KBD; | ||
36 | static int reboot_mode = 0; | 33 | static int reboot_mode = 0; |
37 | int reboot_force; | 34 | int 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 | */ |
47 | static int __init reboot_setup(char *str) | 45 | static 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 | ||