diff options
Diffstat (limited to 'sys/contrib/dev/acpica/components/parser/psargs.c')
-rw-r--r-- | sys/contrib/dev/acpica/components/parser/psargs.c | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/sys/contrib/dev/acpica/components/parser/psargs.c b/sys/contrib/dev/acpica/components/parser/psargs.c index b2a86fe..9c49ea6 100644 --- a/sys/contrib/dev/acpica/components/parser/psargs.c +++ b/sys/contrib/dev/acpica/components/parser/psargs.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -287,8 +287,8 @@ AcpiPsGetNextNamepath ( * the upsearch) */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, - ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, - ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node); + ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, + ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node); /* * If this name is a control method invocation, we must @@ -316,7 +316,7 @@ AcpiPsGetNextNamepath ( ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Control Method - %p Desc %p Path=%p\n", Node, MethodDesc, Path)); - NameOp = AcpiPsAllocOp (AML_INT_NAMEPATH_OP); + NameOp = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, Start); if (!NameOp) { return_ACPI_STATUS (AE_NO_MEMORY); @@ -359,7 +359,7 @@ AcpiPsGetNextNamepath ( /* 1) NotFound is ok during load pass 1/2 (allow forward references) */ if ((WalkState->ParseFlags & ACPI_PARSE_MODE_MASK) != - ACPI_PARSE_EXECUTE) + ACPI_PARSE_EXECUTE) { Status = AE_OK; } @@ -391,7 +391,7 @@ AcpiPsGetNextNamepath ( ACPI_ERROR_NAMESPACE (Path, Status); if ((WalkState->ParseFlags & ACPI_PARSE_MODE_MASK) == - ACPI_PARSE_EXECUTE) + ACPI_PARSE_EXECUTE) { /* Report a control method execution error */ @@ -524,7 +524,7 @@ static ACPI_PARSE_OBJECT * AcpiPsGetNextField ( ACPI_PARSE_STATE *ParserState) { - UINT32 AmlOffset; + UINT8 *Aml; ACPI_PARSE_OBJECT *Field; ACPI_PARSE_OBJECT *Arg = NULL; UINT16 Opcode; @@ -540,8 +540,7 @@ AcpiPsGetNextField ( ACPI_FUNCTION_TRACE (PsGetNextField); - AmlOffset = (UINT32) ACPI_PTR_DIFF ( - ParserState->Aml, ParserState->AmlStart); + Aml = ParserState->Aml; /* Determine field type */ @@ -579,14 +578,12 @@ AcpiPsGetNextField ( /* Allocate a new field op */ - Field = AcpiPsAllocOp (Opcode); + Field = AcpiPsAllocOp (Opcode, Aml); if (!Field) { return_PTR (NULL); } - Field->Common.AmlOffset = AmlOffset; - /* Decode the field type */ switch (Opcode) @@ -650,6 +647,7 @@ AcpiPsGetNextField ( * Argument for Connection operator can be either a Buffer * (resource descriptor), or a NameString. */ + Aml = ParserState->Aml; if (ACPI_GET8 (ParserState->Aml) == AML_BUFFER_OP) { ParserState->Aml++; @@ -662,7 +660,7 @@ AcpiPsGetNextField ( { /* Non-empty list */ - Arg = AcpiPsAllocOp (AML_INT_BYTELIST_OP); + Arg = AcpiPsAllocOp (AML_INT_BYTELIST_OP, Aml); if (!Arg) { AcpiPsFreeOp (Field); @@ -712,7 +710,7 @@ AcpiPsGetNextField ( } else { - Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP); + Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, Aml); if (!Arg) { AcpiPsFreeOp (Field); @@ -784,11 +782,12 @@ AcpiPsGetNextArg ( /* Constants, strings, and namestrings are all the same size */ - Arg = AcpiPsAllocOp (AML_BYTE_OP); + Arg = AcpiPsAllocOp (AML_BYTE_OP, ParserState->Aml); if (!Arg) { return_ACPI_STATUS (AE_NO_MEMORY); } + AcpiPsGetNextSimpleArg (ParserState, ArgType, Arg); break; @@ -836,7 +835,8 @@ AcpiPsGetNextArg ( { /* Non-empty list */ - Arg = AcpiPsAllocOp (AML_INT_BYTELIST_OP); + Arg = AcpiPsAllocOp (AML_INT_BYTELIST_OP, + ParserState->Aml); if (!Arg) { return_ACPI_STATUS (AE_NO_MEMORY); @@ -857,6 +857,7 @@ AcpiPsGetNextArg ( case ARGP_TARGET: case ARGP_SUPERNAME: case ARGP_SIMPLENAME: + case ARGP_NAME_OR_REF: Subop = AcpiPsPeekOpcode (ParserState); if (Subop == 0 || @@ -866,7 +867,7 @@ AcpiPsGetNextArg ( { /* NullName or NameString */ - Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP); + Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, ParserState->Aml); if (!Arg) { return_ACPI_STATUS (AE_NO_MEMORY); @@ -876,11 +877,12 @@ AcpiPsGetNextArg ( if (WalkState->Opcode == AML_UNLOAD_OP) { - Status = AcpiPsGetNextNamepath (WalkState, ParserState, Arg, 1); + Status = AcpiPsGetNextNamepath (WalkState, ParserState, + Arg, ACPI_POSSIBLE_METHOD_CALL); /* - * If the SuperName arg of Unload is a method call, - * we have restored the AML pointer, just free this Arg + * If the SuperName argument is a method call, we have + * already restored the AML pointer, just free this Arg */ if (Arg->Common.AmlOpcode == AML_INT_METHODCALL_OP) { @@ -890,7 +892,8 @@ AcpiPsGetNextArg ( } else { - Status = AcpiPsGetNextNamepath (WalkState, ParserState, Arg, 0); + Status = AcpiPsGetNextNamepath (WalkState, ParserState, + Arg, ACPI_NOT_METHOD_CALL); } } else |