1 /******************************************************************************
3 * Module Name: aslwalks.c - Miscellaneous analytical parse tree walks
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2016, 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.
44 #include "aslcompiler.h"
45 #include "aslcompiler.y.h"
50 #define _COMPONENT ACPI_COMPILER
51 ACPI_MODULE_NAME ("aslwalks")
54 /* Local prototypes */
57 AnAnalyzeStoreOperator (
58 ACPI_PARSE_OBJECT *Op);
61 /*******************************************************************************
63 * FUNCTION: AnMethodTypingWalkEnd
65 * PARAMETERS: ASL_WALK_CALLBACK
69 * DESCRIPTION: Ascending callback for typing walk. Complete the method
70 * return analysis. Check methods for:
71 * 1) Initialized local variables
75 ******************************************************************************/
78 AnMethodTypingWalkEnd (
79 ACPI_PARSE_OBJECT *Op,
86 switch (Op->Asl.ParseOpcode)
90 Op->Asl.CompileFlags |= NODE_METHOD_TYPED;
95 if ((Op->Asl.Child) &&
96 (Op->Asl.Child->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG))
98 ThisOpBtype = AnGetBtype (Op->Asl.Child);
100 if ((Op->Asl.Child->Asl.ParseOpcode == PARSEOP_METHODCALL) &&
101 (ThisOpBtype == (ACPI_UINT32_MAX -1)))
104 * The called method is untyped at this time (typically a
105 * forward reference).
107 * Check for a recursive method call first. Note: the
108 * Child->Node will be null if the method has not been
111 if (Op->Asl.Child->Asl.Node &&
112 (Op->Asl.ParentMethod != Op->Asl.Child->Asl.Node->Op))
114 /* We must type the method here */
116 TrWalkParseTree (Op->Asl.Child->Asl.Node->Op,
117 ASL_WALK_VISIT_UPWARD, NULL,
118 AnMethodTypingWalkEnd, NULL);
120 ThisOpBtype = AnGetBtype (Op->Asl.Child);
124 /* Returns a value, save the value type */
126 if (Op->Asl.ParentMethod)
128 Op->Asl.ParentMethod->Asl.AcpiBtype |= ThisOpBtype;
142 /*******************************************************************************
144 * FUNCTION: AnOperandTypecheckWalkEnd
146 * PARAMETERS: ASL_WALK_CALLBACK
150 * DESCRIPTION: Ascending callback for analysis walk. Complete method
153 ******************************************************************************/
156 AnOperandTypecheckWalkEnd (
157 ACPI_PARSE_OBJECT *Op,
161 const ACPI_OPCODE_INFO *OpInfo;
162 UINT32 RuntimeArgTypes;
163 UINT32 RuntimeArgTypes2;
164 UINT32 RequiredBtypes;
165 UINT32 ThisNodeBtype;
168 ACPI_PARSE_OBJECT *ArgOp;
172 switch (Op->Asl.AmlOpcode)
174 case AML_RAW_DATA_BYTE:
175 case AML_RAW_DATA_WORD:
176 case AML_RAW_DATA_DWORD:
177 case AML_RAW_DATA_QWORD:
178 case AML_RAW_DATA_BUFFER:
179 case AML_RAW_DATA_CHAIN:
180 case AML_PACKAGE_LENGTH:
181 case AML_UNASSIGNED_OPCODE:
182 case AML_DEFAULT_ARG_OP:
184 /* Ignore the internal (compiler-only) AML opcodes */
193 OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
199 ArgOp = Op->Asl.Child;
200 OpcodeClass = OpInfo->Class;
201 RuntimeArgTypes = OpInfo->RuntimeArgs;
203 #ifdef ASL_ERROR_NAMED_OBJECT_IN_WHILE
205 * Update 11/2008: In practice, we can't perform this check. A simple
206 * analysis is not sufficient. Also, it can cause errors when compiling
207 * disassembled code because of the way Switch operators are implemented
208 * (a While(One) loop with a named temp variable created within.)
212 * If we are creating a named object, check if we are within a while loop
213 * by checking if the parent is a WHILE op. This is a simple analysis, but
214 * probably sufficient for many cases.
216 * Allow Scope(), Buffer(), and Package().
218 if (((OpcodeClass == AML_CLASS_NAMED_OBJECT) && (Op->Asl.AmlOpcode != AML_SCOPE_OP)) ||
219 ((OpcodeClass == AML_CLASS_CREATE) && (OpInfo->Flags & AML_NSNODE)))
221 if (Op->Asl.Parent->Asl.AmlOpcode == AML_WHILE_OP)
223 AslError (ASL_ERROR, ASL_MSG_NAMED_OBJECT_IN_WHILE, Op, NULL);
229 * Special case for control opcodes IF/RETURN/WHILE since they
230 * have no runtime arg list (at this time)
232 switch (Op->Asl.AmlOpcode)
238 if (ArgOp->Asl.ParseOpcode == PARSEOP_METHODCALL)
240 /* Check for an internal method */
242 if (AnIsInternalMethod (ArgOp))
247 /* The lone arg is a method call, check it */
249 RequiredBtypes = AnMapArgTypeToBtype (ARGI_INTEGER);
250 if (Op->Asl.AmlOpcode == AML_RETURN_OP)
252 RequiredBtypes = 0xFFFFFFFF;
255 ThisNodeBtype = AnGetBtype (ArgOp);
256 if (ThisNodeBtype == ACPI_UINT32_MAX)
261 AnCheckMethodReturnValue (Op, OpInfo, ArgOp,
262 RequiredBtypes, ThisNodeBtype);
266 case AML_EXTERNAL_OP:
268 * Not really a "runtime" opcode since it used by disassembler only.
269 * The parser will find any issues with the operands.
278 /* Ignore the non-executable opcodes */
280 if (RuntimeArgTypes == ARGI_INVALID_OPCODE)
286 * Special handling for certain opcodes.
288 switch (Op->Asl.AmlOpcode)
290 /* BankField has one TermArg */
292 case AML_BANK_FIELD_OP:
294 OpcodeClass = AML_CLASS_EXECUTE;
295 ArgOp = ArgOp->Asl.Next;
296 ArgOp = ArgOp->Asl.Next;
299 /* Operation Region has 2 TermArgs */
303 OpcodeClass = AML_CLASS_EXECUTE;
304 ArgOp = ArgOp->Asl.Next;
305 ArgOp = ArgOp->Asl.Next;
308 /* DataTableRegion has 3 TermArgs */
310 case AML_DATA_REGION_OP:
312 OpcodeClass = AML_CLASS_EXECUTE;
313 ArgOp = ArgOp->Asl.Next;
316 /* Buffers/Packages have a length that is a TermArg */
320 case AML_VAR_PACKAGE_OP:
322 /* If length is a constant, we are done */
324 if ((ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER) ||
325 (ArgOp->Asl.ParseOpcode == PARSEOP_RAW_DATA))
331 /* Store can write any object to the Debug object */
335 * If this is a Store() to the Debug object, we don't need
336 * to perform any further validation -- because a Store of
337 * any object to Debug is permitted and supported.
339 if (ArgOp->Asl.Next->Asl.AmlOpcode == AML_DEBUG_OP)
351 case AML_CLASS_EXECUTE:
352 case AML_CLASS_CREATE:
353 case AML_CLASS_CONTROL:
354 case AML_CLASS_RETURN_VALUE:
356 /* Reverse the runtime argument list */
358 RuntimeArgTypes2 = 0;
359 while ((ArgType = GET_CURRENT_ARG_TYPE (RuntimeArgTypes)))
361 RuntimeArgTypes2 <<= ARG_TYPE_WIDTH;
362 RuntimeArgTypes2 |= ArgType;
363 INCREMENT_ARG_LIST (RuntimeArgTypes);
366 /* Typecheck each argument */
368 while ((ArgType = GET_CURRENT_ARG_TYPE (RuntimeArgTypes2)))
370 /* Get the required type(s) for the argument */
372 RequiredBtypes = AnMapArgTypeToBtype (ArgType);
376 AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, Op,
377 "Null ArgOp in argument loop");
381 /* Get the actual type of the argument */
383 ThisNodeBtype = AnGetBtype (ArgOp);
384 if (ThisNodeBtype == ACPI_UINT32_MAX)
389 /* Examine the arg based on the required type of the arg */
395 if (ArgOp->Asl.ParseOpcode == PARSEOP_ZERO)
397 /* ZERO is the placeholder for "don't store result" */
399 ThisNodeBtype = RequiredBtypes;
405 case ARGI_STORE_TARGET:
407 if (ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER)
410 * This is the case where an original reference to a resource
411 * descriptor field has been replaced by an (Integer) offset.
412 * These named fields are supported at compile-time only;
413 * the names are not passed to the interpreter (via the AML).
415 if ((ArgOp->Asl.Node->Type == ACPI_TYPE_LOCAL_RESOURCE_FIELD) ||
416 (ArgOp->Asl.Node->Type == ACPI_TYPE_LOCAL_RESOURCE))
418 AslError (ASL_ERROR, ASL_MSG_RESOURCE_FIELD,
423 AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE,
430 #ifdef __FUTURE_IMPLEMENTATION
432 * Possible future typechecking support
434 case ARGI_REFERENCE: /* References */
435 case ARGI_INTEGER_REF:
436 case ARGI_OBJECT_REF:
437 case ARGI_DEVICE_REF:
439 switch (ArgOp->Asl.ParseOpcode)
450 /* TBD: implement analysis of current value (type) of the local */
451 /* For now, just treat any local as a typematch */
453 /*ThisNodeBtype = RequiredBtypes;*/
464 /* Hard to analyze argument types, so we won't */
465 /* for now. Just treat any arg as a typematch */
467 /* ThisNodeBtype = RequiredBtypes; */
486 /* Check for a type mismatch (required versus actual) */
488 CommonBtypes = ThisNodeBtype & RequiredBtypes;
490 if (ArgOp->Asl.ParseOpcode == PARSEOP_METHODCALL)
492 if (AnIsInternalMethod (ArgOp))
497 /* Check a method call for a valid return value */
499 AnCheckMethodReturnValue (Op, OpInfo, ArgOp,
500 RequiredBtypes, ThisNodeBtype);
504 * Now check if the actual type(s) match at least one
505 * bit to the required type
507 else if (!CommonBtypes)
509 /* No match -- this is a type mismatch error */
511 AnFormatBtype (StringBuffer, ThisNodeBtype);
512 AnFormatBtype (StringBuffer2, RequiredBtypes);
514 sprintf (MsgBuffer, "[%s] found, %s operator requires [%s]",
515 StringBuffer, OpInfo->Name, StringBuffer2);
517 AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE,
522 ArgOp = ArgOp->Asl.Next;
523 INCREMENT_ARG_LIST (RuntimeArgTypes2);
536 /*******************************************************************************
538 * FUNCTION: AnOtherSemanticAnalysisWalkBegin
540 * PARAMETERS: ASL_WALK_CALLBACK
544 * DESCRIPTION: Descending callback for the analysis walk. Checks for
545 * miscellaneous issues in the code.
547 ******************************************************************************/
550 AnOtherSemanticAnalysisWalkBegin (
551 ACPI_PARSE_OBJECT *Op,
555 ACPI_PARSE_OBJECT *ArgOp;
556 ACPI_PARSE_OBJECT *PrevArgOp = NULL;
557 const ACPI_OPCODE_INFO *OpInfo;
558 ACPI_NAMESPACE_NODE *Node;
561 OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
565 * Determine if an execution class operator actually does something by
566 * checking if it has a target and/or the function return value is used.
567 * (Target is optional, so a standalone statement can actually do nothing.)
569 if ((OpInfo->Class == AML_CLASS_EXECUTE) &&
570 (OpInfo->Flags & AML_HAS_RETVAL) &&
571 (!AnIsResultUsed (Op)))
573 if (OpInfo->Flags & AML_HAS_TARGET)
576 * Find the target node, it is always the last child. If the target
577 * is not specified in the ASL, a default node of type Zero was
578 * created by the parser.
580 ArgOp = Op->Asl.Child;
581 while (ArgOp->Asl.Next)
584 ArgOp = ArgOp->Asl.Next;
587 /* Divide() is the only weird case, it has two targets */
589 if (Op->Asl.AmlOpcode == AML_DIVIDE_OP)
591 if ((ArgOp->Asl.ParseOpcode == PARSEOP_ZERO) &&
593 (PrevArgOp->Asl.ParseOpcode == PARSEOP_ZERO))
595 AslError (ASL_ERROR, ASL_MSG_RESULT_NOT_USED,
596 Op, Op->Asl.ExternalName);
600 else if (ArgOp->Asl.ParseOpcode == PARSEOP_ZERO)
602 AslError (ASL_ERROR, ASL_MSG_RESULT_NOT_USED,
603 Op, Op->Asl.ExternalName);
609 * Has no target and the result is not used. Only a couple opcodes
610 * can have this combination.
612 switch (Op->Asl.ParseOpcode)
614 case PARSEOP_ACQUIRE:
616 case PARSEOP_LOADTABLE:
622 AslError (ASL_ERROR, ASL_MSG_RESULT_NOT_USED,
623 Op, Op->Asl.ExternalName);
631 * Semantic checks for individual ASL operators
633 switch (Op->Asl.ParseOpcode)
637 if (Gbl_DoTypechecking)
639 AnAnalyzeStoreOperator (Op);
644 case PARSEOP_ACQUIRE:
647 * Emit a warning if the timeout parameter for these operators is not
648 * ACPI_WAIT_FOREVER, and the result value from the operator is not
649 * checked, meaning that a timeout could happen, but the code
650 * would not know about it.
653 /* First child is the namepath, 2nd child is timeout */
655 ArgOp = Op->Asl.Child;
656 ArgOp = ArgOp->Asl.Next;
659 * Check for the WAIT_FOREVER case - defined by the ACPI spec to be
662 if (((ArgOp->Asl.ParseOpcode == PARSEOP_WORDCONST) ||
663 (ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER)) &&
664 (ArgOp->Asl.Value.Integer >= (UINT64) ACPI_WAIT_FOREVER))
670 * The operation could timeout. If the return value is not used
671 * (indicates timeout occurred), issue a warning
673 if (!AnIsResultUsed (Op))
675 AslError (ASL_WARNING, ASL_MSG_TIMEOUT, ArgOp,
676 Op->Asl.ExternalName);
680 case PARSEOP_CREATEFIELD:
682 * Check for a zero Length (NumBits) operand. NumBits is the 3rd operand
684 ArgOp = Op->Asl.Child;
685 ArgOp = ArgOp->Asl.Next;
686 ArgOp = ArgOp->Asl.Next;
688 if ((ArgOp->Asl.ParseOpcode == PARSEOP_ZERO) ||
689 ((ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER) &&
690 (ArgOp->Asl.Value.Integer == 0)))
692 AslError (ASL_ERROR, ASL_MSG_NON_ZERO, ArgOp, NULL);
696 case PARSEOP_CONNECTION:
698 * Ensure that the referenced operation region has the correct SPACE_ID.
699 * From the grammar/parser, we know the parent is a FIELD definition.
701 ArgOp = Op->Asl.Parent; /* Field definition */
702 ArgOp = ArgOp->Asl.Child; /* First child is the OpRegion Name */
703 Node = ArgOp->Asl.Node; /* OpRegion namespace node */
709 ArgOp = Node->Op; /* OpRegion definition */
710 ArgOp = ArgOp->Asl.Child; /* First child is the OpRegion Name */
711 ArgOp = ArgOp->Asl.Next; /* Next peer is the SPACE_ID (what we want) */
714 * The Connection() operator is only valid for the following operation
715 * region SpaceIds: GeneralPurposeIo and GenericSerialBus.
717 if ((ArgOp->Asl.Value.Integer != ACPI_ADR_SPACE_GPIO) &&
718 (ArgOp->Asl.Value.Integer != ACPI_ADR_SPACE_GSBUS))
720 AslError (ASL_ERROR, ASL_MSG_CONNECTION_INVALID, Op, NULL);
726 * Ensure that fields for GeneralPurposeIo and GenericSerialBus
727 * contain at least one Connection() operator
729 ArgOp = Op->Asl.Child; /* 1st child is the OpRegion Name */
730 Node = ArgOp->Asl.Node; /* OpRegion namespace node */
736 ArgOp = Node->Op; /* OpRegion definition */
737 ArgOp = ArgOp->Asl.Child; /* First child is the OpRegion Name */
738 ArgOp = ArgOp->Asl.Next; /* Next peer is the SPACE_ID (what we want) */
740 /* We are only interested in GeneralPurposeIo and GenericSerialBus */
742 if ((ArgOp->Asl.Value.Integer != ACPI_ADR_SPACE_GPIO) &&
743 (ArgOp->Asl.Value.Integer != ACPI_ADR_SPACE_GSBUS))
748 ArgOp = Op->Asl.Child; /* 1st child is the OpRegion Name */
749 ArgOp = ArgOp->Asl.Next; /* AccessType */
750 ArgOp = ArgOp->Asl.Next; /* LockRule */
751 ArgOp = ArgOp->Asl.Next; /* UpdateRule */
752 ArgOp = ArgOp->Asl.Next; /* Start of FieldUnitList */
754 /* Walk the FieldUnitList */
758 if (ArgOp->Asl.ParseOpcode == PARSEOP_CONNECTION)
762 else if (ArgOp->Asl.ParseOpcode == PARSEOP_NAMESEG)
764 AslError (ASL_ERROR, ASL_MSG_CONNECTION_MISSING, ArgOp, NULL);
768 ArgOp = ArgOp->Asl.Next;
781 /*******************************************************************************
783 * FUNCTION: AnAnalyzeStoreOperator
785 * PARAMETERS: Op - Store() operator
789 * DESCRIPTION: Analyze a store operator. Mostly for stores to/from package
790 * objects where there are more restrictions than other data
793 ******************************************************************************/
796 AnAnalyzeStoreOperator (
797 ACPI_PARSE_OBJECT *Op)
799 ACPI_NAMESPACE_NODE *SourceNode;
800 ACPI_NAMESPACE_NODE *TargetNode;
801 ACPI_PARSE_OBJECT *SourceOperandOp;
802 ACPI_PARSE_OBJECT *TargetOperandOp;
803 UINT32 SourceOperandBtype;
804 UINT32 TargetOperandBtype;
807 /* Extract the two operands for STORE */
809 SourceOperandOp = Op->Asl.Child;
810 TargetOperandOp = SourceOperandOp->Asl.Next;
813 * Ignore these Source operand opcodes, they cannot be typechecked,
814 * the actual result is unknown here.
816 switch (SourceOperandOp->Asl.ParseOpcode)
818 /* For these, type of the returned value is unknown at compile time */
820 case PARSEOP_DEREFOF:
821 case PARSEOP_METHODCALL:
823 case PARSEOP_COPYOBJECT:
830 if (!Gbl_EnableReferenceTypechecking)
836 * These opcodes always return an object reference, and thus
837 * the result can only be stored to a Local, Arg, or Debug.
839 if (TargetOperandOp->Asl.AmlOpcode == AML_DEBUG_OP)
844 if ((TargetOperandOp->Asl.AmlOpcode < AML_LOCAL0) ||
845 (TargetOperandOp->Asl.AmlOpcode > AML_ARG6))
847 AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, TargetOperandOp,
848 "Source [Reference], Target must be [Local/Arg/Debug]");
857 * Ignore these Target operand opcodes, they cannot be typechecked
859 switch (TargetOperandOp->Asl.ParseOpcode)
862 case PARSEOP_DEREFOF:
868 case PARSEOP_METHODCALL:
870 * A target is not allowed to be a method call.
871 * It is not supported by the ACPICA interpreter, nor is it
872 * supported by the MS ASL compiler or the MS interpreter.
873 * Although legal syntax up until ACPI 6.1, support for this
874 * will be removed for ACPI 6.2 (02/2016)
876 AslError (ASL_ERROR, ASL_MSG_SYNTAX,
877 TargetOperandOp, "Illegal method invocation as a target operand");
885 * Ignore typecheck for External() operands of type "UnknownObj",
886 * we don't know the actual type (source or target).
888 SourceNode = SourceOperandOp->Asl.Node;
890 (SourceNode->Flags & ANOBJ_IS_EXTERNAL) &&
891 (SourceNode->Type == ACPI_TYPE_ANY))
896 TargetNode = TargetOperandOp->Asl.Node;
898 (TargetNode->Flags & ANOBJ_IS_EXTERNAL) &&
899 (TargetNode->Type == ACPI_TYPE_ANY))
905 * A NULL node with a namepath AML opcode indicates non-existent
906 * name. Just return, the error message is generated elsewhere.
908 if ((!SourceNode && (SourceOperandOp->Asl.AmlOpcode == AML_INT_NAMEPATH_OP)) ||
909 (!TargetNode && (TargetOperandOp->Asl.AmlOpcode == AML_INT_NAMEPATH_OP)))
915 * Simple check for source same as target via NS node.
916 * -- Could be expanded to locals and args.
918 if (SourceNode && TargetNode)
920 if (SourceNode == TargetNode)
922 AslError (ASL_WARNING, ASL_MSG_DUPLICATE_ITEM,
923 TargetOperandOp, "Source is the same as Target");
928 /* Ignore typecheck if either source or target is a local or arg */
930 if ((SourceOperandOp->Asl.AmlOpcode >= AML_LOCAL0) &&
931 (SourceOperandOp->Asl.AmlOpcode <= AML_ARG6))
933 return; /* Cannot type a local/arg at compile time */
936 if ((TargetOperandOp->Asl.AmlOpcode >= AML_LOCAL0) &&
937 (TargetOperandOp->Asl.AmlOpcode <= AML_ARG6))
939 return; /* Cannot type a local/arg at compile time */
943 * Package objects are a special case because they cannot by implicitly
944 * converted to/from anything. Check for these two illegal cases:
946 * Store (non-package, package)
947 * Store (package, non-package)
949 SourceOperandBtype = AnGetBtype (SourceOperandOp);
950 TargetOperandBtype = AnGetBtype (TargetOperandOp);
952 /* Check source first for (package, non-package) case */
954 if (SourceOperandBtype & ACPI_BTYPE_PACKAGE)
956 /* If Source is PACKAGE-->Target must be PACKAGE */
958 if (!(TargetOperandBtype & ACPI_BTYPE_PACKAGE))
960 AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, TargetOperandOp,
961 "Source is [Package], Target must be a package also");
965 /* Else check target for (non-package, package) case */
967 else if (TargetOperandBtype & ACPI_BTYPE_PACKAGE)
969 /* If Target is PACKAGE, Source must be PACKAGE */
971 if (!(SourceOperandBtype & ACPI_BTYPE_PACKAGE))
973 AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, SourceOperandOp,
974 "Target is [Package], Source must be a package also");