+/**\r
+ Allocate pool of a particular type.\r
+\r
+ @param PoolType Type of pool to allocate\r
+ @param Size The amount of pool to allocate\r
+ @param Buffer The address to return a pointer to the allocated\r
+ pool\r
+\r
+ @retval EFI_INVALID_PARAMETER Buffer is NULL.\r
+ PoolType is in the range EfiMaxMemoryType..0x6FFFFFFF.\r
+ PoolType is EfiPersistentMemory.\r
+ @retval EFI_OUT_OF_RESOURCES Size exceeds max pool size or allocation failed.\r
+ @retval EFI_SUCCESS Pool successfully allocated.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CoreAllocatePool (\r
+ IN EFI_MEMORY_TYPE PoolType,\r
+ IN UINTN Size,\r
+ OUT VOID **Buffer\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+\r
+ Status = CoreInternalAllocatePool (PoolType, Size, Buffer);\r
+ if (!EFI_ERROR (Status)) {\r
+ CoreUpdateProfile (\r
+ (EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0),\r
+ MemoryProfileActionAllocatePool,\r
+ PoolType,\r
+ Size,\r
+ *Buffer,\r
+ NULL\r
+ );\r
+ InstallMemoryAttributesTableOnMemoryAllocation (PoolType);\r
+ }\r
+ return Status;\r
+}\r
+\r
+STATIC\r
+VOID *\r
+CoreAllocatePoolPagesI (\r
+ IN EFI_MEMORY_TYPE PoolType,\r
+ IN UINTN NoPages,\r
+ IN UINTN Granularity\r
+ )\r
+{\r
+ VOID *Buffer;\r
+ EFI_STATUS Status;\r