asltransform.c (193529) | asltransform.c (199337) |
---|---|
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; | 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; |
|
471 char *PredicateValueName; 472 UINT16 Index; 473 UINT32 Btype; 474 475 476 /* Start node is the Switch() node */ 477 478 CurrentParentNode = StartNode; --- 154 unchanged lines hidden (view full) --- 633 TrAmlInitNode (Conditional, PARSEOP_IF); 634 635 /* 636 * The first CASE(IF) is not nested under an ELSE. 637 * All other CASEs are children of a parent ELSE. 638 */ 639 if (CurrentParentNode == StartNode) 640 { | 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 { |
641 Conditional->Asl.Parent = CurrentParentNode->Asl.Parent; 642 643 /* Link IF into the peer list */ 644 645 TrAmlInsertPeer (CurrentParentNode, Conditional); | 643 Conditional->Asl.Next = NULL; |
646 } 647 else 648 { 649 /* 650 * The IF is a child of previous IF/ELSE. It 651 * is therefore without peer. 652 */ 653 CurrentParentNode->Asl.Child = Conditional; --- 36 unchanged lines hidden (view full) --- 690 if (CaseOp) 691 { 692 /* Convert the DEFAULT node to an ELSE */ 693 694 if (!Conditional) 695 { 696 return; 697 } | 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 |
|
698 TrAmlInitNode (DefaultOp, PARSEOP_ELSE); 699 DefaultOp->Asl.Parent = Conditional->Asl.Parent; 700 701 /* Link ELSE node as a peer to the previous IF */ 702 703 TrAmlInsertPeer (Conditional, DefaultOp); 704 } 705 } --- 88 unchanged lines hidden (view full) --- 794 795 default: 796 break; 797 } 798 799 TrAmlSetSubtreeParent (NewOp2, NewOp); 800 801 /* | 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 /* |
802 * Transform the Switch() into a Store() node which will be used to save the | 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 */ | 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_STORE); 807 StartNode->Asl.Child = NULL; | 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; |
808 | 811 |
812 /* Create a Store() node */ 813 814 StoreOp = TrCreateLeafNode (PARSEOP_STORE); 815 StoreOp->Asl.Parent = StartNode; 816 TrAmlInsertPeer (NewOp, StoreOp); 817 |
|
809 /* Complete the Store subtree */ 810 | 818 /* Complete the Store subtree */ 819 |
811 StartNode->Asl.Child = Predicate; 812 Predicate->Asl.Parent = StartNode; | 820 StoreOp->Asl.Child = Predicate; 821 Predicate->Asl.Parent = StoreOp; |
813 814 NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESEG, 815 (ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName)); | 822 823 NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESEG, 824 (ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName)); |
816 NewOp->Asl.Parent = StartNode; | 825 NewOp->Asl.Parent = StoreOp; |
817 Predicate->Asl.Next = NewOp; | 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); |
|
818} 819 820 | 839} 840 841 |