]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Core/Pei/Memory/MemoryServices.c
MemoryAllocationLib: For boundary case: “AllocationSize + OverAllocationSize >= 4G”
[mirror_edk2.git] / EdkModulePkg / Core / Pei / Memory / MemoryServices.c
index 48b2b3818cd65bd4b38e62a4020f298484ca05c2..eb99a8040db68771a1ed8df34685c3bb0c89413b 100644 (file)
@@ -301,8 +301,12 @@ Returns:
   EFI_STATUS               Status;\r
   EFI_HOB_MEMORY_POOL      *Hob;\r
 \r
-\r
-  Status = PeiCoreCreateHob (\r
+ //\r
+ // If some ¡°post-memory¡± PEIM wishes to allocate larger pool,\r
+ // it should use AllocatePages service instead.\r
+ //\r
+ ASSERT (Size < 0x10000 - sizeof (EFI_HOB_MEMORY_POOL));\r
+ Status = PeiCoreCreateHob (\r
              EFI_HOB_TYPE_PEI_MEMORY_POOL,\r
              (UINT16)(sizeof (EFI_HOB_MEMORY_POOL) + Size),\r
              (VOID **)&Hob\r