Remove global BlpGetNextPageTable implementation in favor of arch-specific versions
This commit is contained in:
parent
ed75060482
commit
544ec63d6e
@ -739,75 +739,3 @@ BlpGetLoaderMemoryType(IN EFI_MEMORY_TYPE EfiMemoryType)
|
|||||||
/* Return XTLDR memory type */
|
/* Return XTLDR memory type */
|
||||||
return MemoryType;
|
return MemoryType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns next level of the Page Table.
|
|
||||||
*
|
|
||||||
* @param PageMap
|
|
||||||
* Supplies a pointer to the page mapping structure.
|
|
||||||
*
|
|
||||||
* @param PageTable
|
|
||||||
* Supplies a pointer to the current Page Table.
|
|
||||||
*
|
|
||||||
* @param Entry
|
|
||||||
* Supplies an index of the current Page Table entry.
|
|
||||||
*
|
|
||||||
* @param NextPageTable
|
|
||||||
* Supplies a pointer to the memory area where the next Page Table level is returned.
|
|
||||||
*
|
|
||||||
* @return This routine returns a status code.
|
|
||||||
*
|
|
||||||
* @since XT 1.0
|
|
||||||
*/
|
|
||||||
XTCDECL
|
|
||||||
EFI_STATUS
|
|
||||||
BlpGetNextPageTable(IN PXTBL_PAGE_MAPPING PageMap,
|
|
||||||
IN PHARDWARE_PTE PageTable,
|
|
||||||
IN SIZE_T Entry,
|
|
||||||
OUT PHARDWARE_PTE *NextPageTable)
|
|
||||||
{
|
|
||||||
EFI_PHYSICAL_ADDRESS Address;
|
|
||||||
ULONGLONG PmlPointer;
|
|
||||||
EFI_STATUS Status;
|
|
||||||
|
|
||||||
/* Check if this is a valid table */
|
|
||||||
if(PageTable[Entry].Valid)
|
|
||||||
{
|
|
||||||
/* Get PML pointer */
|
|
||||||
PmlPointer = PageTable[Entry].PageFrameNumber;
|
|
||||||
PmlPointer <<= EFI_PAGE_SHIFT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Allocate pages for new PML entry */
|
|
||||||
Status = BlAllocateMemoryPages(1, &Address);
|
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
|
||||||
{
|
|
||||||
/* Memory allocation failure */
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Add new memory mapping */
|
|
||||||
Status = BlMapVirtualMemory(PageMap, NULL, (PVOID)(UINT_PTR)Address, 1, LoaderMemoryData);
|
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
|
||||||
{
|
|
||||||
/* Memory mapping failure */
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Fill allocated memory with zeros */
|
|
||||||
RtlZeroMemory((PVOID)(ULONGLONG)Address, EFI_PAGE_SIZE);
|
|
||||||
|
|
||||||
/* Set paging entry settings */
|
|
||||||
PageTable[Entry].PageFrameNumber = Address / EFI_PAGE_SIZE;
|
|
||||||
PageTable[Entry].Valid = 1;
|
|
||||||
PageTable[Entry].Writable = 1;
|
|
||||||
PmlPointer = (ULONGLONG)Address;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set next Page Map Level (PML) */
|
|
||||||
*NextPageTable = (PHARDWARE_PTE)(ULONGLONG)PmlPointer;
|
|
||||||
|
|
||||||
/* Return success */
|
|
||||||
return STATUS_EFI_SUCCESS;
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user