diff options
Diffstat (limited to 'source/components/executer/exmisc.c')
-rw-r--r-- | source/components/executer/exmisc.c | 45 |
1 files changed, 39 insertions, 6 deletions
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: |