2 * Copyright (C) 2014 Intel Corporation; author Matt Fleming
3 * Copyright (c) 2014 Red Hat, Inc., Mark Salter <msalter@redhat.com>
6 #include <linux/reboot.h>
8 void efi_reboot(enum reboot_mode reboot_mode, const char *__unused)
12 if (!efi_enabled(EFI_RUNTIME_SERVICES))
15 switch (reboot_mode) {
18 efi_mode = EFI_RESET_WARM;
21 efi_mode = EFI_RESET_COLD;
25 efi.reset_system(efi_mode, EFI_SUCCESS, 0, NULL);
28 bool __weak efi_poweroff_required(void)
33 static void efi_power_off(void)
35 efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL);
38 static int __init efi_shutdown_init(void)
40 if (!efi_enabled(EFI_RUNTIME_SERVICES))
43 if (efi_poweroff_required())
44 pm_power_off = efi_power_off;
48 late_initcall(efi_shutdown_init);