diff options
Diffstat (limited to 'source/components/executer')
-rw-r--r-- | source/components/executer/excreate.c | 7 | ||||
-rw-r--r-- | source/components/executer/exdebug.c | 76 | ||||
-rw-r--r-- | source/components/executer/exdump.c | 6 | ||||
-rw-r--r-- | source/components/executer/exmisc.c | 45 | ||||
-rw-r--r-- | source/components/executer/exoparg1.c | 2 |
5 files changed, 107 insertions, 29 deletions
diff --git a/source/components/executer/excreate.c b/source/components/executer/excreate.c index 5e67346091d7d..82e7e767491b3 100644 --- a/source/components/executer/excreate.c +++ b/source/components/executer/excreate.c @@ -350,9 +350,10 @@ AcpiExCreateRegion ( * Remember location in AML stream of address & length * operands since they need to be evaluated at run time. */ - RegionObj2 = ObjDesc->Common.NextObject; + RegionObj2 = AcpiNsGetSecondaryObject (ObjDesc); RegionObj2->Extra.AmlStart = AmlStart; RegionObj2->Extra.AmlLength = AmlLength; + RegionObj2->Extra.Method_REG = NULL; if (WalkState->ScopeInfo) { RegionObj2->Extra.ScopeNode = WalkState->ScopeInfo->Scope.Node; @@ -368,6 +369,10 @@ AcpiExCreateRegion ( ObjDesc->Region.Address = 0; ObjDesc->Region.Length = 0; ObjDesc->Region.Node = Node; + ObjDesc->Region.Handler = NULL; + ObjDesc->Common.Flags &= + ~(AOPOBJ_SETUP_COMPLETE | AOPOBJ_REG_CONNECTED | + AOPOBJ_OBJECT_INITIALIZED); /* Install the new region object in the parent Node */ diff --git a/source/components/executer/exdebug.c b/source/components/executer/exdebug.c index 4d97cda0d3721..982760b91c07c 100644 --- a/source/components/executer/exdebug.c +++ b/source/components/executer/exdebug.c @@ -96,13 +96,20 @@ AcpiExDoDebugObject ( return_VOID; } - /* - * We will emit the current timer value (in microseconds) with each - * debug output. Only need the lower 26 bits. This allows for 67 - * million microseconds or 67 seconds before rollover. - */ - Timer = ((UINT32) AcpiOsGetTimer () / 10); /* (100 nanoseconds to microseconds) */ - Timer &= 0x03FFFFFF; + /* Null string or newline -- don't emit the line header */ + + if (SourceDesc && + (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_OPERAND) && + (SourceDesc->Common.Type == ACPI_TYPE_STRING)) + { + if ((SourceDesc->String.Length == 0) || + ((SourceDesc->String.Length == 1) && + (*SourceDesc->String.Pointer == '\n'))) + { + AcpiOsPrintf ("\n"); + return_VOID; + } + } /* * Print line header as long as we are not in the middle of an @@ -110,14 +117,31 @@ AcpiExDoDebugObject ( */ if (!((Level > 0) && Index == 0)) { - AcpiOsPrintf ("[ACPI Debug %.8u] %*s", Timer, Level, " "); + if (AcpiGbl_DisplayDebugTimer) + { + /* + * We will emit the current timer value (in microseconds) with each + * debug output. Only need the lower 26 bits. This allows for 67 + * million microseconds or 67 seconds before rollover. + * + * Convert 100 nanosecond units to microseconds + */ + Timer = ((UINT32) AcpiOsGetTimer () / 10); + Timer &= 0x03FFFFFF; + + AcpiOsPrintf ("[ACPI Debug T=0x%8.8X] %*s", Timer, Level, " "); + } + else + { + AcpiOsPrintf ("[ACPI Debug] %*s", Level, " "); + } } /* Display the index for package output only */ if (Index > 0) { - AcpiOsPrintf ("(%.2u) ", Index-1); + AcpiOsPrintf ("(%.2u) ", Index - 1); } if (!SourceDesc) @@ -128,7 +152,13 @@ AcpiExDoDebugObject ( if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_OPERAND) { - AcpiOsPrintf ("%s ", AcpiUtGetObjectTypeName (SourceDesc)); + /* No object type prefix needed for integers and strings */ + + if ((SourceDesc->Common.Type != ACPI_TYPE_INTEGER) && + (SourceDesc->Common.Type != ACPI_TYPE_STRING)) + { + AcpiOsPrintf ("%s ", AcpiUtGetObjectTypeName (SourceDesc)); + } if (!AcpiUtValidInternalObject (SourceDesc)) { @@ -138,7 +168,7 @@ AcpiExDoDebugObject ( } else if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_NAMED) { - AcpiOsPrintf ("%s: %p\n", + AcpiOsPrintf ("%s (Node %p)\n", AcpiUtGetTypeName (((ACPI_NAMESPACE_NODE *) SourceDesc)->Type), SourceDesc); return_VOID; @@ -178,13 +208,12 @@ AcpiExDoDebugObject ( case ACPI_TYPE_STRING: - AcpiOsPrintf ("[0x%.2X] \"%s\"\n", - SourceDesc->String.Length, SourceDesc->String.Pointer); + AcpiOsPrintf ("\"%s\"\n", SourceDesc->String.Pointer); break; case ACPI_TYPE_PACKAGE: - AcpiOsPrintf ("[Contains 0x%.2X Elements]\n", + AcpiOsPrintf ("(Contains 0x%.2X Elements):\n", SourceDesc->Package.Count); /* Output the entire contents of the package */ @@ -263,8 +292,10 @@ AcpiExDoDebugObject ( if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Object) == ACPI_DESC_TYPE_NAMED) { - AcpiExDoDebugObject (((ACPI_NAMESPACE_NODE *) - SourceDesc->Reference.Object)->Object, + /* Reference object is a namespace node */ + + AcpiExDoDebugObject (ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, + SourceDesc->Reference.Object), Level + 4, 0); } else @@ -290,8 +321,15 @@ AcpiExDoDebugObject ( case ACPI_TYPE_PACKAGE: AcpiOsPrintf ("Package[%u] = ", Value); - AcpiExDoDebugObject (*SourceDesc->Reference.Where, - Level+4, 0); + if (!(*SourceDesc->Reference.Where)) + { + AcpiOsPrintf ("[Uninitialized Package Element]\n"); + } + else + { + AcpiExDoDebugObject (*SourceDesc->Reference.Where, + Level+4, 0); + } break; default: @@ -306,7 +344,7 @@ AcpiExDoDebugObject ( default: - AcpiOsPrintf ("%p\n", SourceDesc); + AcpiOsPrintf ("(Descriptor %p)\n", SourceDesc); break; } diff --git a/source/components/executer/exdump.c b/source/components/executer/exdump.c index ebd78d9af5fd4..a09d779c24cc6 100644 --- a/source/components/executer/exdump.c +++ b/source/components/executer/exdump.c @@ -522,7 +522,8 @@ AcpiExDumpObject ( if (Next) { AcpiOsPrintf ("(%s %2.2X)", - AcpiUtGetObjectTypeName (Next), Next->Common.Type); + AcpiUtGetObjectTypeName (Next), + Next->AddressSpace.SpaceId); while (Next->AddressSpace.Next) { @@ -534,7 +535,8 @@ AcpiExDumpObject ( Next = Next->AddressSpace.Next; AcpiOsPrintf ("->%p(%s %2.2X)", Next, - AcpiUtGetObjectTypeName (Next), Next->Common.Type); + AcpiUtGetObjectTypeName (Next), + Next->AddressSpace.SpaceId); if ((Next == Start) || (Next == Data)) { diff --git a/source/components/executer/exmisc.c b/source/components/executer/exmisc.c index ab01f6ea50dd5..b56645cc33d7d 100644 --- a/source/components/executer/exmisc.c +++ b/source/components/executer/exmisc.c @@ -107,9 +107,9 @@ AcpiExGetObjectReference ( default: - ACPI_ERROR ((AE_INFO, "Unknown Reference Class 0x%2.2X", + ACPI_ERROR ((AE_INFO, "Invalid Reference Class 0x%2.2X", ObjDesc->Reference.Class)); - return_ACPI_STATUS (AE_AML_INTERNAL); + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } break; @@ -265,6 +265,7 @@ AcpiExDoConcatenate ( ACPI_OPERAND_OBJECT *LocalOperand1 = Operand1; ACPI_OPERAND_OBJECT *ReturnDesc; char *NewBuf; + const char *TypeString; ACPI_STATUS Status; @@ -286,9 +287,42 @@ AcpiExDoConcatenate ( break; case ACPI_TYPE_STRING: + /* + * Per the ACPI spec, Concatenate only supports int/str/buf. + * However, we support all objects here as an extension. + * This improves the usefulness of the Printf() macro. + * 12/2015. + */ + switch (Operand1->Common.Type) + { + case ACPI_TYPE_INTEGER: + case ACPI_TYPE_STRING: + case ACPI_TYPE_BUFFER: - Status = AcpiExConvertToString ( - Operand1, &LocalOperand1, ACPI_IMPLICIT_CONVERT_HEX); + Status = AcpiExConvertToString ( + Operand1, &LocalOperand1, ACPI_IMPLICIT_CONVERT_HEX); + break; + + default: + /* + * Just emit a string containing the object type. + */ + TypeString = AcpiUtGetTypeName (Operand1->Common.Type); + + LocalOperand1 = AcpiUtCreateStringObject ( + ((ACPI_SIZE) strlen (TypeString) + 9)); /* 9 For "[Object]" */ + if (!LocalOperand1) + { + Status = AE_NO_MEMORY; + goto Cleanup; + } + + strcpy (LocalOperand1->String.Pointer, "["); + strcat (LocalOperand1->String.Pointer, TypeString); + strcat (LocalOperand1->String.Pointer, " Object]"); + Status = AE_OK; + break; + } break; case ACPI_TYPE_BUFFER: @@ -367,8 +401,7 @@ AcpiExDoConcatenate ( /* Concatenate the strings */ strcpy (NewBuf, Operand0->String.Pointer); - strcpy (NewBuf + Operand0->String.Length, - LocalOperand1->String.Pointer); + strcat (NewBuf, LocalOperand1->String.Pointer); break; case ACPI_TYPE_BUFFER: diff --git a/source/components/executer/exoparg1.c b/source/components/executer/exoparg1.c index 4d2d88f648625..efaa827701931 100644 --- a/source/components/executer/exoparg1.c +++ b/source/components/executer/exoparg1.c @@ -724,7 +724,7 @@ AcpiExOpcode_1A_0T_1R ( Status = AcpiExStore (ReturnDesc, Operand[0], WalkState); break; - case AML_TYPE_OP: /* ObjectType (SourceObject) */ + case AML_OBJECT_TYPE_OP: /* ObjectType (SourceObject) */ /* * Note: The operand is not resolved at this point because we want to * get the associated object, not its value. For example, we don't |