void (*pm_power_off)(void);
static long no_idt[3];
-static enum {
- BOOT_BIOS = 'b',
- BOOT_TRIPLE = 't',
- BOOT_KBD = 'k'
-} reboot_type = BOOT_KBD;
static int reboot_mode = 0;
+enum reboot_types reboot_type = BOOT_KBD;
+EXPORT_SYMBOL(reboot_type);
+int reboot_override;
+EXPORT_SYMBOL(reboot_override);
-/* reboot=b[ios] | t[riple] | k[bd] [, [w]arm | [c]old]
+void (*machine_reset)(void);
+EXPORT_SYMBOL(machine_reset);
+
+/* reboot=b[ios] | t[riple] | k[bd] [, [w]arm | [c]old] | [a]cpi
bios Use the CPU reboot vector for warm reset
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 ACPI reset mechanism defined in the FADT
*/
static int __init reboot_setup(char *str)
{
case 't':
case 'b':
case 'k':
+ case 'a':
reboot_type = *str;
+ reboot_override = 1;
break;
}
if((str = strchr(str,',')) != NULL)
static inline void kb_wait(void)
{
int i;
-
+
for (i=0; i<0x10000; i++)
if ((inb_p(0x64) & 0x02) == 0)
break;
}
-
+
void machine_shutdown(void)
{
/* Stop the cpus and apics */
#ifdef CONFIG_SMP
int reboot_cpu_id;
-
+
/* The boot cpu is always logical cpu 0 */
reboot_cpu_id = 0;
#endif
local_irq_disable();
-
+
#ifndef CONFIG_SMP
disable_local_APIC();
#endif
int i;
machine_shutdown();
-
- local_irq_disable();
-
-#ifndef CONFIG_SMP
- disable_local_APIC();
-#endif
-
- disable_IO_APIC();
-
- local_irq_enable();
/* Tell the BIOS if we want cold or warm reboot */
*((unsigned short *)__va(0x472)) = reboot_mode;
for (;;) {
/* Could also try the reset bit in the Hammer NB */
switch (reboot_type) {
+ case BOOT_ACPI:
+ if (machine_reset)
+ (*machine_reset)();
+ else
+ reboot_type = BOOT_KBD;
+ break;
+
case BOOT_BIOS:
reboot_warm();