]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c
ArmVirtPkg/MemoryInitPeiLib: split memory HOB based on MAX_ALLOC_ADDRESS
[mirror_edk2.git] / ArmVirtPkg / Library / ArmVirtMemoryInitPeiLib / ArmVirtMemoryInitPeiLib.c
index 6f3e54b7afcb6ecc9eae5af53c6449244250a6d8..66925fc05ebd29511c3470658ad298785d1dec5e 100644 (file)
@@ -16,7 +16,7 @@
 #include <PiPei.h>\r
 \r
 #include <Library/ArmMmuLib.h>\r
-#include <Library/ArmPlatformLib.h>\r
+#include <Library/ArmVirtMemInfoLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/HobLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
@@ -39,7 +39,7 @@ InitMmu (
   RETURN_STATUS                 Status;\r
 \r
   // Get Virtual Memory Map from the Platform Library\r
-  ArmPlatformGetVirtualMemoryMap (&MemoryTable);\r
+  ArmVirtGetMemoryMap (&MemoryTable);\r
 \r
   //Note: Because we called PeiServicesInstallPeiMemory() before to call InitMmu() the MMU Page Table resides in\r
   //      DRAM (even at the top of DRAM as it is the first permanent memory allocation)\r
@@ -75,18 +75,18 @@ MemoryPeim (
   SystemMemoryTop = PcdGet64 (PcdSystemMemoryBase) +\r
                     PcdGet64 (PcdSystemMemorySize);\r
 \r
-  if (SystemMemoryTop - 1 > MAX_ADDRESS) {\r
+  if (SystemMemoryTop - 1 > MAX_ALLOC_ADDRESS) {\r
     BuildResourceDescriptorHob (\r
         EFI_RESOURCE_SYSTEM_MEMORY,\r
         ResourceAttributes,\r
         PcdGet64 (PcdSystemMemoryBase),\r
-        (UINT64)MAX_ADDRESS - PcdGet64 (PcdSystemMemoryBase) + 1\r
+        (UINT64)MAX_ALLOC_ADDRESS - PcdGet64 (PcdSystemMemoryBase) + 1\r
         );\r
     BuildResourceDescriptorHob (\r
         EFI_RESOURCE_SYSTEM_MEMORY,\r
         ResourceAttributes,\r
-        (UINT64)MAX_ADDRESS + 1,\r
-        SystemMemoryTop - MAX_ADDRESS - 1\r
+        (UINT64)MAX_ALLOC_ADDRESS + 1,\r
+        SystemMemoryTop - MAX_ALLOC_ADDRESS - 1\r
         );\r
   } else {\r
     BuildResourceDescriptorHob (\r