5.3.16 ResetSystem()

In general, UEFI drivers should not use this service. System resets should be managed from the UEFI boot manager or OEM-provided utilities. The only exceptions in the EDK II are keyboard drivers that detect the CTRL-ALT-DEL key sequence in keyboard drivers to reset the platform.

The following code fragment shows how the UEFI Runtime Service ResetSystem() is used to request a warm reset of the platform. The EDK II library UefiRuntimeServicesTableLib provides a global variable for the UEFI Runtime Services Table for the currently executing driver. In this example, the global variable for the UEFI Runtime Services Table, gRT, is used to call the UEFI Runtime Service ResetSystem().

Example 84-ResetSystem

#include <Uefi.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/BaseLib.h>
//
// Perform a warm reset of the platform
//
gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
//
// Halt. ResetSystem should never return.
//
CpuDeadLoop ();