Frees pool.\r
\r
@param Buffer The allocated pool entry to free\r
+ @param PoolType Pointer to pool type\r
\r
@retval EFI_INVALID_PARAMETER Buffer is not a valid value.\r
@retval EFI_SUCCESS Pool successfully freed.\r
EFI_STATUS\r
EFIAPI\r
CoreInternalFreePool (\r
- IN VOID *Buffer\r
+ IN VOID *Buffer,\r
+ OUT EFI_MEMORY_TYPE *PoolType OPTIONAL\r
)\r
{\r
EFI_STATUS Status;\r
}\r
\r
CoreAcquireMemoryLock ();\r
- Status = CoreFreePoolI (Buffer);\r
+ Status = CoreFreePoolI (Buffer, PoolType);\r
CoreReleaseMemoryLock ();\r
return Status;\r
}\r
IN VOID *Buffer\r
)\r
{\r
- EFI_STATUS Status;\r
+ EFI_STATUS Status;\r
+ EFI_MEMORY_TYPE PoolType;\r
\r
- Status = CoreInternalFreePool (Buffer);\r
+ Status = CoreInternalFreePool (Buffer, &PoolType);\r
if (!EFI_ERROR (Status)) {\r
CoreUpdateProfile ((EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0), MemoryProfileActionFreePool, (EFI_MEMORY_TYPE) 0, 0, Buffer);\r
}\r
Caller must have the memory lock held\r
\r
@param Buffer The allocated pool entry to free\r
+ @param PoolType Pointer to pool type\r
\r
@retval EFI_INVALID_PARAMETER Buffer not valid\r
@retval EFI_SUCCESS Buffer successfully freed.\r
**/\r
EFI_STATUS\r
CoreFreePoolI (\r
- IN VOID *Buffer\r
+ IN VOID *Buffer,\r
+ OUT EFI_MEMORY_TYPE *PoolType OPTIONAL\r
)\r
{\r
POOL *Pool;\r
Granularity = DEFAULT_PAGE_ALLOCATION;\r
}\r
\r
+ if (PoolType != NULL) {\r
+ *PoolType = Head->Type;\r
+ }\r
+\r
//\r
// Determine the pool list\r
//\r
//\r
if (((UINT32) Pool->MemoryType >= MEMORY_TYPE_OEM_RESERVED_MIN) && Pool->Used == 0) {\r
RemoveEntryList (&Pool->Link);\r
- CoreFreePoolI (Pool);\r
+ CoreFreePoolI (Pool, NULL);\r
}\r
\r
return EFI_SUCCESS;\r