diff options
Diffstat (limited to 'sys/contrib/dev/acpica/dbdisply.c')
-rw-r--r-- | sys/contrib/dev/acpica/dbdisply.c | 151 |
1 files changed, 92 insertions, 59 deletions
diff --git a/sys/contrib/dev/acpica/dbdisply.c b/sys/contrib/dev/acpica/dbdisply.c index a6fcc2a..93fe8ef 100644 --- a/sys/contrib/dev/acpica/dbdisply.c +++ b/sys/contrib/dev/acpica/dbdisply.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbdisply - debug display commands - * $Revision: 106 $ + * $Revision: 1.112 $ * ******************************************************************************/ @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp. * All rights reserved. * * 2. License @@ -127,12 +127,21 @@ #ifdef ACPI_DEBUGGER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbdisply") +/* Local prototypes */ -/****************************************************************************** +static void +AcpiDbDumpParserDescriptor ( + ACPI_PARSE_OBJECT *Op); + +static void * +AcpiDbGetPointer ( + void *Target); + + +/******************************************************************************* * * FUNCTION: AcpiDbGetPointer * @@ -142,9 +151,9 @@ * * DESCRIPTION: Convert an ascii pointer value to a real value * - *****************************************************************************/ + ******************************************************************************/ -void * +static void * AcpiDbGetPointer ( void *Target) { @@ -185,7 +194,7 @@ AcpiDbGetPointer ( * ******************************************************************************/ -void +static void AcpiDbDumpParserDescriptor ( ACPI_PARSE_OBJECT *Op) { @@ -197,7 +206,8 @@ AcpiDbDumpParserDescriptor ( AcpiOsPrintf ("Parser Op Descriptor:\n"); AcpiOsPrintf ("%20.20s : %4.4X\n", "Opcode", Op->Common.AmlOpcode); - ACPI_DEBUG_ONLY_MEMBERS (AcpiOsPrintf ("%20.20s : %s\n", "Opcode Name", Info->Name)); + ACPI_DEBUG_ONLY_MEMBERS (AcpiOsPrintf ("%20.20s : %s\n", "Opcode Name", + Info->Name)); AcpiOsPrintf ("%20.20s : %p\n", "Value/ArgList", Op->Common.Value.Arg); AcpiOsPrintf ("%20.20s : %p\n", "Parent", Op->Common.Parent); @@ -243,7 +253,7 @@ AcpiDbDecodeAndDisplayObject ( if (OutputType) { - ACPI_STRUPR (OutputType); + AcpiUtStrupr (OutputType); if (OutputType[0] == 'W') { Display = DB_WORD_DISPLAY; @@ -268,7 +278,8 @@ AcpiDbDecodeAndDisplayObject ( ObjPtr = AcpiDbGetPointer (Target); if (!AcpiOsReadable (ObjPtr, 16)) { - AcpiOsPrintf ("Address %p is invalid in this address space\n", ObjPtr); + AcpiOsPrintf ("Address %p is invalid in this address space\n", + ObjPtr); return; } @@ -282,12 +293,13 @@ AcpiDbDecodeAndDisplayObject ( if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_NAMESPACE_NODE))) { - AcpiOsPrintf ("Cannot read entire Named object at address %p\n", ObjPtr); + AcpiOsPrintf ( + "Cannot read entire Named object at address %p\n", ObjPtr); return; } Node = ObjPtr; - goto DumpNte; + goto DumpNode; case ACPI_DESC_TYPE_OPERAND: @@ -296,11 +308,13 @@ AcpiDbDecodeAndDisplayObject ( if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_OPERAND_OBJECT))) { - AcpiOsPrintf ("Cannot read entire ACPI object at address %p\n", ObjPtr); + AcpiOsPrintf ("Cannot read entire ACPI object at address %p\n", + ObjPtr); return; } - AcpiUtDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX); + AcpiUtDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT), Display, + ACPI_UINT32_MAX); AcpiExDumpObjectDescriptor (ObjPtr, 1); break; @@ -311,11 +325,13 @@ AcpiDbDecodeAndDisplayObject ( if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_PARSE_OBJECT))) { - AcpiOsPrintf ("Cannot read entire Parser object at address %p\n", ObjPtr); + AcpiOsPrintf ( + "Cannot read entire Parser object at address %p\n", ObjPtr); return; } - AcpiUtDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), Display, ACPI_UINT32_MAX); + AcpiUtDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), Display, + ACPI_UINT32_MAX); AcpiDbDumpParserDescriptor ((ACPI_PARSE_OBJECT *) ObjPtr); break; @@ -348,8 +364,8 @@ AcpiDbDecodeAndDisplayObject ( } -DumpNte: - /* Now dump the Named obj */ +DumpNode: + /* Now dump the NS node */ Status = AcpiGetName (Node, ACPI_FULL_PATHNAME, &RetBuf); if (ACPI_FAILURE (Status)) @@ -359,7 +375,8 @@ DumpNte: else { - AcpiOsPrintf ("Object (%p) Pathname: %s\n", Node, (char *) RetBuf.Pointer); + AcpiOsPrintf ("Object (%p) Pathname: %s\n", + Node, (char *) RetBuf.Pointer); } if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE))) @@ -368,7 +385,8 @@ DumpNte: return; } - AcpiUtDumpBuffer ((void *) Node, sizeof (ACPI_NAMESPACE_NODE), Display, ACPI_UINT32_MAX); + AcpiUtDumpBuffer ((void *) Node, sizeof (ACPI_NAMESPACE_NODE), + Display, ACPI_UINT32_MAX); AcpiExDumpNode (Node, 1); ObjDesc = AcpiNsGetAttachedObject (Node); @@ -377,11 +395,13 @@ DumpNte: AcpiOsPrintf ("\nAttached Object (%p):\n", ObjDesc); if (!AcpiOsReadable (ObjDesc, sizeof (ACPI_OPERAND_OBJECT))) { - AcpiOsPrintf ("Invalid internal ACPI Object at address %p\n", ObjDesc); + AcpiOsPrintf ("Invalid internal ACPI Object at address %p\n", + ObjDesc); return; } - AcpiUtDumpBuffer ((void *) ObjDesc, sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX); + AcpiUtDumpBuffer ((void *) ObjDesc, sizeof (ACPI_OPERAND_OBJECT), + Display, ACPI_UINT32_MAX); AcpiExDumpObjectDescriptor (ObjDesc, 1); } } @@ -492,11 +512,13 @@ AcpiDbDisplayMethodInfo ( Op = AcpiPsGetDepthNext (StartOp, Op); } - AcpiOsPrintf ("Method contains: %X AML Opcodes - %X Operators, %X Operands\n", - NumOps, NumOperators, NumOperands); + AcpiOsPrintf ( + "Method contains: %X AML Opcodes - %X Operators, %X Operands\n", + NumOps, NumOperators, NumOperands); - AcpiOsPrintf ("Remaining to execute: %X AML Opcodes - %X Operators, %X Operands\n", - NumRemainingOps, NumRemainingOperators, NumRemainingOperands); + AcpiOsPrintf ( + "Remaining to execute: %X AML Opcodes - %X Operators, %X Operands\n", + NumRemainingOps, NumRemainingOperators, NumRemainingOperands); } @@ -513,7 +535,8 @@ AcpiDbDisplayMethodInfo ( ******************************************************************************/ void -AcpiDbDisplayLocals (void) +AcpiDbDisplayLocals ( + void) { ACPI_WALK_STATE *WalkState; @@ -542,7 +565,8 @@ AcpiDbDisplayLocals (void) ******************************************************************************/ void -AcpiDbDisplayArguments (void) +AcpiDbDisplayArguments ( + void) { ACPI_WALK_STATE *WalkState; @@ -571,7 +595,8 @@ AcpiDbDisplayArguments (void) ******************************************************************************/ void -AcpiDbDisplayResults (void) +AcpiDbDisplayResults ( + void) { UINT32 i; ACPI_WALK_STATE *WalkState; @@ -620,7 +645,8 @@ AcpiDbDisplayResults (void) ******************************************************************************/ void -AcpiDbDisplayCallingTree (void) +AcpiDbDisplayCallingTree ( + void) { ACPI_WALK_STATE *WalkState; ACPI_NAMESPACE_NODE *Node; @@ -677,18 +703,20 @@ AcpiDbDisplayObjectType ( if (ACPI_SUCCESS (Status)) { Info = Buffer.Pointer; - AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X HID: %s, ADR: %8.8X%8.8X, Status %8.8X\n", - Info->HighestDstates[0], Info->HighestDstates[1], - Info->HighestDstates[2], Info->HighestDstates[3], - Info->HardwareId.Value, - ACPI_FORMAT_UINT64 (Info->Address), - Info->CurrentStatus); + AcpiOsPrintf ( + "S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X HID: %s, ADR: %8.8X%8.8X, Status %8.8X\n", + Info->HighestDstates[0], Info->HighestDstates[1], + Info->HighestDstates[2], Info->HighestDstates[3], + Info->HardwareId.Value, + ACPI_FORMAT_UINT64 (Info->Address), + Info->CurrentStatus); if (Info->Valid & ACPI_VALID_CID) { for (i = 0; i < Info->CompatibilityId.Count; i++) { - AcpiOsPrintf ("CID #%d: %s\n", (UINT32) i, Info->CompatibilityId.Id[i].Value); + AcpiOsPrintf ("CID #%d: %s\n", (UINT32) i, + Info->CompatibilityId.Id[i].Value); } } @@ -779,7 +807,8 @@ AcpiDbDisplayArgumentObject ( ******************************************************************************/ void -AcpiDbDisplayGpes (void) +AcpiDbDisplayGpes ( + void) { ACPI_GPE_BLOCK_INFO *GpeBlock; ACPI_GPE_XRUPT_INFO *GpeXruptInfo; @@ -814,18 +843,23 @@ AcpiDbDisplayGpes (void) } AcpiOsPrintf ("\nBlock %d - Info %p DeviceNode %p [%s]\n", - Block, GpeBlock, GpeBlock->Node, Buffer); - AcpiOsPrintf (" Registers: %u (%u GPEs) \n", - GpeBlock->RegisterCount, - ACPI_MUL_8 (GpeBlock->RegisterCount)); + Block, GpeBlock, GpeBlock->Node, Buffer); + + AcpiOsPrintf (" Registers: %u (%u GPEs)\n", + GpeBlock->RegisterCount, + ACPI_MUL_8 (GpeBlock->RegisterCount)); + AcpiOsPrintf (" GPE range: 0x%X to 0x%X\n", - GpeBlock->BlockBaseNumber, - GpeBlock->BlockBaseNumber + - (GpeBlock->RegisterCount * 8) -1); - AcpiOsPrintf (" RegisterInfo: %p Status %8.8X%8.8X Enable %8.8X%8.8X\n", - GpeBlock->RegisterInfo, - ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (GpeBlock->RegisterInfo->StatusAddress.Address)), - ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (GpeBlock->RegisterInfo->EnableAddress.Address))); + GpeBlock->BlockBaseNumber, + GpeBlock->BlockBaseNumber + + (GpeBlock->RegisterCount * 8) -1); + + AcpiOsPrintf ( + " RegisterInfo: %p Status %8.8X%8.8X Enable %8.8X%8.8X\n", + GpeBlock->RegisterInfo, + ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (GpeBlock->RegisterInfo->StatusAddress.Address)), + ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (GpeBlock->RegisterInfo->EnableAddress.Address))); + AcpiOsPrintf (" EventInfo: %p\n", GpeBlock->EventInfo); /* Examine each GPE Register within the block */ @@ -835,11 +869,11 @@ AcpiDbDisplayGpes (void) GpeRegisterInfo = &GpeBlock->RegisterInfo[i]; AcpiOsPrintf ( - " Reg %u: WakeEnable %2.2X, RunEnable %2.2X Status %8.8X%8.8X Enable %8.8X%8.8X\n", - i, GpeRegisterInfo->EnableForWake, - GpeRegisterInfo->EnableForRun, - ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (GpeRegisterInfo->StatusAddress.Address)), - ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (GpeRegisterInfo->EnableAddress.Address))); + " Reg %u: WakeEnable %2.2X, RunEnable %2.2X Status %8.8X%8.8X Enable %8.8X%8.8X\n", + i, GpeRegisterInfo->EnableForWake, + GpeRegisterInfo->EnableForRun, + ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (GpeRegisterInfo->StatusAddress.Address)), + ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (GpeRegisterInfo->EnableAddress.Address))); /* Now look at the individual GPEs in this byte register */ @@ -856,10 +890,10 @@ AcpiDbDisplayGpes (void) } AcpiOsPrintf ( - " GPE %.3X: %p Bit %2.2X Flags %2.2X: ", - GpeBlock->BlockBaseNumber + GpeIndex, - GpeEventInfo, GpeEventInfo->RegisterBit, - GpeEventInfo->Flags); + " GPE %.3X: %p Bit %2.2X Flags %2.2X: ", + GpeBlock->BlockBaseNumber + GpeIndex, + GpeEventInfo, GpeEventInfo->RegisterBit, + GpeEventInfo->Flags); if (GpeEventInfo->Flags & ACPI_GPE_LEVEL_TRIGGERED) { @@ -931,6 +965,5 @@ AcpiDbDisplayGpes (void) } } - #endif /* ACPI_DEBUGGER */ |