If ExitBootServices() fails, it is mostly caused by map key that is racing with asynchronous events signaled over the back of the timer interrupt. In this case new memory map should be obtained prior to another ExitBootServices() call attempt
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 44s
Builds / ExectOS (i686) (push) Successful in 27s

This commit is contained in:
Rafal Kupiec 2024-01-05 15:13:45 +01:00
parent 9443da9817
commit 0293fb6f28
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -140,7 +140,20 @@ XtEnablePaging(IN PLIST_ENTRY MemoryMappings,
if(Status != STATUS_EFI_SUCCESS)
{
/* Failed to exit boot services */
XtLdrProtocol->Debug.Print(L"Failed to exit boot services (Status code: %lx)\n", Status);
Status = XtLdrProtocol->Memory.GetMemoryMap(MemoryMap);
if(Status != STATUS_EFI_SUCCESS)
{
/* Unable to get memory map */
return Status;
}
Status = XtLdrProtocol->Util.ExitBootServices(MemoryMap->MapKey);
}
/* Check if exitted boot services successfully */
if(Status != STATUS_EFI_SUCCESS)
{
XtLdrProtocol->Console.Print(L"Failed to exit boot services (Status code: %lx)\n", Status);
return STATUS_EFI_ABORTED;
}