New function entry macros. Changed some error handling

date	99.08.13.20.15.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 19:00:43 +00:00
parent b0ac65fd47
commit 8d54659ad7

View File

@ -454,26 +454,25 @@ _CmAllocate (
void *Address = NULL;
FUNCTION_TRACE ("_CmAllocate");
FUNCTION_TRACE_U32 ("_CmAllocate", Size);
Address = OsdAllocate (Size);
if (!Address)
{
/* Report allocation error */
_REPORT_ERROR (Module, Line, Component,
"CmAllocate: Memory allocation failure");
}
else
{
DEBUG_PRINT (TRACE_ALLOCATIONS, ("CmAllocate: %x Size 0x%x\n",
Address, Size));
return_VALUE (NULL);
}
CmAddElementToAllocList (Address, Size, MEM_MALLOC, Component, Module, Line);
DEBUG_PRINT (TRACE_ALLOCATIONS, ("CmAllocate: %x Size 0x%x\n",
Address, Size));
return_VALUE (Address);
}
@ -503,7 +502,7 @@ _CmCallocate (
void *Address = NULL;
FUNCTION_TRACE ("_CmCallocate");
FUNCTION_TRACE_U32 ("_CmCallocate", Size);
Address = OsdCallocate (Size);
@ -514,15 +513,15 @@ _CmCallocate (
_REPORT_ERROR (Module, Line, Component,
"CmCallocate: Memory allocation failure");
}
else
{
DEBUG_PRINT (TRACE_ALLOCATIONS, ("CmCallocate: %x Size 0x%x\n",
Address, Size));
return_VALUE (NULL);
}
CmAddElementToAllocList (Address, Size, MEM_CALLOC, Component, Module, Line);
DEBUG_PRINT (TRACE_ALLOCATIONS, ("CmCallocate: %x Size 0x%x\n",
Address, Size));
return_VALUE (Address);
}
@ -549,7 +548,7 @@ _CmFree (
ACPI_STRING Module,
INT32 Line)
{
FUNCTION_TRACE ("_CmFree");
FUNCTION_TRACE_PTR ("_CmFree", Address);
if (NULL == Address)
@ -558,13 +557,12 @@ _CmFree (
"_CmFree: Trying to delete a NULL address.");
return_VOID;
}
CmDeleteElementFromAllocList (Address, Component, Module, Line);
OsdFree (Address);
DEBUG_PRINT (TRACE_ALLOCATIONS, ("CmFree: %x\n", Address));
DEBUG_PRINT (TRACE_ALLOCATIONS, ("CmFree: %x freed\n", Address));
return_VOID;
}