summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/utalloc.c
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>2001-09-07 01:22:25 +0000
committermsmith <msmith@FreeBSD.org>2001-09-07 01:22:25 +0000
commit9d39e615a85d5e81e8442ec3bf65c8dff5e393c5 (patch)
treeba0c24c50a259baa38d43cef66fae1699ec4f152 /sys/contrib/dev/acpica/utalloc.c
parent56186efdbc469312f31299676d1ef2e2d891ec25 (diff)
downloadFreeBSD-src-9d39e615a85d5e81e8442ec3bf65c8dff5e393c5.zip
FreeBSD-src-9d39e615a85d5e81e8442ec3bf65c8dff5e393c5.tar.gz
Vendor-branch import of the Intel ACPI CA 20010831 snapshot.
Diffstat (limited to 'sys/contrib/dev/acpica/utalloc.c')
-rw-r--r--sys/contrib/dev/acpica/utalloc.c47
1 files changed, 29 insertions, 18 deletions
diff --git a/sys/contrib/dev/acpica/utalloc.c b/sys/contrib/dev/acpica/utalloc.c
index 7485797..c03de85 100644
--- a/sys/contrib/dev/acpica/utalloc.c
+++ b/sys/contrib/dev/acpica/utalloc.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utalloc - local cache and memory allocation routines
- * $Revision: 95 $
+ * $Revision: 100 $
*
*****************************************************************************/
@@ -126,7 +126,6 @@
MODULE_NAME ("utalloc")
-
/******************************************************************************
*
* FUNCTION: AcpiUtReleaseToCache
@@ -149,6 +148,9 @@ AcpiUtReleaseToCache (
ACPI_MEMORY_LIST *CacheInfo;
+ FUNCTION_ENTRY ();
+
+
/* If walk cache is full, just free this wallkstate object */
CacheInfo = &AcpiGbl_MemoryLists[ListId];
@@ -185,7 +187,7 @@ AcpiUtReleaseToCache (
*
* PARAMETERS: ListId - Memory list ID
*
- * RETURN: A requested object. NULL if the object could not be
+ * RETURN: A requested object. NULL if the object could not be
* allocated.
*
* DESCRIPTION: Get an object from the specified cache. If cache is empty,
@@ -201,7 +203,8 @@ AcpiUtAcquireFromCache (
void *Object;
- PROC_NAME ("AcpiUtAcquireFromCache");
+ PROC_NAME ("UtAcquireFromCache");
+
CacheInfo = &AcpiGbl_MemoryLists[ListId];
AcpiUtAcquireMutex (ACPI_MTX_CACHES);
@@ -219,7 +222,10 @@ AcpiUtAcquireFromCache (
ACPI_MEM_TRACKING (CacheInfo->CacheHits++);
CacheInfo->CacheDepth--;
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Object %p from cache %d\n", Object, ListId));
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Object %p from %s\n",
+ Object, AcpiGbl_MemoryLists[ListId].ListName));
+#endif
AcpiUtReleaseMutex (ACPI_MTX_CACHES);
@@ -264,6 +270,9 @@ AcpiUtDeleteGenericCache (
char *Next;
+ FUNCTION_ENTRY ();
+
+
CacheInfo = &AcpiGbl_MemoryLists[ListId];
while (CacheInfo->ListHead)
{
@@ -278,7 +287,6 @@ AcpiUtDeleteGenericCache (
}
-
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
@@ -288,8 +296,8 @@ AcpiUtDeleteGenericCache (
*
* Each memory allocation is tracked via a doubly linked list. Each
* element contains the caller's component, module name, function name, and
- * line number. AcpiUtAllocate and AcpiUtCallocate call
- * AcpiUtAddElementToAllocList to add an element to the list; deletion
+ * line number. AcpiUtAllocate and AcpiUtCallocate call
+ * AcpiUtAddElementToAllocList to add an element to the list; deletion
* occurs in the body of AcpiUtFree.
*/
@@ -314,6 +322,9 @@ AcpiUtSearchAllocList (
ACPI_DEBUG_MEM_BLOCK *Element;
+ FUNCTION_ENTRY ();
+
+
if (ListId > ACPI_MEM_LIST_MAX)
{
return (NULL);
@@ -414,7 +425,7 @@ AcpiUtAddElementToAllocList (
Address->Next = MemList->ListHead;
Address->Previous = NULL;
-
+
MemList->ListHead = Address;
@@ -471,7 +482,7 @@ AcpiUtDeleteElementFromAllocList (
AcpiUtAcquireMutex (ACPI_MTX_MEMORY);
-
+
/* Unlink */
if (Address->Previous)
@@ -583,8 +594,8 @@ AcpiUtDumpCurrentAllocations (
FUNCTION_TRACE ("UtDumpCurrentAllocations");
- Element = AcpiGbl_MemoryLists[0].ListHead;
+ Element = AcpiGbl_MemoryLists[0].ListHead;
if (Element == NULL)
{
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
@@ -688,7 +699,7 @@ AcpiUtAllocate (
ACPI_STATUS Status;
- FUNCTION_TRACE_U32 ("AcpiUtAllocate", Size);
+ FUNCTION_TRACE_U32 ("UtAllocate", Size);
/* Check for an inadvertent size of zero bytes */
@@ -711,7 +722,7 @@ AcpiUtAllocate (
return_PTR (NULL);
}
- Status = AcpiUtAddElementToAllocList (ACPI_MEM_LIST_GLOBAL, Address, Size,
+ Status = AcpiUtAddElementToAllocList (ACPI_MEM_LIST_GLOBAL, Address, Size,
MEM_MALLOC, Component, Module, Line);
if (ACPI_FAILURE (Status))
{
@@ -754,7 +765,7 @@ AcpiUtCallocate (
ACPI_STATUS Status;
- FUNCTION_TRACE_U32 ("AcpiUtCallocate", Size);
+ FUNCTION_TRACE_U32 ("UtCallocate", Size);
/* Check for an inadvertent size of zero bytes */
@@ -777,7 +788,7 @@ AcpiUtCallocate (
return_PTR (NULL);
}
- Status = AcpiUtAddElementToAllocList (ACPI_MEM_LIST_GLOBAL, Address, Size,
+ Status = AcpiUtAddElementToAllocList (ACPI_MEM_LIST_GLOBAL, Address, Size,
MEM_CALLOC, Component, Module, Line);
if (ACPI_FAILURE (Status))
{
@@ -818,7 +829,7 @@ AcpiUtFree (
ACPI_DEBUG_MEM_BLOCK *DebugBlock;
- FUNCTION_TRACE_PTR ("AcpiUtFree", Address);
+ FUNCTION_TRACE_PTR ("UtFree", Address);
if (NULL == Address)
@@ -829,13 +840,13 @@ AcpiUtFree (
return_VOID;
}
- DebugBlock = (ACPI_DEBUG_MEM_BLOCK *)
+ DebugBlock = (ACPI_DEBUG_MEM_BLOCK *)
(((char *) Address) - sizeof (ACPI_DEBUG_MEM_HEADER));
AcpiGbl_MemoryLists[ACPI_MEM_LIST_GLOBAL].TotalFreed++;
AcpiGbl_MemoryLists[ACPI_MEM_LIST_GLOBAL].CurrentTotalSize -= DebugBlock->Size;
- AcpiUtDeleteElementFromAllocList (ACPI_MEM_LIST_GLOBAL, DebugBlock,
+ AcpiUtDeleteElementFromAllocList (ACPI_MEM_LIST_GLOBAL, DebugBlock,
Component, Module, Line);
AcpiOsFree (DebugBlock);
OpenPOWER on IntegriCloud