18#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 5
42 ASSERT (VirtualMemoryMap !=
NULL);
44 TopOfAddressSpace =
LShiftU64 (1ULL, ArmGetPhysicalAddressBits ());
50 MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS
53 if (VirtualMemoryTable ==
NULL) {
56 "%a: Error: Failed to Allocate Pages\n",
64 VirtualMemoryTable[Idx].PhysicalBase =
PcdGet64 (PcdSystemMemoryBase);
65 VirtualMemoryTable[Idx].VirtualBase = VirtualMemoryTable[Idx].PhysicalBase;
66 VirtualMemoryTable[Idx].Length =
PcdGet64 (PcdSystemMemorySize);
67 VirtualMemoryTable[Idx].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;
70 VirtualMemoryTable[++Idx].PhysicalBase = 0x0;
71 VirtualMemoryTable[Idx].VirtualBase = 0x0;
72 VirtualMemoryTable[Idx].Length =
PcdGet64 (PcdSystemMemoryBase);
73 VirtualMemoryTable[Idx].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
76 VirtualMemoryTable[++Idx].PhysicalBase =
PcdGet64 (PcdSystemMemoryBase) +
78 VirtualMemoryTable[Idx].VirtualBase = VirtualMemoryTable[Idx].PhysicalBase;
79 VirtualMemoryTable[Idx].Length = TopOfAddressSpace -
80 VirtualMemoryTable[Idx].PhysicalBase;
81 VirtualMemoryTable[Idx].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
84 VirtualMemoryTable[++Idx].PhysicalBase =
PcdGet64 (PcdFvBaseAddress);
85 VirtualMemoryTable[Idx].VirtualBase = VirtualMemoryTable[Idx].PhysicalBase;
87 VirtualMemoryTable[Idx].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;
90 VirtualMemoryTable[++Idx].PhysicalBase = 0;
91 VirtualMemoryTable[Idx].VirtualBase = 0;
92 VirtualMemoryTable[Idx].Length = 0;
93 VirtualMemoryTable[Idx].Attributes = (ARM_MEMORY_REGION_ATTRIBUTES)0;
95 ASSERT ((Idx + 1) <= MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS);
97 *VirtualMemoryMap = VirtualMemoryTable;
UINT64 EFIAPI LShiftU64(IN UINT64 Operand, IN UINTN Count)
#define DEBUG(Expression)
#define PcdGet64(TokenName)
#define FixedPcdGet32(TokenName)
VOID *EFIAPI AllocatePages(IN UINTN Pages)
UINT64 EFI_PHYSICAL_ADDRESS
#define EFI_SIZE_TO_PAGES(Size)