efi/reboot: Add generic wrapper around EfiResetSystem()

Implement efi_reboot(), which is really just a wrapper around the
EfiResetSystem() EFI runtime service, but it does at least allow us to
funnel all callers through a single location.

It also simplifies the callsites since users no longer need to check to
see whether EFI_RUNTIME_SERVICES are enabled.

Cc: Tony Luck <tony.luck@intel.com>
Tested-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
This commit is contained in:
Matt Fleming
2014-06-13 12:22:22 +01:00
parent f4f75ad574
commit 8562c99cdd
5 changed files with 33 additions and 7 deletions

View File

@@ -528,11 +528,7 @@ static void native_machine_emergency_restart(void)
break;
case BOOT_EFI:
if (efi_enabled(EFI_RUNTIME_SERVICES))
efi.reset_system(reboot_mode == REBOOT_WARM ?
EFI_RESET_WARM :
EFI_RESET_COLD,
EFI_SUCCESS, 0, NULL);
efi_reboot(reboot_mode, NULL);
reboot_type = BOOT_BIOS;
break;