diff options
Diffstat (limited to 'source/components/executer')
-rw-r--r-- | source/components/executer/exconfig.c | 16 | ||||
-rw-r--r-- | source/components/executer/exconvrt.c | 2 | ||||
-rw-r--r-- | source/components/executer/exdump.c | 12 | ||||
-rw-r--r-- | source/components/executer/exprep.c | 4 | ||||
-rw-r--r-- | source/components/executer/exstore.c | 25 | ||||
-rw-r--r-- | source/components/executer/exstoren.c | 2 | ||||
-rw-r--r-- | source/components/executer/exutils.c | 20 |
7 files changed, 54 insertions, 27 deletions
diff --git a/source/components/executer/exconfig.c b/source/components/executer/exconfig.c index f0083ff3beb8e..601fa5422a2f7 100644 --- a/source/components/executer/exconfig.c +++ b/source/components/executer/exconfig.c @@ -50,6 +50,7 @@ #include "actables.h" #include "acdispat.h" #include "acevents.h" +#include "amlcode.h" #define _COMPONENT ACPI_EXECUTER @@ -185,14 +186,15 @@ AcpiExLoadTableOp ( (Operand[1]->String.Length > ACPI_OEM_ID_SIZE) || (Operand[2]->String.Length > ACPI_OEM_TABLE_ID_SIZE)) { - return_ACPI_STATUS (AE_BAD_PARAMETER); + return_ACPI_STATUS (AE_AML_STRING_LIMIT); } /* Find the ACPI table in the RSDT/XSDT */ - Status = AcpiTbFindTable (Operand[0]->String.Pointer, - Operand[1]->String.Pointer, - Operand[2]->String.Pointer, &TableIndex); + Status = AcpiTbFindTable ( + Operand[0]->String.Pointer, + Operand[1]->String.Pointer, + Operand[2]->String.Pointer, &TableIndex); if (ACPI_FAILURE (Status)) { if (Status != AE_NOT_FOUND) @@ -237,8 +239,8 @@ AcpiExLoadTableOp ( if (Operand[4]->String.Length > 0) { - if ((Operand[4]->String.Pointer[0] != '\\') && - (Operand[4]->String.Pointer[0] != '^')) + if ((Operand[4]->String.Pointer[0] != AML_ROOT_PREFIX) && + (Operand[4]->String.Pointer[0] != AML_PARENT_PREFIX)) { /* * Path is not absolute, so it will be relative to the node @@ -299,7 +301,7 @@ AcpiExLoadTableOp ( } *ReturnDesc = DdbHandle; - return_ACPI_STATUS (Status); + return_ACPI_STATUS (Status); } diff --git a/source/components/executer/exconvrt.c b/source/components/executer/exconvrt.c index 81cde05cb4a13..21ab5dd4ad225 100644 --- a/source/components/executer/exconvrt.c +++ b/source/components/executer/exconvrt.c @@ -199,7 +199,7 @@ AcpiExConvertToInteger ( /* Save the Result */ - AcpiExTruncateFor32bitTable (ReturnDesc); + (void) AcpiExTruncateFor32bitTable (ReturnDesc); *ResultDesc = ReturnDesc; return_ACPI_STATUS (AE_OK); } diff --git a/source/components/executer/exdump.c b/source/components/executer/exdump.c index 5e13849a7db36..171ab7d6d8e89 100644 --- a/source/components/executer/exdump.c +++ b/source/components/executer/exdump.c @@ -483,7 +483,9 @@ AcpiExDumpOperand ( ACPI_FUNCTION_NAME (ExDumpOperand) - if (!((ACPI_LV_EXEC & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))) + /* Check if debug output enabled */ + + if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_EXEC, _COMPONENT)) { return; } @@ -873,7 +875,9 @@ AcpiExDumpNamespaceNode ( if (!Flags) { - if (!((ACPI_LV_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))) + /* Check if debug output enabled */ + + if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS, _COMPONENT)) { return; } @@ -1080,7 +1084,9 @@ AcpiExDumpObjectDescriptor ( if (!Flags) { - if (!((ACPI_LV_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))) + /* Check if debug output enabled */ + + if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS, _COMPONENT)) { return_VOID; } diff --git a/source/components/executer/exprep.c b/source/components/executer/exprep.c index 2f62e9db4257e..a183c041ea0f4 100644 --- a/source/components/executer/exprep.c +++ b/source/components/executer/exprep.c @@ -292,7 +292,7 @@ AcpiExDecodeFieldAccess ( ACPI_ERROR ((AE_INFO, "Unknown field access type 0x%X", Access)); - return_UINT32 (0); + return_VALUE (0); } if (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD) @@ -306,7 +306,7 @@ AcpiExDecodeFieldAccess ( } *ReturnByteAlignment = ByteAlignment; - return_UINT32 (BitLength); + return_VALUE (BitLength); } diff --git a/source/components/executer/exstore.c b/source/components/executer/exstore.c index 283cff59864f9..2eb0897834450 100644 --- a/source/components/executer/exstore.c +++ b/source/components/executer/exstore.c @@ -515,13 +515,28 @@ AcpiExStoreObjectToNode ( default: ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "Storing %s (%p) directly into node (%p) with no implicit conversion\n", - AcpiUtGetObjectTypeName (SourceDesc), SourceDesc, Node)); + "Storing [%s] (%p) directly into node [%s] (%p)" + " with no implicit conversion\n", + AcpiUtGetObjectTypeName (SourceDesc), SourceDesc, + AcpiUtGetObjectTypeName (TargetDesc), Node)); - /* No conversions for all other types. Just attach the source object */ + /* + * No conversions for all other types. Directly store a copy of + * the source object. NOTE: This is a departure from the ACPI + * spec, which states "If conversion is impossible, abort the + * running control method". + * + * This code implements "If conversion is impossible, treat the + * Store operation as a CopyObject". + */ + Status = AcpiUtCopyIobjectToIobject (SourceDesc, &NewDesc, WalkState); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } - Status = AcpiNsAttachObject (Node, SourceDesc, - SourceDesc->Common.Type); + Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type); + AcpiUtRemoveReference (NewDesc); break; } diff --git a/source/components/executer/exstoren.c b/source/components/executer/exstoren.c index 84699b67adf22..7bdaf7c595c0e 100644 --- a/source/components/executer/exstoren.c +++ b/source/components/executer/exstoren.c @@ -269,7 +269,7 @@ AcpiExStoreObjectToObject ( /* Truncate value if we are executing from a 32-bit ACPI table */ - AcpiExTruncateFor32bitTable (DestDesc); + (void) AcpiExTruncateFor32bitTable (DestDesc); break; case ACPI_TYPE_STRING: diff --git a/source/components/executer/exutils.c b/source/components/executer/exutils.c index 12befff2e7e62..c0259fdaabf4b 100644 --- a/source/components/executer/exutils.c +++ b/source/components/executer/exutils.c @@ -229,14 +229,14 @@ AcpiExRelinquishInterpreter ( * * PARAMETERS: ObjDesc - Object to be truncated * - * RETURN: none + * RETURN: TRUE if a truncation was performed, FALSE otherwise. * * DESCRIPTION: Truncate an ACPI Integer to 32 bits if the execution mode is * 32-bit, as determined by the revision of the DSDT. * ******************************************************************************/ -void +BOOLEAN AcpiExTruncateFor32bitTable ( ACPI_OPERAND_OBJECT *ObjDesc) { @@ -246,23 +246,27 @@ AcpiExTruncateFor32bitTable ( /* * Object must be a valid number and we must be executing - * a control method. NS node could be there for AML_INT_NAMEPATH_OP. + * a control method. Object could be NS node for AML_INT_NAMEPATH_OP. */ if ((!ObjDesc) || (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) || (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)) { - return; + return (FALSE); } - if (AcpiGbl_IntegerByteWidth == 4) + if ((AcpiGbl_IntegerByteWidth == 4) && + (ObjDesc->Integer.Value > (UINT64) ACPI_UINT32_MAX)) { /* - * We are running a method that exists in a 32-bit ACPI table. + * We are executing in a 32-bit ACPI table. * Truncate the value to 32 bits by zeroing out the upper 32-bit field */ ObjDesc->Integer.Value &= (UINT64) ACPI_UINT32_MAX; + return (TRUE); } + + return (FALSE); } @@ -387,7 +391,7 @@ AcpiExDigitsNeeded ( if (Value == 0) { - return_UINT32 (1); + return_VALUE (1); } CurrentValue = Value; @@ -401,7 +405,7 @@ AcpiExDigitsNeeded ( NumDigits++; } - return_UINT32 (NumDigits); + return_VALUE (NumDigits); } |