forked from xt-sys/exectos
Implement BlPhysicalAddressToVirtual() routine
This commit is contained in:
@@ -247,6 +247,12 @@ BlOpenProtocolHandle(IN EFI_HANDLE Handle,
|
||||
OUT PVOID *ProtocolHandler,
|
||||
IN PEFI_GUID ProtocolGuid);
|
||||
|
||||
XTCDECL
|
||||
PVOID
|
||||
BlPhysicalAddressToVirtual(IN PVOID PhysicalAddress,
|
||||
IN PVOID PhysicalBase,
|
||||
IN PVOID VirtualBase);
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
BlQueryConsoleMode(OUT PUINT_PTR ResX,
|
||||
|
@@ -488,6 +488,32 @@ BlMapVirtualMemory(IN OUT PXTBL_PAGE_MAPPING PageMap,
|
||||
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
|
||||
BlPhysicalAddressToVirtual(IN PVOID PhysicalAddress,
|
||||
IN PVOID PhysicalBase,
|
||||
IN PVOID VirtualBase)
|
||||
{
|
||||
/* Convert physical address to virtual address */
|
||||
return (PUCHAR)VirtualBase + ((PUCHAR)PhysicalAddress - (PUCHAR)PhysicalBase);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts EFI memory type to XTLDR memory type.
|
||||
*
|
||||
|
@@ -636,6 +636,7 @@ BlpInstallXtLoaderProtocol()
|
||||
BlpLdrProtocol.Memory.MapEfiMemory = BlMapEfiMemory;
|
||||
BlpLdrProtocol.Memory.MapPage = BlMapPage;
|
||||
BlpLdrProtocol.Memory.MapVirtualMemory = BlMapVirtualMemory;
|
||||
BlpLdrProtocol.Memory.PhysicalAddressToVirtual = BlPhysicalAddressToVirtual;
|
||||
BlpLdrProtocol.Memory.SetMemory = RtlSetMemory;
|
||||
BlpLdrProtocol.Memory.ZeroMemory = RtlZeroMemory;
|
||||
BlpLdrProtocol.Protocol.Close = BlCloseProtocol;
|
||||
|
Reference in New Issue
Block a user