diff options
Diffstat (limited to 'arch/x86/kernel/reboot.c')
-rw-r--r-- | arch/x86/kernel/reboot.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index cc5a2545dd41..0e3dbc7b2bdb 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
@@ -36,7 +36,10 @@ int reboot_force; | |||
36 | static int reboot_cpu = -1; | 36 | static int reboot_cpu = -1; |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | /* reboot=b[ios] | s[mp] | t[riple] | k[bd] | e[fi] [, [w]arm | [c]old] | 39 | /* This is set by the PCI code if either type 1 or type 2 PCI is detected */ |
40 | bool port_cf9_safe = false; | ||
41 | |||
42 | /* reboot=b[ios] | s[mp] | t[riple] | k[bd] | e[fi] [, [w]arm | [c]old] | p[ci] | ||
40 | warm Don't set the cold reboot flag | 43 | warm Don't set the cold reboot flag |
41 | cold Set the cold reboot flag | 44 | cold Set the cold reboot flag |
42 | bios Reboot by jumping through the BIOS (only for X86_32) | 45 | bios Reboot by jumping through the BIOS (only for X86_32) |
@@ -45,6 +48,7 @@ static int reboot_cpu = -1; | |||
45 | kbd Use the keyboard controller. cold reset (default) | 48 | kbd Use the keyboard controller. cold reset (default) |
46 | acpi Use the RESET_REG in the FADT | 49 | acpi Use the RESET_REG in the FADT |
47 | efi Use efi reset_system runtime service | 50 | efi Use efi reset_system runtime service |
51 | pci Use the so-called "PCI reset register", CF9 | ||
48 | force Avoid anything that could hang. | 52 | force Avoid anything that could hang. |
49 | */ | 53 | */ |
50 | static int __init reboot_setup(char *str) | 54 | static int __init reboot_setup(char *str) |
@@ -79,6 +83,7 @@ static int __init reboot_setup(char *str) | |||
79 | case 'k': | 83 | case 'k': |
80 | case 't': | 84 | case 't': |
81 | case 'e': | 85 | case 'e': |
86 | case 'p': | ||
82 | reboot_type = *str; | 87 | reboot_type = *str; |
83 | break; | 88 | break; |
84 | 89 | ||
@@ -404,12 +409,27 @@ static void native_machine_emergency_restart(void) | |||
404 | reboot_type = BOOT_KBD; | 409 | reboot_type = BOOT_KBD; |
405 | break; | 410 | break; |
406 | 411 | ||
407 | |||
408 | case BOOT_EFI: | 412 | case BOOT_EFI: |
409 | if (efi_enabled) | 413 | if (efi_enabled) |
410 | efi.reset_system(reboot_mode ? EFI_RESET_WARM : EFI_RESET_COLD, | 414 | efi.reset_system(reboot_mode ? |
415 | EFI_RESET_WARM : | ||
416 | EFI_RESET_COLD, | ||
411 | EFI_SUCCESS, 0, NULL); | 417 | EFI_SUCCESS, 0, NULL); |
418 | reboot_type = BOOT_KBD; | ||
419 | break; | ||
420 | |||
421 | case BOOT_CF9: | ||
422 | port_cf9_safe = true; | ||
423 | /* fall through */ | ||
412 | 424 | ||
425 | case BOOT_CF9_COND: | ||
426 | if (port_cf9_safe) { | ||
427 | u8 cf9 = inb(0xcf9) & ~6; | ||
428 | outb(cf9|2, 0xcf9); /* Request hard reset */ | ||
429 | udelay(50); | ||
430 | outb(cf9|6, 0xcf9); /* Actually do the reset */ | ||
431 | udelay(50); | ||
432 | } | ||
413 | reboot_type = BOOT_KBD; | 433 | reboot_type = BOOT_KBD; |
414 | break; | 434 | break; |
415 | } | 435 | } |
@@ -470,6 +490,11 @@ static void native_machine_restart(char *__unused) | |||
470 | 490 | ||
471 | static void native_machine_halt(void) | 491 | static void native_machine_halt(void) |
472 | { | 492 | { |
493 | /* stop other cpus and apics */ | ||
494 | machine_shutdown(); | ||
495 | |||
496 | /* stop this cpu */ | ||
497 | stop_this_cpu(NULL); | ||
473 | } | 498 | } |
474 | 499 | ||
475 | static void native_machine_power_off(void) | 500 | static void native_machine_power_off(void) |