TianoCore EDK2 master
Loading...
Searching...
No Matches
XenVirtMemInfoLib.c
Go to the documentation of this file.
1
9#include <Base.h>
10#include <Library/ArmLib.h>
11#include <Library/BaseLib.h>
12#include <Library/DebugLib.h>
13
14STATIC ARM_MEMORY_REGION_DESCRIPTOR mVirtualMemoryTable[2];
15
29VOID
30EFIAPI
32 OUT ARM_MEMORY_REGION_DESCRIPTOR **VirtualMemoryMap
33 )
34{
35 EFI_PHYSICAL_ADDRESS TopOfAddressSpace;
36
37 ASSERT (VirtualMemoryMap != NULL);
38
39 TopOfAddressSpace = LShiftU64 (1ULL, ArmGetPhysicalAddressBits ());
40
41 //
42 // Map the entire physical memory space as cached. The only device
43 // we care about is the GIC, which will be stage 2 mapped as a device
44 // by the hypervisor, overriding the cached mapping we install here.
45 //
46 mVirtualMemoryTable[0].PhysicalBase = 0x0;
47 mVirtualMemoryTable[0].VirtualBase = 0x0;
48 mVirtualMemoryTable[0].Length = TopOfAddressSpace;
49 mVirtualMemoryTable[0].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;
50
51 mVirtualMemoryTable[1].PhysicalBase = 0x0;
52 mVirtualMemoryTable[1].VirtualBase = 0x0;
53 mVirtualMemoryTable[1].Length = 0x0;
54 mVirtualMemoryTable[1].Attributes = 0x0;
55
56 *VirtualMemoryMap = mVirtualMemoryTable;
57}
UINT64 EFIAPI LShiftU64(IN UINT64 Operand, IN UINTN Count)
Definition: LShiftU64.c:28
#define NULL
Definition: Base.h:319
#define STATIC
Definition: Base.h:264
#define OUT
Definition: Base.h:284
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
VOID EFIAPI ArmVirtGetMemoryMap(OUT ARM_MEMORY_REGION_DESCRIPTOR **VirtualMemoryMap)