Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79994
b: refs/heads/master
c: de18c85
h: refs/heads/master
v: v3
  • Loading branch information
Huang, Ying authored and Ingo Molnar committed Jan 30, 2008
1 parent dd8836e commit fa3dad5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5b83683f32b113d07edfb67a33ce389fc624423d
refs/heads/master: de18c850af701ac9512b7239e88fa45e4c168771
20 changes: 13 additions & 7 deletions trunk/arch/x86/kernel/reboot_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <linux/pm.h>
#include <linux/kdebug.h>
#include <linux/sched.h>
#include <linux/efi.h>
#include <acpi/reboot.h>
#include <asm/io.h>
#include <asm/delay.h>
Expand All @@ -28,20 +29,17 @@ void (*pm_power_off)(void);
EXPORT_SYMBOL(pm_power_off);

static long no_idt[3];
static enum {
BOOT_TRIPLE = 't',
BOOT_KBD = 'k',
BOOT_ACPI = 'a'
} reboot_type = BOOT_KBD;
enum reboot_type reboot_type = BOOT_KBD;
static int reboot_mode = 0;
int reboot_force;

/* reboot=t[riple] | k[bd] [, [w]arm | [c]old]
/* reboot=t[riple] | k[bd] | e[fi] [, [w]arm | [c]old]
warm Don't set the cold reboot flag
cold Set the cold reboot flag
triple Force a triple fault (init)
kbd Use the keyboard controller. cold reset (default)
acpi Use the RESET_REG in the FADT
efi Use efi reset_system runtime service
force Avoid anything that could hang.
*/
static int __init reboot_setup(char *str)
Expand All @@ -60,6 +58,7 @@ static int __init reboot_setup(char *str)
case 'a':
case 'b':
case 'k':
case 'e':
reboot_type = *str;
break;
case 'f':
Expand Down Expand Up @@ -155,7 +154,14 @@ void machine_emergency_restart(void)
acpi_reboot();
reboot_type = BOOT_KBD;
break;
}

case BOOT_EFI:
if (efi_enabled)
efi.reset_system(reboot_mode ? EFI_RESET_WARM : EFI_RESET_COLD,
EFI_SUCCESS, 0, NULL);
reboot_type = BOOT_KBD;
break;
}
}
}

Expand Down
9 changes: 9 additions & 0 deletions trunk/include/asm-x86/emergency-restart.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#ifndef _ASM_EMERGENCY_RESTART_H
#define _ASM_EMERGENCY_RESTART_H

enum reboot_type {
BOOT_TRIPLE = 't',
BOOT_KBD = 'k',
BOOT_ACPI = 'a',
BOOT_EFI = 'e'
};

extern enum reboot_type reboot_type;

extern void machine_emergency_restart(void);

#endif /* _ASM_EMERGENCY_RESTART_H */

0 comments on commit fa3dad5

Please sign in to comment.