Fix memory mappings and exiting boot services for i686
This commit is contained in:
parent
602f8c1c0e
commit
60ce943cab
@ -175,13 +175,8 @@ XtEnablePaging(IN PLIST_ENTRY MemoryMappings,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Map XTLDR code */
|
/* Map XTLDR code */
|
||||||
Status = XtAddVirtualMemoryMapping(MemoryMappings, ImageProtocol->ImageBase, ImageProtocol->ImageBase,
|
XtAddVirtualMemoryMapping(MemoryMappings, ImageProtocol->ImageBase, ImageProtocol->ImageBase,
|
||||||
EFI_SIZE_TO_PAGES(ImageProtocol->ImageSize), LoaderFirmwareTemporary);
|
EFI_SIZE_TO_PAGES(ImageProtocol->ImageSize), LoaderFirmwareTemporary);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
|
||||||
{
|
|
||||||
/* Mapping the boot loader code failed */
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Add page mapping itself to memory mapping */
|
/* Add page mapping itself to memory mapping */
|
||||||
Status = XtAddVirtualMemoryMapping(MemoryMappings, NULL, *PtePointer, 1, LoaderMemoryData);
|
Status = XtAddVirtualMemoryMapping(MemoryMappings, NULL, *PtePointer, 1, LoaderMemoryData);
|
||||||
@ -238,6 +233,20 @@ XtEnablePaging(IN PLIST_ENTRY MemoryMappings,
|
|||||||
/* Exit EFI Boot Services */
|
/* Exit EFI Boot Services */
|
||||||
Status = XtLdrProtocol->Util.ExitBootServices(MemoryMap->MapKey);
|
Status = XtLdrProtocol->Util.ExitBootServices(MemoryMap->MapKey);
|
||||||
|
|
||||||
|
/* Check if exitted boot services successfully */
|
||||||
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
|
{
|
||||||
|
/* Failed to exit boot services */
|
||||||
|
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 */
|
/* Check if exitted boot services successfully */
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user