Retry exiting boot services if first try fails
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 26s
Builds / ExectOS (i686) (push) Successful in 27s

This commit is contained in:
Rafal Kupiec 2023-12-02 16:02:24 +01:00
parent 146a331c80
commit ec63fe3fa6
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 16 additions and 0 deletions

View File

@ -119,6 +119,14 @@ BlEnablePaging(IN PLIST_ENTRY MemoryMappings,
Status = EfiSystemTable->BootServices->ExitBootServices(EfiImageHandle, MemoryMap->MapKey);
if(Status != STATUS_EFI_SUCCESS)
{
/* Retry as UEFI spec says to do it twice */
Status = EfiSystemTable->BootServices->ExitBootServices(EfiImageHandle, MemoryMap->MapKey);
}
/* Check if exitted boot services successfully */
if(Status != STATUS_EFI_SUCCESS)
{
/* Failed to exit boot services */
BlDbgPrint(L"Failed to exit boot services (Status code: %lx)\n", Status);
return STATUS_EFI_ABORTED;
}

View File

@ -216,6 +216,14 @@ BlEnablePaging(IN PLIST_ENTRY MemoryMappings,
Status = EfiSystemTable->BootServices->ExitBootServices(EfiImageHandle, MemoryMap->MapKey);
if(Status != STATUS_EFI_SUCCESS)
{
/* Retry as UEFI spec says to do it twice */
Status = EfiSystemTable->BootServices->ExitBootServices(EfiImageHandle, MemoryMap->MapKey);
}
/* Check if exitted boot services successfully */
if(Status != STATUS_EFI_SUCCESS)
{
/* Failed to exit boot services */
BlDbgPrint(L"Failed to exit boot services (Status code: %lx)\n", Status);
return STATUS_EFI_ABORTED;
}