diff --git a/boot/xtldr/memory.cc b/boot/xtldr/memory.cc index 89b9809..06f0e40 100644 --- a/boot/xtldr/memory.cc +++ b/boot/xtldr/memory.cc @@ -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; -} diff --git a/boot/xtldr/protocol.cc b/boot/xtldr/protocol.cc index 6593e4a..e8221d0 100644 --- a/boot/xtldr/protocol.cc +++ b/boot/xtldr/protocol.cc @@ -1066,8 +1066,6 @@ Protocol::InstallXtLoaderProtocol() LoaderProtocol.Memory.MapPage = Memory::MapPage; LoaderProtocol.Memory.MapVirtualMemory = Memory::MapVirtualMemory; LoaderProtocol.Memory.MoveMemory = RTL::Memory::MoveMemory; - LoaderProtocol.Memory.PhysicalAddressToVirtual = Memory::PhysicalAddressToVirtual; - LoaderProtocol.Memory.PhysicalListToVirtual = Memory::PhysicalListToVirtual; LoaderProtocol.Memory.SetMemory = RTL::Memory::SetMemory; LoaderProtocol.Memory.ZeroMemory = RTL::Memory::ZeroMemory; LoaderProtocol.Protocol.Close = CloseProtocol; diff --git a/sdk/xtdk/bltypes.h b/sdk/xtdk/bltypes.h index 1f7f948..6c6a7bc 100644 --- a/sdk/xtdk/bltypes.h +++ b/sdk/xtdk/bltypes.h @@ -107,14 +107,12 @@ typedef VOID (XTAPI *PBL_MOVE_MEMORY)(IN OUT PVOID Destination, IN PCVOID Source typedef EFI_STATUS (XTCDECL *PBL_OPEN_VOLUME)(IN PEFI_DEVICE_PATH_PROTOCOL DevicePath, OUT PEFI_HANDLE DiskHandle, OUT PEFI_FILE_HANDLE *FsHandle); typedef EFI_STATUS (XTCDECL *PBL_OPEN_PROTOCOL)(OUT PEFI_HANDLE Handle, OUT PVOID *ProtocolHandler, IN PEFI_GUID ProtocolGuid); typedef EFI_STATUS (XTCDECL *PBL_OPEN_PROTOCOL_HANDLE)(IN EFI_HANDLE Handle, OUT PVOID *ProtocolHandler, IN PEFI_GUID ProtocolGuid); -typedef PVOID (XTCDECL *PBL_PHYSICAL_ADDRESS_TO_VIRTUAL)(IN PVOID PhysicalAddress, IN PVOID PhysicalBase, IN PVOID VirtualBase); typedef UCHAR (XTCDECL *PBL_IOPORT_READ_8)(IN USHORT Port); typedef USHORT (XTCDECL *PBL_IOPORT_READ_16)(IN USHORT Port); typedef ULONG (XTCDECL *PBL_IOPORT_READ_32)(IN USHORT Port); typedef VOID (XTCDECL *PBL_IOPORT_WRITE_8)(IN USHORT Port, IN UCHAR Value); typedef VOID (XTCDECL *PBL_IOPORT_WRITE_16)(IN USHORT Port, IN USHORT Value); typedef VOID (XTCDECL *PBL_IOPORT_WRITE_32)(IN USHORT Port, IN ULONG Value); -typedef EFI_STATUS (XTCDECL *PBL_PHYSICAL_LIST_TO_VIRTUAL)(IN PXTBL_PAGE_MAPPING PageMap, IN OUT PLIST_ENTRY ListHead, IN PVOID PhysicalBase, IN PVOID VirtualBase); typedef EFI_STATUS (XTCDECL *PBL_POWER_SYSTEM)(); typedef EFI_STATUS (XTCDECL *PBL_READ_FILE)(IN PEFI_FILE_HANDLE DirHandle, IN PCWSTR FileName, OUT PVOID *FileData, OUT PSIZE_T FileSize); typedef EFI_STATUS (XTCDECL *PBL_REGISTER_BOOT_PROTOCOL)(IN PCWSTR SystemType, IN PEFI_GUID BootProtocolGuid); @@ -461,8 +459,6 @@ typedef struct _XTBL_LOADER_PROTOCOL PBL_MAP_PAGE MapPage; PBL_MAP_VIRTUAL_MEMORY MapVirtualMemory; PBL_MOVE_MEMORY MoveMemory; - PBL_PHYSICAL_ADDRESS_TO_VIRTUAL PhysicalAddressToVirtual; - PBL_PHYSICAL_LIST_TO_VIRTUAL PhysicalListToVirtual; PBL_SET_MEMORY SetMemory; PBL_ZERO_MEMORY ZeroMemory; } Memory;