1 /******************************************************************************
3 * Module Name: psargs - Parse AML opcode arguments
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2019, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
50 #include "acconvert.h"
52 #define _COMPONENT ACPI_PARSER
53 ACPI_MODULE_NAME ("psargs")
55 /* Local prototypes */
58 AcpiPsGetNextPackageLength (
59 ACPI_PARSE_STATE
*ParserState
);
61 static ACPI_PARSE_OBJECT
*
63 ACPI_PARSE_STATE
*ParserState
);
66 /*******************************************************************************
68 * FUNCTION: AcpiPsGetNextPackageLength
70 * PARAMETERS: ParserState - Current parser state object
72 * RETURN: Decoded package length. On completion, the AML pointer points
73 * past the length byte or bytes.
75 * DESCRIPTION: Decode and return a package length field.
76 * Note: Largest package length is 28 bits, from ACPI specification
78 ******************************************************************************/
81 AcpiPsGetNextPackageLength (
82 ACPI_PARSE_STATE
*ParserState
)
84 UINT8
*Aml
= ParserState
->Aml
;
85 UINT32 PackageLength
= 0;
87 UINT8 ByteZeroMask
= 0x3F; /* Default [0:5] */
90 ACPI_FUNCTION_TRACE (PsGetNextPackageLength
);
94 * Byte 0 bits [6:7] contain the number of additional bytes
95 * used to encode the package length, either 0,1,2, or 3
97 ByteCount
= (Aml
[0] >> 6);
98 ParserState
->Aml
+= ((ACPI_SIZE
) ByteCount
+ 1);
100 /* Get bytes 3, 2, 1 as needed */
105 * Final bit positions for the package length bytes:
111 PackageLength
|= (Aml
[ByteCount
] << ((ByteCount
<< 3) - 4));
113 ByteZeroMask
= 0x0F; /* Use bits [0:3] of byte 0 */
117 /* Byte 0 is a special case, either bits [0:3] or [0:5] are used */
119 PackageLength
|= (Aml
[0] & ByteZeroMask
);
120 return_UINT32 (PackageLength
);
124 /*******************************************************************************
126 * FUNCTION: AcpiPsGetNextPackageEnd
128 * PARAMETERS: ParserState - Current parser state object
130 * RETURN: Pointer to end-of-package +1
132 * DESCRIPTION: Get next package length and return a pointer past the end of
133 * the package. Consumes the package length field
135 ******************************************************************************/
138 AcpiPsGetNextPackageEnd (
139 ACPI_PARSE_STATE
*ParserState
)
141 UINT8
*Start
= ParserState
->Aml
;
142 UINT32 PackageLength
;
145 ACPI_FUNCTION_TRACE (PsGetNextPackageEnd
);
148 /* Function below updates ParserState->Aml */
150 PackageLength
= AcpiPsGetNextPackageLength (ParserState
);
152 return_PTR (Start
+ PackageLength
); /* end of package */
156 /*******************************************************************************
158 * FUNCTION: AcpiPsGetNextNamestring
160 * PARAMETERS: ParserState - Current parser state object
162 * RETURN: Pointer to the start of the name string (pointer points into
165 * DESCRIPTION: Get next raw namestring within the AML stream. Handles all name
166 * prefix characters. Set parser state to point past the string.
167 * (Name is consumed from the AML.)
169 ******************************************************************************/
172 AcpiPsGetNextNamestring (
173 ACPI_PARSE_STATE
*ParserState
)
175 UINT8
*Start
= ParserState
->Aml
;
176 UINT8
*End
= ParserState
->Aml
;
179 ACPI_FUNCTION_TRACE (PsGetNextNamestring
);
182 /* Point past any namestring prefix characters (backslash or carat) */
184 while (ACPI_IS_ROOT_PREFIX (*End
) ||
185 ACPI_IS_PARENT_PREFIX (*End
))
190 /* Decode the path prefix character */
205 case AML_DUAL_NAME_PREFIX
:
207 /* Two name segments */
209 End
+= 1 + (2 * ACPI_NAME_SIZE
);
212 case AML_MULTI_NAME_PREFIX
:
214 /* Multiple name segments, 4 chars each, count in next byte */
216 End
+= 2 + (*(End
+ 1) * ACPI_NAME_SIZE
);
221 /* Single name segment */
223 End
+= ACPI_NAME_SIZE
;
227 ParserState
->Aml
= End
;
228 return_PTR ((char *) Start
);
232 /*******************************************************************************
234 * FUNCTION: AcpiPsGetNextNamepath
236 * PARAMETERS: ParserState - Current parser state object
237 * Arg - Where the namepath will be stored
238 * ArgCount - If the namepath points to a control method
239 * the method's argument is returned here.
240 * PossibleMethodCall - Whether the namepath can possibly be the
241 * start of a method call
245 * DESCRIPTION: Get next name (if method call, return # of required args).
246 * Names are looked up in the internal namespace to determine
247 * if the name represents a control method. If a method
248 * is found, the number of arguments to the method is returned.
249 * This information is critical for parsing to continue correctly.
251 ******************************************************************************/
254 AcpiPsGetNextNamepath (
255 ACPI_WALK_STATE
*WalkState
,
256 ACPI_PARSE_STATE
*ParserState
,
257 ACPI_PARSE_OBJECT
*Arg
,
258 BOOLEAN PossibleMethodCall
)
262 ACPI_PARSE_OBJECT
*NameOp
;
263 ACPI_OPERAND_OBJECT
*MethodDesc
;
264 ACPI_NAMESPACE_NODE
*Node
;
265 UINT8
*Start
= ParserState
->Aml
;
268 ACPI_FUNCTION_TRACE (PsGetNextNamepath
);
271 Path
= AcpiPsGetNextNamestring (ParserState
);
272 AcpiPsInitOp (Arg
, AML_INT_NAMEPATH_OP
);
274 /* Null path case is allowed, just exit */
278 Arg
->Common
.Value
.Name
= Path
;
279 return_ACPI_STATUS (AE_OK
);
283 * Lookup the name in the internal namespace, starting with the current
284 * scope. We don't want to add anything new to the namespace here,
285 * however, so we use MODE_EXECUTE.
286 * Allow searching of the parent tree, but don't open a new scope -
287 * we just want to lookup the object (must be mode EXECUTE to perform
290 Status
= AcpiNsLookup (WalkState
->ScopeInfo
, Path
,
291 ACPI_TYPE_ANY
, ACPI_IMODE_EXECUTE
,
292 ACPI_NS_SEARCH_PARENT
| ACPI_NS_DONT_OPEN_SCOPE
, NULL
, &Node
);
295 * If this name is a control method invocation, we must
296 * setup the method call
298 if (ACPI_SUCCESS (Status
) &&
299 PossibleMethodCall
&&
300 (Node
->Type
== ACPI_TYPE_METHOD
))
302 if ((GET_CURRENT_ARG_TYPE (WalkState
->ArgTypes
) == ARGP_SUPERNAME
) ||
303 (GET_CURRENT_ARG_TYPE (WalkState
->ArgTypes
) == ARGP_TARGET
))
306 * AcpiPsGetNextNamestring has increased the AML pointer past
307 * the method invocation namestring, so we need to restore the
308 * saved AML pointer back to the original method invocation
311 WalkState
->ParserState
.Aml
= Start
;
312 WalkState
->ArgCount
= 1;
313 AcpiPsInitOp (Arg
, AML_INT_METHODCALL_OP
);
316 /* This name is actually a control method invocation */
318 MethodDesc
= AcpiNsGetAttachedObject (Node
);
319 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE
,
320 "Control Method invocation %4.4s - %p Desc %p Path=%p\n",
321 Node
->Name
.Ascii
, Node
, MethodDesc
, Path
));
323 NameOp
= AcpiPsAllocOp (AML_INT_NAMEPATH_OP
, Start
);
326 return_ACPI_STATUS (AE_NO_MEMORY
);
329 /* Change Arg into a METHOD CALL and attach name to it */
331 AcpiPsInitOp (Arg
, AML_INT_METHODCALL_OP
);
332 NameOp
->Common
.Value
.Name
= Path
;
334 /* Point METHODCALL/NAME to the METHOD Node */
336 NameOp
->Common
.Node
= Node
;
337 AcpiPsAppendArg (Arg
, NameOp
);
341 ACPI_ERROR ((AE_INFO
,
342 "Control Method %p has no attached object",
344 return_ACPI_STATUS (AE_AML_INTERNAL
);
347 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE
,
348 "Control Method - %p Args %X\n",
349 Node
, MethodDesc
->Method
.ParamCount
));
351 /* Get the number of arguments to expect */
353 WalkState
->ArgCount
= MethodDesc
->Method
.ParamCount
;
354 return_ACPI_STATUS (AE_OK
);
358 * Special handling if the name was not found during the lookup -
359 * some NotFound cases are allowed
361 if (Status
== AE_NOT_FOUND
)
363 /* 1) NotFound is ok during load pass 1/2 (allow forward references) */
365 if ((WalkState
->ParseFlags
& ACPI_PARSE_MODE_MASK
) !=
371 /* 2) NotFound during a CondRefOf(x) is ok by definition */
373 else if (WalkState
->Op
->Common
.AmlOpcode
== AML_CONDITIONAL_REF_OF_OP
)
379 * 3) NotFound while building a Package is ok at this point, we
380 * may flag as an error later if slack mode is not enabled.
381 * (Some ASL code depends on allowing this behavior)
383 else if ((Arg
->Common
.Parent
) &&
384 ((Arg
->Common
.Parent
->Common
.AmlOpcode
== AML_PACKAGE_OP
) ||
385 (Arg
->Common
.Parent
->Common
.AmlOpcode
== AML_VARIABLE_PACKAGE_OP
)))
391 /* Final exception check (may have been changed from code above) */
393 if (ACPI_FAILURE (Status
))
395 ACPI_ERROR_NAMESPACE (WalkState
->ScopeInfo
, Path
, Status
);
397 if ((WalkState
->ParseFlags
& ACPI_PARSE_MODE_MASK
) ==
400 /* Report a control method execution error */
402 Status
= AcpiDsMethodError (Status
, WalkState
);
406 /* Save the namepath */
408 Arg
->Common
.Value
.Name
= Path
;
409 return_ACPI_STATUS (Status
);
413 /*******************************************************************************
415 * FUNCTION: AcpiPsGetNextSimpleArg
417 * PARAMETERS: ParserState - Current parser state object
418 * ArgType - The argument type (AML_*_ARG)
419 * Arg - Where the argument is returned
423 * DESCRIPTION: Get the next simple argument (constant, string, or namestring)
425 ******************************************************************************/
428 AcpiPsGetNextSimpleArg (
429 ACPI_PARSE_STATE
*ParserState
,
431 ACPI_PARSE_OBJECT
*Arg
)
435 UINT8
*Aml
= ParserState
->Aml
;
438 ACPI_FUNCTION_TRACE_U32 (PsGetNextSimpleArg
, ArgType
);
445 /* Get 1 byte from the AML stream */
447 Opcode
= AML_BYTE_OP
;
448 Arg
->Common
.Value
.Integer
= (UINT64
) *Aml
;
454 /* Get 2 bytes from the AML stream */
456 Opcode
= AML_WORD_OP
;
457 ACPI_MOVE_16_TO_64 (&Arg
->Common
.Value
.Integer
, Aml
);
463 /* Get 4 bytes from the AML stream */
465 Opcode
= AML_DWORD_OP
;
466 ACPI_MOVE_32_TO_64 (&Arg
->Common
.Value
.Integer
, Aml
);
472 /* Get 8 bytes from the AML stream */
474 Opcode
= AML_QWORD_OP
;
475 ACPI_MOVE_64_TO_64 (&Arg
->Common
.Value
.Integer
, Aml
);
481 /* Get a pointer to the string, point past the string */
483 Opcode
= AML_STRING_OP
;
484 Arg
->Common
.Value
.String
= ACPI_CAST_PTR (char, Aml
);
486 /* Find the null terminator */
497 case ARGP_NAMESTRING
:
499 AcpiPsInitOp (Arg
, AML_INT_NAMEPATH_OP
);
500 Arg
->Common
.Value
.Name
= AcpiPsGetNextNamestring (ParserState
);
505 ACPI_ERROR ((AE_INFO
, "Invalid ArgType 0x%X", ArgType
));
509 AcpiPsInitOp (Arg
, Opcode
);
510 ParserState
->Aml
+= Length
;
515 /*******************************************************************************
517 * FUNCTION: AcpiPsGetNextField
519 * PARAMETERS: ParserState - Current parser state object
521 * RETURN: A newly allocated FIELD op
523 * DESCRIPTION: Get next field (NamedField, ReservedField, or AccessField)
525 ******************************************************************************/
527 static ACPI_PARSE_OBJECT
*
529 ACPI_PARSE_STATE
*ParserState
)
532 ACPI_PARSE_OBJECT
*Field
;
533 ACPI_PARSE_OBJECT
*Arg
= NULL
;
537 UINT8 AccessAttribute
;
544 ACPI_FUNCTION_TRACE (PsGetNextField
);
547 ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState
);
548 Aml
= ParserState
->Aml
;
550 /* Determine field type */
552 switch (ACPI_GET8 (ParserState
->Aml
))
554 case AML_FIELD_OFFSET_OP
:
556 Opcode
= AML_INT_RESERVEDFIELD_OP
;
560 case AML_FIELD_ACCESS_OP
:
562 Opcode
= AML_INT_ACCESSFIELD_OP
;
566 case AML_FIELD_CONNECTION_OP
:
568 Opcode
= AML_INT_CONNECTION_OP
;
572 case AML_FIELD_EXT_ACCESS_OP
:
574 Opcode
= AML_INT_EXTACCESSFIELD_OP
;
580 Opcode
= AML_INT_NAMEDFIELD_OP
;
584 /* Allocate a new field op */
586 Field
= AcpiPsAllocOp (Opcode
, Aml
);
592 /* Decode the field type */
594 ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState
);
597 case AML_INT_NAMEDFIELD_OP
:
599 /* Get the 4-character name */
601 ACPI_MOVE_32_TO_32 (&Name
, ParserState
->Aml
);
602 AcpiPsSetName (Field
, Name
);
603 ParserState
->Aml
+= ACPI_NAME_SIZE
;
606 ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState
);
608 #ifdef ACPI_ASL_COMPILER
610 * Because the package length isn't represented as a parse tree object,
611 * take comments surrounding this and add to the previously created
614 if (Field
->Common
.InlineComment
)
616 Field
->Common
.NameComment
= Field
->Common
.InlineComment
;
618 Field
->Common
.InlineComment
= AcpiGbl_CurrentInlineComment
;
619 AcpiGbl_CurrentInlineComment
= NULL
;
622 /* Get the length which is encoded as a package length */
624 Field
->Common
.Value
.Size
= AcpiPsGetNextPackageLength (ParserState
);
628 case AML_INT_RESERVEDFIELD_OP
:
630 /* Get the length which is encoded as a package length */
632 Field
->Common
.Value
.Size
= AcpiPsGetNextPackageLength (ParserState
);
636 case AML_INT_ACCESSFIELD_OP
:
637 case AML_INT_EXTACCESSFIELD_OP
:
640 * Get AccessType and AccessAttrib and merge into the field Op
641 * AccessType is first operand, AccessAttribute is second. stuff
642 * these bytes into the node integer value for convenience.
645 /* Get the two bytes (Type/Attribute) */
647 AccessType
= ACPI_GET8 (ParserState
->Aml
);
649 AccessAttribute
= ACPI_GET8 (ParserState
->Aml
);
652 Field
->Common
.Value
.Integer
= (UINT8
) AccessType
;
653 Field
->Common
.Value
.Integer
|= (UINT16
) (AccessAttribute
<< 8);
655 /* This opcode has a third byte, AccessLength */
657 if (Opcode
== AML_INT_EXTACCESSFIELD_OP
)
659 AccessLength
= ACPI_GET8 (ParserState
->Aml
);
662 Field
->Common
.Value
.Integer
|= (UINT32
) (AccessLength
<< 16);
667 case AML_INT_CONNECTION_OP
:
670 * Argument for Connection operator can be either a Buffer
671 * (resource descriptor), or a NameString.
673 Aml
= ParserState
->Aml
;
674 if (ACPI_GET8 (ParserState
->Aml
) == AML_BUFFER_OP
)
678 ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState
);
679 PkgEnd
= ParserState
->Aml
;
680 PkgLength
= AcpiPsGetNextPackageLength (ParserState
);
683 ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState
);
684 if (ParserState
->Aml
< PkgEnd
)
688 Arg
= AcpiPsAllocOp (AML_INT_BYTELIST_OP
, Aml
);
691 AcpiPsFreeOp (Field
);
695 /* Get the actual buffer length argument */
697 Opcode
= ACPI_GET8 (ParserState
->Aml
);
700 ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState
);
703 case AML_BYTE_OP
: /* AML_BYTEDATA_ARG */
705 BufferLength
= ACPI_GET8 (ParserState
->Aml
);
706 ParserState
->Aml
+= 1;
709 case AML_WORD_OP
: /* AML_WORDDATA_ARG */
711 BufferLength
= ACPI_GET16 (ParserState
->Aml
);
712 ParserState
->Aml
+= 2;
715 case AML_DWORD_OP
: /* AML_DWORDATA_ARG */
717 BufferLength
= ACPI_GET32 (ParserState
->Aml
);
718 ParserState
->Aml
+= 4;
727 /* Fill in bytelist data */
729 ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState
);
730 Arg
->Named
.Value
.Size
= BufferLength
;
731 Arg
->Named
.Data
= ParserState
->Aml
;
734 /* Skip to End of byte data */
736 ParserState
->Aml
= PkgEnd
;
740 Arg
= AcpiPsAllocOp (AML_INT_NAMEPATH_OP
, Aml
);
743 AcpiPsFreeOp (Field
);
747 /* Get the Namestring argument */
749 Arg
->Common
.Value
.Name
= AcpiPsGetNextNamestring (ParserState
);
752 /* Link the buffer/namestring to parent (CONNECTION_OP) */
754 AcpiPsAppendArg (Field
, Arg
);
760 /* Opcode was set in previous switch */
768 /*******************************************************************************
770 * FUNCTION: AcpiPsGetNextArg
772 * PARAMETERS: WalkState - Current state
773 * ParserState - Current parser state object
774 * ArgType - The argument type (AML_*_ARG)
775 * ReturnArg - Where the next arg is returned
777 * RETURN: Status, and an op object containing the next argument.
779 * DESCRIPTION: Get next argument (including complex list arguments that require
780 * pushing the parser stack)
782 ******************************************************************************/
786 ACPI_WALK_STATE
*WalkState
,
787 ACPI_PARSE_STATE
*ParserState
,
789 ACPI_PARSE_OBJECT
**ReturnArg
)
791 ACPI_PARSE_OBJECT
*Arg
= NULL
;
792 ACPI_PARSE_OBJECT
*Prev
= NULL
;
793 ACPI_PARSE_OBJECT
*Field
;
795 ACPI_STATUS Status
= AE_OK
;
798 ACPI_FUNCTION_TRACE_PTR (PsGetNextArg
, ParserState
);
801 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE
,
802 "Expected argument type ARGP: %s (%2.2X)\n",
803 AcpiUtGetArgumentTypeName (ArgType
), ArgType
));
812 case ARGP_NAMESTRING
:
814 /* Constants, strings, and namestrings are all the same size */
816 Arg
= AcpiPsAllocOp (AML_BYTE_OP
, ParserState
->Aml
);
819 return_ACPI_STATUS (AE_NO_MEMORY
);
822 AcpiPsGetNextSimpleArg (ParserState
, ArgType
, Arg
);
827 /* Package length, nothing returned */
829 ParserState
->PkgEnd
= AcpiPsGetNextPackageEnd (ParserState
);
834 if (ParserState
->Aml
< ParserState
->PkgEnd
)
838 while (ParserState
->Aml
< ParserState
->PkgEnd
)
840 Field
= AcpiPsGetNextField (ParserState
);
843 return_ACPI_STATUS (AE_NO_MEMORY
);
848 Prev
->Common
.Next
= Field
;
857 /* Skip to End of byte data */
859 ParserState
->Aml
= ParserState
->PkgEnd
;
865 if (ParserState
->Aml
< ParserState
->PkgEnd
)
869 Arg
= AcpiPsAllocOp (AML_INT_BYTELIST_OP
,
873 return_ACPI_STATUS (AE_NO_MEMORY
);
876 /* Fill in bytelist data */
878 Arg
->Common
.Value
.Size
= (UINT32
)
879 ACPI_PTR_DIFF (ParserState
->PkgEnd
, ParserState
->Aml
);
880 Arg
->Named
.Data
= ParserState
->Aml
;
882 /* Skip to End of byte data */
884 ParserState
->Aml
= ParserState
->PkgEnd
;
888 case ARGP_SIMPLENAME
:
889 case ARGP_NAME_OR_REF
:
891 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE
,
892 "**** SimpleName/NameOrRef: %s (%2.2X)\n",
893 AcpiUtGetArgumentTypeName (ArgType
), ArgType
));
895 Subop
= AcpiPsPeekOpcode (ParserState
);
897 AcpiPsIsLeadingChar (Subop
) ||
898 ACPI_IS_ROOT_PREFIX (Subop
) ||
899 ACPI_IS_PARENT_PREFIX (Subop
))
901 /* NullName or NameString */
903 Arg
= AcpiPsAllocOp (AML_INT_NAMEPATH_OP
, ParserState
->Aml
);
906 return_ACPI_STATUS (AE_NO_MEMORY
);
909 Status
= AcpiPsGetNextNamepath (WalkState
, ParserState
,
910 Arg
, ACPI_NOT_METHOD_CALL
);
914 /* Single complex argument, nothing returned */
916 WalkState
->ArgCount
= 1;
923 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE
,
924 "**** Target/Supername: %s (%2.2X)\n",
925 AcpiUtGetArgumentTypeName (ArgType
), ArgType
));
927 Subop
= AcpiPsPeekOpcode (ParserState
);
929 AcpiPsIsLeadingChar (Subop
) ||
930 ACPI_IS_ROOT_PREFIX (Subop
) ||
931 ACPI_IS_PARENT_PREFIX (Subop
))
933 /* NULL target (zero). Convert to a NULL namepath */
935 Arg
= AcpiPsAllocOp (AML_INT_NAMEPATH_OP
, ParserState
->Aml
);
938 return_ACPI_STATUS (AE_NO_MEMORY
);
941 Status
= AcpiPsGetNextNamepath (WalkState
, ParserState
,
942 Arg
, ACPI_POSSIBLE_METHOD_CALL
);
944 if (Arg
->Common
.AmlOpcode
== AML_INT_METHODCALL_OP
)
946 /* Free method call op and corresponding namestring sub-ob */
948 AcpiPsFreeOp (Arg
->Common
.Value
.Arg
);
951 WalkState
->ArgCount
= 1;
956 /* Single complex argument, nothing returned */
958 WalkState
->ArgCount
= 1;
965 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE
,
966 "**** TermArg/DataObj: %s (%2.2X)\n",
967 AcpiUtGetArgumentTypeName (ArgType
), ArgType
));
969 /* Single complex argument, nothing returned */
971 WalkState
->ArgCount
= 1;
974 case ARGP_DATAOBJLIST
:
978 if (ParserState
->Aml
< ParserState
->PkgEnd
)
980 /* Non-empty list of variable arguments, nothing returned */
982 WalkState
->ArgCount
= ACPI_VAR_ARGS
;
988 ACPI_ERROR ((AE_INFO
, "Invalid ArgType: 0x%X", ArgType
));
989 Status
= AE_AML_OPERAND_TYPE
;
994 return_ACPI_STATUS (Status
);