Clean up unused physical-to-virtual conversion routines
This commit is contained in:
@@ -638,105 +638,3 @@ Memory::MapVirtualMemory(IN OUT PXTBL_PAGE_MAPPING PageMap,
|
||||
/* Return success */
|
||||
return STATUS_EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts physical address to virtual address based on physical base and virtual base.
|
||||
*
|
||||
* @param PhysicalAddress
|
||||
* Specifies physical address that will be converted to virtual address.
|
||||
*
|
||||
* @param PhysicalBase
|
||||
* Supplies a physical base address.
|
||||
*
|
||||
* @param VirtualBase
|
||||
* Supplies a virtual base address.
|
||||
*
|
||||
* @return This routine returns a mapped virtual address.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTCDECL
|
||||
PVOID
|
||||
Memory::PhysicalAddressToVirtual(IN PVOID PhysicalAddress,
|
||||
IN PVOID PhysicalBase,
|
||||
IN PVOID VirtualBase)
|
||||
{
|
||||
/* Convert physical address to virtual address */
|
||||
return (PUCHAR)VirtualBase + ((PUCHAR)PhysicalAddress - (PUCHAR)PhysicalBase);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts whole linked list addressing from physical to virtual for future use after enabling paging.
|
||||
*
|
||||
* @param PageMap
|
||||
* Supplies a pointer to the page mapping structure.
|
||||
*
|
||||
* @param ListHead
|
||||
* Supplies a pointer to a structure that serves as the list header.
|
||||
*
|
||||
* @param PhysicalBase
|
||||
* Supplies a physical base address.
|
||||
*
|
||||
* @param VirtualBase
|
||||
* Supplies a virtual base address.
|
||||
*
|
||||
* @return This routine returns a status code.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
Memory::PhysicalListToVirtual(IN PXTBL_PAGE_MAPPING PageMap,
|
||||
IN OUT PLIST_ENTRY ListHead,
|
||||
IN PVOID PhysicalBase,
|
||||
IN PVOID VirtualBase)
|
||||
{
|
||||
PLIST_ENTRY ListEntry, NextEntry;
|
||||
|
||||
/* Make sure list is properly initialized */
|
||||
if(ListHead->Flink == 0 || ListHead->Blink == 0)
|
||||
{
|
||||
/* List not initialized, return error code */
|
||||
return STATUS_EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
/* Iterate through all elements */
|
||||
ListEntry = ListHead->Flink;
|
||||
while(ListEntry != ListHead)
|
||||
{
|
||||
/* Save physical address of the next element */
|
||||
NextEntry = ListEntry->Flink;
|
||||
|
||||
/* Convert the address of this element to VirtualAddress */
|
||||
if(ListEntry->Blink == ListHead)
|
||||
{
|
||||
/* Find virtual address of list head */
|
||||
ListEntry->Blink = (PLIST_ENTRY)GetVirtualAddress(PageMap, ListEntry->Blink);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Convert list entry */
|
||||
ListEntry->Blink = (PLIST_ENTRY)PhysicalAddressToVirtual(ListEntry->Blink, (PVOID)PhysicalBase, VirtualBase);
|
||||
}
|
||||
if(ListEntry->Flink == ListHead)
|
||||
{
|
||||
/* Convert list head */
|
||||
ListEntry->Flink = ListHead->Flink->Blink;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Convert list entry */
|
||||
ListEntry->Flink = (PLIST_ENTRY)PhysicalAddressToVirtual(ListEntry->Flink, (PVOID)PhysicalBase, VirtualBase);
|
||||
}
|
||||
|
||||
/* Get to the next element*/
|
||||
ListEntry = NextEntry;
|
||||
}
|
||||
|
||||
/* Convert list head */
|
||||
ListHead->Blink = (PLIST_ENTRY)PhysicalAddressToVirtual(ListHead->Blink, (PVOID)PhysicalBase, VirtualBase);
|
||||
ListHead->Flink = (PLIST_ENTRY)PhysicalAddressToVirtual(ListHead->Flink, (PVOID)PhysicalBase, VirtualBase);
|
||||
|
||||
/* Return success */
|
||||
return STATUS_EFI_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user