Implement BlRebootSystem() and BlShutdownSystem() routines

This commit is contained in:
2024-01-12 15:59:38 +01:00
parent 489734d5c9
commit 521006d939
3 changed files with 35 additions and 0 deletions

View File

@@ -99,6 +99,36 @@ BlGetSecureBootStatus()
return SecureBootStatus;
}
/**
* Reboots the machine.
*
* @return This routine returns a status code.
*
* @since XT 1.0
*/
XTCDECL
EFI_STATUS
BlRebootSystem()
{
/* Reboot machine */
return EfiSystemTable->RuntimeServices->ResetSystem(EfiResetCold, STATUS_EFI_SUCCESS, 0, NULL);
}
/**
* Shuts down the machine.
*
* @return This routine returns a status code.
*
* @since XT 1.0
*/
XTCDECL
EFI_STATUS
BlShutdownSystem()
{
/* Shutdown machine */
return EfiSystemTable->RuntimeServices->ResetSystem(EfiResetShutdown, STATUS_EFI_SUCCESS, 0, NULL);
}
/**
* Puts the system to sleep for the specified number of milliseconds.
*

View File

@@ -646,6 +646,8 @@ BlpInstallXtLoaderProtocol()
BlpLdrProtocol.Tui.UpdateProgressBar = BlUpdateProgressBar;
BlpLdrProtocol.Util.ExitBootServices = BlExitBootServices;
BlpLdrProtocol.Util.GetSecureBootStatus = BlGetSecureBootStatus;
BlpLdrProtocol.Util.RebootSystem = BlRebootSystem;
BlpLdrProtocol.Util.ShutdownSystem = BlShutdownSystem;
BlpLdrProtocol.Util.SleepExecution = BlSleepExecution;
BlpLdrProtocol.Util.WaitForEfiEvent = BlWaitForEfiEvent;