diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2015-12-18 18:35:46 +0000 | 
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2015-12-18 18:35:46 +0000 | 
| commit | 1c6f3e7bf6ed0a9ff1bd466e319cdf456e6e91dc (patch) | |
| tree | 9ffecbf2e9ce4e63aac5515363a488b761a02b03 /source/components/executer/exmisc.c | |
| parent | b9098066cd6284319bca922f13e59517f774a103 (diff) | |
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 ab01f6ea50dd..b56645cc33d7 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: | 
