Renamed DebugLevel

date	2000.06.19.15.46.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 18:22:10 +00:00
parent f00950e800
commit 5d43f51a23

View File

@ -1,6 +1,6 @@
/******************************************************************************
*
*
* Module Name: nsdump - table dumping routines for debug
*
*****************************************************************************/
@ -39,9 +39,9 @@
* The above copyright and patent license is granted only if the following
* conditions are met:
*
* 3. Conditions
* 3. Conditions
*
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification with rights to further distribute source must include
* the above Copyright Notice, the above License, this list of Conditions,
@ -49,11 +49,11 @@
* Licensee must cause all Covered Code to which Licensee contributes to
* contain a file documenting the changes Licensee made to create that Covered
* Code and the date of any change. Licensee must include in that file the
* documentation of any changes made by any predecessor Licensee. Licensee
* documentation of any changes made by any predecessor Licensee. Licensee
* must include a prominent statement that the modification is derived,
* directly or indirectly, from Original Intel Code.
*
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification without rights to further distribute source must
* include the following Disclaimer and Export Compliance provision in the
@ -87,7 +87,7 @@
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
* PARTICULAR PURPOSE.
* PARTICULAR PURPOSE.
*
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
@ -117,10 +117,10 @@
#define __NSDUMP_C__
#include <acpi.h>
#include <interp.h>
#include <namesp.h>
#include <tables.h>
#include "acpi.h"
#include "interp.h"
#include "namesp.h"
#include "tables.h"
#define _COMPONENT NAMESPACE
@ -132,7 +132,7 @@
/****************************************************************************
*
* FUNCTION: NsDumpPathname
* FUNCTION: AcpiNsDumpPathname
*
* PARAMETERS: Handle - Object
* Msg - Prefix message
@ -145,26 +145,26 @@
***************************************************************************/
ACPI_STATUS
NsDumpPathname (
ACPI_HANDLE Handle,
char *Msg,
UINT32 Level,
AcpiNsDumpPathname (
ACPI_HANDLE Handle,
char *Msg,
UINT32 Level,
UINT32 Component)
{
char *Buffer;
UINT32 Length;
FUNCTION_TRACE ("NsDumpPathname");
/* Do this only if the requested debug level and component are enabled */
if (!(DebugLevel & Level) || !(DebugLayer & Component))
if (!(AcpiDbgLevel & Level) || !(AcpiDbgLayer & Component))
{
return_ACPI_STATUS (AE_OK);
}
Buffer = CmAllocate (PATHNAME_MAX);
Buffer = AcpiCmAllocate (PATHNAME_MAX);
if (!Buffer)
{
return_ACPI_STATUS (AE_NO_MEMORY);
@ -173,12 +173,12 @@ NsDumpPathname (
/* Convert handle to a full pathname and print it (with supplied message) */
Length = PATHNAME_MAX;
if (ACPI_SUCCESS (NsHandleToPathname (Handle, &Length, Buffer)))
if (ACPI_SUCCESS (AcpiNsHandleToPathname (Handle, &Length, Buffer)))
{
OsdPrintf ("%s %s (%p)\n", Msg, Buffer, Handle);
AcpiOsdPrintf ("%s %s (%p)\n", Msg, Buffer, Handle);
}
CmFree (Buffer);
AcpiCmFree (Buffer);
return_ACPI_STATUS (AE_OK);
}
@ -186,21 +186,21 @@ NsDumpPathname (
/****************************************************************************
*
* FUNCTION: NsDumpOneObject
* FUNCTION: AcpiNsDumpOneObject
*
* PARAMETERS: Handle - Entry to be dumped
* Level - Nesting level of the handle
* Context - Passed into WalkNamespace
*
* DESCRIPTION: Dump a single nte
* This procedure is a UserFunction called by NsWalkNamespace.
* This procedure is a UserFunction called by AcpiNsWalkNamespace.
*
***************************************************************************/
ACPI_STATUS
NsDumpOneObject (
ACPI_HANDLE ObjHandle,
UINT32 Level,
AcpiNsDumpOneObject (
ACPI_HANDLE ObjHandle,
UINT32 Level,
void *Context,
void **ReturnValue)
{
@ -218,18 +218,18 @@ NsDumpOneObject (
UINT32 Size = 0;
ThisEntry = NsConvertHandleToEntry (ObjHandle);
ThisEntry = AcpiNsConvertHandleToEntry (ObjHandle);
LevelTmp = Level;
Type = ThisEntry->Type;
WhichBit = 1;
if (!(DebugLevel & Info->DebugLevel))
if (!(AcpiDbgLevel & Info->DebugLevel))
{
return AE_OK;
}
if (!ObjHandle)
{
DEBUG_PRINT (ACPI_INFO, ("Null object handle\n"));
@ -255,7 +255,7 @@ NsDumpOneObject (
if (LevelTmp)
{
if (DownstreamSiblingMask & WhichBit)
{
{
DEBUG_PRINT_RAW (TRACE_TABLES, ("|"));
}
@ -263,13 +263,13 @@ NsDumpOneObject (
{
DEBUG_PRINT_RAW (TRACE_TABLES, (" "));
}
WhichBit <<= 1;
}
else
{
if (NsExistDownstreamSibling (ThisEntry + 1, Size, Appendage))
if (AcpiNsExistDownstreamSibling (ThisEntry + 1, Size, Appendage))
{
DownstreamSiblingMask |= (1 << (Level - 1));
DEBUG_PRINT_RAW (TRACE_TABLES, ("+"));
@ -285,13 +285,13 @@ NsDumpOneObject (
{
DEBUG_PRINT_RAW (TRACE_TABLES, ("-"));
}
else if (NsExistDownstreamSibling (ThisEntry->Scope, NS_TABLE_SIZE,
else if (AcpiNsExistDownstreamSibling (ThisEntry->Scope, NS_TABLE_SIZE,
NEXTSEG (ThisEntry->Scope)))
{
DEBUG_PRINT_RAW (TRACE_TABLES, ("+"));
}
else
{
DEBUG_PRINT_RAW (TRACE_TABLES, ("-"));
@ -304,10 +304,10 @@ NsDumpOneObject (
if (Type > INTERNAL_TYPE_MAX)
{
Type = INTERNAL_TYPE_DefAny; /* prints as *ERROR* */
Type = INTERNAL_TYPE_DEF_ANY; /* prints as *ERROR* */
}
if (!CmValidAcpiName (ThisEntry->Name))
if (!AcpiCmValidAcpiName (ThisEntry->Name))
{
REPORT_WARNING ("Invalid Name");
}
@ -316,7 +316,7 @@ NsDumpOneObject (
* Now we can print out the pertinent information
*/
DEBUG_PRINT_RAW (TRACE_TABLES, (" %4.4s %-9s ", &ThisEntry->Name, CmGetTypeName (Type)));
DEBUG_PRINT_RAW (TRACE_TABLES, (" %4.4s %-9s ", &ThisEntry->Name, AcpiCmGetTypeName (Type)));
DEBUG_PRINT_RAW (TRACE_TABLES, ("%p S:%p O:%p", ThisEntry, ThisEntry->Scope, ThisEntry->Object));
@ -331,25 +331,25 @@ NsDumpOneObject (
switch (Type)
{
case ACPI_TYPE_Method:
case ACPI_TYPE_METHOD:
/* Name is a Method and its AML offset/length are set */
DEBUG_PRINT_RAW (TRACE_TABLES, (" M:%p-%X\n",
((ACPI_OBJECT_INTERNAL *) ThisEntry->Object)->Method.Pcode,
((ACPI_OBJECT_INTERNAL *) ThisEntry->Object)->Method.PcodeLength));
((ACPI_OBJECT_INTERNAL *) ThisEntry->Object)->Method.PcodeLength));
break;
case ACPI_TYPE_Number:
case ACPI_TYPE_NUMBER:
DEBUG_PRINT_RAW (TRACE_TABLES, (" N:%X\n",
((ACPI_OBJECT_INTERNAL *) ThisEntry->Object)->Number.Value));
break;
case ACPI_TYPE_String:
case ACPI_TYPE_STRING:
DEBUG_PRINT_RAW (TRACE_TABLES, (" S:%p-%X\n",
((ACPI_OBJECT_INTERNAL *) ThisEntry->Object)->String.Pointer,
@ -357,7 +357,7 @@ NsDumpOneObject (
break;
case ACPI_TYPE_Buffer:
case ACPI_TYPE_BUFFER:
DEBUG_PRINT_RAW (TRACE_TABLES, (" B:%p-%X\n",
((ACPI_OBJECT_INTERNAL *) ThisEntry->Object)->Buffer.Pointer,
@ -370,10 +370,10 @@ NsDumpOneObject (
DEBUG_PRINT_RAW (TRACE_TABLES, ("\n"));
break;
}
/* If debug turned off, done */
if (!(DebugLevel & TRACE_VALUES))
if (!(AcpiDbgLevel & TRACE_VALUES))
{
return AE_OK;
}
@ -387,13 +387,13 @@ NsDumpOneObject (
while (Value)
{
ObjType = INTERNAL_TYPE_Invalid;
ObjType = INTERNAL_TYPE_INVALID;
/* Decode the type of attached object and dump the contents */
DEBUG_PRINT_RAW (TRACE_TABLES, (" Attached Object %p: ", Value));
if (TbSystemTablePointer (Value))
if (AcpiTbSystemTablePointer (Value))
{
DEBUG_PRINT_RAW (TRACE_TABLES, ("(Ptr to AML Code)\n"));
BytesToDump = 16;
@ -419,8 +419,8 @@ NsDumpOneObject (
else
{
DEBUG_PRINT_RAW (TRACE_TABLES, ("(Ptr to ACPI Object type 0x%X [%s])\n",
ObjType, CmGetTypeName (ObjType)));
DEBUG_PRINT_RAW (TRACE_TABLES, ("(Ptr to ACPI Object type 0x%X [%s])\n",
ObjType, AcpiCmGetTypeName (ObjType)));
BytesToDump = ObjDesc->Common.Size;
}
}
@ -435,46 +435,46 @@ NsDumpOneObject (
/* If value is NOT an internal object, we are done */
if ((TbSystemTablePointer (Value)) ||
if ((AcpiTbSystemTablePointer (Value)) ||
(VALID_DESCRIPTOR_TYPE (Value, DESC_TYPE_NTE)))
{
goto Cleanup;
}
/*
/*
* Valid object, get the pointer to next level, if any
*/
switch (ObjType)
{
case ACPI_TYPE_String:
case ACPI_TYPE_STRING:
Value = (UINT8 *) ObjDesc->String.Pointer;
break;
case ACPI_TYPE_Buffer:
case ACPI_TYPE_BUFFER:
Value = (UINT8 *) ObjDesc->Buffer.Pointer;
break;
case ACPI_TYPE_Package:
case ACPI_TYPE_PACKAGE:
Value = (UINT8 *) ObjDesc->Package.Elements;
break;
case ACPI_TYPE_Method:
case ACPI_TYPE_METHOD:
Value = (UINT8 *) ObjDesc->Method.Pcode;
break;
case ACPI_TYPE_FieldUnit:
case ACPI_TYPE_FIELD_UNIT:
Value = (UINT8 *) ObjDesc->FieldUnit.Container;
break;
case INTERNAL_TYPE_DefField:
case INTERNAL_TYPE_DEF_FIELD:
Value = (UINT8 *) ObjDesc->Field.Container;
break;
case INTERNAL_TYPE_BankField:
case INTERNAL_TYPE_BANK_FIELD:
Value = (UINT8 *) ObjDesc->BankField.Container;
break;
case INTERNAL_TYPE_IndexField:
case INTERNAL_TYPE_INDEX_FIELD:
Value = (UINT8 *) ObjDesc->IndexField.Index;
break;
@ -482,7 +482,7 @@ NsDumpOneObject (
goto Cleanup;
}
ObjType = INTERNAL_TYPE_Invalid; /* Terminate loop after next pass */
ObjType = INTERNAL_TYPE_INVALID; /* Terminate loop after next pass */
}
Cleanup:
@ -493,7 +493,7 @@ Cleanup:
/****************************************************************************
*
* FUNCTION: NsDumpObjects
* FUNCTION: AcpiNsDumpObjects
*
* PARAMETERS: Type - Object type to be dumped
* MaxDepth - Maximum depth of dump. Use ACPI_UINT32_MAX
@ -503,14 +503,14 @@ Cleanup:
* StartHandle - Where in namespace to start/end search
*
* DESCRIPTION: Dump typed objects within the loaded namespace.
* Uses NsWalkNamespace in conjunction with NsDumpOneObject.
* Uses AcpiNsWalkNamespace in conjunction with AcpiNsDumpOneObject.
*
***************************************************************************/
void
NsDumpObjects (
OBJECT_TYPE_INTERNAL Type,
UINT32 MaxDepth,
AcpiNsDumpObjects (
OBJECT_TYPE_INTERNAL Type,
UINT32 MaxDepth,
UINT32 OwnerId,
ACPI_HANDLE StartHandle)
{
@ -520,28 +520,28 @@ NsDumpObjects (
Info.DebugLevel = TRACE_TABLES;
Info.OwnerId = OwnerId;
NsWalkNamespace (Type, StartHandle, MaxDepth, NS_WALK_NO_UNLOCK, NsDumpOneObject,
AcpiNsWalkNamespace (Type, StartHandle, MaxDepth, NS_WALK_NO_UNLOCK, AcpiNsDumpOneObject,
(void *) &Info, NULL);
}
/****************************************************************************
*
* FUNCTION: NsDumpOneDevice
* FUNCTION: AcpiNsDumpOneDevice
*
* PARAMETERS: Handle - Entry to be dumped
* Level - Nesting level of the handle
* Context - Passed into WalkNamespace
*
* DESCRIPTION: Dump a single nte that represents a device
* This procedure is a UserFunction called by NsWalkNamespace.
* This procedure is a UserFunction called by AcpiNsWalkNamespace.
*
***************************************************************************/
ACPI_STATUS
NsDumpOneDevice (
ACPI_HANDLE ObjHandle,
UINT32 Level,
AcpiNsDumpOneDevice (
ACPI_HANDLE ObjHandle,
UINT32 Level,
void *Context,
void **ReturnValue)
{
@ -550,7 +550,7 @@ NsDumpOneDevice (
UINT32 i;
Status = NsDumpOneObject (ObjHandle, Level, Context, ReturnValue);
Status = AcpiNsDumpOneObject (ObjHandle, Level, Context, ReturnValue);
Status = AcpiGetObjectInfo (ObjHandle, &Info);
if (ACPI_SUCCESS (Status))
@ -571,7 +571,7 @@ NsDumpOneDevice (
/****************************************************************************
*
* FUNCTION: NsDumpRootDevices
* FUNCTION: AcpiNsDumpRootDevices
*
* PARAMETERS: None
*
@ -580,14 +580,14 @@ NsDumpOneDevice (
***************************************************************************/
void
NsDumpRootDevices (void)
AcpiNsDumpRootDevices (void)
{
ACPI_HANDLE SysBusHandle;
/* Only dump the table if tracing is enabled */
if (!(TRACE_TABLES & DebugLevel))
if (!(TRACE_TABLES & AcpiDbgLevel))
{
return;
}
@ -595,14 +595,14 @@ NsDumpRootDevices (void)
AcpiGetHandle (0, NS_SYSTEM_BUS, &SysBusHandle);
DEBUG_PRINT (TRACE_TABLES, ("Display of all devices in the namespace:\n"));
NsWalkNamespace (ACPI_TYPE_Device, SysBusHandle, ACPI_INT32_MAX, NS_WALK_NO_UNLOCK,
NsDumpOneDevice, NULL, NULL);
AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, SysBusHandle, ACPI_INT32_MAX, NS_WALK_NO_UNLOCK,
AcpiNsDumpOneDevice, NULL, NULL);
}
/****************************************************************************
*
* FUNCTION: NsDumpTables
*
* FUNCTION: AcpiNsDumpTables
*
* PARAMETERS: SearchBase - Root of subtree to be dumped, or
* NS_ALL to dump the entire namespace
@ -614,8 +614,8 @@ NsDumpRootDevices (void)
***************************************************************************/
void
NsDumpTables (
ACPI_HANDLE SearchBase,
AcpiNsDumpTables (
ACPI_HANDLE SearchBase,
INT32 MaxDepth)
{
ACPI_HANDLE SearchHandle = SearchBase;
@ -624,9 +624,9 @@ NsDumpTables (
FUNCTION_TRACE ("NsDumpTables");
if (!Gbl_RootObject->Scope)
{
/*
if (!AcpiGbl_RootObject->Scope)
{
/*
* If the name space has not been initialized,
* there is nothing to dump.
*/
@ -638,19 +638,19 @@ NsDumpTables (
{
/* entire namespace */
SearchHandle = Gbl_RootObject;
SearchHandle = AcpiGbl_RootObject;
DEBUG_PRINT (TRACE_TABLES, ("\\\n"));
}
NsDumpObjects (ACPI_TYPE_Any, MaxDepth, ACPI_UINT32_MAX, SearchHandle);
AcpiNsDumpObjects (ACPI_TYPE_ANY, MaxDepth, ACPI_UINT32_MAX, SearchHandle);
return_VOID;
}
/****************************************************************************
*
* FUNCTION: NsDumpEntry
* FUNCTION: AcpiNsDumpEntry
*
* PARAMETERS: Handle - Entry to be dumped
* DebugLevel - Output level
@ -660,7 +660,7 @@ NsDumpTables (
***************************************************************************/
void
NsDumpEntry (
AcpiNsDumpEntry (
ACPI_HANDLE Handle,
UINT32 DebugLevel)
{
@ -672,11 +672,11 @@ NsDumpEntry (
Info.DebugLevel = DebugLevel;
Info.OwnerId = ACPI_UINT32_MAX;
NsDumpOneObject (Handle, 1, &Info, NULL);
DEBUG_PRINT (TRACE_EXEC, ("leave NsDumpEntry %p\n", Handle));
AcpiNsDumpOneObject (Handle, 1, &Info, NULL);
DEBUG_PRINT (TRACE_EXEC, ("leave AcpiNsDumpEntry %p\n", Handle));
return_VOID;
}
#endif