diff options
Diffstat (limited to 'source/components/parser')
| -rw-r--r-- | source/components/parser/psargs.c | 77 | ||||
| -rw-r--r-- | source/components/parser/psloop.c | 3 | ||||
| -rw-r--r-- | source/components/parser/psobject.c | 8 | ||||
| -rw-r--r-- | source/components/parser/pstree.c | 10 | 
4 files changed, 59 insertions, 39 deletions
| diff --git a/source/components/parser/psargs.c b/source/components/parser/psargs.c index a4745c3adc1df..5cc328612e118 100644 --- a/source/components/parser/psargs.c +++ b/source/components/parser/psargs.c @@ -298,23 +298,12 @@ AcpiPsGetNextNamepath (          PossibleMethodCall &&          (Node->Type == ACPI_TYPE_METHOD))      { -        if (WalkState->Opcode == AML_UNLOAD_OP) -        { -            /* -             * AcpiPsGetNextNamestring has increased the AML pointer, -             * so we need to restore the saved AML pointer for method call. -             */ -            WalkState->ParserState.Aml = Start; -            WalkState->ArgCount = 1; -            AcpiPsInitOp (Arg, AML_INT_METHODCALL_OP); -            return_ACPI_STATUS (AE_OK); -        } -          /* This name is actually a control method invocation */          MethodDesc = AcpiNsGetAttachedObject (Node);          ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, -            "Control Method - %p Desc %p Path=%p\n", Node, MethodDesc, Path)); +            "Control Method invocation %4.4s - %p Desc %p Path=%p\n", +            Node->Name.Ascii, Node, MethodDesc, Path));          NameOp = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, Start);          if (!NameOp) @@ -771,6 +760,10 @@ AcpiPsGetNextArg (      ACPI_FUNCTION_TRACE_PTR (PsGetNextArg, ParserState); +    ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, +        "Expected argument type ARGP: %s (%2.2X)\n", +        AcpiUtGetArgumentTypeName (ArgType), ArgType)); +      switch (ArgType)      {      case ARGP_BYTEDATA: @@ -854,11 +847,13 @@ AcpiPsGetNextArg (          }          break; -    case ARGP_TARGET: -    case ARGP_SUPERNAME:      case ARGP_SIMPLENAME:      case ARGP_NAME_OR_REF: +        ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, +            "**** SimpleName/NameOrRef: %s (%2.2X)\n", +            AcpiUtGetArgumentTypeName (ArgType), ArgType)); +          Subop = AcpiPsPeekOpcode (ParserState);          if (Subop == 0                  ||              AcpiPsIsLeadingChar (Subop) || @@ -873,28 +868,37 @@ AcpiPsGetNextArg (                  return_ACPI_STATUS (AE_NO_MEMORY);              } -            /* To support SuperName arg of Unload */ +            Status = AcpiPsGetNextNamepath (WalkState, ParserState, +                Arg, ACPI_NOT_METHOD_CALL); +        } +        else +        { +            /* Single complex argument, nothing returned */ -            if (WalkState->Opcode == AML_UNLOAD_OP) -            { -                Status = AcpiPsGetNextNamepath (WalkState, ParserState, -                    Arg, ACPI_POSSIBLE_METHOD_CALL); - -                /* -                 * 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) -                { -                    AcpiPsFreeOp (Arg); -                    Arg = NULL; -                } -            } -            else +            WalkState->ArgCount = 1; +        } +        break; + +    case ARGP_TARGET: +    case ARGP_SUPERNAME: + +        ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, +            "**** Target/Supername: %s (%2.2X)\n", +            AcpiUtGetArgumentTypeName (ArgType), ArgType)); + +        Subop = AcpiPsPeekOpcode (ParserState); +        if (Subop == 0) +        { +            /* NULL target (zero). Convert to a NULL namepath */ + +            Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, ParserState->Aml); +            if (!Arg)              { -                Status = AcpiPsGetNextNamepath (WalkState, ParserState, -                    Arg, ACPI_NOT_METHOD_CALL); +                return_ACPI_STATUS (AE_NO_MEMORY);              } + +            Status = AcpiPsGetNextNamepath (WalkState, ParserState, +                Arg, ACPI_POSSIBLE_METHOD_CALL);          }          else          { @@ -907,6 +911,11 @@ AcpiPsGetNextArg (      case ARGP_DATAOBJ:      case ARGP_TERMARG: + +    ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, +        "**** TermArg/DataObj: %s (%2.2X)\n", +        AcpiUtGetArgumentTypeName (ArgType), ArgType)); +          /* Single complex argument, nothing returned */          WalkState->ArgCount = 1; diff --git a/source/components/parser/psloop.c b/source/components/parser/psloop.c index e0839fd7d828b..5056cd1de7f0a 100644 --- a/source/components/parser/psloop.c +++ b/source/components/parser/psloop.c @@ -104,6 +104,9 @@ AcpiPsGetArguments (      ACPI_FUNCTION_TRACE_PTR (PsGetArguments, WalkState); +    ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, +        "Get arguments for opcode [%s]\n", Op->Common.AmlOpName)); +      switch (Op->Common.AmlOpcode)      {      case AML_BYTE_OP:       /* AML_BYTEDATA_ARG */ diff --git a/source/components/parser/psobject.c b/source/components/parser/psobject.c index 7edc39e2b7ad2..d027f6d9892c8 100644 --- a/source/components/parser/psobject.c +++ b/source/components/parser/psobject.c @@ -373,7 +373,13 @@ AcpiPsCreateOp (                  Op->Common.Flags |= ACPI_PARSEOP_TARGET;              }          } -        else if (ParentScope->Common.AmlOpcode == AML_INCREMENT_OP) + +        /* +         * Special case for both Increment() and Decrement(), where +         * the lone argument is both a source and a target. +         */ +        else if ((ParentScope->Common.AmlOpcode == AML_INCREMENT_OP) || +                (ParentScope->Common.AmlOpcode == AML_DECREMENT_OP))          {              Op->Common.Flags |= ACPI_PARSEOP_TARGET;          } diff --git a/source/components/parser/pstree.c b/source/components/parser/pstree.c index 729856982b649..0d6ab6373b6e5 100644 --- a/source/components/parser/pstree.c +++ b/source/components/parser/pstree.c @@ -142,12 +142,12 @@ AcpiPsAppendArg (      const ACPI_OPCODE_INFO  *OpInfo; -    ACPI_FUNCTION_ENTRY (); +    ACPI_FUNCTION_TRACE ("PsAppendArg");      if (!Op)      { -        return; +        return_VOID;      }      /* Get the info structure for this opcode */ @@ -159,7 +159,7 @@ AcpiPsAppendArg (          ACPI_ERROR ((AE_INFO, "Invalid AML Opcode: 0x%2.2X",              Op->Common.AmlOpcode)); -        return; +        return_VOID;      }      /* Check if this opcode requires argument sub-objects */ @@ -168,7 +168,7 @@ AcpiPsAppendArg (      {          /* Has no linked argument objects */ -        return; +        return_VOID;      }      /* Append the argument to the linked argument list */ @@ -200,6 +200,8 @@ AcpiPsAppendArg (          Op->Common.ArgListLength++;      } + +    return_VOID;  } | 
