diff options
Diffstat (limited to 'source/components/debugger/dbcmds.c')
-rw-r--r-- | source/components/debugger/dbcmds.c | 83 |
1 files changed, 59 insertions, 24 deletions
diff --git a/source/components/debugger/dbcmds.c b/source/components/debugger/dbcmds.c index d22bf4ca79e2..c9d06f977f83 100644 --- a/source/components/debugger/dbcmds.c +++ b/source/components/debugger/dbcmds.c @@ -49,7 +49,6 @@ #include "acresrc.h" #include "actables.h" -#ifdef ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbcmds") @@ -88,6 +87,7 @@ AcpiDbDoOneSleepState ( static char *AcpiDbTraceMethodName = NULL; + /******************************************************************************* * * FUNCTION: AcpiDbConvertToNode @@ -140,7 +140,8 @@ AcpiDbConvertToNode ( Node = AcpiDbLocalNsLookup (InString); if (!Node) { - AcpiOsPrintf ("Could not find [%s] in namespace, defaulting to root node\n", + AcpiOsPrintf ( + "Could not find [%s] in namespace, defaulting to root node\n", InString); Node = AcpiGbl_RootNode; } @@ -203,7 +204,7 @@ AcpiDbSleep ( * * PARAMETERS: SleepState - Desired sleep state (0-5) * - * RETURN: Status + * RETURN: None * * DESCRIPTION: Simulate a sleep/wake sequence * @@ -340,7 +341,8 @@ AcpiDbDisplayTableInfo ( /* Header */ - AcpiOsPrintf ("Idx ID Status Type TableHeader (Sig, Address, Length)\n"); + AcpiOsPrintf ("Idx ID Status Type " + "TableHeader (Sig, Address, Length, Misc)\n"); /* Walk the entire root table list */ @@ -499,7 +501,8 @@ AcpiDbSendNotify ( else { AcpiOsPrintf ( - "Named object [%4.4s] Type %s, must be Device/Thermal/Processor type\n", + "Named object [%4.4s] Type %s, " + "must be Device/Thermal/Processor type\n", AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type)); } } @@ -532,8 +535,7 @@ AcpiDbDisplayInterfaces ( if (!ActionArg) { - (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, - ACPI_WAIT_FOREVER); + (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); NextInterface = AcpiGbl_SupportedInterfaces; while (NextInterface) @@ -542,6 +544,7 @@ AcpiDbDisplayInterfaces ( { AcpiOsPrintf ("%s\n", NextInterface->Name); } + NextInterface = NextInterface->Next; } @@ -647,7 +650,8 @@ AcpiDbDisplayTemplate ( if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("Could not convert Buffer to a resource list: %s, %s\n", + AcpiOsPrintf ( + "Could not convert Buffer to a resource list: %s, %s\n", BufferArg, AcpiFormatException (Status)); goto DumpBuffer; } @@ -708,7 +712,8 @@ AcpiDmCompareAmlResources ( if (Aml1BufferLength != Aml2BufferLength) { AcpiOsPrintf ( - "**** Buffer length mismatch in converted AML: Original %X, New %X ****\n", + "**** Buffer length mismatch in converted " + "AML: Original %X, New %X ****\n", Aml1BufferLength, Aml2BufferLength); } @@ -732,7 +737,8 @@ AcpiDmCompareAmlResources ( if (Aml1Length != Aml2Length) { AcpiOsPrintf ( - "**** Length mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X Len1 %X, Len2 %X ****\n", + "**** Length mismatch in descriptor [%.2X] type %2.2X, " + "Offset %8.8X Len1 %X, Len2 %X ****\n", Count, ResourceType, Offset, Aml1Length, Aml2Length); } @@ -741,7 +747,8 @@ AcpiDmCompareAmlResources ( else if (memcmp (Aml1, Aml2, Aml1Length)) { AcpiOsPrintf ( - "**** Data mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X ****\n", + "**** Data mismatch in descriptor [%.2X] type %2.2X, " + "Offset %8.8X ****\n", Count, ResourceType, Offset); for (i = 0; i < Aml1Length; i++) @@ -749,7 +756,8 @@ AcpiDmCompareAmlResources ( if (Aml1[i] != Aml2[i]) { AcpiOsPrintf ( - "Mismatch at byte offset %.2X: is %2.2X, should be %2.2X\n", + "Mismatch at byte offset %.2X: is %2.2X, " + "should be %2.2X\n", i, Aml2[i], Aml1[i]); } } @@ -914,10 +922,15 @@ AcpiDbDeviceResources ( /* Get handles to the resource methods for this device */ - (void) AcpiGetHandle (Node, METHOD_NAME__PRT, ACPI_CAST_PTR (ACPI_HANDLE, &PrtNode)); - (void) AcpiGetHandle (Node, METHOD_NAME__CRS, ACPI_CAST_PTR (ACPI_HANDLE, &CrsNode)); - (void) AcpiGetHandle (Node, METHOD_NAME__PRS, ACPI_CAST_PTR (ACPI_HANDLE, &PrsNode)); - (void) AcpiGetHandle (Node, METHOD_NAME__AEI, ACPI_CAST_PTR (ACPI_HANDLE, &AeiNode)); + (void) AcpiGetHandle (Node, METHOD_NAME__PRT, + ACPI_CAST_PTR (ACPI_HANDLE, &PrtNode)); + (void) AcpiGetHandle (Node, METHOD_NAME__CRS, + ACPI_CAST_PTR (ACPI_HANDLE, &CrsNode)); + (void) AcpiGetHandle (Node, METHOD_NAME__PRS, + ACPI_CAST_PTR (ACPI_HANDLE, &PrsNode)); + (void) AcpiGetHandle (Node, METHOD_NAME__AEI, + ACPI_CAST_PTR (ACPI_HANDLE, &AeiNode)); + if (!PrtNode && !CrsNode && !PrsNode && !AeiNode) { goto Cleanup; /* Nothing to do */ @@ -1071,7 +1084,8 @@ GetPrs: goto GetAei; } - AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer)); + AcpiRsDumpResourceList (ACPI_CAST_PTR ( + ACPI_RESOURCE, AcpiGbl_DbBuffer)); } @@ -1104,7 +1118,8 @@ GetAei: goto Cleanup; } - AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer)); + AcpiRsDumpResourceList (ACPI_CAST_PTR ( + ACPI_RESOURCE, AcpiGbl_DbBuffer)); } @@ -1143,7 +1158,7 @@ AcpiDbDisplayResources ( if (!ObjectArg || (!strcmp (ObjectArg, "*"))) { (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, AcpiDbDeviceResources, NULL, NULL, NULL); + ACPI_UINT32_MAX, AcpiDbDeviceResources, NULL, NULL, NULL); } else { @@ -1154,7 +1169,8 @@ AcpiDbDisplayResources ( { if (Node->Type != ACPI_TYPE_DEVICE) { - AcpiOsPrintf ("%4.4s: Name is not a device object (%s)\n", + AcpiOsPrintf ( + "%4.4s: Name is not a device object (%s)\n", Node->Name.Ascii, AcpiUtGetTypeName (Node->Type)); } else @@ -1219,6 +1235,19 @@ AcpiDbGenerateGpe ( (void) AcpiEvGpeDispatch (NULL, GpeEventInfo, GpeNumber); } + +/******************************************************************************* + * + * FUNCTION: AcpiDbGenerateSci + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Simulate an SCI -- just call the SCI dispatch. + * + ******************************************************************************/ + void AcpiDbGenerateSci ( void) @@ -1259,10 +1288,12 @@ AcpiDbTrace ( { AcpiUtStrupr (EnableArg); } + if (OnceArg) { AcpiUtStrupr (OnceArg); } + if (MethodArg) { if (AcpiDbTraceMethodName) @@ -1270,14 +1301,18 @@ AcpiDbTrace ( ACPI_FREE (AcpiDbTraceMethodName); AcpiDbTraceMethodName = NULL; } + AcpiDbTraceMethodName = ACPI_ALLOCATE (strlen (MethodArg) + 1); if (!AcpiDbTraceMethodName) { - AcpiOsPrintf ("Failed to allocate method name (%s)\n", MethodArg); + AcpiOsPrintf ("Failed to allocate method name (%s)\n", + MethodArg); return; } + strcpy (AcpiDbTraceMethodName, MethodArg); } + if (!strcmp (EnableArg, "ENABLE") || !strcmp (EnableArg, "METHOD") || !strcmp (EnableArg, "OPCODE")) @@ -1298,10 +1333,12 @@ AcpiDbTrace ( } Flags = ACPI_TRACE_ENABLED; + if (!strcmp (EnableArg, "OPCODE")) { Flags |= ACPI_TRACE_OPCODE; } + if (OnceArg && !strcmp (OnceArg, "ONCE")) { Flags |= ACPI_TRACE_ONESHOT; @@ -1309,7 +1346,5 @@ AcpiDbTrace ( } (void) AcpiDebugTrace (AcpiDbTraceMethodName, - DebugLevel, DebugLayer, Flags); + DebugLevel, DebugLayer, Flags); } - -#endif /* ACPI_DEBUGGER */ |