Deleted Added
sdiff udiff text old ( 151937 ) new ( 167802 )
full compact
1
2/******************************************************************************
3 *
4 * Module Name: asltransform - Parse tree transforms
5 * $Revision: 1.35 $
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
14 * All rights reserved.
15 *
16 * 2. License
17 *
18 * 2.1. This is your license from Intel Corp. under its intellectual property
19 * rights. You may have additional license terms from the party that provided
20 * you this software, covering your right to use that party's intellectual
21 * property rights.

--- 402 unchanged lines hidden (view full) ---

424 Next = Next->Asl.Next;
425 if (i == 0)
426 {
427 /*
428 * This is the table signature. Only the DSDT can be assumed
429 * to be at the root of the namespace; Therefore, namepath
430 * optimization can only be performed on the DSDT.
431 */
432 if (ACPI_STRNCMP (Next->Asl.Value.String, "DSDT", 4))
433 {
434 Gbl_ReferenceOptimizationFlag = FALSE;
435 }
436 }
437 }
438
439 Gbl_FirstLevelInsertionNode = Next;
440}

--- 215 unchanged lines hidden (view full) ---

656 }
657 }
658 else if (Next->Asl.ParseOpcode == PARSEOP_DEFAULT)
659 {
660 if (DefaultOp)
661 {
662 /*
663 * More than one Default
664 * (Parser should catch this, should not get here)
665 */
666 AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, Next,
667 "Found more than one Default()");
668 }
669
670 /* Save the DEFAULT node for later, after CASEs */
671
672 DefaultOp = Next;
673 }
674 else
675 {
676 /* Unknown peer opcode */
677
678 AcpiOsPrintf ("Unknown parse opcode for switch statement: %s (%d)\n",
679 Next->Asl.ParseOpName, Next->Asl.ParseOpcode);
680 }

--- 22 unchanged lines hidden (view full) ---

703 }
704 }
705
706 if (!CaseOp)
707 {
708 AslError (ASL_ERROR, ASL_MSG_NO_CASES, StartNode, NULL);
709 }
710
711 /*
712 * Add a NAME node for the temp integer:
713 * Change the SWITCH node to a Name (_T_x, Type)
714 */
715 Predicate = StartNode->Asl.Child;
716 TrAmlInitNode (StartNode, PARSEOP_NAME);
717
718 NewOp = StartNode;
719
720 NewOp->Asl.CompileFlags |= NODE_COMPILER_EMITTED;
721
722 NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESEG,
723 (ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName));
724 NewOp2->Asl.CompileFlags |= NODE_IS_NAME_DECLARATION;
725 NewOp->Asl.Child = NewOp2;
726
727 /* Btype was already validated above */
728
729 switch (Btype)
730 {
731 case ACPI_BTYPE_INTEGER:
732 NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_ZERO,
733 (ACPI_INTEGER) 0);
734 break;
735
736 case ACPI_BTYPE_STRING:
737 NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL,
738 (ACPI_INTEGER) "");
739 break;
740

--- 11 unchanged lines hidden (view full) ---

752
753 default:
754 break;
755 }
756
757 TrAmlSetSubtreeParent (NewOp2, NewOp);
758
759 /*
760 * Create and insert a new Store() node which will be used to save the
761 * Switch() value. The store is of the form: Store (Value, _T_x)
762 * where _T_x is the temp variable.
763 */
764 Next = TrCreateLeafNode (PARSEOP_STORE);
765 TrAmlInsertPeer (StartNode, Next);
766 TrAmlSetSubtreeParent (Next, StartNode->Asl.Parent);
767
768 TrAmlInitLineNumbers (Next, StartNode);
769 TrAmlInitLineNumbers (NewOp2, StartNode);
770 TrAmlInitLineNumbers (NewOp2->Asl.Next, StartNode);
771
772 /* Complete the Store subtree */
773
774 Next->Asl.Child = Predicate;
775 Predicate->Asl.Parent = Next;
776
777 NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESEG,
778 (ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName));
779 NewOp->Asl.Parent = Next;
780 Predicate->Asl.Next = NewOp;
781}
782
783