Lines Matching +full:store +full:- +full:conditional
3 * Module Name: asltransform - Parse tree transforms
11 * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
108 * any of its subsidiaries will export/re-export any technical data, process,
130 * 3. Neither the names of the above-listed copyright holders nor the names
217 * PARAMETERS: Op - Current parse op
218 * TempCount - Current temporary counter. Was originally
219 * per-module; Currently per method, could be
220 * expanded to per-scope.
237 if (*TempCount >= (10 + 26)) /* 0-35 valid: 0-9 and A-Z for TempName[3] */ in TrAmlGetNextTempName()
247 if (*TempCount < 10) /* 0-9 */ in TrAmlGetNextTempName()
251 else /* 10-35: A-Z */ in TrAmlGetNextTempName()
253 TempName[3] = (char) (*TempCount + ('A' - 10)); in TrAmlGetNextTempName()
272 * PARAMETERS: Op - Op to be initialized
273 * Neighbor - Op used for initialization values
287 Op->Asl.EndLine = Neighbor->Asl.EndLine; in TrAmlInitLineNumbers()
288 Op->Asl.EndLogicalLine = Neighbor->Asl.EndLogicalLine; in TrAmlInitLineNumbers()
289 Op->Asl.LineNumber = Neighbor->Asl.LineNumber; in TrAmlInitLineNumbers()
290 Op->Asl.LogicalByteOffset = Neighbor->Asl.LogicalByteOffset; in TrAmlInitLineNumbers()
291 Op->Asl.LogicalLineNumber = Neighbor->Asl.LogicalLineNumber; in TrAmlInitLineNumbers()
299 * PARAMETERS: Op - Op to be initialized
300 * ParseOpcode - Opcode for this node
314 Op->Asl.ParseOpcode = ParseOpcode; in TrAmlInitNode()
323 * PARAMETERS: Op - First node in a list of peer nodes
324 * Parent - Parent of the subtree
343 Next->Asl.Parent = Parent; in TrAmlSetSubtreeParent()
344 Next = Next->Asl.Next; in TrAmlSetSubtreeParent()
353 * PARAMETERS: Op - First node in a list of peer nodes
354 * NewPeer - Peer node to insert
368 NewPeer->Asl.Next = Op->Asl.Next; in TrAmlInsertPeer()
369 Op->Asl.Next = NewPeer; in TrAmlInsertPeer()
420 if (Op->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK) in TrAmlTransformWalkEnd()
422 Op->Asl.Value.Arg = AslGbl_ExternalsListHead; in TrAmlTransformWalkEnd()
434 * PARAMETERS: Op - The parent parse node
452 if (Op->Asl.AmlOpcode == AML_RAW_DATA_BYTE) in TrTransformSubtree()
457 switch (Op->Asl.ParseOpcode) in TrTransformSubtree()
483 Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL; in TrTransformSubtree()
491 if (MethodOp->Asl.ParseOpcode == PARSEOP_METHOD) in TrTransformSubtree()
495 MethodOp = MethodOp->Asl.Child; in TrTransformSubtree()
496 Op->Asl.Value.String = MethodOp->Asl.Value.String; in TrTransformSubtree()
500 MethodOp = MethodOp->Asl.Parent; in TrTransformSubtree()
505 Op->Asl.Value.String = "\\"; in TrTransformSubtree()
511 * (with 254 dot separators) - as per the ACPI specification. Note: in TrTransformSubtree()
515 Info.ExternalName = Op->Asl.Value.String; in TrTransformSubtree()
533 if (Op->Asl.Child->Asl.Value.Integer > 1000) in TrTransformSubtree()
541 AslError (ASL_WARNING, ASL_MSG_LEGACY_PROCESSOR_OP, Op, Op->Asl.ExternalName); in TrTransformSubtree()
546 AslError (ASL_WARNING, ASL_MSG_LEGACY_DDB_TYPE, Op, Op->Asl.ExternalName); in TrTransformSubtree()
562 * PARAMETERS: Op - Parse node
567 * node. It is used by the compiler to insert compiler-generated
584 Next = Op->Asl.Child; in TrDoDefinitionBlock()
587 Next = Next->Asl.Next; in TrDoDefinitionBlock()
595 if (!ACPI_COMPARE_NAMESEG (Next->Asl.Value.String, ACPI_SIG_DSDT)) in TrDoDefinitionBlock()
610 * PARAMETERS: StartNode - Parse node for SWITCH
615 * no actual AML opcode for SWITCH -- it must be simulated.
628 ACPI_PARSE_OBJECT *Conditional = NULL; in TrDoSwitch() local
656 Next = StartNode->Asl.Child; in TrDoSwitch()
659 * Examine the return type of the Switch Value - in TrDoSwitch()
662 Index = (UINT16) (Next->Asl.ParseOpcode - ASL_PARSE_OPCODE_BASE); in TrDoSwitch()
674 Peer = Next->Asl.Next; in TrDoSwitch()
678 Peer = Next->Asl.Next; in TrDoSwitch()
680 if (Next->Asl.ParseOpcode == PARSEOP_CASE) in TrDoSwitch()
682 TrCheckForDuplicateCase (Next, Next->Asl.Child); in TrDoSwitch()
689 NewOp->Asl.Parent = Conditional->Asl.Parent; in TrDoSwitch()
690 TrAmlInitLineNumbers (NewOp, NewOp->Asl.Parent); in TrDoSwitch()
694 TrAmlInsertPeer (Conditional, NewOp); in TrDoSwitch()
699 Conditional = CaseOp; in TrDoSwitch()
700 CaseBlock = CaseOp->Asl.Child->Asl.Next; in TrDoSwitch()
701 Conditional->Asl.Child->Asl.Next = NULL; in TrDoSwitch()
702 Predicate = CaseOp->Asl.Child; in TrDoSwitch()
704 if ((Predicate->Asl.ParseOpcode == PARSEOP_PACKAGE) || in TrDoSwitch()
705 (Predicate->Asl.ParseOpcode == PARSEOP_VAR_PACKAGE)) in TrDoSwitch()
714 Predicate->Asl.Next = NewOp2; in TrDoSwitch()
715 TrAmlInitLineNumbers (NewOp2, Conditional); in TrDoSwitch()
720 NewOp->Asl.Next = NewOp2; in TrDoSwitch()
725 NewOp->Asl.Next = NewOp2; in TrDoSwitch()
730 NewOp->Asl.Next = NewOp2; in TrDoSwitch()
735 NewOp->Asl.Next = NewOp2; in TrDoSwitch()
739 NewOp2->Asl.Child = Predicate; /* PARSEOP_PACKAGE */ in TrDoSwitch()
740 TrAmlInitLineNumbers (NewOp2, Conditional); in TrDoSwitch()
745 NewOp->Asl.Next = NewOp2; in TrDoSwitch()
746 TrAmlInitLineNumbers (NewOp2, Conditional); in TrDoSwitch()
749 NewOp2->Asl.Child = NewOp; in TrDoSwitch()
750 NewOp->Asl.Parent = NewOp2; in TrDoSwitch()
751 TrAmlInitLineNumbers (NewOp2, Conditional); in TrDoSwitch()
756 NewOp2->Asl.Child = NewOp; in TrDoSwitch()
757 NewOp2->Asl.Parent = Conditional; in TrDoSwitch()
758 NewOp->Asl.Parent = NewOp2; in TrDoSwitch()
759 TrAmlInitLineNumbers (NewOp2, Conditional); in TrDoSwitch()
761 Conditional->Asl.Child = NewOp2; in TrDoSwitch()
762 NewOp2->Asl.Next = CaseBlock; in TrDoSwitch()
773 * CaseOp->Child is the case value in TrDoSwitch()
774 * CaseOp->Child->Peer is the beginning of the case block in TrDoSwitch()
778 NewOp->Asl.Next = Predicate; in TrDoSwitch()
782 NewOp2->Asl.Parent = Conditional; in TrDoSwitch()
783 NewOp2->Asl.Child = NewOp; in TrDoSwitch()
784 TrAmlInitLineNumbers (NewOp2, Conditional); in TrDoSwitch()
789 Predicate->Asl.Next = CaseBlock; in TrDoSwitch()
791 TrAmlSetSubtreeParent (Predicate, Conditional); in TrDoSwitch()
792 Conditional->Asl.Child = Predicate; in TrDoSwitch()
797 TrAmlInitNode (Conditional, PARSEOP_IF); in TrDoSwitch()
805 Conditional->Asl.Next = NULL; in TrDoSwitch()
813 CurrentParentNode->Asl.Child = Conditional; in TrDoSwitch()
814 Conditional->Asl.Parent = CurrentParentNode; in TrDoSwitch()
815 Conditional->Asl.Next = NULL; in TrDoSwitch()
818 else if (Next->Asl.ParseOpcode == PARSEOP_DEFAULT) in TrDoSwitch()
840 Next->Asl.ParseOpName, Next->Asl.ParseOpcode); in TrDoSwitch()
848 /* If no CASE statements, this is an error - see below */ in TrDoSwitch()
855 DefaultOp->Asl.Parent = Conditional->Asl.Parent; in TrDoSwitch()
859 TrAmlInsertPeer (Conditional, DefaultOp); in TrDoSwitch()
877 Predicate = StartNode->Asl.Child; in TrDoSwitch()
884 while ((Next->Asl.ParseOpcode != PARSEOP_METHOD) && in TrDoSwitch()
885 (Next->Asl.ParseOpcode != PARSEOP_DEFINITION_BLOCK)) in TrDoSwitch()
887 Next = Next->Asl.Parent; in TrDoSwitch()
891 NewOp->Asl.CompileFlags |= OP_COMPILER_EMITTED; in TrDoSwitch()
892 NewOp->Asl.Parent = Next; in TrDoSwitch()
896 Next = Next->Asl.Child; /* Name */ in TrDoSwitch()
897 Next = Next->Asl.Next; /* NumArgs */ in TrDoSwitch()
898 Next = Next->Asl.Next; /* SerializeRule */ in TrDoSwitch()
902 * that Switch() must be implemented -- we cannot allow multiple threads in TrDoSwitch()
906 if (Next->Asl.ParseOpcode != PARSEOP_SERIALIZERULE_SERIAL) in TrDoSwitch()
910 Next->Asl.ParseOpcode = PARSEOP_SERIALIZERULE_SERIAL; in TrDoSwitch()
913 Next = Next->Asl.Next; /* SyncLevel */ in TrDoSwitch()
914 Next = Next->Asl.Next; /* ReturnType */ in TrDoSwitch()
915 Next = Next->Asl.Next; /* ParameterTypes */ in TrDoSwitch()
925 NewOp2->Asl.CompileFlags |= OP_IS_NAME_DECLARATION; in TrDoSwitch()
926 NewOp->Asl.Child = NewOp2; in TrDoSwitch()
934 NewOp2->Asl.Next = TrCreateValuedLeafOp (PARSEOP_ZERO, in TrDoSwitch()
936 TrAmlInitLineNumbers (NewOp2->Asl.Next, NewOp); in TrDoSwitch()
941 NewOp2->Asl.Next = TrCreateValuedLeafOp (PARSEOP_STRING_LITERAL, in TrDoSwitch()
943 TrAmlInitLineNumbers (NewOp2->Asl.Next, NewOp); in TrDoSwitch()
950 Next = NewOp2->Asl.Next; in TrDoSwitch()
955 TrAmlInitLineNumbers (Next->Asl.Child, Next); in TrDoSwitch()
958 TrAmlInitLineNumbers (BufferOp, Next->Asl.Child); in TrDoSwitch()
959 (void) TrLinkPeerOp (Next->Asl.Child, BufferOp); in TrDoSwitch()
961 TrAmlSetSubtreeParent (Next->Asl.Child, Next); in TrDoSwitch()
972 * Transform the Switch() into a While(One)-Break node. in TrDoSwitch()
973 * And create a Store() node which will be used to save the in TrDoSwitch()
974 * Switch() value. The store is of the form: Store (Value, _T_x) in TrDoSwitch()
980 NewOp->Asl.Next = Predicate->Asl.Next; in TrDoSwitch()
981 NewOp->Asl.Parent = StartNode; in TrDoSwitch()
982 StartNode->Asl.Child = NewOp; in TrDoSwitch()
984 /* Create a Store() node */ in TrDoSwitch()
988 StoreOp->Asl.Parent = StartNode; in TrDoSwitch()
991 /* Complete the Store subtree */ in TrDoSwitch()
993 StoreOp->Asl.Child = Predicate; in TrDoSwitch()
994 Predicate->Asl.Parent = StoreOp; in TrDoSwitch()
999 NewOp->Asl.Parent = StoreOp; in TrDoSwitch()
1000 Predicate->Asl.Next = NewOp; in TrDoSwitch()
1004 Conditional = StartNode->Asl.Child; in TrDoSwitch()
1005 while (Conditional->Asl.Next) in TrDoSwitch()
1007 Conditional = Conditional->Asl.Next; in TrDoSwitch()
1012 BreakOp->Asl.Parent = StartNode; in TrDoSwitch()
1013 TrAmlInsertPeer (Conditional, BreakOp); in TrDoSwitch()
1021 * PARAMETERS: CaseOp - Parse node for first Case statement in list
1022 * Predicate1 - Case value for the input CaseOp
1042 Next = CaseOp->Asl.Next; in TrCheckForDuplicateCase()
1045 if (Next->Asl.ParseOpcode == PARSEOP_CASE) in TrCheckForDuplicateCase()
1049 if (Next->Asl.CompileFlags & OP_IS_DUPLICATE) in TrCheckForDuplicateCase()
1056 Predicate2 = Next->Asl.Child; in TrCheckForDuplicateCase()
1057 if ((Predicate1->Asl.ParseOpcode == PARSEOP_INTEGER) && in TrCheckForDuplicateCase()
1058 (Predicate2->Asl.ParseOpcode == PARSEOP_INTEGER)) in TrCheckForDuplicateCase()
1060 if (Predicate1->Asl.Value.Integer == Predicate2->Asl.Value.Integer) in TrCheckForDuplicateCase()
1068 else if (((Predicate1->Asl.ParseOpcode == PARSEOP_ZERO) && in TrCheckForDuplicateCase()
1069 (Predicate2->Asl.ParseOpcode == PARSEOP_ZERO)) || in TrCheckForDuplicateCase()
1070 ((Predicate1->Asl.ParseOpcode == PARSEOP_ONE) && in TrCheckForDuplicateCase()
1071 (Predicate2->Asl.ParseOpcode == PARSEOP_ONE)) || in TrCheckForDuplicateCase()
1072 ((Predicate1->Asl.ParseOpcode == PARSEOP_ONES) && in TrCheckForDuplicateCase()
1073 (Predicate2->Asl.ParseOpcode == PARSEOP_ONES))) in TrCheckForDuplicateCase()
1080 else if ((Predicate1->Asl.ParseOpcode == PARSEOP_STRING_LITERAL) && in TrCheckForDuplicateCase()
1081 (Predicate2->Asl.ParseOpcode == PARSEOP_STRING_LITERAL)) in TrCheckForDuplicateCase()
1083 if (!strcmp (Predicate1->Asl.Value.String, in TrCheckForDuplicateCase()
1084 Predicate2->Asl.Value.String)) in TrCheckForDuplicateCase()
1092 else if ((Predicate1->Asl.ParseOpcode == PARSEOP_BUFFER) && in TrCheckForDuplicateCase()
1093 (Predicate2->Asl.ParseOpcode == PARSEOP_BUFFER)) in TrCheckForDuplicateCase()
1095 if (TrCheckForBufferMatch (Predicate1->Asl.Child, in TrCheckForDuplicateCase()
1096 Predicate2->Asl.Child)) in TrCheckForDuplicateCase()
1107 Next->Asl.CompileFlags |= OP_IS_DUPLICATE; in TrCheckForDuplicateCase()
1110 Next->Asl.Value.String, ASL_MSG_CASE_FOUND_HERE, CaseOp, in TrCheckForDuplicateCase()
1111 CaseOp->Asl.ExternalName); in TrCheckForDuplicateCase()
1114 Next = Next->Asl.Next; in TrCheckForDuplicateCase()
1122 * PARAMETERS: Op - Parse node for first opcode in buffer initializer
1137 if (Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) in TrBufferIsAllZero()
1141 else if (Op->Asl.Value.Integer != 0) in TrBufferIsAllZero()
1146 Op = Op->Asl.Next; in TrBufferIsAllZero()
1157 * PARAMETERS: Next1 - Parse node for first opcode in first buffer list
1159 * Next2 - Parse node for first opcode in second buffer list
1179 if ((NextOp1->Asl.ParseOpcode == PARSEOP_INTEGER && in TrCheckForBufferMatch()
1180 NextOp2->Asl.ParseOpcode == PARSEOP_INTEGER) && in TrCheckForBufferMatch()
1181 NextOp1->Asl.Value.Integer != NextOp2->Asl.Value.Integer) in TrCheckForBufferMatch()
1199 if (NextOp1->Asl.ParseOpcode != NextOp2->Asl.ParseOpcode && in TrCheckForBufferMatch()
1200 TrBufferIsAllZero (NextOp1->Asl.Next) && in TrCheckForBufferMatch()
1201 TrBufferIsAllZero (NextOp2->Asl.Next)) in TrCheckForBufferMatch()
1208 NextOp1 = NextOp1->Asl.Next; in TrCheckForBufferMatch()
1209 NextOp2 = NextOp2->Asl.Next; in TrCheckForBufferMatch()
1213 * end-of-lists are found in TrCheckForBufferMatch()
1217 if ((NextOp1->Asl.ParseOpcode == PARSEOP_STRING_LITERAL) && in TrCheckForBufferMatch()
1218 (NextOp2->Asl.ParseOpcode == PARSEOP_STRING_LITERAL)) in TrCheckForBufferMatch()
1220 if (!strcmp (NextOp1->Asl.Value.String, NextOp2->Asl.Value.String)) in TrCheckForBufferMatch()
1229 if ((UINT8) NextOp1->Asl.Value.Integer != (UINT8) NextOp2->Asl.Value.Integer) in TrCheckForBufferMatch()
1234 NextOp1 = NextOp1->Asl.Next; in TrCheckForBufferMatch()
1235 NextOp2 = NextOp2->Asl.Next; in TrCheckForBufferMatch()
1238 /* Not a match if one of the lists is not at end-of-list */ in TrCheckForBufferMatch()
1255 * PARAMETERS: Op - Parse node for SWITCH
1280 ArgCountOp = Op->Asl.Child->Asl.Next; in TrDoMethod()
1281 if (ArgCountOp->Asl.ParseOpcode == PARSEOP_BYTECONST) in TrDoMethod()
1294 ParameterOp = ArgCountOp->Asl.Next->Asl.Next->Asl.Next->Asl.Next; in TrDoMethod()
1295 if (ParameterOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) in TrDoMethod()
1298 ParameterOp = ParameterOp->Asl.Child; in TrDoMethod()
1302 ParameterOp = ParameterOp->Asl.Next; in TrDoMethod()
1306 ArgCountOp->Asl.Value.Integer = ArgCount; in TrDoMethod()
1307 ArgCountOp->Asl.ParseOpcode = PARSEOP_BYTECONST; in TrDoMethod()
1318 ArgCountOp->Asl.Value.Integer = 1; in TrDoMethod()
1319 ArgCountOp->Asl.ParseOpcode = PARSEOP_BYTECONST; in TrDoMethod()