diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2018-04-27 21:30:01 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2018-04-27 21:30:01 +0000 |
commit | 5dc04bcfd5c1bd0942e4a6640bf39d15f464af4f (patch) | |
tree | 78a599bc6dc9341412480da5af5b8f78175d1d65 /source/components/debugger | |
parent | e44d3d8ceb12ae786d331468fe4acf41a4af5424 (diff) |
Notes
Diffstat (limited to 'source/components/debugger')
-rw-r--r-- | source/components/debugger/dbnames.c | 13 | ||||
-rw-r--r-- | source/components/debugger/dbtest.c | 67 |
2 files changed, 74 insertions, 6 deletions
diff --git a/source/components/debugger/dbnames.c b/source/components/debugger/dbnames.c index 49c40bcc921b..c151a3efa612 100644 --- a/source/components/debugger/dbnames.c +++ b/source/components/debugger/dbnames.c @@ -372,8 +372,17 @@ AcpiDbDumpNamespace ( } AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT); - AcpiOsPrintf ("ACPI Namespace (from %4.4s (%p) subtree):\n", - ((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Name.Ascii, SubtreeEntry); + + if (((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Parent) + { + AcpiOsPrintf ("ACPI Namespace (from %4.4s (%p) subtree):\n", + ((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Name.Ascii, SubtreeEntry); + } + else + { + AcpiOsPrintf ("ACPI Namespace (from %s):\n", + ACPI_NAMESPACE_ROOT); + } /* Display the subtree */ diff --git a/source/components/debugger/dbtest.c b/source/components/debugger/dbtest.c index 0969f9b0a6d0..04f93892e370 100644 --- a/source/components/debugger/dbtest.c +++ b/source/components/debugger/dbtest.c @@ -189,6 +189,10 @@ AcpiDbTestStringType ( UINT32 ByteLength); static ACPI_STATUS +AcpiDbTestPackageType ( + ACPI_NAMESPACE_NODE *Node); + +static ACPI_STATUS AcpiDbReadFromObject ( ACPI_NAMESPACE_NODE *Node, ACPI_OBJECT_TYPE ExpectedType, @@ -456,6 +460,11 @@ AcpiDbTestOneObject ( BitLength = ByteLength * 8; break; + case ACPI_TYPE_PACKAGE: + + LocalType = ACPI_TYPE_PACKAGE; + break; + case ACPI_TYPE_FIELD_UNIT: case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD: @@ -490,6 +499,7 @@ AcpiDbTestOneObject ( AcpiOsPrintf ("%14s: %4.4s", AcpiUtGetTypeName (Node->Type), Node->Name.Ascii); + if (!ObjDesc) { AcpiOsPrintf (" Ignoring, no attached object\n"); @@ -510,13 +520,12 @@ AcpiDbTestOneObject ( case ACPI_ADR_SPACE_SYSTEM_MEMORY: case ACPI_ADR_SPACE_SYSTEM_IO: case ACPI_ADR_SPACE_PCI_CONFIG: - case ACPI_ADR_SPACE_EC: break; default: - AcpiOsPrintf (" %s space is not supported [%4.4s]\n", + AcpiOsPrintf (" %s space is not supported in this command [%4.4s]\n", AcpiUtGetRegionName (RegionObj->Region.SpaceId), RegionObj->Region.Node->Name.Ascii); return (AE_OK); @@ -546,6 +555,11 @@ AcpiDbTestOneObject ( Status = AcpiDbTestBufferType (Node, BitLength); break; + case ACPI_TYPE_PACKAGE: + + Status = AcpiDbTestPackageType (Node); + break; + default: AcpiOsPrintf (" Ignoring, type not implemented (%2.2X)", @@ -553,6 +567,14 @@ AcpiDbTestOneObject ( break; } + /* Exit on error, but don't abort the namespace walk */ + + if (ACPI_FAILURE (Status)) + { + Status = AE_OK; + goto Exit; + } + switch (Node->Type) { case ACPI_TYPE_LOCAL_REGION_FIELD: @@ -560,12 +582,14 @@ AcpiDbTestOneObject ( RegionObj = ObjDesc->Field.RegionObj; AcpiOsPrintf (" (%s)", AcpiUtGetRegionName (RegionObj->Region.SpaceId)); + break; default: break; } +Exit: AcpiOsPrintf ("\n"); return (Status); } @@ -624,7 +648,6 @@ AcpiDbTestIntegerType ( { ValueToWrite = 0; } - /* Write a new value */ WriteValue.Type = ACPI_TYPE_INTEGER; @@ -917,6 +940,40 @@ Exit: /******************************************************************************* * + * FUNCTION: AcpiDbTestPackageType + * + * PARAMETERS: Node - Parent NS node for the object + * + * RETURN: Status + * + * DESCRIPTION: Test read for a Package object. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDbTestPackageType ( + ACPI_NAMESPACE_NODE *Node) +{ + ACPI_OBJECT *Temp1 = NULL; + ACPI_STATUS Status; + + + /* Read the original value */ + + Status = AcpiDbReadFromObject (Node, ACPI_TYPE_PACKAGE, &Temp1); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + AcpiOsPrintf (" %8.8X Elements", Temp1->Package.Count); + AcpiOsFree (Temp1); + return (Status); +} + + +/******************************************************************************* + * * FUNCTION: AcpiDbReadFromObject * * PARAMETERS: Node - Parent NS node for the object @@ -957,8 +1014,8 @@ AcpiDbReadFromObject ( AcpiGbl_MethodExecuting = TRUE; Status = AcpiEvaluateObject (ReadHandle, NULL, &ParamObjects, &ReturnObj); - AcpiGbl_MethodExecuting = FALSE; + AcpiGbl_MethodExecuting = FALSE; if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not read from object, %s", @@ -973,6 +1030,7 @@ AcpiDbReadFromObject ( case ACPI_TYPE_INTEGER: case ACPI_TYPE_BUFFER: case ACPI_TYPE_STRING: + case ACPI_TYPE_PACKAGE: /* * Did we receive the type we wanted? Most important for the * Integer/Buffer case (when a field is larger than an Integer, @@ -984,6 +1042,7 @@ AcpiDbReadFromObject ( AcpiUtGetTypeName (ExpectedType), AcpiUtGetTypeName (RetValue->Type)); + AcpiOsFree (ReturnObj.Pointer); return (AE_TYPE); } |