1 2/****************************************************************************** 3 * 4 * Module Name: asltransform - Parse tree transforms 5 * 6 *****************************************************************************/ 7 8/****************************************************************************** --- 454 unchanged lines hidden (view full) --- 463 ACPI_PARSE_OBJECT *DefaultOp = NULL; 464 ACPI_PARSE_OBJECT *CurrentParentNode; 465 ACPI_PARSE_OBJECT *Conditional = NULL; 466 ACPI_PARSE_OBJECT *Predicate; 467 ACPI_PARSE_OBJECT *Peer; 468 ACPI_PARSE_OBJECT *NewOp; 469 ACPI_PARSE_OBJECT *NewOp2; 470 ACPI_PARSE_OBJECT *MethodOp; |
471 ACPI_PARSE_OBJECT *StoreOp; 472 ACPI_PARSE_OBJECT *BreakOp; |
473 char *PredicateValueName; 474 UINT16 Index; 475 UINT32 Btype; 476 477 478 /* Start node is the Switch() node */ 479 480 CurrentParentNode = StartNode; --- 154 unchanged lines hidden (view full) --- 635 TrAmlInitNode (Conditional, PARSEOP_IF); 636 637 /* 638 * The first CASE(IF) is not nested under an ELSE. 639 * All other CASEs are children of a parent ELSE. 640 */ 641 if (CurrentParentNode == StartNode) 642 { |
643 Conditional->Asl.Next = NULL; |
644 } 645 else 646 { 647 /* 648 * The IF is a child of previous IF/ELSE. It 649 * is therefore without peer. 650 */ 651 CurrentParentNode->Asl.Child = Conditional; --- 36 unchanged lines hidden (view full) --- 688 if (CaseOp) 689 { 690 /* Convert the DEFAULT node to an ELSE */ 691 692 if (!Conditional) 693 { 694 return; 695 } |
696 |
697 TrAmlInitNode (DefaultOp, PARSEOP_ELSE); 698 DefaultOp->Asl.Parent = Conditional->Asl.Parent; 699 700 /* Link ELSE node as a peer to the previous IF */ 701 702 TrAmlInsertPeer (Conditional, DefaultOp); 703 } 704 } --- 88 unchanged lines hidden (view full) --- 793 794 default: 795 break; 796 } 797 798 TrAmlSetSubtreeParent (NewOp2, NewOp); 799 800 /* |
801 * Transform the Switch() into a While(One)-Break node. 802 * And create a Store() node which will be used to save the |
803 * Switch() value. The store is of the form: Store (Value, _T_x) 804 * where _T_x is the temp variable. 805 */ |
806 TrAmlInitNode (StartNode, PARSEOP_WHILE); 807 NewOp = TrCreateLeafNode (PARSEOP_ONE); 808 NewOp->Asl.Next = Predicate->Asl.Next; 809 NewOp->Asl.Parent = StartNode; 810 StartNode->Asl.Child = NewOp; |
811 |
812 /* Create a Store() node */ 813 814 StoreOp = TrCreateLeafNode (PARSEOP_STORE); 815 StoreOp->Asl.Parent = StartNode; 816 TrAmlInsertPeer (NewOp, StoreOp); 817 |
818 /* Complete the Store subtree */ 819 |
820 StoreOp->Asl.Child = Predicate; 821 Predicate->Asl.Parent = StoreOp; |
822 823 NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESEG, 824 (ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName)); |
825 NewOp->Asl.Parent = StoreOp; |
826 Predicate->Asl.Next = NewOp; |
827 828 /* Create a Break() node and insert it into the end of While() */ 829 830 Conditional = StartNode->Asl.Child; 831 while (Conditional->Asl.Next) 832 { 833 Conditional = Conditional->Asl.Next; 834 } 835 836 BreakOp = TrCreateLeafNode (PARSEOP_BREAK); 837 BreakOp->Asl.Parent = StartNode; 838 TrAmlInsertPeer (Conditional, BreakOp); |
839} 840 841 |