diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2017-06-29 18:42:13 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2017-06-29 18:42:13 +0000 |
commit | 744d47ba98ced2e2a7d3aff2f894136544386e34 (patch) | |
tree | 917f6a025e019c7b80e50a45fa783593b4e3c19e | |
parent | c457a42be4fca72c51fdca569271b62213d01a37 (diff) |
Import ACPICA 20170629.vendor/acpica/20170629
Notes
Notes:
svn path=/vendor-sys/acpica/dist/; revision=320476
svn path=/vendor-sys/acpica/20170629/; revision=320477; tag=vendor/acpica/20170629
71 files changed, 3036 insertions, 3049 deletions
diff --git a/changes.txt b/changes.txt index 18b43b8d8186..f7eee1d568f0 100644 --- a/changes.txt +++ b/changes.txt @@ -1,4 +1,204 @@ ---------------------------------------- +29 June 2017. Summary of changes for version 20170629: + + +1) ACPICA kernel-resident subsystem: + +Tables: Implemented a deferred ACPI table verification. This is useful +for operating systems where the tables cannot be verified in the early +initialization stage due to early memory mapping limitations on some +architectures. Lv Zheng. + +Tables: Removed the signature validation for dynamically loaded tables. +Provides compatibility with other ACPI implementations. Previously, only +SSDT tables were allowed, as per the ACPI specification. Now, any table +signature can be used via the Load() operator. Lv Zheng. + +Tables: Fixed several mutex issues that could cause errors during table +acquisition. Lv Zheng. + +Tables: Fixed a problem where an ACPI warning could be generated if a +null pointer was passed to the AcpiPutTable interface. Lv Zheng. + +Tables: Added a mechanism to handle imbalances for the AcpiGetTable and +AcpiPutTable interfaces. This applies to the "late stage" table loading +when the use of AcpiPutTable is no longer required (since the system +memory manager is fully running and available). Lv Zheng. + +Fixed/Reverted a regression during processing of resource descriptors +that contain only a single EndTag. Fixes an AE_AML_NO_RESOURCE_END_TAG +exception in this case. + +Headers: IORT/SMMU support: Updated the SMMU models for Revision C of the +I/O Remapping specification. Robin Murphy <robin.murphy@arm.com> + +Interpreter: Fixed a possible fault if an Alias operator with an invalid +or duplicate target is encountered during Alias creation in +AcpiExCreateAlias. Alex James <theracermaster@gmail.com> + +Added an option to use designated initializers for function pointers. +Kees Cook <keescook@google.com> + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Allow compilation of External declarations with target pathnames +that refer to existing named objects within the table. Erik Schmauss. + +iASL: Fixed a regression when compiling FieldUnits. Fixes an error if a +FieldUnit name also is declared via External in the same table. Erik +Schmauss. + +iASL: Allow existing scope names within pathnames used in External +statements. For example: + External (ABCD.EFGH) // ABCD exists, but EFGH is truly external + Device (ABCD) + +iASL: IORT ACPI table: Implemented changes required to decode the new +Proximity Domain for the SMMUv3 IORT. Disassembler and Data Table +compiler. Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com> + +Disassembler: Don't abort disassembly on errors from External() +statements. Erik Schmauss. + +Disassembler: fixed a possible fault when one of the Create*Field +operators references a Resource Template. ACPICA Bugzilla 1396. + +iASL: In the source code, resolved some naming inconsistences across the +parsing support. Fixes confusion between "Parse Op" and "Parse Node". +Adds a new file, aslparseop.c + +---------------------------------------- +31 May 2017. Summary of changes for version 20170531: + + +0) ACPI 6.2 support: + +The ACPI specification version 6.2 has been released and is available at +http://uefi.org/specifications + +This version of ACPICA fully supports the ACPI 6.2 specification. Changes +are summarized below. + +New ACPI tables (Table Compiler/Disassembler/Templates): + HMAT (Heterogeneous Memory Attributes Table) + WSMT (Windows SMM Security Mitigation Table) + PPTT (Processor Properties Topology Table) + +New subtables for existing ACPI tables: + HEST (New subtable, Arch-deferred machine check) + SRAT (New subtable, Arch-specific affinity structure) + PCCT (New subtables, Extended PCC subspaces (types 3 and 4)) + +Simple updates for existing ACPI tables: + BGRT (two new flag bits) + HEST (New bit defined for several subtables, GHES_ASSIST) + +New Resource Descriptors and Resource macros (Compiler/Disassembler): + PinConfig() + PinFunction() + PinGroup() + PinGroupConfig() + PinGroupFunction() + New type for hardware error notification (section 18.3.2.9) + +New predefined names/methods (Compiler/Interpreter): + _HMA (Heterogeneous Memory Attributes) + _LSI (Label Storage Information) + _LSR (Label Storage Read) + _LSW (Label Storage Write) + +ASL grammar/macro changes (Compiler): + For() ASL macro, implemented with the AML while operator + Extensions to Concatenate operator + Support for multiple definition blocks in same ASL file + Clarification for Buffer operator + Allow executable AML code underneath all scopes (Devices, etc.) + Clarification/change for the _OSI return value + ASL grammar update for reference operators + Allow a zero-length string for AML filename in DefinitionBlock + +Miscellaneous: + New device object notification value + Remove a notify value (0x0C) for graceful shutdown + New UUIDs for processor/cache properties and + physical package property + New _HID, ACPI0014 (Wireless Power Calibration Device) + + +1) ACPICA kernel-resident subsystem: + +Added support to disable ACPI events on hardware-reduced platforms. +Eliminates error messages of the form "Could not enable fixed event". Lv +Zheng + +Fixed a problem using Device/Thermal objects with the ObjectType and +DerefOf ASL operators. This support had not been fully/properly +implemented. + +Fixed a problem where if a Buffer object containing a resource template +was longer than the actual resource template, an error was generated -- +even though the AML is legal. This case has been seen in the field. + +Fixed a problem with the header definition of the MADT PCAT_COMPAT flag. +The values for DUAL_PIC and MULTIPLE_APIC were reversed. + +Added header file changes for the TPM2 ACPI table. Update to new version +of the TCG specification. Adds a new TPM2 subtable for ARM SMC. + +Exported the external interfaces AcpiAcquireMutex and AcpiReleaseMutex. +These interfaces are intended to be used only in conjunction with the +predefined _DLM method (Device Lock Method). "This object appears in a +device scope when AML access to the device must be synchronized with the +OS environment". + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 143.1K Code, 60.0K Data, 203.1K Total + Debug Version: 204.0K Code, 84.3K Data, 288.3K Total + Previous Release: + Non-Debug Version: 141.7K Code, 58.5K Data, 200.2K Total + Debug Version: 207.5K Code, 82.7K Data, 290.2K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a problem where an External() declaration could not refer to +a Field Unit. Erik Schmauss. + +Disassembler: Improved support for the Switch/Case operators. This +feature will disassemble AML code back to the original Switch operators +when possible, instead of an If..Else sequence. David Box + +iASL and disassembler: Improved the handling of multiple extraneous +parentheses for both ASL input and disassembled ASL output. + +Improved the behavior of the iASL compiler and disassembler to detect +improper use of external declarations + +Disassembler: Now aborts immediately upon detection of an unknown AML +opcode. The AML parser has no real way to recover from this, and can +result in the creation of an ill-formed parse tree that causes errors +later during the disassembly. + +All tools: Fixed a problem where the Unix application OSL did not handle +control-c correctly. For example, a control-c could incorrectly wake the +debugger. + +AcpiExec: Improved the Control-C handling and added a handler for +segmentation faults (SIGSEGV). Supports both Windows and Unix-like +environments. + +Reduced the verbosity of the generic unix makefiles. Previously, each +compilation displayed the full set of compiler options. This has been +eliminated as the options are easily inspected within the makefiles. Each +compilation now results in a single line of output. + +---------------------------------------- 03 March 2017. Summary of changes for version 20170303: diff --git a/generate/unix/iasl/Makefile b/generate/unix/iasl/Makefile index 156c23ad8db6..1487b4e011dd 100644 --- a/generate/unix/iasl/Makefile +++ b/generate/unix/iasl/Makefile @@ -82,6 +82,7 @@ OBJECTS = \ $(OBJDIR)/asloperands.o\ $(OBJDIR)/aslopt.o\ $(OBJDIR)/asloptions.o\ + $(OBJDIR)/aslparseop.o\ $(OBJDIR)/aslpredef.o\ $(OBJDIR)/aslprepkg.o\ $(OBJDIR)/aslprintf.o\ diff --git a/source/common/acfileio.c b/source/common/acfileio.c index a334d541e78a..a4e227a67b2b 100644 --- a/source/common/acfileio.c +++ b/source/common/acfileio.c @@ -175,6 +175,36 @@ AcCheckTextModeCorruption ( /******************************************************************************* * + * FUNCTION: AcDeleteTableList + * + * PARAMETERS: ListHead - List to delete + * + * RETURN: Status + * + * DESCRIPTION: Delete a list of tables. This is useful for removing memory + * allocated by AcGetAllTablesFromFile + * + ******************************************************************************/ + +void +AcDeleteTableList ( + ACPI_NEW_TABLE_DESC *ListHead) +{ + ACPI_NEW_TABLE_DESC *Current = ListHead; + ACPI_NEW_TABLE_DESC *Previous = Current; + + + while (Current) + { + Current = Current->Next; + AcpiOsFree (Previous); + Previous = Current; + } +} + + +/******************************************************************************* + * * FUNCTION: AcGetAllTablesFromFile * * PARAMETERS: Filename - Table filename diff --git a/source/common/adisasm.c b/source/common/adisasm.c index 703691523fe2..e6f0e0f91e7c 100644 --- a/source/common/adisasm.c +++ b/source/common/adisasm.c @@ -408,6 +408,8 @@ Cleanup: ACPI_FREE (Table); } + AcDeleteTableList (ListHead); + if (File) { fclose (File); @@ -748,6 +750,7 @@ AdDoExternalFileList ( continue; } + AcDeleteTableList (ExternalListHead); return (Status); } @@ -761,6 +764,7 @@ AdDoExternalFileList ( { AcpiOsPrintf ("Could not parse external ACPI tables, %s\n", AcpiFormatException (Status)); + AcDeleteTableList (ExternalListHead); return (Status); } @@ -780,6 +784,8 @@ AdDoExternalFileList ( ExternalFileList = ExternalFileList->Next; } + AcDeleteTableList (ExternalListHead); + if (ACPI_FAILURE (GlobalStatus)) { return (GlobalStatus); diff --git a/source/common/adwalk.c b/source/common/adwalk.c index 887835cb0507..e7bb924b3920 100644 --- a/source/common/adwalk.c +++ b/source/common/adwalk.c @@ -536,11 +536,20 @@ AcpiDmDumpDescending ( case AML_NAME_OP: case AML_METHOD_OP: case AML_DEVICE_OP: + + AcpiOsPrintf ("%4.4s", + ACPI_CAST_PTR (char, &Op->Named.Name)); + break; + case AML_INT_NAMEDFIELD_OP: - AcpiOsPrintf ("%4.4s", ACPI_CAST_PTR (char, &Op->Named.Name)); + AcpiOsPrintf ("%4.4s Length: (bits) %8.8X%8.8X (bytes) %8.8X%8.8X", + ACPI_CAST_PTR (char, &Op->Named.Name), + ACPI_FORMAT_UINT64 (Op->Common.Value.Integer), + ACPI_FORMAT_UINT64 (Op->Common.Value.Integer / 8)); break; + default: break; @@ -1070,10 +1079,10 @@ AcpiDmCommonDescendingOp ( { ACPI_STATUS Status; + /* Resource descriptor conversion */ Status = AcpiDmProcessResourceDescriptors (Op, Level, Context); - if (ACPI_FAILURE (Status)) { return (Status); @@ -1082,7 +1091,6 @@ AcpiDmCommonDescendingOp ( /* Switch/Case conversion */ Status = AcpiDmProcessSwitch (Op); - return (AE_OK); } @@ -1113,6 +1121,7 @@ AcpiDmProcessResourceDescriptors ( ACPI_OBJECT_TYPE ObjectType; ACPI_STATUS Status; + WalkState = Info->WalkState; OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); @@ -1138,7 +1147,6 @@ AcpiDmProcessResourceDescriptors ( * If so, convert the reference into a symbolic reference. */ AcpiDmCheckResourceReference (Op, WalkState); - return (AE_OK); } diff --git a/source/common/ahpredef.c b/source/common/ahpredef.c index edcfa2f04301..5cd1064c6534 100644 --- a/source/common/ahpredef.c +++ b/source/common/ahpredef.c @@ -474,6 +474,15 @@ AcpiAhMatchPredefinedName ( const AH_PREDEFINED_NAME *Info; + /* Nameseg must start with an underscore */ + + if (*Nameseg != '_') + { + return (NULL); + } + + /* Search for a match in the predefined name table */ + for (Info = AslPredefinedInfo; Info->Name; Info++) { if (ACPI_COMPARE_NAME (Nameseg, Info->Name)) diff --git a/source/common/dmtbinfo.c b/source/common/dmtbinfo.c index 692763fd43a0..56dd5539f5ea 100644 --- a/source/common/dmtbinfo.c +++ b/source/common/dmtbinfo.c @@ -1838,6 +1838,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[] = {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "COHACC Override", 0}, {ACPI_DMT_FLAG1, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "HTTU Override", 0}, + {ACPI_DMT_FLAG3, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "Proximity Domain Valid", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_IORT4_OFFSET (VatosAddress), "VATOS Address", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Model), "Model", 0}, @@ -1845,6 +1846,9 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[] = {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (PriGsiv), "PRI GSIV", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (GerrGsiv), "GERR GSIV", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (SyncGsiv), "Sync GSIV", 0}, + {ACPI_DMT_UINT8, ACPI_IORT4_OFFSET (Pxm), "Proximity Domain", 0}, + {ACPI_DMT_UINT8, ACPI_IORT4_OFFSET (Reserved1), "Reserved", 0}, + {ACPI_DMT_UINT16, ACPI_IORT4_OFFSET (Reserved2), "Reserved", 0}, ACPI_DMT_TERMINATOR }; diff --git a/source/compiler/aslanalyze.c b/source/compiler/aslanalyze.c index 1df0dad03b1e..664dad086437 100644 --- a/source/compiler/aslanalyze.c +++ b/source/compiler/aslanalyze.c @@ -435,13 +435,13 @@ AnCheckMethodReturnValue ( /* Examine the parent op of this method */ OwningOp = Node->Op; - if (OwningOp->Asl.CompileFlags & NODE_METHOD_NO_RETVAL) + if (OwningOp->Asl.CompileFlags & OP_METHOD_NO_RETVAL) { /* Method NEVER returns a value */ AslError (ASL_ERROR, ASL_MSG_NO_RETVAL, Op, Op->Asl.ExternalName); } - else if (OwningOp->Asl.CompileFlags & NODE_METHOD_SOME_NO_RETVAL) + else if (OwningOp->Asl.CompileFlags & OP_METHOD_SOME_NO_RETVAL) { /* Method SOMETIMES returns a value, SOMETIMES not */ diff --git a/source/compiler/aslbtypes.c b/source/compiler/aslbtypes.c index 6a4e9beff27a..5bae87d6fa7a 100644 --- a/source/compiler/aslbtypes.c +++ b/source/compiler/aslbtypes.c @@ -560,7 +560,7 @@ AnGetBtype ( return (ACPI_UINT32_MAX); } - if (ReferencedNode->Asl.CompileFlags & NODE_METHOD_TYPED) + if (ReferencedNode->Asl.CompileFlags & OP_METHOD_TYPED) { ThisNodeBtype = ReferencedNode->Asl.AcpiBtype; } diff --git a/source/compiler/aslcodegen.c b/source/compiler/aslcodegen.c index 903f771d5c04..a527ddda832a 100644 --- a/source/compiler/aslcodegen.c +++ b/source/compiler/aslcodegen.c @@ -291,6 +291,8 @@ CgAmlWriteWalk ( /* 19 */ Op->Asl.LogicalLineNumber, /* 20 */ Op->Asl.EndLogicalLine); + TrPrintOpFlags (Op->Asl.CompileFlags, ASL_TREE_OUTPUT); + DbgPrint (ASL_TREE_OUTPUT, "\n"); return (AE_OK); } @@ -438,7 +440,7 @@ CgWriteAmlOpcode ( /* Does this opcode have an associated "PackageLength" field? */ - if (Op->Asl.CompileFlags & NODE_AML_PACKAGE) + if (Op->Asl.CompileFlags & OP_AML_PACKAGE) { if (Op->Asl.AmlPkgLenBytes == 1) { diff --git a/source/compiler/aslcompiler.h b/source/compiler/aslcompiler.h index 07a7d512e4d6..c3794246ec94 100644 --- a/source/compiler/aslcompiler.h +++ b/source/compiler/aslcompiler.h @@ -790,17 +790,6 @@ TrAmlTransformWalkEnd ( /* - * asltree - parse tree support - */ -ACPI_STATUS -TrWalkParseTree ( - ACPI_PARSE_OBJECT *Op, - UINT32 Visitation, - ASL_WALK_CALLBACK DescendingCallback, - ASL_WALK_CALLBACK AscendingCallback, - void *Context); - -/* * aslexternal - External opcode support */ ACPI_STATUS @@ -826,104 +815,112 @@ ExDoExternal ( #define ASL_WALK_VISIT_TWICE (ASL_WALK_VISIT_DOWNWARD | ASL_WALK_VISIT_UPWARD) -void -TrSetParent ( - ACPI_PARSE_OBJECT *Op, - ACPI_PARSE_OBJECT *ParentOp); - -ACPI_PARSE_OBJECT * -TrAllocateNode ( - UINT32 ParseOpcode); - -void -TrPrintNodeCompileFlags ( - UINT32 Flags); - -void -TrReleaseNode ( - ACPI_PARSE_OBJECT *Op); - -ACPI_PARSE_OBJECT * -TrUpdateNode ( - UINT32 ParseOpcode, - ACPI_PARSE_OBJECT *Op); - +/* + * aslparseop.c - Parse op create/allocate/cache + */ ACPI_PARSE_OBJECT * -TrCreateNode ( +TrCreateOp ( UINT32 ParseOpcode, UINT32 NumChildren, ...); ACPI_PARSE_OBJECT * -TrCreateLeafNode ( +TrCreateLeafOp ( UINT32 ParseOpcode); ACPI_PARSE_OBJECT * -TrCreateNullTarget ( +TrCreateNullTargetOp ( void); ACPI_PARSE_OBJECT * -TrCreateAssignmentNode ( +TrCreateAssignmentOp ( ACPI_PARSE_OBJECT *Target, ACPI_PARSE_OBJECT *Source); ACPI_PARSE_OBJECT * -TrCreateTargetOperand ( +TrCreateTargetOp ( ACPI_PARSE_OBJECT *OriginalOp, ACPI_PARSE_OBJECT *ParentOp); ACPI_PARSE_OBJECT * -TrCreateValuedLeafNode ( +TrCreateValuedLeafOp ( UINT32 ParseOpcode, UINT64 Value); ACPI_PARSE_OBJECT * -TrCreateConstantLeafNode ( +TrCreateConstantLeafOp ( UINT32 ParseOpcode); ACPI_PARSE_OBJECT * -TrLinkChildren ( - ACPI_PARSE_OBJECT *Op, - UINT32 NumChildren, - ...); +TrAllocateOp ( + UINT32 ParseOpcode); void -TrSetEndLineNumber ( +TrPrintOpFlags ( + UINT32 Flags, + UINT32 OutputLevel); + + +/* + * asltree.c - Parse tree management + */ +void +TrSetOpParent ( + ACPI_PARSE_OBJECT *Op, + ACPI_PARSE_OBJECT *ParentOp); + +ACPI_PARSE_OBJECT * +TrSetOpIntegerValue ( + UINT32 ParseOpcode, ACPI_PARSE_OBJECT *Op); void -TrSetCurrentFilename ( +TrSetOpEndLineNumber ( ACPI_PARSE_OBJECT *Op); void -TrWalkTree ( - void); +TrSetOpCurrentFilename ( + ACPI_PARSE_OBJECT *Op); ACPI_PARSE_OBJECT * -TrLinkPeerNode ( +TrLinkOpChildren ( + ACPI_PARSE_OBJECT *Op, + UINT32 NumChildren, + ...); + +ACPI_PARSE_OBJECT * +TrLinkPeerOp ( ACPI_PARSE_OBJECT *Op1, ACPI_PARSE_OBJECT *Op2); ACPI_PARSE_OBJECT * -TrLinkChildNode ( +TrLinkChildOp ( ACPI_PARSE_OBJECT *Op1, ACPI_PARSE_OBJECT *Op2); ACPI_PARSE_OBJECT * -TrSetNodeFlags ( +TrSetOpFlags ( ACPI_PARSE_OBJECT *Op, UINT32 Flags); ACPI_PARSE_OBJECT * -TrSetNodeAmlLength ( +TrSetOpAmlLength ( ACPI_PARSE_OBJECT *Op, UINT32 Length); ACPI_PARSE_OBJECT * -TrLinkPeerNodes ( +TrLinkPeerOps ( UINT32 NumPeers, ...); +ACPI_STATUS +TrWalkParseTree ( + ACPI_PARSE_OBJECT *Op, + UINT32 Visitation, + ASL_WALK_CALLBACK DescendingCallback, + ASL_WALK_CALLBACK AscendingCallback, + void *Context); + /* * aslfiles - File I/O support diff --git a/source/compiler/aslcstyle.y b/source/compiler/aslcstyle.y index 031a3829af38..928e3a4e18a9 100644 --- a/source/compiler/aslcstyle.y +++ b/source/compiler/aslcstyle.y @@ -201,59 +201,59 @@ Expression /* Unary operators */ - : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} - TermArg {$$ = TrLinkChildren ($<n>2,1,$3);} - | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} - TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateNullTarget ());} + : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafOp (PARSEOP_LNOT);} + TermArg {$$ = TrLinkOpChildren ($<n>2,1,$3);} + | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafOp (PARSEOP_NOT);} + TermArg {$$ = TrLinkOpChildren ($<n>2,2,$3,TrCreateNullTargetOp ());} - | SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} - {$$ = TrLinkChildren ($<n>3,1,$1);} - | SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} - {$$ = TrLinkChildren ($<n>3,1,$1);} + | SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafOp (PARSEOP_INCREMENT);} + {$$ = TrLinkOpChildren ($<n>3,1,$1);} + | SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafOp (PARSEOP_DECREMENT);} + {$$ = TrLinkOpChildren ($<n>3,1,$1);} /* Binary operators: math and logical */ - | TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} - TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), - TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - - | TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - - | TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - | TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - | TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - | TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - - | TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - - | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} + | TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafOp (PARSEOP_ADD);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());} + | TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafOp (PARSEOP_DIVIDE);} + TermArg {$$ = TrLinkOpChildren ($<n>3,4,$1,$4,TrCreateNullTargetOp (), + TrCreateNullTargetOp ());} + | TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafOp (PARSEOP_MOD);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());} + | TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafOp (PARSEOP_MULTIPLY);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());} + | TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafOp (PARSEOP_SHIFTLEFT);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());} + | TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafOp (PARSEOP_SHIFTRIGHT);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());} + | TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafOp (PARSEOP_SUBTRACT);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());} + + | TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafOp (PARSEOP_AND);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());} + | TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafOp (PARSEOP_OR);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());} + | TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafOp (PARSEOP_XOR);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());} + + | TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafOp (PARSEOP_LGREATER);} + TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);} + | TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafOp (PARSEOP_LGREATEREQUAL);} + TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);} + | TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafOp (PARSEOP_LLESS);} + TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);} + | TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafOp (PARSEOP_LLESSEQUAL);} + TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);} + + | TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafOp (PARSEOP_LEQUAL);} + TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);} + | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafOp (PARSEOP_LNOTEQUAL);} + TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);} + + | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafOp (PARSEOP_LAND);} + TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);} + | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafOp (PARSEOP_LOR);} + TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);} /* Parentheses */ @@ -280,8 +280,8 @@ IndexExpTerm : SuperName PARSEOP_EXP_INDEX_LEFT TermArg - PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafNode (PARSEOP_INDEX); - TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());} + PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafOp (PARSEOP_INDEX); + TrLinkOpChildren ($$,3,$1,$3,TrCreateNullTargetOp ());} ; @@ -304,7 +304,7 @@ EqualsTerm | SuperName PARSEOP_EXP_EQUALS - TermArg {$$ = TrCreateAssignmentNode ($1, $3);} + TermArg {$$ = TrCreateAssignmentOp ($1, $3);} /* Chained equals: (a=RefOf)=b, a=b=c=d etc. */ @@ -312,47 +312,47 @@ EqualsTerm EqualsTerm PARSEOP_CLOSE_PAREN PARSEOP_EXP_EQUALS - TermArg {$$ = TrCreateAssignmentNode ($2, $5);} + TermArg {$$ = TrCreateAssignmentOp ($2, $5);} /* Compound assignments -- Add (operand, operand, target) */ - | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_ADD);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} - TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_DIVIDE);} + TermArg {$$ = TrLinkOpChildren ($<n>3,4,$1,$4,TrCreateNullTargetOp (), + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_MOD);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_MULTIPLY);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_SHIFTLEFT);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_SHIFTRIGHT);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_SUBTRACT);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_AND);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_OR);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_XOR);} + TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} ; diff --git a/source/compiler/asldefine.h b/source/compiler/asldefine.h index 2b6d73d67788..a7d1a289d527 100644 --- a/source/compiler/asldefine.h +++ b/source/compiler/asldefine.h @@ -290,7 +290,7 @@ #define ASL_PARSE_TREE_DEBUG2 \ " %08X %04X %04X %01X %04X %04X %05X %05X "\ - "%08X %08X %08X %08X %08X %08X %04X %02d %5d %5d %5d %5d\n" + "%08X %08X %08X %08X %08X %08X %04X %02d %5d %5d %5d %5d" /* * Macros for ASL/ASL+ converter diff --git a/source/compiler/aslexternal.c b/source/compiler/aslexternal.c index 67a95e562c84..21729bd70258 100644 --- a/source/compiler/aslexternal.c +++ b/source/compiler/aslexternal.c @@ -202,7 +202,7 @@ ExDoExternal ( /* Create new list node of arbitrary type */ - ListOp = TrAllocateNode (PARSEOP_DEFAULT_ARG); + ListOp = TrAllocateOp (PARSEOP_DEFAULT_ARG); /* Store External node as child */ @@ -266,7 +266,7 @@ ExInsertArgCount ( /* Skip if External node already handled */ - if (Next->Asl.Child->Asl.CompileFlags & NODE_VISITED) + if (Next->Asl.Child->Asl.CompileFlags & OP_VISITED) { Next = Next->Asl.Next; continue; @@ -282,7 +282,7 @@ ExInsertArgCount ( continue; } - Next->Asl.Child->Asl.CompileFlags |= NODE_VISITED; + Next->Asl.Child->Asl.CompileFlags |= OP_VISITED; /* * Since we will reposition Externals to the Root, set Namepath @@ -544,7 +544,7 @@ ExMoveExternals ( Next->Asl.Child->Asl.Next->Asl.Value.Integer; if (ObjType == ACPI_TYPE_METHOD && - !(Next->Asl.CompileFlags & NODE_VISITED)) + !(Next->Asl.CompileFlags & OP_VISITED)) { if (Next == Prev) { @@ -578,12 +578,12 @@ ExMoveExternals ( Gbl_ExternalsListHead->Asl.ParseOpcode = PARSEOP_IF; Gbl_ExternalsListHead->Asl.AmlOpcode = AML_IF_OP; - Gbl_ExternalsListHead->Asl.CompileFlags = NODE_AML_PACKAGE; + Gbl_ExternalsListHead->Asl.CompileFlags = OP_AML_PACKAGE; UtSetParseOpName (Gbl_ExternalsListHead); /* Create a Zero op for the If predicate */ - PredicateOp = TrAllocateNode (PARSEOP_ZERO); + PredicateOp = TrAllocateOp (PARSEOP_ZERO); PredicateOp->Asl.AmlOpcode = AML_ZERO_OP; PredicateOp->Asl.Parent = Gbl_ExternalsListHead; diff --git a/source/compiler/aslfold.c b/source/compiler/aslfold.c index 27090a229756..511db575bc6f 100644 --- a/source/compiler/aslfold.c +++ b/source/compiler/aslfold.c @@ -232,8 +232,8 @@ OpcAmlConstantWalk ( * Only interested in subtrees that could possibly contain * expressions that can be evaluated at this time */ - if ((!(Op->Asl.CompileFlags & NODE_COMPILE_TIME_CONST)) || - (Op->Asl.CompileFlags & NODE_IS_TARGET)) + if ((!(Op->Asl.CompileFlags & OP_COMPILE_TIME_CONST)) || + (Op->Asl.CompileFlags & OP_IS_TARGET)) { return (AE_OK); } @@ -412,7 +412,7 @@ OpcAmlCheckForConstant ( { /* Error if there is a target operand */ - if (Op->Asl.CompileFlags & NODE_IS_TARGET) + if (Op->Asl.CompileFlags & OP_IS_TARGET) { AslError (ASL_ERROR, ASL_MSG_INVALID_TARGET, Op, NULL); Status = AE_TYPE; @@ -420,11 +420,11 @@ OpcAmlCheckForConstant ( /* Error if expression cannot be reduced (folded) */ - if (!(NextOp->Asl.CompileFlags & NODE_COULD_NOT_REDUCE)) + if (!(NextOp->Asl.CompileFlags & OP_COULD_NOT_REDUCE)) { /* Ensure only one error message per statement */ - NextOp->Asl.CompileFlags |= NODE_COULD_NOT_REDUCE; + NextOp->Asl.CompileFlags |= OP_COULD_NOT_REDUCE; DbgPrint (ASL_PARSE_OUTPUT, "**** Could not reduce operands for NAME opcode ****\n"); @@ -441,7 +441,7 @@ OpcAmlCheckForConstant ( /* This is not a 3/4/5 opcode, but maybe can convert to STORE */ - if (Op->Asl.CompileFlags & NODE_IS_TARGET) + if (Op->Asl.CompileFlags & OP_IS_TARGET) { DbgPrint (ASL_PARSE_OUTPUT, "**** Valid Target, transform to Store ****\n"); @@ -484,7 +484,7 @@ OpcAmlCheckForConstant ( DbgPrint (ASL_PARSE_OUTPUT, "TYPE_345"); - if (Op->Asl.CompileFlags & NODE_IS_TARGET) + if (Op->Asl.CompileFlags & OP_IS_TARGET) { if (Op->Asl.ParseOpcode == PARSEOP_ZERO) { @@ -496,7 +496,7 @@ OpcAmlCheckForConstant ( } } - if (Op->Asl.CompileFlags & NODE_IS_TERM_ARG) + if (Op->Asl.CompileFlags & OP_IS_TERM_ARG) { DbgPrint (ASL_PARSE_OUTPUT, "%-16s", " TERMARG"); } @@ -505,7 +505,7 @@ CleanupAndExit: /* Dump the node compile flags also */ - TrPrintNodeCompileFlags (Op->Asl.CompileFlags); + TrPrintOpFlags (Op->Asl.CompileFlags, ASL_PARSE_OUTPUT); DbgPrint (ASL_PARSE_OUTPUT, "\n"); return (Status); } @@ -543,7 +543,7 @@ TrSimpleConstantReduction ( /* Allocate a new temporary root for this subtree */ - RootOp = TrAllocateNode (PARSEOP_INTEGER); + RootOp = TrAllocateOp (PARSEOP_INTEGER); if (!RootOp) { return (AE_NO_MEMORY); @@ -654,7 +654,7 @@ TrTransformToStoreOp ( * Create a NULL (zero) target so that we can use the * interpreter to evaluate the expression. */ - NewTarget = TrCreateNullTarget (); + NewTarget = TrCreateNullTargetOp (); NewTarget->Common.AmlOpcode = AML_INT_NAMEPATH_OP; /* Handle one-operand cases (NOT, TOBCD, etc.) */ @@ -670,7 +670,7 @@ TrTransformToStoreOp ( Child2->Asl.Next = NewTarget; NewTarget->Asl.Parent = OriginalTarget->Asl.Parent; - NewParent = TrAllocateNode (PARSEOP_INTEGER); + NewParent = TrAllocateOp (PARSEOP_INTEGER); NewParent->Common.AmlOpcode = AML_INT_EVAL_SUBTREE_OP; OriginalParent = Op->Common.Parent; @@ -799,12 +799,12 @@ TrInstallReducedConstant ( */ Op->Asl.ParseOpcode = PARSEOP_BUFFER; Op->Common.AmlOpcode = AML_BUFFER_OP; - Op->Asl.CompileFlags = NODE_AML_PACKAGE; + Op->Asl.CompileFlags = OP_AML_PACKAGE; UtSetParseOpName (Op); /* Child node is the buffer length */ - LengthOp = TrAllocateNode (PARSEOP_INTEGER); + LengthOp = TrAllocateOp (PARSEOP_INTEGER); LengthOp->Asl.AmlOpcode = AML_DWORD_OP; LengthOp->Asl.Value.Integer = ObjDesc->Buffer.Length; @@ -815,7 +815,7 @@ TrInstallReducedConstant ( /* Next child is the raw buffer data */ - DataOp = TrAllocateNode (PARSEOP_RAW_DATA); + DataOp = TrAllocateOp (PARSEOP_RAW_DATA); DataOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; DataOp->Asl.AmlLength = ObjDesc->Buffer.Length; DataOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer; @@ -863,25 +863,25 @@ OpcUpdateIntegerNode ( { case 1: - TrUpdateNode (PARSEOP_BYTECONST, Op); + TrSetOpIntegerValue (PARSEOP_BYTECONST, Op); Op->Asl.AmlOpcode = AML_RAW_DATA_BYTE; break; case 2: - TrUpdateNode (PARSEOP_WORDCONST, Op); + TrSetOpIntegerValue (PARSEOP_WORDCONST, Op); Op->Asl.AmlOpcode = AML_RAW_DATA_WORD; break; case 4: - TrUpdateNode (PARSEOP_DWORDCONST, Op); + TrSetOpIntegerValue (PARSEOP_DWORDCONST, Op); Op->Asl.AmlOpcode = AML_RAW_DATA_DWORD; break; case 8: - TrUpdateNode (PARSEOP_QWORDCONST, Op); + TrSetOpIntegerValue (PARSEOP_QWORDCONST, Op); Op->Asl.AmlOpcode = AML_RAW_DATA_QWORD; break; @@ -889,7 +889,7 @@ OpcUpdateIntegerNode ( default: OpcSetOptimalIntegerSize (Op); - TrUpdateNode (PARSEOP_INTEGER, Op); + TrSetOpIntegerValue (PARSEOP_INTEGER, Op); break; } diff --git a/source/compiler/aslglobal.h b/source/compiler/aslglobal.h index 16b798c11e2c..0c58041ffb18 100644 --- a/source/compiler/aslglobal.h +++ b/source/compiler/aslglobal.h @@ -196,9 +196,37 @@ ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES] = {NULL, NULL, "Converter db :", "Converter debug Output"} }; +/* Table below must match the defines with the same names in actypes.h */ + +const char *Gbl_OpFlagNames[ACPI_NUM_OP_FLAGS] = +{ + "OP_VISITED", + "OP_AML_PACKAGE", + "OP_IS_TARGET", + "OP_IS_RESOURCE_DESC", + "OP_IS_RESOURCE_FIELD", + "OP_HAS_NO_EXIT", + "OP_IF_HAS_NO_EXIT", + "OP_NAME_INTERNALIZED", + "OP_METHOD_NO_RETVAL", + "OP_METHOD_SOME_NO_RETVAL", + "OP_RESULT_NOT_USED", + "OP_METHOD_TYPED", + "OP_COULD_NOT_REDUCE", + "OP_COMPILE_TIME_CONST", + "OP_IS_TERM_ARG", + "OP_WAS_ONES_OP", + "OP_IS_NAME_DECLARATION", + "OP_COMPILER_EMITTED", + "OP_IS_DUPLICATE", + "OP_IS_RESOURCE_DATA", + "OP_IS_NULL_RETURN" +}; + #else extern UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS]; extern ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES]; +extern const char *Gbl_OpFlagNames[ACPI_NUM_OP_FLAGS]; #endif @@ -387,9 +415,9 @@ ASL_EXTERN ASL_COMMENT_STATE Gbl_CommentState; * Determines if an inline comment should be saved in the InlineComment or NodeEndComment * field of ACPI_PARSE_OBJECT. */ -ASL_EXTERN ACPI_COMMENT_NODE ASL_INIT_GLOBAL (*Gbl_Comment_List_Head, NULL); -ASL_EXTERN ACPI_COMMENT_NODE ASL_INIT_GLOBAL (*Gbl_Comment_List_Tail, NULL); -ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_Inline_Comment_Buffer, NULL); +ASL_EXTERN ACPI_COMMENT_NODE ASL_INIT_GLOBAL (*Gbl_CommentListHead, NULL); +ASL_EXTERN ACPI_COMMENT_NODE ASL_INIT_GLOBAL (*Gbl_CommentListTail, NULL); +ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_InlineCommentBuffer, NULL); /* Static structures */ diff --git a/source/compiler/aslhelpers.y b/source/compiler/aslhelpers.y index f200bf2b0e78..cd898b155137 100644 --- a/source/compiler/aslhelpers.y +++ b/source/compiler/aslhelpers.y @@ -160,11 +160,11 @@ NoEcho(' ******************************************************************************/ OptionalBusMasterKeyword - : ',' {$$ = TrCreateLeafNode ( + : ',' {$$ = TrCreateLeafOp ( PARSEOP_BUSMASTERTYPE_MASTER);} - | ',' PARSEOP_BUSMASTERTYPE_MASTER {$$ = TrCreateLeafNode ( + | ',' PARSEOP_BUSMASTERTYPE_MASTER {$$ = TrCreateLeafOp ( PARSEOP_BUSMASTERTYPE_MASTER);} - | ',' PARSEOP_BUSMASTERTYPE_NOTMASTER {$$ = TrCreateLeafNode ( + | ',' PARSEOP_BUSMASTERTYPE_NOTMASTER {$$ = TrCreateLeafOp ( PARSEOP_BUSMASTERTYPE_NOTMASTER);} ; @@ -176,9 +176,9 @@ OptionalAccessAttribTerm ; OptionalAccessSize - : {$$ = TrCreateValuedLeafNode ( + : {$$ = TrCreateValuedLeafOp ( PARSEOP_BYTECONST, 0);} - | ',' {$$ = TrCreateValuedLeafNode ( + | ',' {$$ = TrCreateValuedLeafOp ( PARSEOP_BYTECONST, 0);} | ',' ByteConstExpr {$$ = $2;} ; @@ -243,10 +243,10 @@ OptionalIoRestriction ; OptionalListString - : {$$ = TrCreateValuedLeafNode ( + : {$$ = TrCreateValuedLeafOp ( PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ - | ',' {$$ = TrCreateValuedLeafNode ( + | ',' {$$ = TrCreateValuedLeafOp ( PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ | ',' TermArg {$$ = $2;} @@ -280,13 +280,13 @@ OptionalNameString_Last ; OptionalNameString_First - : {$$ = TrCreateLeafNode ( + : {$$ = TrCreateLeafOp ( PARSEOP_ZERO);} | NameString {$$ = $1;} ; OptionalObjectTypeKeyword - : {$$ = TrCreateLeafNode ( + : {$$ = TrCreateLeafOp ( PARSEOP_OBJECTTYPE_UNK);} | ',' ObjectTypeKeyword {$$ = $2;} ; @@ -308,33 +308,33 @@ OptionalRangeType ; OptionalReadWriteKeyword - : {$$ = TrCreateLeafNode ( + : {$$ = TrCreateLeafOp ( PARSEOP_READWRITETYPE_BOTH);} - | PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafNode ( + | PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafOp ( PARSEOP_READWRITETYPE_BOTH);} - | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafNode ( + | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafOp ( PARSEOP_READWRITETYPE_READONLY);} ; OptionalResourceType_First - : {$$ = TrCreateLeafNode ( + : {$$ = TrCreateLeafOp ( PARSEOP_RESOURCETYPE_CONSUMER);} | ResourceTypeKeyword {$$ = $1;} ; OptionalResourceType - : {$$ = TrCreateLeafNode ( + : {$$ = TrCreateLeafOp ( PARSEOP_RESOURCETYPE_CONSUMER);} - | ',' {$$ = TrCreateLeafNode ( + | ',' {$$ = TrCreateLeafOp ( PARSEOP_RESOURCETYPE_CONSUMER);} | ',' ResourceTypeKeyword {$$ = $2;} ; /* Same as above except default is producer */ OptionalProducerResourceType - : {$$ = TrCreateLeafNode ( + : {$$ = TrCreateLeafOp ( PARSEOP_RESOURCETYPE_PRODUCER);} - | ',' {$$ = TrCreateLeafNode ( + | ',' {$$ = TrCreateLeafOp ( PARSEOP_RESOURCETYPE_PRODUCER);} | ',' ResourceTypeKeyword {$$ = $2;} ; @@ -395,9 +395,9 @@ OptionalWordConstExpr ; OptionalXferSize - : {$$ = TrCreateValuedLeafNode ( + : {$$ = TrCreateValuedLeafOp ( PARSEOP_XFERSIZE_32, 2);} - | ',' {$$ = TrCreateValuedLeafNode ( + | ',' {$$ = TrCreateValuedLeafOp ( PARSEOP_XFERSIZE_32, 2);} | ',' XferSizeKeyword {$$ = $2;} ; diff --git a/source/compiler/aslkeywords.y b/source/compiler/aslkeywords.y index 08fbfc708965..e259d849ee55 100644 --- a/source/compiler/aslkeywords.y +++ b/source/compiler/aslkeywords.y @@ -159,46 +159,46 @@ NoEcho(' ******************************************************************************/ AccessAttribKeyword - : PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK);} - | PARSEOP_ACCESSATTRIB_BLOCK_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK_CALL);} - | PARSEOP_ACCESSATTRIB_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BYTE);} - | PARSEOP_ACCESSATTRIB_QUICK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_QUICK );} - | PARSEOP_ACCESSATTRIB_SND_RCV {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_SND_RCV);} - | PARSEOP_ACCESSATTRIB_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD);} - | PARSEOP_ACCESSATTRIB_WORD_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD_CALL);} + : PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_BLOCK);} + | PARSEOP_ACCESSATTRIB_BLOCK_CALL {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_BLOCK_CALL);} + | PARSEOP_ACCESSATTRIB_BYTE {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_BYTE);} + | PARSEOP_ACCESSATTRIB_QUICK {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_QUICK );} + | PARSEOP_ACCESSATTRIB_SND_RCV {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_SND_RCV);} + | PARSEOP_ACCESSATTRIB_WORD {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_WORD);} + | PARSEOP_ACCESSATTRIB_WORD_CALL {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_WORD_CALL);} | PARSEOP_ACCESSATTRIB_MULTIBYTE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_MULTIBYTE);} ByteConst - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);} | PARSEOP_ACCESSATTRIB_RAW_BYTES - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_RAW_BYTES);} ByteConst - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);} | PARSEOP_ACCESSATTRIB_RAW_PROCESS - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_RAW_PROCESS);} ByteConst - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);} ; AccessTypeKeyword - : PARSEOP_ACCESSTYPE_ANY {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_ANY);} - | PARSEOP_ACCESSTYPE_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BYTE);} - | PARSEOP_ACCESSTYPE_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_WORD);} - | PARSEOP_ACCESSTYPE_DWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_DWORD);} - | PARSEOP_ACCESSTYPE_QWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_QWORD);} - | PARSEOP_ACCESSTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BUF);} + : PARSEOP_ACCESSTYPE_ANY {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_ANY);} + | PARSEOP_ACCESSTYPE_BYTE {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_BYTE);} + | PARSEOP_ACCESSTYPE_WORD {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_WORD);} + | PARSEOP_ACCESSTYPE_DWORD {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_DWORD);} + | PARSEOP_ACCESSTYPE_QWORD {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_QWORD);} + | PARSEOP_ACCESSTYPE_BUF {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_BUF);} ; AddressingModeKeyword - : PARSEOP_ADDRESSINGMODE_7BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_7BIT);} - | PARSEOP_ADDRESSINGMODE_10BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_10BIT);} + : PARSEOP_ADDRESSINGMODE_7BIT {$$ = TrCreateLeafOp (PARSEOP_ADDRESSINGMODE_7BIT);} + | PARSEOP_ADDRESSINGMODE_10BIT {$$ = TrCreateLeafOp (PARSEOP_ADDRESSINGMODE_10BIT);} ; AddressKeyword - : PARSEOP_ADDRESSTYPE_MEMORY {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_MEMORY);} - | PARSEOP_ADDRESSTYPE_RESERVED {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_RESERVED);} - | PARSEOP_ADDRESSTYPE_NVS {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_NVS);} - | PARSEOP_ADDRESSTYPE_ACPI {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_ACPI);} + : PARSEOP_ADDRESSTYPE_MEMORY {$$ = TrCreateLeafOp (PARSEOP_ADDRESSTYPE_MEMORY);} + | PARSEOP_ADDRESSTYPE_RESERVED {$$ = TrCreateLeafOp (PARSEOP_ADDRESSTYPE_RESERVED);} + | PARSEOP_ADDRESSTYPE_NVS {$$ = TrCreateLeafOp (PARSEOP_ADDRESSTYPE_NVS);} + | PARSEOP_ADDRESSTYPE_ACPI {$$ = TrCreateLeafOp (PARSEOP_ADDRESSTYPE_ACPI);} ; AddressSpaceKeyword @@ -207,130 +207,130 @@ AddressSpaceKeyword ; BitsPerByteKeyword - : PARSEOP_BITSPERBYTE_FIVE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_FIVE);} - | PARSEOP_BITSPERBYTE_SIX {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SIX);} - | PARSEOP_BITSPERBYTE_SEVEN {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SEVEN);} - | PARSEOP_BITSPERBYTE_EIGHT {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_EIGHT);} - | PARSEOP_BITSPERBYTE_NINE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_NINE);} + : PARSEOP_BITSPERBYTE_FIVE {$$ = TrCreateLeafOp (PARSEOP_BITSPERBYTE_FIVE);} + | PARSEOP_BITSPERBYTE_SIX {$$ = TrCreateLeafOp (PARSEOP_BITSPERBYTE_SIX);} + | PARSEOP_BITSPERBYTE_SEVEN {$$ = TrCreateLeafOp (PARSEOP_BITSPERBYTE_SEVEN);} + | PARSEOP_BITSPERBYTE_EIGHT {$$ = TrCreateLeafOp (PARSEOP_BITSPERBYTE_EIGHT);} + | PARSEOP_BITSPERBYTE_NINE {$$ = TrCreateLeafOp (PARSEOP_BITSPERBYTE_NINE);} ; ClockPhaseKeyword - : PARSEOP_CLOCKPHASE_FIRST {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_FIRST);} - | PARSEOP_CLOCKPHASE_SECOND {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_SECOND);} + : PARSEOP_CLOCKPHASE_FIRST {$$ = TrCreateLeafOp (PARSEOP_CLOCKPHASE_FIRST);} + | PARSEOP_CLOCKPHASE_SECOND {$$ = TrCreateLeafOp (PARSEOP_CLOCKPHASE_SECOND);} ; ClockPolarityKeyword - : PARSEOP_CLOCKPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_LOW);} - | PARSEOP_CLOCKPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_HIGH);} + : PARSEOP_CLOCKPOLARITY_LOW {$$ = TrCreateLeafOp (PARSEOP_CLOCKPOLARITY_LOW);} + | PARSEOP_CLOCKPOLARITY_HIGH {$$ = TrCreateLeafOp (PARSEOP_CLOCKPOLARITY_HIGH);} ; DecodeKeyword - : PARSEOP_DECODETYPE_POS {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_POS);} - | PARSEOP_DECODETYPE_SUB {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_SUB);} + : PARSEOP_DECODETYPE_POS {$$ = TrCreateLeafOp (PARSEOP_DECODETYPE_POS);} + | PARSEOP_DECODETYPE_SUB {$$ = TrCreateLeafOp (PARSEOP_DECODETYPE_SUB);} ; DevicePolarityKeyword - : PARSEOP_DEVICEPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_LOW);} - | PARSEOP_DEVICEPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_HIGH);} + : PARSEOP_DEVICEPOLARITY_LOW {$$ = TrCreateLeafOp (PARSEOP_DEVICEPOLARITY_LOW);} + | PARSEOP_DEVICEPOLARITY_HIGH {$$ = TrCreateLeafOp (PARSEOP_DEVICEPOLARITY_HIGH);} ; DMATypeKeyword - : PARSEOP_DMATYPE_A {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_A);} - | PARSEOP_DMATYPE_COMPATIBILITY {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_COMPATIBILITY);} - | PARSEOP_DMATYPE_B {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_B);} - | PARSEOP_DMATYPE_F {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_F);} + : PARSEOP_DMATYPE_A {$$ = TrCreateLeafOp (PARSEOP_DMATYPE_A);} + | PARSEOP_DMATYPE_COMPATIBILITY {$$ = TrCreateLeafOp (PARSEOP_DMATYPE_COMPATIBILITY);} + | PARSEOP_DMATYPE_B {$$ = TrCreateLeafOp (PARSEOP_DMATYPE_B);} + | PARSEOP_DMATYPE_F {$$ = TrCreateLeafOp (PARSEOP_DMATYPE_F);} ; EndianKeyword - : PARSEOP_ENDIAN_LITTLE {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_LITTLE);} - | PARSEOP_ENDIAN_BIG {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_BIG);} + : PARSEOP_ENDIAN_LITTLE {$$ = TrCreateLeafOp (PARSEOP_ENDIAN_LITTLE);} + | PARSEOP_ENDIAN_BIG {$$ = TrCreateLeafOp (PARSEOP_ENDIAN_BIG);} ; FlowControlKeyword - : PARSEOP_FLOWCONTROL_HW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_HW);} - | PARSEOP_FLOWCONTROL_NONE {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_NONE);} - | PARSEOP_FLOWCONTROL_SW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_SW);} + : PARSEOP_FLOWCONTROL_HW {$$ = TrCreateLeafOp (PARSEOP_FLOWCONTROL_HW);} + | PARSEOP_FLOWCONTROL_NONE {$$ = TrCreateLeafOp (PARSEOP_FLOWCONTROL_NONE);} + | PARSEOP_FLOWCONTROL_SW {$$ = TrCreateLeafOp (PARSEOP_FLOWCONTROL_SW);} ; InterruptLevel - : PARSEOP_INTLEVEL_ACTIVEBOTH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEBOTH);} - | PARSEOP_INTLEVEL_ACTIVEHIGH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEHIGH);} - | PARSEOP_INTLEVEL_ACTIVELOW {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVELOW);} + : PARSEOP_INTLEVEL_ACTIVEBOTH {$$ = TrCreateLeafOp (PARSEOP_INTLEVEL_ACTIVEBOTH);} + | PARSEOP_INTLEVEL_ACTIVEHIGH {$$ = TrCreateLeafOp (PARSEOP_INTLEVEL_ACTIVEHIGH);} + | PARSEOP_INTLEVEL_ACTIVELOW {$$ = TrCreateLeafOp (PARSEOP_INTLEVEL_ACTIVELOW);} ; InterruptTypeKeyword - : PARSEOP_INTTYPE_EDGE {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_EDGE);} - | PARSEOP_INTTYPE_LEVEL {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_LEVEL);} + : PARSEOP_INTTYPE_EDGE {$$ = TrCreateLeafOp (PARSEOP_INTTYPE_EDGE);} + | PARSEOP_INTTYPE_LEVEL {$$ = TrCreateLeafOp (PARSEOP_INTTYPE_LEVEL);} ; IODecodeKeyword - : PARSEOP_IODECODETYPE_16 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_16);} - | PARSEOP_IODECODETYPE_10 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_10);} + : PARSEOP_IODECODETYPE_16 {$$ = TrCreateLeafOp (PARSEOP_IODECODETYPE_16);} + | PARSEOP_IODECODETYPE_10 {$$ = TrCreateLeafOp (PARSEOP_IODECODETYPE_10);} ; IoRestrictionKeyword - : PARSEOP_IORESTRICT_IN {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_IN);} - | PARSEOP_IORESTRICT_OUT {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_OUT);} - | PARSEOP_IORESTRICT_NONE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_NONE);} - | PARSEOP_IORESTRICT_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_PRESERVE);} + : PARSEOP_IORESTRICT_IN {$$ = TrCreateLeafOp (PARSEOP_IORESTRICT_IN);} + | PARSEOP_IORESTRICT_OUT {$$ = TrCreateLeafOp (PARSEOP_IORESTRICT_OUT);} + | PARSEOP_IORESTRICT_NONE {$$ = TrCreateLeafOp (PARSEOP_IORESTRICT_NONE);} + | PARSEOP_IORESTRICT_PRESERVE {$$ = TrCreateLeafOp (PARSEOP_IORESTRICT_PRESERVE);} ; LockRuleKeyword - : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);} - | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_NOLOCK);} + : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafOp (PARSEOP_LOCKRULE_LOCK);} + | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafOp (PARSEOP_LOCKRULE_NOLOCK);} ; MatchOpKeyword - : PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);} - | PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);} - | PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLE);} - | PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLT);} - | PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGE);} - | PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGT);} + : PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MTR);} + | PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MEQ);} + | PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MLE);} + | PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MLT);} + | PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MGE);} + | PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MGT);} ; MaxKeyword - : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);} - | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);} + : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafOp (PARSEOP_MAXTYPE_FIXED);} + | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafOp (PARSEOP_MAXTYPE_NOTFIXED);} ; MemTypeKeyword - : PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_CACHEABLE);} - | PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_WRITECOMBINING);} - | PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_PREFETCHABLE);} - | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_NONCACHEABLE);} + : PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafOp (PARSEOP_MEMTYPE_CACHEABLE);} + | PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafOp (PARSEOP_MEMTYPE_WRITECOMBINING);} + | PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafOp (PARSEOP_MEMTYPE_PREFETCHABLE);} + | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafOp (PARSEOP_MEMTYPE_NONCACHEABLE);} ; MinKeyword - : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);} - | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);} + : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafOp (PARSEOP_MINTYPE_FIXED);} + | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafOp (PARSEOP_MINTYPE_NOTFIXED);} ; ObjectTypeKeyword - : PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} - | PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_INT);} - | PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_STR);} - | PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BUF);} - | PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PKG);} - | PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_FLD);} - | PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DEV);} - | PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_EVT);} - | PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTH);} - | PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTX);} - | PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_OPR);} - | PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_POW);} - | PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PRO);} - | PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_THZ);} - | PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BFF);} - | PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DDB);} + : PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_UNK);} + | PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_INT);} + | PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_STR);} + | PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_BUF);} + | PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_PKG);} + | PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_FLD);} + | PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_DEV);} + | PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_EVT);} + | PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_MTH);} + | PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_MTX);} + | PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_OPR);} + | PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_POW);} + | PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_PRO);} + | PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_THZ);} + | PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_BFF);} + | PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_DDB);} ; ParityTypeKeyword - : PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_SPACE);} - | PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_MARK);} - | PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_ODD);} - | PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_EVEN);} - | PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_NONE);} + : PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafOp (PARSEOP_PARITYTYPE_SPACE);} + | PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafOp (PARSEOP_PARITYTYPE_MARK);} + | PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafOp (PARSEOP_PARITYTYPE_ODD);} + | PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafOp (PARSEOP_PARITYTYPE_EVEN);} + | PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafOp (PARSEOP_PARITYTYPE_NONE);} ; PinConfigByte @@ -339,125 +339,125 @@ PinConfigByte ; PinConfigKeyword - : PARSEOP_PIN_NOPULL {$$ = TrCreateLeafNode (PARSEOP_PIN_NOPULL);} - | PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDOWN);} - | PARSEOP_PIN_PULLUP {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLUP);} - | PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDEFAULT);} + : PARSEOP_PIN_NOPULL {$$ = TrCreateLeafOp (PARSEOP_PIN_NOPULL);} + | PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafOp (PARSEOP_PIN_PULLDOWN);} + | PARSEOP_PIN_PULLUP {$$ = TrCreateLeafOp (PARSEOP_PIN_PULLUP);} + | PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafOp (PARSEOP_PIN_PULLDEFAULT);} ; PldKeyword - : PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);} - | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);} - | PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);} - | PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);} - | PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);} - | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);} - | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);} - | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);} - | PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);} - | PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);} - | PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);} - | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);} - | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);} - | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);} - | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);} - | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);} - | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);} - | PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);} - | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);} - | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);} - | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);} - | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);} - | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);} - | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);} - | PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);} - | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);} - | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);} - | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);} + : PARSEOP_PLD_REVISION {$$ = TrCreateLeafOp (PARSEOP_PLD_REVISION);} + | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafOp (PARSEOP_PLD_IGNORECOLOR);} + | PARSEOP_PLD_RED {$$ = TrCreateLeafOp (PARSEOP_PLD_RED);} + | PARSEOP_PLD_GREEN {$$ = TrCreateLeafOp (PARSEOP_PLD_GREEN);} + | PARSEOP_PLD_BLUE {$$ = TrCreateLeafOp (PARSEOP_PLD_BLUE);} + | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafOp (PARSEOP_PLD_WIDTH);} + | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafOp (PARSEOP_PLD_HEIGHT);} + | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafOp (PARSEOP_PLD_USERVISIBLE);} + | PARSEOP_PLD_DOCK {$$ = TrCreateLeafOp (PARSEOP_PLD_DOCK);} + | PARSEOP_PLD_LID {$$ = TrCreateLeafOp (PARSEOP_PLD_LID);} + | PARSEOP_PLD_PANEL {$$ = TrCreateLeafOp (PARSEOP_PLD_PANEL);} + | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafOp (PARSEOP_PLD_VERTICALPOSITION);} + | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafOp (PARSEOP_PLD_HORIZONTALPOSITION);} + | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafOp (PARSEOP_PLD_SHAPE);} + | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafOp (PARSEOP_PLD_GROUPORIENTATION);} + | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafOp (PARSEOP_PLD_GROUPTOKEN);} + | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafOp (PARSEOP_PLD_GROUPPOSITION);} + | PARSEOP_PLD_BAY {$$ = TrCreateLeafOp (PARSEOP_PLD_BAY);} + | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafOp (PARSEOP_PLD_EJECTABLE);} + | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafOp (PARSEOP_PLD_EJECTREQUIRED);} + | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafOp (PARSEOP_PLD_CABINETNUMBER);} + | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafOp (PARSEOP_PLD_CARDCAGENUMBER);} + | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafOp (PARSEOP_PLD_REFERENCE);} + | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafOp (PARSEOP_PLD_ROTATION);} + | PARSEOP_PLD_ORDER {$$ = TrCreateLeafOp (PARSEOP_PLD_ORDER);} + | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafOp (PARSEOP_PLD_RESERVED);} + | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafOp (PARSEOP_PLD_VERTICALOFFSET);} + | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafOp (PARSEOP_PLD_HORIZONTALOFFSET);} ; RangeTypeKeyword - : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);} - | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);} - | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ENTIRE);} + : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafOp (PARSEOP_RANGETYPE_ISAONLY);} + | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafOp (PARSEOP_RANGETYPE_NONISAONLY);} + | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafOp (PARSEOP_RANGETYPE_ENTIRE);} ; RegionSpaceKeyword - : PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IO);} - | PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_MEM);} - | PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCI);} - | PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_EC);} - | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);} - | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);} - | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);} - | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);} - | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);} - | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);} - | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);} - | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);} + : PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_IO);} + | PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_MEM);} + | PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_PCI);} + | PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_EC);} + | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_SMBUS);} + | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_CMOS);} + | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_PCIBAR);} + | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_IPMI);} + | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_GPIO);} + | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_GSBUS);} + | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_PCC);} + | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_FFIXEDHW);} ; ResourceTypeKeyword - : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} - | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);} + : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafOp (PARSEOP_RESOURCETYPE_CONSUMER);} + | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafOp (PARSEOP_RESOURCETYPE_PRODUCER);} ; SerializeRuleKeyword - : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);} - | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL);} + : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafOp (PARSEOP_SERIALIZERULE_SERIAL);} + | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafOp (PARSEOP_SERIALIZERULE_NOTSERIAL);} ; ShareTypeKeyword - : PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHARED);} - | PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVE);} - | PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHAREDWAKE);} - | PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);} + : PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafOp (PARSEOP_SHARETYPE_SHARED);} + | PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafOp (PARSEOP_SHARETYPE_EXCLUSIVE);} + | PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafOp (PARSEOP_SHARETYPE_SHAREDWAKE);} + | PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafOp (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);} ; SlaveModeKeyword - : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_CONTROLLERINIT);} - | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_DEVICEINIT);} + : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafOp (PARSEOP_SLAVEMODE_CONTROLLERINIT);} + | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafOp (PARSEOP_SLAVEMODE_DEVICEINIT);} ; StopBitsKeyword - : PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_TWO);} - | PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONEPLUSHALF);} - | PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONE);} - | PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ZERO);} + : PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafOp (PARSEOP_STOPBITS_TWO);} + | PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafOp (PARSEOP_STOPBITS_ONEPLUSHALF);} + | PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafOp (PARSEOP_STOPBITS_ONE);} + | PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafOp (PARSEOP_STOPBITS_ZERO);} ; TranslationKeyword - : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);} - | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);} + : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafOp (PARSEOP_TRANSLATIONTYPE_SPARSE);} + | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafOp (PARSEOP_TRANSLATIONTYPE_DENSE);} ; TypeKeyword - : PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafNode (PARSEOP_TYPE_TRANSLATION);} - | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafNode (PARSEOP_TYPE_STATIC);} + : PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafOp (PARSEOP_TYPE_TRANSLATION);} + | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafOp (PARSEOP_TYPE_STATIC);} ; UpdateRuleKeyword - : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);} - | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);} - | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);} + : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafOp (PARSEOP_UPDATERULE_PRESERVE);} + | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafOp (PARSEOP_UPDATERULE_ONES);} + | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafOp (PARSEOP_UPDATERULE_ZEROS);} ; WireModeKeyword - : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_FOUR);} - | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_THREE);} + : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafOp (PARSEOP_WIREMODE_FOUR);} + | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafOp (PARSEOP_WIREMODE_THREE);} ; XferSizeKeyword - : PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_8, 0);} - | PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_16, 1);} - | PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} - | PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_64, 3);} - | PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_128, 4);} - | PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_256, 5);} + : PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_8, 0);} + | PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_16, 1);} + | PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_32, 2);} + | PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_64, 3);} + | PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_128, 4);} + | PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_256, 5);} ; XferTypeKeyword - : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);} - | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);} - | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);} + : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafOp (PARSEOP_XFERTYPE_8);} + | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafOp (PARSEOP_XFERTYPE_8_16);} + | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafOp (PARSEOP_XFERTYPE_16);} ; diff --git a/source/compiler/asllength.c b/source/compiler/asllength.c index 58e69008c9b5..28ae2929a1e1 100644 --- a/source/compiler/asllength.c +++ b/source/compiler/asllength.c @@ -338,7 +338,7 @@ CgGenerateAmlOpcodeLength ( /* Does this opcode have an associated "PackageLength" field? */ Op->Asl.AmlPkgLenBytes = 0; - if (Op->Asl.CompileFlags & NODE_AML_PACKAGE) + if (Op->Asl.CompileFlags & OP_AML_PACKAGE) { Op->Asl.AmlPkgLenBytes = CgGetPackageLenByteCount ( Op, Op->Asl.AmlSubtreeLength); @@ -459,7 +459,7 @@ CgGenerateAmlLengths ( case PARSEOP_NAMESTRING: case PARSEOP_METHODCALL: - if (Op->Asl.CompileFlags & NODE_NAME_INTERNALIZED) + if (Op->Asl.CompileFlags & OP_NAME_INTERNALIZED) { break; } @@ -475,7 +475,7 @@ CgGenerateAmlLengths ( Op->Asl.ExternalName = Op->Asl.Value.String; Op->Asl.Value.String = Buffer; - Op->Asl.CompileFlags |= NODE_NAME_INTERNALIZED; + Op->Asl.CompileFlags |= OP_NAME_INTERNALIZED; Op->Asl.AmlLength = strlen (Buffer); /* diff --git a/source/compiler/asllisting.c b/source/compiler/asllisting.c index e8919d240676..6fe01f491846 100644 --- a/source/compiler/asllisting.c +++ b/source/compiler/asllisting.c @@ -313,7 +313,7 @@ LsAmlListingWalk ( LsWriteNodeToListing (Op, FileId); - if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DATA) + if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DATA) { /* Buffer is a resource template, don't dump the data all at once */ @@ -445,7 +445,7 @@ LsTreeWriteWalk ( Op->Asl.LineNumber, Op->Asl.EndLine, Op->Asl.LogicalLineNumber, Op->Asl.EndLogicalLine); - TrPrintNodeCompileFlags (Op->Asl.CompileFlags); + TrPrintOpFlags (Op->Asl.CompileFlags, ASL_TREE_OUTPUT); DbgPrint (ASL_TREE_OUTPUT, "\n"); return (AE_OK); } @@ -616,7 +616,7 @@ LsWriteNodeToListing ( case PARSEOP_DEFAULT_ARG: - if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC) + if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC) { LsWriteSourceLines (Op->Asl.LineNumber, Op->Asl.EndLogicalLine, FileId); @@ -660,7 +660,7 @@ LsWriteNodeToListing ( case AML_NAME_OP: - if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC) + if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC) { LsWriteSourceLines (Op->Asl.LineNumber, Op->Asl.LogicalLineNumber, FileId); @@ -779,7 +779,7 @@ LsWriteNodeToListing ( default: if ((Op->Asl.ParseOpcode == PARSEOP_BUFFER) && - (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC)) + (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC)) { return; } diff --git a/source/compiler/aslload.c b/source/compiler/aslload.c index bd564b33682e..2c825f0fd3c7 100644 --- a/source/compiler/aslload.c +++ b/source/compiler/aslload.c @@ -316,7 +316,8 @@ LdLoadFieldElements ( return (Status); } else if (Status == AE_ALREADY_EXISTS && - (Node->Flags & ANOBJ_IS_EXTERNAL)) + (Node->Flags & ANOBJ_IS_EXTERNAL) && + Node->OwnerId != WalkState->OwnerId) { Node->Type = (UINT8) ACPI_TYPE_LOCAL_REGION_FIELD; } @@ -564,7 +565,7 @@ LdNamespace1Begin ( * a new scope so that the resource subfield names can be entered into * the namespace underneath this name */ - if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC) + if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC) { ForceNewScope = TRUE; } @@ -614,7 +615,7 @@ LdNamespace1Begin ( case PARSEOP_DEFAULT_ARG: - if (Op->Asl.CompileFlags == NODE_IS_RESOURCE_DESC) + if (Op->Asl.CompileFlags == OP_IS_RESOURCE_DESC) { Status = LdLoadResourceElements (Op, WalkState); return_ACPI_STATUS (Status); @@ -823,11 +824,16 @@ LdNamespace1Begin ( Status = AE_OK; - if (Node->OwnerId == WalkState->OwnerId) + if (Node->OwnerId == WalkState->OwnerId && + !(Node->Flags & IMPLICIT_EXTERNAL)) { AslError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Op, Op->Asl.ExternalName); } + if (Node->Flags & IMPLICIT_EXTERNAL) + { + Node->Flags &= ~IMPLICIT_EXTERNAL; + } } else if (!(Node->Flags & ANOBJ_IS_EXTERNAL) && (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL)) @@ -1000,7 +1006,7 @@ LdNamespace2Begin ( /* Get the type to determine if we should push the scope */ if ((Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) && - (Op->Asl.CompileFlags == NODE_IS_RESOURCE_DESC)) + (Op->Asl.CompileFlags == OP_IS_RESOURCE_DESC)) { ObjectType = ACPI_TYPE_LOCAL_RESOURCE; } @@ -1013,7 +1019,7 @@ LdNamespace2Begin ( if (Op->Asl.ParseOpcode == PARSEOP_NAME) { - if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC) + if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC) { ForceNewScope = TRUE; } @@ -1124,7 +1130,7 @@ LdCommonNamespaceEnd ( /* Get the type to determine if we should pop the scope */ if ((Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) && - (Op->Asl.CompileFlags == NODE_IS_RESOURCE_DESC)) + (Op->Asl.CompileFlags == OP_IS_RESOURCE_DESC)) { /* TBD: Merge into AcpiDsMapNamedOpcodeToDataType */ @@ -1139,7 +1145,7 @@ LdCommonNamespaceEnd ( if (Op->Asl.ParseOpcode == PARSEOP_NAME) { - if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC) + if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC) { ForceNewScope = TRUE; } diff --git a/source/compiler/asllookup.c b/source/compiler/asllookup.c index 73157465653f..acec30247c59 100644 --- a/source/compiler/asllookup.c +++ b/source/compiler/asllookup.c @@ -413,7 +413,7 @@ LkGetNameOp ( /* Name must appear as the last parameter */ NameOp = Op->Asl.Child; - while (!(NameOp->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)) + while (!(NameOp->Asl.CompileFlags & OP_IS_NAME_DECLARATION)) { NameOp = NameOp->Asl.Next; } diff --git a/source/compiler/aslmap.c b/source/compiler/aslmap.c index aed87661d091..a51bd60f01ce 100644 --- a/source/compiler/aslmap.c +++ b/source/compiler/aslmap.c @@ -267,7 +267,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* ARG4 */ OP_TABLE_ENTRY (AML_ARG4, 0, 0, ACPI_BTYPE_OBJECTS_AND_REFS), /* ARG5 */ OP_TABLE_ENTRY (AML_ARG5, 0, 0, ACPI_BTYPE_OBJECTS_AND_REFS), /* ARG6 */ OP_TABLE_ENTRY (AML_ARG6, 0, 0, ACPI_BTYPE_OBJECTS_AND_REFS), -/* BANKFIELD */ OP_TABLE_ENTRY (AML_BANK_FIELD_OP, 0, NODE_AML_PACKAGE, 0), +/* BANKFIELD */ OP_TABLE_ENTRY (AML_BANK_FIELD_OP, 0, OP_AML_PACKAGE, 0), /* BITSPERBYTE_EIGHT */ OP_TABLE_ENTRY (AML_BYTE_OP, 3, 0, 0), /* BITSPERBYTE_FIVE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* BITSPERBYTE_NINE */ OP_TABLE_ENTRY (AML_BYTE_OP, 4, 0, 0), @@ -275,7 +275,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* BITSPERBYTE_SIX */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* BREAK */ OP_TABLE_ENTRY (AML_BREAK_OP, 0, 0, 0), /* BREAKPOINT */ OP_TABLE_ENTRY (AML_BREAKPOINT_OP, 0, 0, 0), -/* BUFFER */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_BUFFER), +/* BUFFER */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_BUFFER), /* BUSMASTERTYPE_MASTER */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* BUSMASTERTYPE_NOTMASTER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* BYTECONST */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, 0, 0, ACPI_BTYPE_INTEGER), @@ -306,7 +306,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* DEFAULT_ARG */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* DEFINITIONBLOCK */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* DEREFOF */ OP_TABLE_ENTRY (AML_DEREF_OF_OP, 0, 0, ACPI_BTYPE_DATA_REFERENCE | ACPI_BTYPE_STRING), -/* DEVICE */ OP_TABLE_ENTRY (AML_DEVICE_OP, 0, NODE_AML_PACKAGE, 0), +/* DEVICE */ OP_TABLE_ENTRY (AML_DEVICE_OP, 0, OP_AML_PACKAGE, 0), /* DEVICEPOLARITY_HIGH */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* DEVICEPOLARITY_LOW */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* DIVIDE */ OP_TABLE_ENTRY (AML_DIVIDE_OP, 0, 0, ACPI_BTYPE_INTEGER), @@ -320,8 +320,8 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* DWORDMEMORY */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* DWORDSPACE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* EISAID */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, 0, ACPI_BTYPE_INTEGER), -/* ELSE */ OP_TABLE_ENTRY (AML_ELSE_OP, 0, NODE_AML_PACKAGE, 0), -/* ELSEIF */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, NODE_AML_PACKAGE, 0), +/* ELSE */ OP_TABLE_ENTRY (AML_ELSE_OP, 0, OP_AML_PACKAGE, 0), +/* ELSEIF */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, OP_AML_PACKAGE, 0), /* ENDDEPENDENTFN */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* ENDIAN_BIG */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* ENDIAN_LITTLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), @@ -333,7 +333,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* EXTENDEDSPACE */ OP_TABLE_ENTRY (AML_RAW_DATA_QWORD, 0, 0, ACPI_BTYPE_INTEGER), /* EXTERNAL */ OP_TABLE_ENTRY (AML_EXTERNAL_OP, 0, 0, 0), /* FATAL */ OP_TABLE_ENTRY (AML_FATAL_OP, 0, 0, 0), -/* FIELD */ OP_TABLE_ENTRY (AML_FIELD_OP, 0, NODE_AML_PACKAGE, 0), +/* FIELD */ OP_TABLE_ENTRY (AML_FIELD_OP, 0, OP_AML_PACKAGE, 0), /* FINDSETLEFTBIT */ OP_TABLE_ENTRY (AML_FIND_SET_LEFT_BIT_OP, 0, 0, ACPI_BTYPE_INTEGER), /* FINDSETRIGHTBIT */ OP_TABLE_ENTRY (AML_FIND_SET_RIGHT_BIT_OP, 0, 0, ACPI_BTYPE_INTEGER), /* FIXEDDMA */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), @@ -342,17 +342,17 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* FLOWCONTROL_NONE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* FLOWCONTROL_SW */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0), /* FROMBCD */ OP_TABLE_ENTRY (AML_FROM_BCD_OP, 0, 0, ACPI_BTYPE_INTEGER), -/* FUNCTION */ OP_TABLE_ENTRY (AML_METHOD_OP, 0, NODE_AML_PACKAGE, 0), +/* FUNCTION */ OP_TABLE_ENTRY (AML_METHOD_OP, 0, OP_AML_PACKAGE, 0), /* GPIOINT */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* GPIOIO */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* I2CSERIALBUS */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* I2CSERIALBUSV2 */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), -/* IF */ OP_TABLE_ENTRY (AML_IF_OP, 0, NODE_AML_PACKAGE, 0), +/* IF */ OP_TABLE_ENTRY (AML_IF_OP, 0, OP_AML_PACKAGE, 0), /* INCLUDE */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* INCLUDE_END */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* INCREMENT */ OP_TABLE_ENTRY (AML_INCREMENT_OP, 0, 0, ACPI_BTYPE_INTEGER), /* INDEX */ OP_TABLE_ENTRY (AML_INDEX_OP, 0, 0, ACPI_BTYPE_REFERENCE_OBJECT), -/* INDEXFIELD */ OP_TABLE_ENTRY (AML_INDEX_FIELD_OP, 0, NODE_AML_PACKAGE, 0), +/* INDEXFIELD */ OP_TABLE_ENTRY (AML_INDEX_FIELD_OP, 0, OP_AML_PACKAGE, 0), /* INTEGER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, ACPI_BTYPE_INTEGER), /* INTERRUPT */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* INTLEVEL_ACTIVEBOTH */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0), @@ -406,7 +406,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* MEMTYPE_NONCACHEABLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* MEMTYPE_PREFETCHABLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 3, 0, 0), /* MEMTYPE_WRITECOMBINING */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0), -/* METHOD */ OP_TABLE_ENTRY (AML_METHOD_OP, 0, NODE_AML_PACKAGE, 0), +/* METHOD */ OP_TABLE_ENTRY (AML_METHOD_OP, 0, OP_AML_PACKAGE, 0), /* METHODCALL */ OP_TABLE_ENTRY (AML_INT_METHODCALL_OP, 0, 0, ACPI_BTYPE_OBJECTS_AND_REFS), /* MID */ OP_TABLE_ENTRY (AML_MID_OP, 0, 0, ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER), /* MINTYPE_FIXED */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), @@ -444,8 +444,8 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* ONES */ OP_TABLE_ENTRY (AML_ONES_OP, 0, 0, ACPI_BTYPE_INTEGER), /* OPERATIONREGION */ OP_TABLE_ENTRY (AML_REGION_OP, 0, 0, 0), /* OR */ OP_TABLE_ENTRY (AML_BIT_OR_OP, 0, 0, ACPI_BTYPE_INTEGER), -/* PACKAGE */ OP_TABLE_ENTRY (AML_PACKAGE_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_PACKAGE), -/* PACKAGEP_LENGTH */ OP_TABLE_ENTRY (AML_PACKAGE_LENGTH, 0, NODE_AML_PACKAGE, 0), +/* PACKAGE */ OP_TABLE_ENTRY (AML_PACKAGE_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_PACKAGE), +/* PACKAGEP_LENGTH */ OP_TABLE_ENTRY (AML_PACKAGE_LENGTH, 0, OP_AML_PACKAGE, 0), /* PARITYTYPE_EVEN */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* PARITYTYPE_MARK */ OP_TABLE_ENTRY (AML_BYTE_OP, 3, 0, 0), /* PARITYTYPE_NONE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), @@ -460,8 +460,8 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* PIN_PULLDEFAULT */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* PIN_PULLDOWN */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0), /* PIN_PULLUP */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), -/* POWERRESOURCE */ OP_TABLE_ENTRY (AML_POWER_RESOURCE_OP, 0, NODE_AML_PACKAGE, 0), -/* PROCESSOR */ OP_TABLE_ENTRY (AML_PROCESSOR_OP, 0, NODE_AML_PACKAGE, 0), +/* POWERRESOURCE */ OP_TABLE_ENTRY (AML_POWER_RESOURCE_OP, 0, OP_AML_PACKAGE, 0), +/* PROCESSOR */ OP_TABLE_ENTRY (AML_PROCESSOR_OP, 0, OP_AML_PACKAGE, 0), /* QWORDCONST */ OP_TABLE_ENTRY (AML_RAW_DATA_QWORD, 0, 0, ACPI_BTYPE_INTEGER), /* QWORDIO */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* QWORDMEMORY */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), @@ -494,7 +494,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* RESOURCETYPE_PRODUCER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* RETURN */ OP_TABLE_ENTRY (AML_RETURN_OP, 0, 0, 0), /* REVISION */ OP_TABLE_ENTRY (AML_REVISION_OP, 0, 0, ACPI_BTYPE_INTEGER), -/* SCOPE */ OP_TABLE_ENTRY (AML_SCOPE_OP, 0, NODE_AML_PACKAGE, 0), +/* SCOPE */ OP_TABLE_ENTRY (AML_SCOPE_OP, 0, OP_AML_PACKAGE, 0), /* SERIALIZERULE_NOTSERIAL */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* SERIALIZERULE_SERIAL */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* SHARETYPE_EXCLUSIVE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), @@ -521,7 +521,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* STRING_LITERAL */ OP_TABLE_ENTRY (AML_STRING_OP, 0, 0, ACPI_BTYPE_STRING), /* SUBTRACT */ OP_TABLE_ENTRY (AML_SUBTRACT_OP, 0, 0, ACPI_BTYPE_INTEGER), /* SWITCH */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), -/* THERMALZONE */ OP_TABLE_ENTRY (AML_THERMAL_ZONE_OP, 0, NODE_AML_PACKAGE, 0), +/* THERMALZONE */ OP_TABLE_ENTRY (AML_THERMAL_ZONE_OP, 0, OP_AML_PACKAGE, 0), /* TIMER */ OP_TABLE_ENTRY (AML_TIMER_OP, 0, 0, ACPI_BTYPE_INTEGER), /* TOBCD */ OP_TABLE_ENTRY (AML_TO_BCD_OP, 0, 0, ACPI_BTYPE_INTEGER), /* TOBUFFER */ OP_TABLE_ENTRY (AML_TO_BUFFER_OP, 0, 0, ACPI_BTYPE_BUFFER), @@ -529,23 +529,23 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* TOHEXSTRING */ OP_TABLE_ENTRY (AML_TO_HEX_STRING_OP, 0, 0, ACPI_BTYPE_STRING), /* TOINTEGER */ OP_TABLE_ENTRY (AML_TO_INTEGER_OP, 0, 0, ACPI_BTYPE_INTEGER), /* TOSTRING */ OP_TABLE_ENTRY (AML_TO_STRING_OP, 0, 0, ACPI_BTYPE_STRING), -/* TOUUID */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_INTEGER), +/* TOUUID */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_INTEGER), /* TRANSLATIONTYPE_DENSE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* TRANSLATIONTYPE_SPARSE */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* TYPE_STATIC */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* TYPE_TRANSLATION */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* UART_SERIALBUS */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* UART_SERIALBUSV2 */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), -/* UNICODE */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, NODE_AML_PACKAGE, 0), +/* UNICODE */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, OP_AML_PACKAGE, 0), /* UNLOAD */ OP_TABLE_ENTRY (AML_UNLOAD_OP, 0, 0, 0), /* UPDATERULE_ONES */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_UPDATE_WRITE_AS_ONES, 0, 0), /* UPDATERULE_PRESERVE */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_UPDATE_PRESERVE, 0, 0), /* UPDATERULE_ZEROS */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_UPDATE_WRITE_AS_ZEROS,0, 0), -/* VARIABLE_PACKAGE */ OP_TABLE_ENTRY (AML_VARIABLE_PACKAGE_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_PACKAGE), +/* VARIABLE_PACKAGE */ OP_TABLE_ENTRY (AML_VARIABLE_PACKAGE_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_PACKAGE), /* VENDORLONG */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* VENDORSHORT */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* WAIT */ OP_TABLE_ENTRY (AML_WAIT_OP, 0, 0, ACPI_BTYPE_INTEGER), -/* WHILE */ OP_TABLE_ENTRY (AML_WHILE_OP, 0, NODE_AML_PACKAGE, 0), +/* WHILE */ OP_TABLE_ENTRY (AML_WHILE_OP, 0, OP_AML_PACKAGE, 0), /* WIREMODE_FOUR */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* WIREMODE_THREE */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* WORDBUSNUMBER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), @@ -563,7 +563,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* XFERTYPE_16 */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0), /* XOR */ OP_TABLE_ENTRY (AML_BIT_XOR_OP, 0, 0, ACPI_BTYPE_INTEGER), /* ZERO */ OP_TABLE_ENTRY (AML_ZERO_OP, 0, 0, ACPI_BTYPE_INTEGER), -/* TOPLD */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_INTEGER), +/* TOPLD */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_INTEGER), /* XFERSIZE_128 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* REVISION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* IGNORECOLOR */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), diff --git a/source/compiler/aslmapoutput.c b/source/compiler/aslmapoutput.c index de5dc1c6c3d1..5fdb54cddaea 100644 --- a/source/compiler/aslmapoutput.c +++ b/source/compiler/aslmapoutput.c @@ -685,7 +685,7 @@ MpNamespaceXrefBegin ( * are references to other objects within the namespace and the * parent objects of name declarations */ - if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION) + if (Op->Asl.CompileFlags & OP_IS_NAME_DECLARATION) { return (AE_OK); } diff --git a/source/compiler/aslmethod.c b/source/compiler/aslmethod.c index 2b313997366c..9734b643efd9 100644 --- a/source/compiler/aslmethod.c +++ b/source/compiler/aslmethod.c @@ -380,7 +380,7 @@ MtMethodAnalysisWalkBegin ( * If the local is being used as a target, mark the local * initialized */ - if (Op->Asl.CompileFlags & NODE_IS_TARGET) + if (Op->Asl.CompileFlags & OP_IS_TARGET) { MethodInfo->LocalInitialized[RegisterNumber] = TRUE; } @@ -425,7 +425,7 @@ MtMethodAnalysisWalkBegin ( * If the Arg is being used as a target, mark the local * initialized */ - if (Op->Asl.CompileFlags & NODE_IS_TARGET) + if (Op->Asl.CompileFlags & OP_IS_TARGET) { MethodInfo->ArgInitialized[RegisterNumber] = TRUE; } @@ -464,7 +464,7 @@ MtMethodAnalysisWalkBegin ( /* * A child indicates a possible return value. A simple Return or - * Return() is marked with NODE_IS_NULL_RETURN by the parser so + * Return() is marked with OP_IS_NULL_RETURN by the parser so * that it is not counted as a "real" return-with-value, although * the AML code that is actually emitted is Return(0). The AML * definition of Return has a required parameter, so we are @@ -472,7 +472,7 @@ MtMethodAnalysisWalkBegin ( */ if ((Op->Asl.Child) && (Op->Asl.Child->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) && - (!(Op->Asl.Child->Asl.CompileFlags & NODE_IS_NULL_RETURN))) + (!(Op->Asl.Child->Asl.CompileFlags & OP_IS_NULL_RETURN))) { MethodInfo->NumReturnWithValue++; } @@ -704,7 +704,7 @@ MtMethodAnalysisWalkEnd ( * of the method can possibly terminate without a return statement. */ if ((!AnLastStatementIsReturn (Op)) && - (!(Op->Asl.CompileFlags & NODE_HAS_NO_EXIT))) + (!(Op->Asl.CompileFlags & OP_HAS_NO_EXIT))) { /* * No return statement, and execution can possibly exit @@ -736,11 +736,11 @@ MtMethodAnalysisWalkEnd ( { if (MethodInfo->NumReturnWithValue) { - Op->Asl.CompileFlags |= NODE_METHOD_SOME_NO_RETVAL; + Op->Asl.CompileFlags |= OP_METHOD_SOME_NO_RETVAL; } else { - Op->Asl.CompileFlags |= NODE_METHOD_NO_RETVAL; + Op->Asl.CompileFlags |= OP_METHOD_NO_RETVAL; } } @@ -784,7 +784,7 @@ MtMethodAnalysisWalkEnd ( * The parent block does not "exit" and continue execution -- the * method is terminated here with the Return() statement. */ - Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT; + Op->Asl.Parent->Asl.CompileFlags |= OP_HAS_NO_EXIT; /* Used in the "typing" pass later */ @@ -804,7 +804,7 @@ MtMethodAnalysisWalkEnd ( case PARSEOP_IF: - if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) && + if ((Op->Asl.CompileFlags & OP_HAS_NO_EXIT) && (Op->Asl.Next) && (Op->Asl.Next->Asl.ParseOpcode == PARSEOP_ELSE)) { @@ -813,32 +813,32 @@ MtMethodAnalysisWalkEnd ( * (it contains an unconditional Return) * mark the ELSE block to remember this fact. */ - Op->Asl.Next->Asl.CompileFlags |= NODE_IF_HAS_NO_EXIT; + Op->Asl.Next->Asl.CompileFlags |= OP_IF_HAS_NO_EXIT; } break; case PARSEOP_ELSE: - if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) && - (Op->Asl.CompileFlags & NODE_IF_HAS_NO_EXIT)) + if ((Op->Asl.CompileFlags & OP_HAS_NO_EXIT) && + (Op->Asl.CompileFlags & OP_IF_HAS_NO_EXIT)) { /* * This ELSE block has no exit and the corresponding IF block * has no exit either. Therefore, the parent node has no exit. */ - Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT; + Op->Asl.Parent->Asl.CompileFlags |= OP_HAS_NO_EXIT; } break; default: - if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) && + if ((Op->Asl.CompileFlags & OP_HAS_NO_EXIT) && (Op->Asl.Parent)) { /* If this node has no exit, then the parent has no exit either */ - Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT; + Op->Asl.Parent->Asl.CompileFlags |= OP_HAS_NO_EXIT; } break; } diff --git a/source/compiler/asloffset.c b/source/compiler/asloffset.c index 0964d4feaa81..c57c1261c39c 100644 --- a/source/compiler/asloffset.c +++ b/source/compiler/asloffset.c @@ -211,7 +211,7 @@ LsAmlOffsetWalk ( /* Ignore actual data blocks for resource descriptors */ - if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DATA) + if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DATA) { return (AE_OK); /* Do NOT update the global AML offset */ } @@ -228,7 +228,7 @@ LsAmlOffsetWalk ( /* Named resource descriptor (has a descriptor tag) */ if ((Node->Type == ACPI_TYPE_LOCAL_RESOURCE) && - (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC)) + (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC)) { LsEmitOffsetTableEntry (FileId, Node, 0, Gbl_CurrentAmlOffset, Op->Asl.ParseOpName, 0, Op->Asl.Extra, AML_BUFFER_OP); diff --git a/source/compiler/aslopcodes.c b/source/compiler/aslopcodes.c index 74d1ecef712e..1fffc1e70ffb 100644 --- a/source/compiler/aslopcodes.c +++ b/source/compiler/aslopcodes.c @@ -550,7 +550,7 @@ OpcDoConnection ( */ BufferOp->Asl.ParseOpcode = PARSEOP_BUFFER; BufferOp->Asl.AmlOpcode = AML_BUFFER_OP; - BufferOp->Asl.CompileFlags = NODE_AML_PACKAGE | NODE_IS_RESOURCE_DESC; + BufferOp->Asl.CompileFlags = OP_AML_PACKAGE | OP_IS_RESOURCE_DESC; UtSetParseOpName (BufferOp); BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER; @@ -598,7 +598,7 @@ OpcDoUnicode ( /* Change op into a buffer object */ - Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST; + Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST; Op->Asl.ParseOpcode = PARSEOP_BUFFER; UtSetParseOpName (Op); @@ -756,7 +756,7 @@ OpcDoEisaId ( */ Op->Asl.Value.Integer = EisaId; - Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST; + Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST; Op->Asl.ParseOpcode = PARSEOP_INTEGER; (void) OpcSetOptimalIntegerSize (Op); @@ -808,12 +808,12 @@ OpcDoUuId ( /* Disable further optimization */ - Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST; + Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST; UtSetParseOpName (Op); /* Child node is the buffer length */ - NewOp = TrAllocateNode (PARSEOP_INTEGER); + NewOp = TrAllocateOp (PARSEOP_INTEGER); NewOp->Asl.AmlOpcode = AML_BYTE_OP; NewOp->Asl.Value.Integer = 16; @@ -824,7 +824,7 @@ OpcDoUuId ( /* Peer to the child is the raw buffer data */ - NewOp = TrAllocateNode (PARSEOP_RAW_DATA); + NewOp = TrAllocateOp (PARSEOP_RAW_DATA); NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; NewOp->Asl.AmlLength = 16; NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer); diff --git a/source/compiler/aslopt.c b/source/compiler/aslopt.c index d5908ab8e2cf..79e41da24650 100644 --- a/source/compiler/aslopt.c +++ b/source/compiler/aslopt.c @@ -699,7 +699,7 @@ OptOptimizeNamePath ( if (!(Flags & (AML_NAMED | AML_CREATE))) { - if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION) + if (Op->Asl.CompileFlags & OP_IS_NAME_DECLARATION) { /* We don't want to fuss with actual name declaration nodes here */ @@ -893,7 +893,7 @@ OptOptimizeNamePath ( /* Name must appear as the last parameter */ NextOp = Op->Asl.Child; - while (!(NextOp->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)) + while (!(NextOp->Asl.CompileFlags & OP_IS_NAME_DECLARATION)) { NextOp = NextOp->Asl.Next; } diff --git a/source/compiler/aslparseop.c b/source/compiler/aslparseop.c new file mode 100644 index 000000000000..4e6e5a16276c --- /dev/null +++ b/source/compiler/aslparseop.c @@ -0,0 +1,945 @@ +/****************************************************************************** + * + * Module Name: aslparseop - Parse op create/allocate/cache interfaces + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2017, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + ***************************************************************************** + * + * Alternatively, you may choose to be licensed under the terms of the + * following license: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Alternatively, you may choose to be licensed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + *****************************************************************************/ + +#include "aslcompiler.h" +#include "aslcompiler.y.h" +#include "acapps.h" +#include "acconvert.h" + +#define _COMPONENT ACPI_COMPILER + ACPI_MODULE_NAME ("aslparseop") + + +/* Local prototypes */ + +static ACPI_PARSE_OBJECT * +TrGetOpFromCache ( + void); + + +/******************************************************************************* + * + * FUNCTION: TrCreateOp + * + * PARAMETERS: ParseOpcode - Opcode to be assigned to the op + * NumChildren - Number of children to follow + * ... - A list of child ops to link to the new + * op. NumChildren long. + * + * RETURN: Pointer to the new op. Aborts on allocation failure + * + * DESCRIPTION: Create a new parse op and link together a list of child + * ops underneath the new op. + * + ******************************************************************************/ + +ACPI_PARSE_OBJECT * +TrCreateOp ( + UINT32 ParseOpcode, + UINT32 NumChildren, + ...) +{ + ACPI_PARSE_OBJECT *Op; + ACPI_PARSE_OBJECT *Child; + ACPI_PARSE_OBJECT *PrevChild; + va_list ap; + UINT32 i; + BOOLEAN FirstChild; + + + va_start (ap, NumChildren); + + /* Allocate one new op */ + + Op = TrAllocateOp (ParseOpcode); + + DbgPrint (ASL_PARSE_OUTPUT, + "\nCreateOp Ln/Col %u/%u NewParent %p Child %u Op %s ", + Op->Asl.LineNumber, Op->Asl.Column, Op, + NumChildren, UtGetOpName(ParseOpcode)); + + /* Some extra debug output based on the parse opcode */ + + switch (ParseOpcode) + { + case PARSEOP_ASL_CODE: + + Gbl_ParseTreeRoot = Op; + Op->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; + DbgPrint (ASL_PARSE_OUTPUT, "ASLCODE (Tree Completed)->"); + break; + + case PARSEOP_DEFINITION_BLOCK: + + DbgPrint (ASL_PARSE_OUTPUT, "DEFINITION_BLOCK (Tree Completed)->"); + break; + + case PARSEOP_OPERATIONREGION: + + DbgPrint (ASL_PARSE_OUTPUT, "OPREGION->"); + break; + + case PARSEOP_OR: + + DbgPrint (ASL_PARSE_OUTPUT, "OR->"); + break; + + default: + + /* Nothing to do for other opcodes */ + + break; + } + + /* Link the new op to its children */ + + PrevChild = NULL; + FirstChild = TRUE; + for (i = 0; i < NumChildren; i++) + { + /* Get the next child */ + + Child = va_arg (ap, ACPI_PARSE_OBJECT *); + DbgPrint (ASL_PARSE_OUTPUT, "%p, ", Child); + + /* + * If child is NULL, this means that an optional argument + * was omitted. We must create a placeholder with a special + * opcode (DEFAULT_ARG) so that the code generator will know + * that it must emit the correct default for this argument + */ + if (!Child) + { + Child = TrAllocateOp (PARSEOP_DEFAULT_ARG); + } + + /* Link first child to parent */ + + if (FirstChild) + { + FirstChild = FALSE; + Op->Asl.Child = Child; + + /* + * For the ASL-/ASL+ converter: if the ParseOp is a Connection, + * External, Offset or AccessAs, it means that the comments in the + * FirstChild belongs to their parent due to the parsing order in + * the .y files. To correct this, take the comments in the + * FirstChild place it in the parent. This also means that + * legitimate comments for the child gets put to the parent. + */ + if (Gbl_CaptureComments && + ((ParseOpcode == PARSEOP_CONNECTION) || + (ParseOpcode == PARSEOP_EXTERNAL) || + (ParseOpcode == PARSEOP_OFFSET) || + (ParseOpcode == PARSEOP_ACCESSAS))) + { + Op->Asl.CommentList = Child->Asl.CommentList; + Op->Asl.EndBlkComment = Child->Asl.EndBlkComment; + Op->Asl.InlineComment = Child->Asl.InlineComment; + Op->Asl.FileChanged = Child->Asl.FileChanged; + + Child->Asl.CommentList = NULL; + Child->Asl.EndBlkComment = NULL; + Child->Asl.InlineComment = NULL; + Child->Asl.FileChanged = FALSE; + + /* + * These do not need to be "passed off". They can be copied + * because the code for these opcodes should be printed in the + * same file. + */ + Op->Asl.Filename = Child->Asl.Filename; + Op->Asl.ParentFilename = Child->Asl.ParentFilename; + } + } + + /* Point all children to parent */ + + Child->Asl.Parent = Op; + + /* Link children in a peer list */ + + if (PrevChild) + { + PrevChild->Asl.Next = Child; + }; + + /* Get the comment from last child in the resource template call */ + + if (Gbl_CaptureComments && + (Op->Asl.ParseOpcode == PARSEOP_RESOURCETEMPLATE)) + { + CvDbgPrint ("Transferred current comment list to this op.\n"); + Op->Asl.CommentList = Child->Asl.CommentList; + Child->Asl.CommentList = NULL; + + Op->Asl.InlineComment = Child->Asl.InlineComment; + Child->Asl.InlineComment = NULL; + } + + /* + * This child might be a list, point all ops in the list + * to the same parent + */ + while (Child->Asl.Next) + { + Child = Child->Asl.Next; + Child->Asl.Parent = Op; + } + + PrevChild = Child; + } + + va_end(ap); + DbgPrint (ASL_PARSE_OUTPUT, "\n"); + return (Op); +} + + +/******************************************************************************* + * + * FUNCTION: TrCreateLeafOp + * + * PARAMETERS: ParseOpcode - New opcode to be assigned to the op + * + * RETURN: Pointer to the new op. Aborts on allocation failure + * + * DESCRIPTION: Create a simple leaf op (no children or peers, and no value + * assigned to the op) + * + ******************************************************************************/ + +ACPI_PARSE_OBJECT * +TrCreateLeafOp ( + UINT32 ParseOpcode) +{ + ACPI_PARSE_OBJECT *Op; + + + Op = TrAllocateOp (ParseOpcode); + + DbgPrint (ASL_PARSE_OUTPUT, + "\nCreateLeafOp Ln/Col %u/%u NewOp %p Op %s\n\n", + Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode)); + + return (Op); +} + + +/******************************************************************************* + * + * FUNCTION: TrCreateValuedLeafOp + * + * PARAMETERS: ParseOpcode - New opcode to be assigned to the op + * Value - Value to be assigned to the op + * + * RETURN: Pointer to the new op. Aborts on allocation failure + * + * DESCRIPTION: Create a leaf op (no children or peers) with a value + * assigned to it + * + ******************************************************************************/ + +ACPI_PARSE_OBJECT * +TrCreateValuedLeafOp ( + UINT32 ParseOpcode, + UINT64 Value) +{ + ACPI_PARSE_OBJECT *Op; + + + Op = TrAllocateOp (ParseOpcode); + Op->Asl.Value.Integer = Value; + + DbgPrint (ASL_PARSE_OUTPUT, + "\nCreateValuedLeafOp Ln/Col %u/%u NewOp %p " + "Op %s Value %8.8X%8.8X ", + Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode), + ACPI_FORMAT_UINT64 (Value)); + + switch (ParseOpcode) + { + case PARSEOP_STRING_LITERAL: + + DbgPrint (ASL_PARSE_OUTPUT, "STRING->%s", Value); + break; + + case PARSEOP_NAMESEG: + + DbgPrint (ASL_PARSE_OUTPUT, "NAMESEG->%s", Value); + break; + + case PARSEOP_NAMESTRING: + + DbgPrint (ASL_PARSE_OUTPUT, "NAMESTRING->%s", Value); + break; + + case PARSEOP_EISAID: + + DbgPrint (ASL_PARSE_OUTPUT, "EISAID->%s", Value); + break; + + case PARSEOP_METHOD: + + DbgPrint (ASL_PARSE_OUTPUT, "METHOD"); + break; + + case PARSEOP_INTEGER: + + DbgPrint (ASL_PARSE_OUTPUT, "INTEGER->%8.8X%8.8X", + ACPI_FORMAT_UINT64 (Value)); + break; + + default: + break; + } + + DbgPrint (ASL_PARSE_OUTPUT, "\n\n"); + return (Op); +} + + +/******************************************************************************* + * + * FUNCTION: TrCreateTargetOp + * + * PARAMETERS: OriginalOp - Op to be copied + * + * RETURN: Pointer to the new op. Aborts on allocation failure + * + * DESCRIPTION: Copy an existing op (and subtree). Used in ASL+ (C-style) + * expressions where the target is the same as one of the + * operands. A new op and subtree must be created from the + * original so that the parse tree can be linked properly. + * + * NOTE: This code is specific to target operands that are the last + * operand in an ASL/AML operator. Meaning that the top-level + * parse Op in a possible subtree has a NULL Next pointer. + * This simplifies the recursion. + * + * Subtree example: + * DeRefOf (Local1) += 32 + * + * This gets converted to: + * Add (DeRefOf (Local1), 32, DeRefOf (Local1)) + * + * Each DeRefOf has a single child, Local1. Even more complex + * subtrees can be created via the Index and DeRefOf operators. + * + ******************************************************************************/ + +ACPI_PARSE_OBJECT * +TrCreateTargetOp ( + ACPI_PARSE_OBJECT *OriginalOp, + ACPI_PARSE_OBJECT *ParentOp) +{ + ACPI_PARSE_OBJECT *Op; + + + if (!OriginalOp) + { + return (NULL); + } + + Op = TrGetOpFromCache (); + + /* Copy the pertinent values (omit link pointer fields) */ + + Op->Asl.Value = OriginalOp->Asl.Value; + Op->Asl.Filename = OriginalOp->Asl.Filename; + Op->Asl.LineNumber = OriginalOp->Asl.LineNumber; + Op->Asl.LogicalLineNumber = OriginalOp->Asl.LogicalLineNumber; + Op->Asl.LogicalByteOffset = OriginalOp->Asl.LogicalByteOffset; + Op->Asl.Column = OriginalOp->Asl.Column; + Op->Asl.Flags = OriginalOp->Asl.Flags; + Op->Asl.CompileFlags = OriginalOp->Asl.CompileFlags; + Op->Asl.AmlOpcode = OriginalOp->Asl.AmlOpcode; + Op->Asl.ParseOpcode = OriginalOp->Asl.ParseOpcode; + Op->Asl.Parent = ParentOp; + + UtSetParseOpName (Op); + + /* Copy a possible subtree below this op */ + + if (OriginalOp->Asl.Child) + { + Op->Asl.Child = TrCreateTargetOp (OriginalOp->Asl.Child, Op); + } + + if (OriginalOp->Asl.Next) /* Null for top-level op */ + { + Op->Asl.Next = TrCreateTargetOp (OriginalOp->Asl.Next, ParentOp); + } + + return (Op); +} + + +/******************************************************************************* + * + * FUNCTION: TrCreateAssignmentOp + * + * PARAMETERS: Target - Assignment target + * Source - Assignment source + * + * RETURN: Pointer to the new op. Aborts on allocation failure + * + * DESCRIPTION: Implements the C-style '=' operator. It changes the parse + * tree if possible to utilize the last argument of the math + * operators which is a target operand -- thus saving invocation + * of and additional Store() operator. An optimization. + * + ******************************************************************************/ + +ACPI_PARSE_OBJECT * +TrCreateAssignmentOp ( + ACPI_PARSE_OBJECT *Target, + ACPI_PARSE_OBJECT *Source) +{ + ACPI_PARSE_OBJECT *TargetOp; + ACPI_PARSE_OBJECT *SourceOp1; + ACPI_PARSE_OBJECT *SourceOp2; + ACPI_PARSE_OBJECT *Operator; + + + DbgPrint (ASL_PARSE_OUTPUT, + "\nTrCreateAssignmentOp Line [%u to %u] Source %s Target %s\n", + Source->Asl.LineNumber, Source->Asl.EndLine, + UtGetOpName (Source->Asl.ParseOpcode), + UtGetOpName (Target->Asl.ParseOpcode)); + + TrSetOpFlags (Target, OP_IS_TARGET); + + switch (Source->Asl.ParseOpcode) + { + /* + * Only these operators can be optimized because they have + * a target operand + */ + case PARSEOP_ADD: + case PARSEOP_AND: + case PARSEOP_DIVIDE: + case PARSEOP_INDEX: + case PARSEOP_MOD: + case PARSEOP_MULTIPLY: + case PARSEOP_NOT: + case PARSEOP_OR: + case PARSEOP_SHIFTLEFT: + case PARSEOP_SHIFTRIGHT: + case PARSEOP_SUBTRACT: + case PARSEOP_XOR: + + break; + + /* Otherwise, just create a normal Store operator */ + + default: + goto CannotOptimize; + } + + /* + * Transform the parse tree such that the target is moved to the + * last operand of the operator + */ + SourceOp1 = Source->Asl.Child; + SourceOp2 = SourceOp1->Asl.Next; + + /* NOT only has one operand, but has a target */ + + if (Source->Asl.ParseOpcode == PARSEOP_NOT) + { + SourceOp2 = SourceOp1; + } + + /* DIVIDE has an extra target operand (remainder) */ + + if (Source->Asl.ParseOpcode == PARSEOP_DIVIDE) + { + SourceOp2 = SourceOp2->Asl.Next; + } + + TargetOp = SourceOp2->Asl.Next; + + /* + * Can't perform this optimization if there already is a target + * for the operator (ZERO is a "no target" placeholder). + */ + if (TargetOp->Asl.ParseOpcode != PARSEOP_ZERO) + { + goto CannotOptimize; + } + + /* Link in the target as the final operand */ + + SourceOp2->Asl.Next = Target; + Target->Asl.Parent = Source; + return (Source); + + +CannotOptimize: + + Operator = TrAllocateOp (PARSEOP_STORE); + TrLinkOpChildren (Operator, 2, Source, Target); + + /* Set the appropriate line numbers for the new op */ + + Operator->Asl.LineNumber = Target->Asl.LineNumber; + Operator->Asl.LogicalLineNumber = Target->Asl.LogicalLineNumber; + Operator->Asl.LogicalByteOffset = Target->Asl.LogicalByteOffset; + Operator->Asl.Column = Target->Asl.Column; + + return (Operator); +} + + +/******************************************************************************* + * + * FUNCTION: TrCreateNullTargetOp + * + * PARAMETERS: None + * + * RETURN: Pointer to the new op. Aborts on allocation failure + * + * DESCRIPTION: Create a "null" target op. This is defined by the ACPI + * specification to be a zero AML opcode, and indicates that + * no target has been specified for the parent operation + * + ******************************************************************************/ + +ACPI_PARSE_OBJECT * +TrCreateNullTargetOp ( + void) +{ + ACPI_PARSE_OBJECT *Op; + + + Op = TrAllocateOp (PARSEOP_ZERO); + Op->Asl.CompileFlags |= (OP_IS_TARGET | OP_COMPILE_TIME_CONST); + + DbgPrint (ASL_PARSE_OUTPUT, + "\nCreateNullTargetOp Ln/Col %u/%u NewOp %p Op %s\n", + Op->Asl.LineNumber, Op->Asl.Column, Op, + UtGetOpName (Op->Asl.ParseOpcode)); + + return (Op); +} + + +/******************************************************************************* + * + * FUNCTION: TrCreateConstantLeafOp + * + * PARAMETERS: ParseOpcode - The constant opcode + * + * RETURN: Pointer to the new op. Aborts on allocation failure + * + * DESCRIPTION: Create a leaf op (no children or peers) for one of the + * special constants - __LINE__, __FILE__, and __DATE__. + * + * Note: An implemenation of __FUNC__ cannot happen here because we don't + * have a full parse tree at this time and cannot find the parent control + * method. If it is ever needed, __FUNC__ must be implemented later, after + * the parse tree has been fully constructed. + * + ******************************************************************************/ + +ACPI_PARSE_OBJECT * +TrCreateConstantLeafOp ( + UINT32 ParseOpcode) +{ + ACPI_PARSE_OBJECT *Op = NULL; + time_t CurrentTime; + char *StaticTimeString; + char *TimeString; + char *Filename; + + + switch (ParseOpcode) + { + case PARSEOP___LINE__: + + Op = TrAllocateOp (PARSEOP_INTEGER); + Op->Asl.Value.Integer = Op->Asl.LineNumber; + break; + + case PARSEOP___PATH__: + + Op = TrAllocateOp (PARSEOP_STRING_LITERAL); + + /* Op.Asl.Filename contains the full pathname to the file */ + + Op->Asl.Value.String = Op->Asl.Filename; + break; + + case PARSEOP___FILE__: + + Op = TrAllocateOp (PARSEOP_STRING_LITERAL); + + /* Get the simple filename from the full path */ + + FlSplitInputPathname (Op->Asl.Filename, NULL, &Filename); + Op->Asl.Value.String = Filename; + break; + + case PARSEOP___DATE__: + + Op = TrAllocateOp (PARSEOP_STRING_LITERAL); + + /* Get a copy of the current time */ + + CurrentTime = time (NULL); + StaticTimeString = ctime (&CurrentTime); + TimeString = UtLocalCalloc (strlen (StaticTimeString) + 1); + strcpy (TimeString, StaticTimeString); + + TimeString[strlen(TimeString) -1] = 0; /* Remove trailing newline */ + Op->Asl.Value.String = TimeString; + break; + + default: /* This would be an internal error */ + + return (NULL); + } + + DbgPrint (ASL_PARSE_OUTPUT, + "\nCreateConstantLeafOp Ln/Col %u/%u NewOp %p " + "Op %s Value %8.8X%8.8X \n", + Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode), + ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer)); + + return (Op); +} + + +/******************************************************************************* + * + * FUNCTION: TrAllocateOp + * + * PARAMETERS: ParseOpcode - Opcode to be assigned to the op + * + * RETURN: New parse op. Aborts on allocation failure + * + * DESCRIPTION: Allocate and initialize a new parse op for the parse tree + * + ******************************************************************************/ + +ACPI_PARSE_OBJECT * +TrAllocateOp ( + UINT32 ParseOpcode) +{ + ACPI_PARSE_OBJECT *Op; + ACPI_PARSE_OBJECT *LatestOp; + + + Op = TrGetOpFromCache (); + + Op->Asl.ParseOpcode = (UINT16) ParseOpcode; + Op->Asl.Filename = Gbl_Files[ASL_FILE_INPUT].Filename; + Op->Asl.LineNumber = Gbl_CurrentLineNumber; + Op->Asl.LogicalLineNumber = Gbl_LogicalLineNumber; + Op->Asl.LogicalByteOffset = Gbl_CurrentLineOffset; + Op->Asl.Column = Gbl_CurrentColumn; + + UtSetParseOpName (Op); + + /* The following is for capturing comments */ + + if(Gbl_CaptureComments) + { + LatestOp = Gbl_CommentState.LatestParseOp; + Op->Asl.InlineComment = NULL; + Op->Asl.EndNodeComment = NULL; + Op->Asl.CommentList = NULL; + Op->Asl.FileChanged = FALSE; + + /* + * Check to see if the file name has changed before resetting the + * latest parse op. + */ + if (LatestOp && + (ParseOpcode != PARSEOP_INCLUDE) && + (ParseOpcode != PARSEOP_INCLUDE_END) && + strcmp (LatestOp->Asl.Filename, Op->Asl.Filename)) + { + CvDbgPrint ("latest op: %s\n", LatestOp->Asl.ParseOpName); + Op->Asl.FileChanged = TRUE; + if (Gbl_IncludeFileStack) + { + Op->Asl.ParentFilename = Gbl_IncludeFileStack->Filename; + } + else + { + Op->Asl.ParentFilename = NULL; + } + } + + Gbl_CommentState.LatestParseOp = Op; + CvDbgPrint ("TrAllocateOp=Set latest parse op to this op.\n"); + CvDbgPrint (" Op->Asl.ParseOpName = %s\n", + Gbl_CommentState.LatestParseOp->Asl.ParseOpName); + CvDbgPrint (" Op->Asl.ParseOpcode = 0x%x\n", ParseOpcode); + + if (Op->Asl.FileChanged) + { + CvDbgPrint(" file has been changed!\n"); + } + + /* + * if this parse op's syntax uses () and {} (i.e. Package(1){0x00}) then + * set a flag in the comment state. This facilitates paring comments for + * these types of opcodes. + */ + if ((CvParseOpBlockType(Op) == (BLOCK_PAREN | BLOCK_BRACE)) && + (ParseOpcode != PARSEOP_DEFINITION_BLOCK)) + { + CvDbgPrint ("Parsing paren/Brace op now!\n"); + Gbl_CommentState.ParsingParenBraceNode = Op; + } + + if (Gbl_CommentListHead) + { + CvDbgPrint ("Transferring...\n"); + Op->Asl.CommentList = Gbl_CommentListHead; + Gbl_CommentListHead = NULL; + Gbl_CommentListTail = NULL; + CvDbgPrint (" Transferred current comment list to this op.\n"); + CvDbgPrint (" %s\n", Op->Asl.CommentList->Comment); + } + + if (Gbl_InlineCommentBuffer) + { + Op->Asl.InlineComment = Gbl_InlineCommentBuffer; + Gbl_InlineCommentBuffer = NULL; + CvDbgPrint ("Transferred current inline comment list to this op.\n"); + } + } + + return (Op); +} + + +/******************************************************************************* + * + * FUNCTION: TrGetOpFromCache + * + * PARAMETERS: None + * + * RETURN: New parse op. Aborts on allocation failure + * + * DESCRIPTION: Allocate a new parse op for the parse tree. Bypass the local + * dynamic memory manager for performance reasons (This has a + * major impact on the speed of the compiler.) + * + ******************************************************************************/ + +static ACPI_PARSE_OBJECT * +TrGetOpFromCache ( + void) +{ + ASL_CACHE_INFO *Cache; + + + if (Gbl_ParseOpCacheNext >= Gbl_ParseOpCacheLast) + { + /* Allocate a new buffer */ + + Cache = UtLocalCalloc (sizeof (Cache->Next) + + (sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE)); + + /* Link new cache buffer to head of list */ + + Cache->Next = Gbl_ParseOpCacheList; + Gbl_ParseOpCacheList = Cache; + + /* Setup cache management pointers */ + + Gbl_ParseOpCacheNext = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Cache->Buffer); + Gbl_ParseOpCacheLast = Gbl_ParseOpCacheNext + ASL_PARSEOP_CACHE_SIZE; + } + + Gbl_ParseOpCount++; + return (Gbl_ParseOpCacheNext++); +} + + +/******************************************************************************* + * + * FUNCTION: TrPrintOpFlags + * + * PARAMETERS: Flags - Flags word to be decoded + * OutputLevel - Debug output level: ASL_TREE_OUTPUT etc. + * + * RETURN: None + * + * DESCRIPTION: Decode a flags word to text. Displays all flags that are set. + * + ******************************************************************************/ + +void +TrPrintOpFlags ( + UINT32 Flags, + UINT32 OutputLevel) +{ + UINT32 FlagBit = 1; + UINT32 i; + + + for (i = 0; i < ACPI_NUM_OP_FLAGS; i++) + { + if (Flags & FlagBit) + { + DbgPrint (OutputLevel, " %s", Gbl_OpFlagNames[i]); + } + + FlagBit <<= 1; + } +} diff --git a/source/compiler/aslpld.c b/source/compiler/aslpld.c index e7964bdbb5bb..862eef03cf02 100644 --- a/source/compiler/aslpld.c +++ b/source/compiler/aslpld.c @@ -682,12 +682,12 @@ OpcDoPld ( /* Disable further optimization */ - Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST; + Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST; UtSetParseOpName (Op); /* Child node is the buffer length */ - NewOp = TrAllocateNode (PARSEOP_INTEGER); + NewOp = TrAllocateOp (PARSEOP_INTEGER); NewOp->Asl.AmlOpcode = AML_BYTE_OP; NewOp->Asl.Value.Integer = 20; @@ -698,7 +698,7 @@ OpcDoPld ( /* Peer to the child is the raw buffer data */ - NewOp = TrAllocateNode (PARSEOP_RAW_DATA); + NewOp = TrAllocateOp (PARSEOP_RAW_DATA); NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; NewOp->Asl.AmlLength = 20; NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer); diff --git a/source/compiler/aslpredef.c b/source/compiler/aslpredef.c index 2ba9b4f63f20..095f1d4fc92e 100644 --- a/source/compiler/aslpredef.c +++ b/source/compiler/aslpredef.c @@ -666,7 +666,7 @@ ApCheckForSpecialName ( { /* Ignore if actually emitted by the compiler */ - if (Op->Asl.CompileFlags & NODE_COMPILER_EMITTED) + if (Op->Asl.CompileFlags & OP_COMPILER_EMITTED) { return (ACPI_NOT_RESERVED_NAME); } diff --git a/source/compiler/aslprimaries.y b/source/compiler/aslprimaries.y index 3d0fa48c9e7d..3c8ced1ef69d 100644 --- a/source/compiler/aslprimaries.y +++ b/source/compiler/aslprimaries.y @@ -166,7 +166,7 @@ AccessAsTerm PARSEOP_OPEN_PAREN AccessTypeKeyword OptionalAccessAttribTerm - PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrCreateOp (PARSEOP_ACCESSAS,2,$3,$4);} | PARSEOP_ACCESSAS PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -174,10 +174,10 @@ AccessAsTerm AcquireTerm : PARSEOP_ACQUIRE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp(PARSEOP_ACQUIRE);} SuperName ',' WordConstExpr - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$6);} | PARSEOP_ACQUIRE PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -185,11 +185,11 @@ AcquireTerm AddTerm : PARSEOP_ADD - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_ADD);} TermArg TermArgItem Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);} | PARSEOP_ADD PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -197,11 +197,11 @@ AddTerm AliasTerm : PARSEOP_ALIAS - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_ALIAS);} NameString NameStringItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4, - TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4, + TrSetOpFlags ($5, OP_IS_NAME_DECLARATION));} | PARSEOP_ALIAS PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -209,29 +209,29 @@ AliasTerm AndTerm : PARSEOP_AND - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_AND);} TermArg TermArgItem Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);} | PARSEOP_AND PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ArgTerm - : PARSEOP_ARG0 {$$ = TrCreateLeafNode (PARSEOP_ARG0);} - | PARSEOP_ARG1 {$$ = TrCreateLeafNode (PARSEOP_ARG1);} - | PARSEOP_ARG2 {$$ = TrCreateLeafNode (PARSEOP_ARG2);} - | PARSEOP_ARG3 {$$ = TrCreateLeafNode (PARSEOP_ARG3);} - | PARSEOP_ARG4 {$$ = TrCreateLeafNode (PARSEOP_ARG4);} - | PARSEOP_ARG5 {$$ = TrCreateLeafNode (PARSEOP_ARG5);} - | PARSEOP_ARG6 {$$ = TrCreateLeafNode (PARSEOP_ARG6);} + : PARSEOP_ARG0 {$$ = TrCreateLeafOp (PARSEOP_ARG0);} + | PARSEOP_ARG1 {$$ = TrCreateLeafOp (PARSEOP_ARG1);} + | PARSEOP_ARG2 {$$ = TrCreateLeafOp (PARSEOP_ARG2);} + | PARSEOP_ARG3 {$$ = TrCreateLeafOp (PARSEOP_ARG3);} + | PARSEOP_ARG4 {$$ = TrCreateLeafOp (PARSEOP_ARG4);} + | PARSEOP_ARG5 {$$ = TrCreateLeafOp (PARSEOP_ARG5);} + | PARSEOP_ARG6 {$$ = TrCreateLeafOp (PARSEOP_ARG6);} ; BankFieldTerm : PARSEOP_BANKFIELD - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_BANKFIELD);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_BANKFIELD);} NameString NameStringItem TermArgItem @@ -239,7 +239,7 @@ BankFieldTerm ',' LockRuleKeyword ',' UpdateRuleKeyword PARSEOP_CLOSE_PAREN '{' - FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,7, + FieldUnitList '}' {$$ = TrLinkOpChildren ($<n>3,7, $4,$5,$6,$8,$10,$12,$15);} | PARSEOP_BANKFIELD PARSEOP_OPEN_PAREN @@ -248,17 +248,17 @@ BankFieldTerm ; BreakTerm - : PARSEOP_BREAK {$$ = TrCreateNode (PARSEOP_BREAK, 0);} + : PARSEOP_BREAK {$$ = TrCreateOp (PARSEOP_BREAK, 0);} ; BreakPointTerm - : PARSEOP_BREAKPOINT {$$ = TrCreateNode (PARSEOP_BREAKPOINT, 0);} + : PARSEOP_BREAKPOINT {$$ = TrCreateOp (PARSEOP_BREAKPOINT, 0);} ; BufferTerm - : PARSEOP_BUFFER {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER); COMMENT_CAPTURE_OFF; } + : PARSEOP_BUFFER {$<n>$ = TrCreateLeafOp (PARSEOP_BUFFER); COMMENT_CAPTURE_OFF; } OptionalDataCount - '{' BufferTermData '}' {$$ = TrLinkChildren ($<n>2,2,$3,$5); COMMENT_CAPTURE_ON;} + '{' BufferTermData '}' {$$ = TrLinkOpChildren ($<n>2,2,$3,$5); COMMENT_CAPTURE_ON;} ; BufferTermData @@ -268,10 +268,10 @@ BufferTermData CaseTerm : PARSEOP_CASE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CASE);} DataObject PARSEOP_CLOSE_PAREN '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + TermList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);} | PARSEOP_CASE PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -279,11 +279,11 @@ CaseTerm ConcatTerm : PARSEOP_CONCATENATE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CONCATENATE);} TermArg TermArgItem Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);} | PARSEOP_CONCATENATE PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -291,12 +291,12 @@ ConcatTerm ConcatResTerm : PARSEOP_CONCATENATERESTEMPLATE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode ( + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp ( PARSEOP_CONCATENATERESTEMPLATE);} TermArg TermArgItem Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);} | PARSEOP_CONCATENATERESTEMPLATE PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -304,10 +304,10 @@ ConcatResTerm CondRefOfTerm : PARSEOP_CONDREFOF - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CONDREFOF);} CondRefOfSource Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_CONDREFOF PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -317,15 +317,15 @@ ConnectionTerm : PARSEOP_CONNECTION PARSEOP_OPEN_PAREN NameString - PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_CONNECTION,1,$3);} + PARSEOP_CLOSE_PAREN {$$ = TrCreateOp (PARSEOP_CONNECTION,1,$3);} | PARSEOP_CONNECTION - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CONNECTION);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CONNECTION);} ResourceMacroTerm - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3, 1, - TrLinkChildren ( - TrCreateLeafNode (PARSEOP_RESOURCETEMPLATE), 3, - TrCreateLeafNode (PARSEOP_DEFAULT_ARG), - TrCreateLeafNode (PARSEOP_DEFAULT_ARG), + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3, 1, + TrLinkOpChildren ( + TrCreateLeafOp (PARSEOP_RESOURCETEMPLATE), 3, + TrCreateLeafOp (PARSEOP_DEFAULT_ARG), + TrCreateLeafOp (PARSEOP_DEFAULT_ARG), $4));} | PARSEOP_CONNECTION PARSEOP_OPEN_PAREN @@ -333,16 +333,16 @@ ConnectionTerm ; ContinueTerm - : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);} + : PARSEOP_CONTINUE {$$ = TrCreateOp (PARSEOP_CONTINUE, 0);} ; CopyObjectTerm : PARSEOP_COPYOBJECT - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_COPYOBJECT);} TermArg ',' SimpleName - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4, - TrSetNodeFlags ($6, NODE_IS_TARGET));} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4, + TrSetOpFlags ($6, OP_IS_TARGET));} | PARSEOP_COPYOBJECT PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -350,12 +350,12 @@ CopyObjectTerm CreateBitFieldTerm : PARSEOP_CREATEBITFIELD - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CREATEBITFIELD);} TermArg TermArgItem NameStringItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5, - TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5, + TrSetOpFlags ($6, OP_IS_NAME_DECLARATION));} | PARSEOP_CREATEBITFIELD PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -363,12 +363,12 @@ CreateBitFieldTerm CreateByteFieldTerm : PARSEOP_CREATEBYTEFIELD - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBYTEFIELD);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CREATEBYTEFIELD);} TermArg TermArgItem NameStringItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5, - TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5, + TrSetOpFlags ($6, OP_IS_NAME_DECLARATION));} | PARSEOP_CREATEBYTEFIELD PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -376,12 +376,12 @@ CreateByteFieldTerm CreateDWordFieldTerm : PARSEOP_CREATEDWORDFIELD - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEDWORDFIELD);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CREATEDWORDFIELD);} TermArg TermArgItem NameStringItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5, - TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5, + TrSetOpFlags ($6, OP_IS_NAME_DECLARATION));} | PARSEOP_CREATEDWORDFIELD PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -389,13 +389,13 @@ CreateDWordFieldTerm CreateFieldTerm : PARSEOP_CREATEFIELD - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEFIELD);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CREATEFIELD);} TermArg TermArgItem TermArgItem NameStringItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6, - TrSetNodeFlags ($7, NODE_IS_NAME_DECLARATION));} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4,$4,$5,$6, + TrSetOpFlags ($7, OP_IS_NAME_DECLARATION));} | PARSEOP_CREATEFIELD PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -403,12 +403,12 @@ CreateFieldTerm CreateQWordFieldTerm : PARSEOP_CREATEQWORDFIELD - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEQWORDFIELD);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CREATEQWORDFIELD);} TermArg TermArgItem NameStringItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5, - TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5, + TrSetOpFlags ($6, OP_IS_NAME_DECLARATION));} | PARSEOP_CREATEQWORDFIELD PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -416,12 +416,12 @@ CreateQWordFieldTerm CreateWordFieldTerm : PARSEOP_CREATEWORDFIELD - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEWORDFIELD);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CREATEWORDFIELD);} TermArg TermArgItem NameStringItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5, - TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5, + TrSetOpFlags ($6, OP_IS_NAME_DECLARATION));} | PARSEOP_CREATEWORDFIELD PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -429,44 +429,44 @@ CreateWordFieldTerm DataRegionTerm : PARSEOP_DATATABLEREGION - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DATATABLEREGION);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DATATABLEREGION);} NameString TermArgItem TermArgItem TermArgItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4, - TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$6,$7);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4, + TrSetOpFlags ($4, OP_IS_NAME_DECLARATION),$5,$6,$7);} | PARSEOP_DATATABLEREGION PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; DebugTerm - : PARSEOP_DEBUG {$$ = TrCreateLeafNode (PARSEOP_DEBUG);} + : PARSEOP_DEBUG {$$ = TrCreateLeafOp (PARSEOP_DEBUG);} ; DecTerm : PARSEOP_DECREMENT - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DECREMENT);} SuperName - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);} | PARSEOP_DECREMENT PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; DefaultTerm - : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFAULT);} - TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} + : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafOp (PARSEOP_DEFAULT);} + TermList '}' {$$ = TrLinkOpChildren ($<n>3,1,$4);} | PARSEOP_DEFAULT '{' error '}' {$$ = AslDoError(); yyclearin;} ; DerefOfTerm : PARSEOP_DEREFOF - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DEREFOF);} DerefOfSource - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);} | PARSEOP_DEREFOF PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -474,11 +474,11 @@ DerefOfTerm DeviceTerm : PARSEOP_DEVICE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DEVICE);} NameString PARSEOP_CLOSE_PAREN '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,2, - TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} + TermList '}' {$$ = TrLinkOpChildren ($<n>3,2, + TrSetOpFlags ($4, OP_IS_NAME_DECLARATION),$7);} | PARSEOP_DEVICE PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -486,12 +486,12 @@ DeviceTerm DivideTerm : PARSEOP_DIVIDE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DIVIDE);} TermArg TermArgItem Target Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4,$4,$5,$6,$7);} | PARSEOP_DIVIDE PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -501,21 +501,21 @@ EISAIDTerm : PARSEOP_EISAID PARSEOP_OPEN_PAREN StringData - PARSEOP_CLOSE_PAREN {$$ = TrUpdateNode (PARSEOP_EISAID, $3);} + PARSEOP_CLOSE_PAREN {$$ = TrSetOpIntegerValue (PARSEOP_EISAID, $3);} | PARSEOP_EISAID PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ElseIfTerm - : IfTerm ElseTerm {$$ = TrLinkPeerNode ($1,$2);} + : IfTerm ElseTerm {$$ = TrLinkPeerOp ($1,$2);} ; ElseTerm : {$$ = NULL;} | PARSEOP_ELSE '{' - TermList {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} - '}' {$$ = TrLinkChildren ($<n>4,1,$3);} + TermList {$<n>$ = TrCreateLeafOp (PARSEOP_ELSE);} + '}' {$$ = TrLinkOpChildren ($<n>4,1,$3);} | PARSEOP_ELSE '{' error '}' {$$ = AslDoError(); yyclearin;} @@ -524,12 +524,12 @@ ElseTerm error {$$ = AslDoError(); yyclearin;} | PARSEOP_ELSEIF - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} - TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_ELSE);} + TermArg {$<n>$ = TrCreateLeafOp (PARSEOP_IF);} PARSEOP_CLOSE_PAREN '{' - TermList '}' {TrLinkChildren ($<n>5,2,$4,$8);} - ElseTerm {TrLinkPeerNode ($<n>5,$11);} - {$$ = TrLinkChildren ($<n>3,1,$<n>5);} + TermList '}' {TrLinkOpChildren ($<n>5,2,$4,$8);} + ElseTerm {TrLinkPeerOp ($<n>5,$11);} + {$$ = TrLinkOpChildren ($<n>3,1,$<n>5);} | PARSEOP_ELSEIF PARSEOP_OPEN_PAREN @@ -541,10 +541,10 @@ ElseTerm EventTerm : PARSEOP_EVENT - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EVENT);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_EVENT);} NameString - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1, - TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION));} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1, + TrSetOpFlags ($4, OP_IS_NAME_DECLARATION));} | PARSEOP_EVENT PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -557,7 +557,7 @@ ExternalTerm OptionalObjectTypeKeyword OptionalParameterTypePackage OptionalParameterTypesPackage - PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);} + PARSEOP_CLOSE_PAREN {$$ = TrCreateOp (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);} | PARSEOP_EXTERNAL PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -565,11 +565,11 @@ ExternalTerm FatalTerm : PARSEOP_FATAL - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FATAL);} ByteConstExpr ',' DWordConstExpr TermArgItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$6,$7);} | PARSEOP_FATAL PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -577,13 +577,13 @@ FatalTerm FieldTerm : PARSEOP_FIELD - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FIELD);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FIELD);} NameString ',' AccessTypeKeyword ',' LockRuleKeyword ',' UpdateRuleKeyword PARSEOP_CLOSE_PAREN '{' - FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$8,$10,$13);} + FieldUnitList '}' {$$ = TrLinkOpChildren ($<n>3,5,$4,$6,$8,$10,$13);} | PARSEOP_FIELD PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN @@ -592,10 +592,10 @@ FieldTerm FindSetLeftBitTerm : PARSEOP_FINDSETLEFTBIT - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FINDSETLEFTBIT);} TermArg Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_FINDSETLEFTBIT PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -603,10 +603,10 @@ FindSetLeftBitTerm FindSetRightBitTerm : PARSEOP_FINDSETRIGHTBIT - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FINDSETRIGHTBIT);} TermArg Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_FINDSETRIGHTBIT PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -615,29 +615,29 @@ FindSetRightBitTerm /* Convert a For() loop to a While() loop */ ForTerm : PARSEOP_FOR - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_WHILE);} OptionalTermArg ',' {} OptionalPredicate ',' - OptionalTermArg {$<n>$ = TrLinkPeerNode ($4,$<n>3); - TrSetParent ($9,$<n>3);} /* New parent is WHILE */ + OptionalTermArg {$<n>$ = TrLinkPeerOp ($4,$<n>3); + TrSetOpParent ($9,$<n>3);} /* New parent is WHILE */ PARSEOP_CLOSE_PAREN - '{' TermList '}' {$<n>$ = TrLinkChildren ($<n>3,2,$7,$13);} - {$<n>$ = TrLinkPeerNode ($13,$9); + '{' TermList '}' {$<n>$ = TrLinkOpChildren ($<n>3,2,$7,$13);} + {$<n>$ = TrLinkPeerOp ($13,$9); $$ = $<n>10;} ; OptionalPredicate - : {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, 1);} + : {$$ = TrCreateValuedLeafOp (PARSEOP_INTEGER, 1);} | TermArg {$$ = $1;} ; FprintfTerm : PARSEOP_FPRINTF - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FPRINTF);} TermArg ',' StringData PrintfArgList - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$6,$7);} | PARSEOP_FPRINTF PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -645,10 +645,10 @@ FprintfTerm FromBCDTerm : PARSEOP_FROMBCD - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FROMBCD);} TermArg Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_FROMBCD PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -656,16 +656,16 @@ FromBCDTerm FunctionTerm : PARSEOP_FUNCTION - PARSEOP_OPEN_PAREN {COMMENT_CAPTURE_OFF; $<n>$ = TrCreateLeafNode (PARSEOP_METHOD); } + PARSEOP_OPEN_PAREN {COMMENT_CAPTURE_OFF; $<n>$ = TrCreateLeafOp (PARSEOP_METHOD); } NameString OptionalParameterTypePackage OptionalParameterTypesPackage PARSEOP_CLOSE_PAREN '{' {COMMENT_CAPTURE_ON; } - TermList '}' {$$ = TrLinkChildren ($<n>3,7, - TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION), - TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0), - TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL), - TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0),$5,$6,$10);} + TermList '}' {$$ = TrLinkOpChildren ($<n>3,7, + TrSetOpFlags ($4, OP_IS_NAME_DECLARATION), + TrCreateValuedLeafOp (PARSEOP_BYTECONST, 0), + TrCreateLeafOp (PARSEOP_SERIALIZERULE_NOTSERIAL), + TrCreateValuedLeafOp (PARSEOP_BYTECONST, 0),$5,$6,$10);} | PARSEOP_FUNCTION PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -673,10 +673,10 @@ FunctionTerm IfTerm : PARSEOP_IF - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_IF);} TermArg PARSEOP_CLOSE_PAREN '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + TermList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);} | PARSEOP_IF PARSEOP_OPEN_PAREN @@ -687,20 +687,20 @@ IncludeTerm : PARSEOP_INCLUDE PARSEOP_OPEN_PAREN String - PARSEOP_CLOSE_PAREN {$$ = TrUpdateNode (PARSEOP_INCLUDE, $3); + PARSEOP_CLOSE_PAREN {$$ = TrSetOpIntegerValue (PARSEOP_INCLUDE, $3); FlOpenIncludeFile ($3);} ; IncludeEndTerm - : PARSEOP_INCLUDE_END {$<n>$ = TrCreateLeafNode (PARSEOP_INCLUDE_END); - TrSetCurrentFilename ($$);} + : PARSEOP_INCLUDE_END {$<n>$ = TrCreateLeafOp (PARSEOP_INCLUDE_END); + TrSetOpCurrentFilename ($$);} ; IncTerm : PARSEOP_INCREMENT - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_INCREMENT);} SuperName - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);} | PARSEOP_INCREMENT PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -708,14 +708,14 @@ IncTerm IndexFieldTerm : PARSEOP_INDEXFIELD - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_INDEXFIELD);} NameString NameStringItem ',' AccessTypeKeyword ',' LockRuleKeyword ',' UpdateRuleKeyword PARSEOP_CLOSE_PAREN '{' - FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$7,$9,$11,$14);} + FieldUnitList '}' {$$ = TrLinkOpChildren ($<n>3,6,$4,$5,$7,$9,$11,$14);} | PARSEOP_INDEXFIELD PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN @@ -724,11 +724,11 @@ IndexFieldTerm IndexTerm : PARSEOP_INDEX - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_INDEX);} TermArg TermArgItem Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);} | PARSEOP_INDEX PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -736,10 +736,10 @@ IndexTerm LAndTerm : PARSEOP_LAND - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LAND);} TermArg TermArgItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_LAND PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -747,10 +747,10 @@ LAndTerm LEqualTerm : PARSEOP_LEQUAL - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LEQUAL);} TermArg TermArgItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_LEQUAL PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -758,11 +758,11 @@ LEqualTerm LGreaterEqualTerm : PARSEOP_LGREATEREQUAL - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LLESS);} TermArg TermArgItem - PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_LNOT, 1, - TrLinkChildren ($<n>3,2,$4,$5));} + PARSEOP_CLOSE_PAREN {$$ = TrCreateOp (PARSEOP_LNOT, 1, + TrLinkOpChildren ($<n>3,2,$4,$5));} | PARSEOP_LGREATEREQUAL PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -770,10 +770,10 @@ LGreaterEqualTerm LGreaterTerm : PARSEOP_LGREATER - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LGREATER);} TermArg TermArgItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_LGREATER PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -781,11 +781,11 @@ LGreaterTerm LLessEqualTerm : PARSEOP_LLESSEQUAL - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LGREATER);} TermArg TermArgItem - PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_LNOT, 1, - TrLinkChildren ($<n>3,2,$4,$5));} + PARSEOP_CLOSE_PAREN {$$ = TrCreateOp (PARSEOP_LNOT, 1, + TrLinkOpChildren ($<n>3,2,$4,$5));} | PARSEOP_LLESSEQUAL PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -793,10 +793,10 @@ LLessEqualTerm LLessTerm : PARSEOP_LLESS - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LLESS);} TermArg TermArgItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_LLESS PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -804,11 +804,11 @@ LLessTerm LNotEqualTerm : PARSEOP_LNOTEQUAL - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LEQUAL);} TermArg TermArgItem - PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_LNOT, 1, - TrLinkChildren ($<n>3,2,$4,$5));} + PARSEOP_CLOSE_PAREN {$$ = TrCreateOp (PARSEOP_LNOT, 1, + TrLinkOpChildren ($<n>3,2,$4,$5));} | PARSEOP_LNOTEQUAL PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -816,9 +816,9 @@ LNotEqualTerm LNotTerm : PARSEOP_LNOT - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LNOT);} TermArg - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);} | PARSEOP_LNOT PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -826,14 +826,14 @@ LNotTerm LoadTableTerm : PARSEOP_LOADTABLE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LOADTABLE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LOADTABLE);} TermArg TermArgItem TermArgItem OptionalListString OptionalListString OptionalReference - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$5,$6,$7,$8,$9);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,6,$4,$5,$6,$7,$8,$9);} | PARSEOP_LOADTABLE PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -841,32 +841,32 @@ LoadTableTerm LoadTerm : PARSEOP_LOAD - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LOAD);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LOAD);} NameString RequiredTarget - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_LOAD PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; LocalTerm - : PARSEOP_LOCAL0 {$$ = TrCreateLeafNode (PARSEOP_LOCAL0);} - | PARSEOP_LOCAL1 {$$ = TrCreateLeafNode (PARSEOP_LOCAL1);} - | PARSEOP_LOCAL2 {$$ = TrCreateLeafNode (PARSEOP_LOCAL2);} - | PARSEOP_LOCAL3 {$$ = TrCreateLeafNode (PARSEOP_LOCAL3);} - | PARSEOP_LOCAL4 {$$ = TrCreateLeafNode (PARSEOP_LOCAL4);} - | PARSEOP_LOCAL5 {$$ = TrCreateLeafNode (PARSEOP_LOCAL5);} - | PARSEOP_LOCAL6 {$$ = TrCreateLeafNode (PARSEOP_LOCAL6);} - | PARSEOP_LOCAL7 {$$ = TrCreateLeafNode (PARSEOP_LOCAL7);} + : PARSEOP_LOCAL0 {$$ = TrCreateLeafOp (PARSEOP_LOCAL0);} + | PARSEOP_LOCAL1 {$$ = TrCreateLeafOp (PARSEOP_LOCAL1);} + | PARSEOP_LOCAL2 {$$ = TrCreateLeafOp (PARSEOP_LOCAL2);} + | PARSEOP_LOCAL3 {$$ = TrCreateLeafOp (PARSEOP_LOCAL3);} + | PARSEOP_LOCAL4 {$$ = TrCreateLeafOp (PARSEOP_LOCAL4);} + | PARSEOP_LOCAL5 {$$ = TrCreateLeafOp (PARSEOP_LOCAL5);} + | PARSEOP_LOCAL6 {$$ = TrCreateLeafOp (PARSEOP_LOCAL6);} + | PARSEOP_LOCAL7 {$$ = TrCreateLeafOp (PARSEOP_LOCAL7);} ; LOrTerm : PARSEOP_LOR - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LOR);} TermArg TermArgItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_LOR PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -874,14 +874,14 @@ LOrTerm MatchTerm : PARSEOP_MATCH - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MATCH);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MATCH);} TermArg ',' MatchOpKeyword TermArgItem ',' MatchOpKeyword TermArgItem TermArgItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);} | PARSEOP_MATCH PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -889,7 +889,7 @@ MatchTerm MethodTerm : PARSEOP_METHOD - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD); COMMENT_CAPTURE_OFF;} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_METHOD); COMMENT_CAPTURE_OFF;} NameString OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} OptionalSerializeRuleKeyword @@ -897,8 +897,8 @@ MethodTerm OptionalParameterTypePackage OptionalParameterTypesPackage PARSEOP_CLOSE_PAREN '{' {COMMENT_CAPTURE_ON;} - TermList '}' {$$ = TrLinkChildren ($<n>3,7, - TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION), + TermList '}' {$$ = TrLinkOpChildren ($<n>3,7, + TrSetOpFlags ($4, OP_IS_NAME_DECLARATION), $5,$7,$8,$9,$10,$14);} | PARSEOP_METHOD PARSEOP_OPEN_PAREN @@ -907,12 +907,12 @@ MethodTerm MidTerm : PARSEOP_MID - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MID);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MID);} TermArg TermArgItem TermArgItem Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4,$4,$5,$6,$7);} | PARSEOP_MID PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -920,11 +920,11 @@ MidTerm ModTerm : PARSEOP_MOD - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MOD);} TermArg TermArgItem Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);} | PARSEOP_MOD PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -932,11 +932,11 @@ ModTerm MultiplyTerm : PARSEOP_MULTIPLY - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MULTIPLY);} TermArg TermArgItem Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);} | PARSEOP_MULTIPLY PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -944,11 +944,11 @@ MultiplyTerm MutexTerm : PARSEOP_MUTEX - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MUTEX);} NameString ',' ByteConstExpr - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2, - TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2, + TrSetOpFlags ($4, OP_IS_NAME_DECLARATION),$6);} | PARSEOP_MUTEX PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -956,11 +956,11 @@ MutexTerm NameTerm : PARSEOP_NAME - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_NAME);} NameString ',' DataObject - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2, - TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2, + TrSetOpFlags ($4, OP_IS_NAME_DECLARATION),$6);} | PARSEOP_NAME PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -968,27 +968,27 @@ NameTerm NAndTerm : PARSEOP_NAND - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_NAND);} TermArg TermArgItem Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);} | PARSEOP_NAND PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; NoOpTerm - : PARSEOP_NOOP {$$ = TrCreateNode (PARSEOP_NOOP, 0);} + : PARSEOP_NOOP {$$ = TrCreateOp (PARSEOP_NOOP, 0);} ; NOrTerm : PARSEOP_NOR - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_NOR);} TermArg TermArgItem Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);} | PARSEOP_NOR PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -996,10 +996,10 @@ NOrTerm NotifyTerm : PARSEOP_NOTIFY - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_NOTIFY);} SuperName TermArgItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_NOTIFY PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1007,10 +1007,10 @@ NotifyTerm NotTerm : PARSEOP_NOT - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_NOT);} TermArg Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_NOT PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1018,9 +1018,9 @@ NotTerm ObjectTypeTerm : PARSEOP_OBJECTTYPE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE);} ObjectTypeSource - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);} | PARSEOP_OBJECTTYPE PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1030,7 +1030,7 @@ OffsetTerm : PARSEOP_OFFSET PARSEOP_OPEN_PAREN AmlPackageLengthTerm - PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);} + PARSEOP_CLOSE_PAREN {$$ = TrCreateOp (PARSEOP_OFFSET,1,$3);} | PARSEOP_OFFSET PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1038,13 +1038,13 @@ OffsetTerm OpRegionTerm : PARSEOP_OPERATIONREGION - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_OPERATIONREGION);} NameString ',' OpRegionSpaceIdTerm TermArgItem TermArgItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4, - TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION), + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4, + TrSetOpFlags ($4, OP_IS_NAME_DECLARATION), $6,$7,$8);} | PARSEOP_OPERATIONREGION PARSEOP_OPEN_PAREN @@ -1058,30 +1058,30 @@ OpRegionSpaceIdTerm OrTerm : PARSEOP_OR - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_OR);} TermArg TermArgItem Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);} | PARSEOP_OR PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; PackageTerm - : PARSEOP_PACKAGE {$<n>$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} + : PARSEOP_PACKAGE {$<n>$ = TrCreateLeafOp (PARSEOP_VAR_PACKAGE);} OptionalDataCount - '{' PackageList '}' {$$ = TrLinkChildren ($<n>2,2,$3,$5);} + '{' PackageList '}' {$$ = TrLinkOpChildren ($<n>2,2,$3,$5);} PowerResTerm : PARSEOP_POWERRESOURCE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_POWERRESOURCE);} NameString ',' ByteConstExpr ',' WordConstExpr PARSEOP_CLOSE_PAREN '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,4, - TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION), + TermList '}' {$$ = TrLinkOpChildren ($<n>3,4, + TrSetOpFlags ($4, OP_IS_NAME_DECLARATION), $6,$8,$11);} | PARSEOP_POWERRESOURCE PARSEOP_OPEN_PAREN @@ -1090,10 +1090,10 @@ PowerResTerm PrintfTerm : PARSEOP_PRINTF - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PRINTF);} StringData PrintfArgList - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_PRINTF PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1103,19 +1103,19 @@ PrintfArgList : {$$ = NULL;} | TermArg {$$ = $1;} | PrintfArgList ',' - TermArg {$$ = TrLinkPeerNode ($1, $3);} + TermArg {$$ = TrLinkPeerOp ($1, $3);} ; ProcessorTerm : PARSEOP_PROCESSOR - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PROCESSOR);} NameString ',' ByteConstExpr OptionalDWordConstExpr OptionalByteConstExpr PARSEOP_CLOSE_PAREN '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,5, - TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION), + TermList '}' {$$ = TrLinkOpChildren ($<n>3,5, + TrSetOpFlags ($4, OP_IS_NAME_DECLARATION), $6,$7,$8,$11);} | PARSEOP_PROCESSOR PARSEOP_OPEN_PAREN @@ -1124,10 +1124,10 @@ ProcessorTerm RawDataBufferTerm : PARSEOP_DATABUFFER - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DATABUFFER);} OptionalWordConst PARSEOP_CLOSE_PAREN '{' - ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + ByteList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);} | PARSEOP_DATABUFFER PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1139,10 +1139,10 @@ RawDataBufferTerm */ RefOfTerm : PARSEOP_REFOF - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_REFOF);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_REFOF);} RefOfSource - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1, - TrSetNodeFlags ($4, NODE_IS_TARGET));} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1, + TrSetOpFlags ($4, OP_IS_TARGET));} | PARSEOP_REFOF PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1150,9 +1150,9 @@ RefOfTerm ReleaseTerm : PARSEOP_RELEASE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_RELEASE);} SuperName - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);} | PARSEOP_RELEASE PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1160,9 +1160,9 @@ ReleaseTerm ResetTerm : PARSEOP_RESET - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_RESET);} SuperName - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);} | PARSEOP_RESET PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1170,13 +1170,13 @@ ResetTerm ReturnTerm : PARSEOP_RETURN - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_RETURN);} OptionalReturnArg - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_RETURN {$$ = TrLinkChildren ( - TrCreateLeafNode (PARSEOP_RETURN),1, - TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), - NODE_IS_NULL_RETURN));} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);} + | PARSEOP_RETURN {$$ = TrLinkOpChildren ( + TrCreateLeafOp (PARSEOP_RETURN),1, + TrSetOpFlags (TrCreateLeafOp (PARSEOP_ZERO), + OP_IS_NULL_RETURN));} | PARSEOP_RETURN PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1184,11 +1184,11 @@ ReturnTerm ScopeTerm : PARSEOP_SCOPE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SCOPE);} NameString PARSEOP_CLOSE_PAREN '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,2, - TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} + TermList '}' {$$ = TrLinkOpChildren ($<n>3,2, + TrSetOpFlags ($4, OP_IS_NAME_DECLARATION),$7);} | PARSEOP_SCOPE PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1196,11 +1196,11 @@ ScopeTerm ShiftLeftTerm : PARSEOP_SHIFTLEFT - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SHIFTLEFT);} TermArg TermArgItem Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);} | PARSEOP_SHIFTLEFT PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1208,11 +1208,11 @@ ShiftLeftTerm ShiftRightTerm : PARSEOP_SHIFTRIGHT - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SHIFTRIGHT);} TermArg TermArgItem Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);} | PARSEOP_SHIFTRIGHT PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1220,9 +1220,9 @@ ShiftRightTerm SignalTerm : PARSEOP_SIGNAL - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SIGNAL);} SuperName - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);} | PARSEOP_SIGNAL PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1230,9 +1230,9 @@ SignalTerm SizeOfTerm : PARSEOP_SIZEOF - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SIZEOF);} SuperName - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);} | PARSEOP_SIZEOF PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1240,9 +1240,9 @@ SizeOfTerm SleepTerm : PARSEOP_SLEEP - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SLEEP);} TermArg - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);} | PARSEOP_SLEEP PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1250,9 +1250,9 @@ SleepTerm StallTerm : PARSEOP_STALL - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_STALL);} TermArg - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);} | PARSEOP_STALL PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1260,11 +1260,11 @@ StallTerm StoreTerm : PARSEOP_STORE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STORE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_STORE);} TermArg ',' SuperName - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4, - TrSetNodeFlags ($6, NODE_IS_TARGET));} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4, + TrSetOpFlags ($6, OP_IS_TARGET));} | PARSEOP_STORE PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1272,11 +1272,11 @@ StoreTerm SubtractTerm : PARSEOP_SUBTRACT - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SUBTRACT);} TermArg TermArgItem Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);} | PARSEOP_SUBTRACT PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1284,10 +1284,10 @@ SubtractTerm SwitchTerm : PARSEOP_SWITCH - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SWITCH);} TermArg PARSEOP_CLOSE_PAREN '{' - CaseDefaultTermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + CaseDefaultTermList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);} | PARSEOP_SWITCH PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1295,11 +1295,11 @@ SwitchTerm ThermalZoneTerm : PARSEOP_THERMALZONE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_THERMALZONE);} NameString PARSEOP_CLOSE_PAREN '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,2, - TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} + TermList '}' {$$ = TrLinkOpChildren ($<n>3,2, + TrSetOpFlags ($4, OP_IS_NAME_DECLARATION),$7);} | PARSEOP_THERMALZONE PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1307,10 +1307,10 @@ ThermalZoneTerm TimerTerm : PARSEOP_TIMER - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);} - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,0);} - | PARSEOP_TIMER {$$ = TrLinkChildren ( - TrCreateLeafNode (PARSEOP_TIMER),0);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_TIMER);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,0);} + | PARSEOP_TIMER {$$ = TrLinkOpChildren ( + TrCreateLeafOp (PARSEOP_TIMER),0);} | PARSEOP_TIMER PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1318,10 +1318,10 @@ TimerTerm ToBCDTerm : PARSEOP_TOBCD - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOBCD);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_TOBCD);} TermArg Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_TOBCD PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1329,10 +1329,10 @@ ToBCDTerm ToBufferTerm : PARSEOP_TOBUFFER - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_TOBUFFER);} TermArg Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_TOBUFFER PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1340,10 +1340,10 @@ ToBufferTerm ToDecimalStringTerm : PARSEOP_TODECIMALSTRING - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_TODECIMALSTRING);} TermArg Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_TODECIMALSTRING PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1351,10 +1351,10 @@ ToDecimalStringTerm ToHexStringTerm : PARSEOP_TOHEXSTRING - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_TOHEXSTRING);} TermArg Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_TOHEXSTRING PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1362,10 +1362,10 @@ ToHexStringTerm ToIntegerTerm : PARSEOP_TOINTEGER - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_TOINTEGER);} TermArg Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_TOINTEGER PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1373,9 +1373,9 @@ ToIntegerTerm ToPLDTerm : PARSEOP_TOPLD - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_TOPLD);} PldKeywordList - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);} | PARSEOP_TOPLD PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1384,26 +1384,26 @@ ToPLDTerm PldKeywordList : {$$ = NULL;} | PldKeyword - PARSEOP_EXP_EQUALS Integer {$$ = TrLinkChildren ($1,1,$3);} + PARSEOP_EXP_EQUALS Integer {$$ = TrLinkOpChildren ($1,1,$3);} | PldKeyword - PARSEOP_EXP_EQUALS String {$$ = TrLinkChildren ($1,1,$3);} + PARSEOP_EXP_EQUALS String {$$ = TrLinkOpChildren ($1,1,$3);} | PldKeywordList ',' /* Allows a trailing comma at list end */ | PldKeywordList ',' PldKeyword - PARSEOP_EXP_EQUALS Integer {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} + PARSEOP_EXP_EQUALS Integer {$$ = TrLinkPeerOp ($1,TrLinkOpChildren ($3,1,$5));} | PldKeywordList ',' PldKeyword - PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} + PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerOp ($1,TrLinkOpChildren ($3,1,$5));} ; ToStringTerm : PARSEOP_TOSTRING - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_TOSTRING);} TermArg OptionalCount Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);} | PARSEOP_TOSTRING PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1413,7 +1413,7 @@ ToUUIDTerm : PARSEOP_TOUUID PARSEOP_OPEN_PAREN StringData - PARSEOP_CLOSE_PAREN {$$ = TrUpdateNode (PARSEOP_TOUUID, $3);} + PARSEOP_CLOSE_PAREN {$$ = TrSetOpIntegerValue (PARSEOP_TOUUID, $3);} | PARSEOP_TOUUID PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1421,9 +1421,9 @@ ToUUIDTerm UnicodeTerm : PARSEOP_UNICODE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_UNICODE);} StringData - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,0,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,0,$4);} | PARSEOP_UNICODE PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1431,9 +1431,9 @@ UnicodeTerm UnloadTerm : PARSEOP_UNLOAD - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_UNLOAD);} SuperName - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);} | PARSEOP_UNLOAD PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1441,10 +1441,10 @@ UnloadTerm WaitTerm : PARSEOP_WAIT - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_WAIT);} SuperName TermArgItem - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_WAIT PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1452,11 +1452,11 @@ WaitTerm XOrTerm : PARSEOP_XOR - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_XOR);} TermArg TermArgItem Target - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);} | PARSEOP_XOR PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -1464,10 +1464,10 @@ XOrTerm WhileTerm : PARSEOP_WHILE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_WHILE);} TermArg PARSEOP_CLOSE_PAREN - '{' TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + '{' TermList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);} | PARSEOP_WHILE PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} diff --git a/source/compiler/aslprintf.c b/source/compiler/aslprintf.c index a9584bc5caa3..e5f56f11fd93 100644 --- a/source/compiler/aslprintf.c +++ b/source/compiler/aslprintf.c @@ -191,7 +191,7 @@ OpcDoPrintf ( /* Store destination is the Debug op */ - DestOp = TrAllocateNode (PARSEOP_DEBUG); + DestOp = TrAllocateOp (PARSEOP_DEBUG); DestOp->Asl.AmlOpcode = AML_DEBUG_OP; DestOp->Asl.Parent = Op; DestOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber; @@ -296,7 +296,7 @@ OpcParsePrintf ( NewString = UtStringCacheCalloc (StringLength + 1); strncpy (NewString, StartPosition, StringLength); - NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL); + NewOp = TrAllocateOp (PARSEOP_STRING_LITERAL); NewOp->Asl.Value.String = NewString; NewOp->Asl.AmlOpcode = AML_STRING_OP; NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING; @@ -357,7 +357,7 @@ OpcParsePrintf ( */ if (!Op->Asl.Child) { - NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL); + NewOp = TrAllocateOp (PARSEOP_STRING_LITERAL); NewOp->Asl.Value.String = ""; NewOp->Asl.AmlOpcode = AML_STRING_OP; NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING; @@ -385,7 +385,7 @@ OpcParsePrintf ( NewString = UtStringCacheCalloc (StringLength + 1); strncpy (NewString, StartPosition, StringLength); - NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL); + NewOp = TrAllocateOp (PARSEOP_STRING_LITERAL); NewOp->Asl.Value.String = NewString; NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING; NewOp->Asl.AmlOpcode = AML_STRING_OP; @@ -423,7 +423,7 @@ OpcParsePrintf ( /* Disable further optimization */ - Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST; + Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST; UtSetParseOpName (Op); /* Set Store destination */ @@ -461,7 +461,7 @@ OpcCreateConcatenateNode ( return; } - NewConcatOp = TrAllocateNode (PARSEOP_CONCATENATE); + NewConcatOp = TrAllocateOp (PARSEOP_CONCATENATE); NewConcatOp->Asl.AmlOpcode = AML_CONCATENATE_OP; NewConcatOp->Asl.AcpiBtype = 0x7; NewConcatOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber; @@ -479,7 +479,7 @@ OpcCreateConcatenateNode ( /* Third arg is Zero (not used) */ NewConcatOp->Asl.Child->Asl.Next->Asl.Next = - TrAllocateNode (PARSEOP_ZERO); + TrAllocateOp (PARSEOP_ZERO); NewConcatOp->Asl.Child->Asl.Next->Asl.Next->Asl.Parent = NewConcatOp; diff --git a/source/compiler/aslresource.c b/source/compiler/aslresource.c index 42931452da7a..eb0c22a1b692 100644 --- a/source/compiler/aslresource.c +++ b/source/compiler/aslresource.c @@ -573,7 +573,7 @@ RsCreateResourceField ( { Op->Asl.ExternalName = Name; - Op->Asl.CompileFlags |= NODE_IS_RESOURCE_FIELD; + Op->Asl.CompileFlags |= OP_IS_RESOURCE_FIELD; Op->Asl.Value.Tag.BitOffset = (ByteOffset * 8) + BitOffset; Op->Asl.Value.Tag.BitLength = BitLength; @@ -719,9 +719,9 @@ RsCheckListForDuplicates ( { /* Emit error only once per duplicate node */ - if (!(NextOp->Asl.CompileFlags & NODE_IS_DUPLICATE)) + if (!(NextOp->Asl.CompileFlags & OP_IS_DUPLICATE)) { - NextOp->Asl.CompileFlags |= NODE_IS_DUPLICATE; + NextOp->Asl.CompileFlags |= OP_IS_DUPLICATE; AslError (ASL_ERROR, ASL_MSG_DUPLICATE_ITEM, NextOp, NULL); } @@ -1033,7 +1033,7 @@ RsDoOneResourceDescriptor ( * references to the descriptor can be resolved. */ Info->DescriptorTypeOp->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; - Info->DescriptorTypeOp->Asl.CompileFlags = NODE_IS_RESOURCE_DESC; + Info->DescriptorTypeOp->Asl.CompileFlags = OP_IS_RESOURCE_DESC; Info->DescriptorTypeOp->Asl.Value.Integer = Info->CurrentByteOffset; if (Rnode) @@ -1132,7 +1132,7 @@ RsDoResourceTemplate ( if (Op->Asl.Parent) { - Op->Asl.Parent->Asl.CompileFlags |= NODE_IS_RESOURCE_DESC; + Op->Asl.Parent->Asl.CompileFlags |= OP_IS_RESOURCE_DESC; } /* ResourceTemplate Opcode is first (Op) */ @@ -1171,7 +1171,7 @@ RsDoResourceTemplate ( Info.DescriptorTypeOp = DescriptorTypeOp; Info.CurrentByteOffset = CurrentByteOffset; - DescriptorTypeOp->Asl.CompileFlags |= NODE_IS_RESOURCE_DESC; + DescriptorTypeOp->Asl.CompileFlags |= OP_IS_RESOURCE_DESC; Rnode = RsDoOneResourceDescriptor (&Info, &State); /* @@ -1206,7 +1206,7 @@ RsDoResourceTemplate ( */ Op->Asl.ParseOpcode = PARSEOP_BUFFER; Op->Asl.AmlOpcode = AML_BUFFER_OP; - Op->Asl.CompileFlags = NODE_AML_PACKAGE | NODE_IS_RESOURCE_DESC; + Op->Asl.CompileFlags = OP_AML_PACKAGE | OP_IS_RESOURCE_DESC; UtSetParseOpName (Op); BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER; @@ -1219,7 +1219,7 @@ RsDoResourceTemplate ( BufferOp->Asl.AmlOpcodeLength = 0; BufferOp->Asl.AmlLength = CurrentByteOffset; BufferOp->Asl.Value.Buffer = (UINT8 *) HeadRnode.Next; - BufferOp->Asl.CompileFlags |= NODE_IS_RESOURCE_DATA; + BufferOp->Asl.CompileFlags |= OP_IS_RESOURCE_DATA; UtSetParseOpName (BufferOp); return; diff --git a/source/compiler/aslresources.y b/source/compiler/aslresources.y index fc70940c7e9c..5b73ed872216 100644 --- a/source/compiler/aslresources.y +++ b/source/compiler/aslresources.y @@ -169,11 +169,11 @@ ResourceTemplateTerm : PARSEOP_RESOURCETEMPLATE {COMMENT_CAPTURE_OFF;} OptionalParentheses '{' - ResourceMacroList '}' {$$ = TrCreateNode (PARSEOP_RESOURCETEMPLATE,4, - TrCreateLeafNode (PARSEOP_DEFAULT_ARG), - TrCreateLeafNode (PARSEOP_DEFAULT_ARG), + ResourceMacroList '}' {$$ = TrCreateOp (PARSEOP_RESOURCETEMPLATE,4, + TrCreateLeafOp (PARSEOP_DEFAULT_ARG), + TrCreateLeafOp (PARSEOP_DEFAULT_ARG), $5, - TrCreateLeafNode (PARSEOP_ENDTAG)); + TrCreateLeafOp (PARSEOP_ENDTAG)); COMMENT_CAPTURE_ON;} ; @@ -186,7 +186,7 @@ OptionalParentheses ResourceMacroList : {$$ = NULL;} | ResourceMacroList - ResourceMacroTerm {$$ = TrLinkPeerNode ($1,$2);} + ResourceMacroTerm {$$ = TrLinkPeerOp ($1,$2);} ; ResourceMacroTerm @@ -235,13 +235,13 @@ ResourceMacroTerm DMATerm : PARSEOP_DMA - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DMA);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DMA);} DMATypeKeyword OptionalBusMasterKeyword ',' XferTypeKeyword OptionalNameString_Last PARSEOP_CLOSE_PAREN '{' - ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$5,$7,$8,$11);} + ByteList '}' {$$ = TrLinkOpChildren ($<n>3,5,$4,$5,$7,$8,$11);} | PARSEOP_DMA PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -249,7 +249,7 @@ DMATerm DWordIOTerm : PARSEOP_DWORDIO - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDIO);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DWORDIO);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -265,7 +265,7 @@ DWordIOTerm OptionalNameString OptionalType OptionalTranslationType_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15, $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} | PARSEOP_DWORDIO PARSEOP_OPEN_PAREN @@ -274,7 +274,7 @@ DWordIOTerm DWordMemoryTerm : PARSEOP_DWORDMEMORY - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DWORDMEMORY);} OptionalResourceType_First OptionalDecodeType OptionalMinType @@ -291,7 +291,7 @@ DWordMemoryTerm OptionalNameString OptionalAddressRange OptionalType_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,16, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,16, $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);} | PARSEOP_DWORDMEMORY PARSEOP_OPEN_PAREN @@ -300,7 +300,7 @@ DWordMemoryTerm DWordSpaceTerm : PARSEOP_DWORDSPACE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DWORDSPACE);} ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} OptionalResourceType OptionalDecodeType @@ -315,7 +315,7 @@ DWordSpaceTerm OptionalByteConstExpr OptionalStringData OptionalNameString_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14, $4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} | PARSEOP_DWORDSPACE PARSEOP_OPEN_PAREN @@ -325,7 +325,7 @@ DWordSpaceTerm EndDependentFnTerm : PARSEOP_ENDDEPENDENTFN PARSEOP_OPEN_PAREN - PARSEOP_CLOSE_PAREN {$$ = TrCreateLeafNode (PARSEOP_ENDDEPENDENTFN);} + PARSEOP_CLOSE_PAREN {$$ = TrCreateLeafOp (PARSEOP_ENDDEPENDENTFN);} | PARSEOP_ENDDEPENDENTFN PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -333,7 +333,7 @@ EndDependentFnTerm ExtendedIOTerm : PARSEOP_EXTENDEDIO - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_EXTENDEDIO);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -348,7 +348,7 @@ ExtendedIOTerm OptionalNameString OptionalType OptionalTranslationType_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14, $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22);} | PARSEOP_EXTENDEDIO PARSEOP_OPEN_PAREN @@ -357,7 +357,7 @@ ExtendedIOTerm ExtendedMemoryTerm : PARSEOP_EXTENDEDMEMORY - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_EXTENDEDMEMORY);} OptionalResourceType_First OptionalDecodeType OptionalMinType @@ -373,7 +373,7 @@ ExtendedMemoryTerm OptionalNameString OptionalAddressRange OptionalType_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15, $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24);} | PARSEOP_EXTENDEDMEMORY PARSEOP_OPEN_PAREN @@ -381,7 +381,7 @@ ExtendedMemoryTerm ; ExtendedSpaceTerm - : PARSEOP_EXTENDEDSPACE PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);} + : PARSEOP_EXTENDEDSPACE PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_EXTENDEDSPACE);} ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} OptionalResourceType OptionalDecodeType @@ -395,7 +395,7 @@ ExtendedSpaceTerm ',' QWordConstExpr OptionalQWordConstExpr OptionalNameString_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,13, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,13, $4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23);} | PARSEOP_EXTENDEDSPACE PARSEOP_OPEN_PAREN @@ -404,12 +404,12 @@ ExtendedSpaceTerm FixedDmaTerm : PARSEOP_FIXEDDMA - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDDMA);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FIXEDDMA);} WordConstExpr /* 04: DMA RequestLines */ ',' WordConstExpr /* 06: DMA Channels */ OptionalXferSize /* 07: DMA TransferSize */ OptionalNameString /* 08: DescriptorName */ - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$6,$7,$8);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4,$4,$6,$7,$8);} | PARSEOP_FIXEDDMA PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -417,11 +417,11 @@ FixedDmaTerm FixedIOTerm : PARSEOP_FIXEDIO - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDIO);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FIXEDIO);} WordConstExpr ',' ByteConstExpr OptionalNameString_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$6,$7);} | PARSEOP_FIXEDIO PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -429,7 +429,7 @@ FixedIOTerm GpioIntTerm : PARSEOP_GPIO_INT - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_GPIO_INT);} InterruptTypeKeyword /* 04: InterruptType */ ',' InterruptLevel /* 06: InterruptLevel */ OptionalShareType /* 07: SharedType */ @@ -441,7 +441,7 @@ GpioIntTerm OptionalNameString /* 15: DescriptorName */ OptionalBuffer_Last /* 16: VendorData */ PARSEOP_CLOSE_PAREN '{' - DWordConstExpr '}' {$$ = TrLinkChildren ($<n>3,11, + DWordConstExpr '}' {$$ = TrLinkOpChildren ($<n>3,11, $4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);} | PARSEOP_GPIO_INT PARSEOP_OPEN_PAREN @@ -450,7 +450,7 @@ GpioIntTerm GpioIoTerm : PARSEOP_GPIO_IO - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_GPIO_IO);} OptionalShareType_First /* 04: SharedType */ ',' PinConfigByte /* 06: PinConfig */ OptionalWordConstExpr /* 07: DebounceTimeout */ @@ -462,7 +462,7 @@ GpioIoTerm OptionalNameString /* 14: DescriptorName */ OptionalBuffer_Last /* 15: VendorData */ PARSEOP_CLOSE_PAREN '{' - DWordList '}' {$$ = TrLinkChildren ($<n>3,11, + DWordList '}' {$$ = TrLinkOpChildren ($<n>3,11, $4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);} | PARSEOP_GPIO_IO PARSEOP_OPEN_PAREN @@ -471,7 +471,7 @@ GpioIoTerm I2cSerialBusTerm : PARSEOP_I2C_SERIALBUS - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_I2C_SERIALBUS);} WordConstExpr /* 04: SlaveAddress */ OptionalSlaveMode /* 05: SlaveMode */ ',' DWordConstExpr /* 07: ConnectionSpeed */ @@ -481,9 +481,9 @@ I2cSerialBusTerm OptionalResourceType /* 12: ResourceType */ OptionalNameString /* 13: DescriptorName */ OptionalBuffer_Last /* 14: VendorData */ - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,10, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,10, $4,$5,$7,$8,$10,$11,$12,$13, - TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$14);} + TrCreateLeafOp (PARSEOP_DEFAULT_ARG),$14);} | PARSEOP_I2C_SERIALBUS PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -491,7 +491,7 @@ I2cSerialBusTerm I2cSerialBusTermV2 : PARSEOP_I2C_SERIALBUS_V2 - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS_V2);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_I2C_SERIALBUS_V2);} WordConstExpr /* 04: SlaveAddress */ OptionalSlaveMode /* 05: SlaveMode */ ',' DWordConstExpr /* 07: ConnectionSpeed */ @@ -502,7 +502,7 @@ I2cSerialBusTermV2 OptionalNameString /* 13: DescriptorName */ OptionalShareType /* 14: Share */ OptionalBuffer_Last /* 15: VendorData */ - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,10, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,10, $4,$5,$7,$8,$10,$11,$12,$13,$14,$15);} | PARSEOP_I2C_SERIALBUS_V2 PARSEOP_OPEN_PAREN @@ -511,7 +511,7 @@ I2cSerialBusTermV2 InterruptTerm : PARSEOP_INTERRUPT - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_INTERRUPT);} OptionalResourceType_First ',' InterruptTypeKeyword ',' InterruptLevel @@ -520,7 +520,7 @@ InterruptTerm OptionalStringData OptionalNameString_Last PARSEOP_CLOSE_PAREN '{' - DWordList '}' {$$ = TrLinkChildren ($<n>3,8, + DWordList '}' {$$ = TrLinkOpChildren ($<n>3,8, $4,$6,$8,$9,$10,$11,$12,$15);} | PARSEOP_INTERRUPT PARSEOP_OPEN_PAREN @@ -529,14 +529,14 @@ InterruptTerm IOTerm : PARSEOP_IO - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IO);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_IO);} IODecodeKeyword ',' WordConstExpr ',' WordConstExpr ',' ByteConstExpr ',' ByteConstExpr OptionalNameString_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} | PARSEOP_IO PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -544,10 +544,10 @@ IOTerm IRQNoFlagsTerm : PARSEOP_IRQNOFLAGS - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_IRQNOFLAGS);} OptionalNameString_First PARSEOP_CLOSE_PAREN '{' - ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + ByteList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);} | PARSEOP_IRQNOFLAGS PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -555,13 +555,13 @@ IRQNoFlagsTerm IRQTerm : PARSEOP_IRQ - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IRQ);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_IRQ);} InterruptTypeKeyword ',' InterruptLevel OptionalShareType OptionalNameString_Last PARSEOP_CLOSE_PAREN '{' - ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$7,$8,$11);} + ByteList '}' {$$ = TrLinkOpChildren ($<n>3,5,$4,$6,$7,$8,$11);} | PARSEOP_IRQ PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -569,14 +569,14 @@ IRQTerm Memory24Term : PARSEOP_MEMORY24 - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY24);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MEMORY24);} OptionalReadWriteKeyword ',' WordConstExpr ',' WordConstExpr ',' WordConstExpr ',' WordConstExpr OptionalNameString_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} | PARSEOP_MEMORY24 PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -584,12 +584,12 @@ Memory24Term Memory32FixedTerm : PARSEOP_MEMORY32FIXED - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MEMORY32FIXED);} OptionalReadWriteKeyword ',' DWordConstExpr ',' DWordConstExpr OptionalNameString_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$6,$8,$9);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4,$4,$6,$8,$9);} | PARSEOP_MEMORY32FIXED PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -597,14 +597,14 @@ Memory32FixedTerm Memory32Term : PARSEOP_MEMORY32 - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MEMORY32);} OptionalReadWriteKeyword ',' DWordConstExpr ',' DWordConstExpr ',' DWordConstExpr ',' DWordConstExpr OptionalNameString_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} | PARSEOP_MEMORY32 PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -612,7 +612,7 @@ Memory32Term PinConfigTerm : PARSEOP_PINCONFIG - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PINCONFIG);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PINCONFIG);} OptionalShareType_First /* 04: SharedType */ ',' ByteConstExpr /* 06: PinConfigType */ ',' DWordConstExpr /* 08: PinConfigValue */ @@ -622,7 +622,7 @@ PinConfigTerm OptionalNameString /* 13: DescriptorName */ OptionalBuffer_Last /* 14: VendorData */ PARSEOP_CLOSE_PAREN '{' - DWordList '}' {$$ = TrLinkChildren ($<n>3,9, + DWordList '}' {$$ = TrLinkOpChildren ($<n>3,9, $4,$6,$8,$10,$11,$12,$13,$14,$17);} | PARSEOP_PINCONFIG PARSEOP_OPEN_PAREN @@ -631,7 +631,7 @@ PinConfigTerm PinFunctionTerm : PARSEOP_PINFUNCTION - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PINFUNCTION);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PINFUNCTION);} OptionalShareType_First /* 04: SharedType */ ',' PinConfigByte /* 06: PinConfig */ ',' WordConstExpr /* 08: FunctionNumber */ @@ -641,7 +641,7 @@ PinFunctionTerm OptionalNameString /* 13: DescriptorName */ OptionalBuffer_Last /* 14: VendorData */ PARSEOP_CLOSE_PAREN '{' - DWordList '}' {$$ = TrLinkChildren ($<n>3,9, + DWordList '}' {$$ = TrLinkOpChildren ($<n>3,9, $4,$6,$8,$10,$11,$12,$13,$14,$17);} | PARSEOP_PINFUNCTION PARSEOP_OPEN_PAREN @@ -650,13 +650,13 @@ PinFunctionTerm PinGroupTerm : PARSEOP_PINGROUP - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PINGROUP);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PINGROUP);} StringData /* 04: ResourceLabel */ OptionalProducerResourceType /* 05: ResourceType */ OptionalNameString /* 06: DescriptorName */ OptionalBuffer_Last /* 07: VendorData */ PARSEOP_CLOSE_PAREN '{' - DWordList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$5,$6,$7,$10);} + DWordList '}' {$$ = TrLinkOpChildren ($<n>3,5,$4,$5,$6,$7,$10);} | PARSEOP_PINGROUP PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -664,7 +664,7 @@ PinGroupTerm PinGroupConfigTerm : PARSEOP_PINGROUPCONFIG - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PINGROUPCONFIG);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PINGROUPCONFIG);} OptionalShareType_First /* 04: SharedType */ ',' ByteConstExpr /* 06: PinConfigType */ ',' DWordConstExpr /* 08: PinConfigValue */ @@ -674,7 +674,7 @@ PinGroupConfigTerm OptionalResourceType /* 14: ResourceType */ OptionalNameString /* 15: DescriptorName */ OptionalBuffer_Last /* 16: VendorData */ - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,9, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,9, $4,$6,$8,$10,$11,$13,$14,$15,$16);} | PARSEOP_PINGROUPCONFIG PARSEOP_OPEN_PAREN @@ -683,7 +683,7 @@ PinGroupConfigTerm PinGroupFunctionTerm : PARSEOP_PINGROUPFUNCTION - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PINGROUPFUNCTION);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PINGROUPFUNCTION);} OptionalShareType_First /* 04: SharedType */ ',' WordConstExpr /* 06: FunctionNumber */ ',' StringData /* 08: ResourceSource */ @@ -692,7 +692,7 @@ PinGroupFunctionTerm OptionalResourceType /* 12: ResourceType */ OptionalNameString /* 13: DescriptorName */ OptionalBuffer_Last /* 14: VendorData */ - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,8, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,8, $4,$6,$8,$9,$11,$12,$13,$14);} | PARSEOP_PINGROUPFUNCTION PARSEOP_OPEN_PAREN @@ -701,7 +701,7 @@ PinGroupFunctionTerm QWordIOTerm : PARSEOP_QWORDIO - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDIO);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_QWORDIO);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -717,7 +717,7 @@ QWordIOTerm OptionalNameString OptionalType OptionalTranslationType_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15, $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} | PARSEOP_QWORDIO PARSEOP_OPEN_PAREN @@ -726,7 +726,7 @@ QWordIOTerm QWordMemoryTerm : PARSEOP_QWORDMEMORY - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_QWORDMEMORY);} OptionalResourceType_First OptionalDecodeType OptionalMinType @@ -743,7 +743,7 @@ QWordMemoryTerm OptionalNameString OptionalAddressRange OptionalType_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,16, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,16, $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);} | PARSEOP_QWORDMEMORY PARSEOP_OPEN_PAREN @@ -752,7 +752,7 @@ QWordMemoryTerm QWordSpaceTerm : PARSEOP_QWORDSPACE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_QWORDSPACE);} ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} OptionalResourceType OptionalDecodeType @@ -767,7 +767,7 @@ QWordSpaceTerm OptionalByteConstExpr OptionalStringData OptionalNameString_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14, $4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} | PARSEOP_QWORDSPACE PARSEOP_OPEN_PAREN @@ -776,14 +776,14 @@ QWordSpaceTerm RegisterTerm : PARSEOP_REGISTER - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_REGISTER);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_REGISTER);} AddressSpaceKeyword ',' ByteConstExpr ',' ByteConstExpr ',' QWordConstExpr OptionalAccessSize OptionalNameString_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$11,$12);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$8,$10,$11,$12);} | PARSEOP_REGISTER PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -791,7 +791,7 @@ RegisterTerm SpiSerialBusTerm : PARSEOP_SPI_SERIALBUS - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SPI_SERIALBUS);} WordConstExpr /* 04: DeviceSelection */ OptionalDevicePolarity /* 05: DevicePolarity */ OptionalWireMode /* 06: WireMode */ @@ -805,9 +805,9 @@ SpiSerialBusTerm OptionalResourceType /* 19: ResourceType */ OptionalNameString /* 20: DescriptorName */ OptionalBuffer_Last /* 21: VendorData */ - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14, $4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20, - TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$21);} + TrCreateLeafOp (PARSEOP_DEFAULT_ARG),$21);} | PARSEOP_SPI_SERIALBUS PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -815,7 +815,7 @@ SpiSerialBusTerm SpiSerialBusTermV2 : PARSEOP_SPI_SERIALBUS_V2 - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS_V2);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SPI_SERIALBUS_V2);} WordConstExpr /* 04: DeviceSelection */ OptionalDevicePolarity /* 05: DevicePolarity */ OptionalWireMode /* 06: WireMode */ @@ -830,7 +830,7 @@ SpiSerialBusTermV2 OptionalNameString /* 20: DescriptorName */ OptionalShareType /* 21: Share */ OptionalBuffer_Last /* 22: VendorData */ - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14, $4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21,$22);} | PARSEOP_SPI_SERIALBUS_V2 PARSEOP_OPEN_PAREN @@ -839,9 +839,9 @@ SpiSerialBusTermV2 StartDependentFnNoPriTerm : PARSEOP_STARTDEPENDENTFN_NOPRI - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_STARTDEPENDENTFN_NOPRI);} PARSEOP_CLOSE_PAREN '{' - ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,1,$6);} + ResourceMacroList '}' {$$ = TrLinkOpChildren ($<n>3,1,$6);} | PARSEOP_STARTDEPENDENTFN_NOPRI PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -849,11 +849,11 @@ StartDependentFnNoPriTerm StartDependentFnTerm : PARSEOP_STARTDEPENDENTFN - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_STARTDEPENDENTFN);} ByteConstExpr ',' ByteConstExpr PARSEOP_CLOSE_PAREN '{' - ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$9);} + ResourceMacroList '}' {$$ = TrLinkOpChildren ($<n>3,3,$4,$6,$9);} | PARSEOP_STARTDEPENDENTFN PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -861,7 +861,7 @@ StartDependentFnTerm UartSerialBusTerm : PARSEOP_UART_SERIALBUS - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_UART_SERIALBUS);} DWordConstExpr /* 04: ConnectionSpeed */ OptionalBitsPerByte /* 05: BitsPerByte */ OptionalStopBits /* 06: StopBits */ @@ -876,9 +876,9 @@ UartSerialBusTerm OptionalResourceType /* 19: ResourceType */ OptionalNameString /* 20: DescriptorName */ OptionalBuffer_Last /* 21: VendorData */ - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15, $4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20, - TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$21);} + TrCreateLeafOp (PARSEOP_DEFAULT_ARG),$21);} | PARSEOP_UART_SERIALBUS PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -886,7 +886,7 @@ UartSerialBusTerm UartSerialBusTermV2 : PARSEOP_UART_SERIALBUS_V2 - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS_V2);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_UART_SERIALBUS_V2);} DWordConstExpr /* 04: ConnectionSpeed */ OptionalBitsPerByte /* 05: BitsPerByte */ OptionalStopBits /* 06: StopBits */ @@ -902,7 +902,7 @@ UartSerialBusTermV2 OptionalNameString /* 20: DescriptorName */ OptionalShareType /* 21: Share */ OptionalBuffer_Last /* 22: VendorData */ - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15, $4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21,$22);} | PARSEOP_UART_SERIALBUS_V2 PARSEOP_OPEN_PAREN @@ -911,10 +911,10 @@ UartSerialBusTermV2 VendorLongTerm : PARSEOP_VENDORLONG - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORLONG);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_VENDORLONG);} OptionalNameString_First PARSEOP_CLOSE_PAREN '{' - ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + ByteList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);} | PARSEOP_VENDORLONG PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -922,10 +922,10 @@ VendorLongTerm VendorShortTerm : PARSEOP_VENDORSHORT - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_VENDORSHORT);} OptionalNameString_First PARSEOP_CLOSE_PAREN '{' - ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + ByteList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);} | PARSEOP_VENDORSHORT PARSEOP_OPEN_PAREN error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} @@ -933,7 +933,7 @@ VendorShortTerm WordBusNumberTerm : PARSEOP_WORDBUSNUMBER - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_WORDBUSNUMBER);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -946,7 +946,7 @@ WordBusNumberTerm OptionalByteConstExpr OptionalStringData OptionalNameString_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,12, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,12, $4,$5,$6,$7,$9,$11,$13,$15,$17,$18,$19,$20);} | PARSEOP_WORDBUSNUMBER PARSEOP_OPEN_PAREN @@ -955,7 +955,7 @@ WordBusNumberTerm WordIOTerm : PARSEOP_WORDIO - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WORDIO);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_WORDIO);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -971,7 +971,7 @@ WordIOTerm OptionalNameString OptionalType OptionalTranslationType_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15, $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} | PARSEOP_WORDIO PARSEOP_OPEN_PAREN @@ -980,7 +980,7 @@ WordIOTerm WordSpaceTerm : PARSEOP_WORDSPACE - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WORDSPACE);} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_WORDSPACE);} ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} OptionalResourceType OptionalDecodeType @@ -995,7 +995,7 @@ WordSpaceTerm OptionalByteConstExpr OptionalStringData OptionalNameString_Last - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14, $4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} | PARSEOP_WORDSPACE PARSEOP_OPEN_PAREN diff --git a/source/compiler/aslrules.y b/source/compiler/aslrules.y index d09852c7d166..eb7850697b41 100644 --- a/source/compiler/aslrules.y +++ b/source/compiler/aslrules.y @@ -165,8 +165,8 @@ NoEcho(' * to handle output from preprocessors */ AslCode - : DefinitionBlockList {$<n>$ = TrLinkChildren ( - TrCreateLeafNode (PARSEOP_ASL_CODE),1, $1);} + : DefinitionBlockList {$<n>$ = TrLinkOpChildren ( + TrCreateLeafOp (PARSEOP_ASL_CODE),1, $1);} | error {YYABORT; $$ = NULL;} ; @@ -192,22 +192,22 @@ AslCode */ DefinitionBlockTerm : PARSEOP_DEFINITION_BLOCK - PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITION_BLOCK); COMMENT_CAPTURE_OFF;} + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DEFINITION_BLOCK); COMMENT_CAPTURE_OFF;} String ',' String ',' ByteConst ',' String ',' String ',' DWordConst - PARSEOP_CLOSE_PAREN {TrSetEndLineNumber ($<n>3); COMMENT_CAPTURE_ON;} - '{' TermList '}' {$$ = TrLinkChildren ($<n>3,7, + PARSEOP_CLOSE_PAREN {TrSetOpEndLineNumber ($<n>3); COMMENT_CAPTURE_ON;} + '{' TermList '}' {$$ = TrLinkOpChildren ($<n>3,7, $4,$6,$8,$10,$12,$14,$18);} ; DefinitionBlockList : DefinitionBlockTerm | DefinitionBlockTerm - DefinitionBlockList {$$ = TrLinkPeerNodes (2, $1,$2);} + DefinitionBlockList {$$ = TrLinkPeerOps (2, $1,$2);} ; @@ -217,21 +217,21 @@ DefinitionBlockList NameString : NameSeg {} - | PARSEOP_NAMESTRING {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) $1);} - | PARSEOP_IO {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IO");} - | PARSEOP_DMA {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "DMA");} - | PARSEOP_IRQ {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IRQ");} - | PARSEOP_FOR {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "FOR");} + | PARSEOP_NAMESTRING {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) $1);} + | PARSEOP_IO {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IO");} + | PARSEOP_DMA {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "DMA");} + | PARSEOP_IRQ {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IRQ");} + | PARSEOP_FOR {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "FOR");} ; /* NameSeg - : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, (ACPI_NATIVE_INT) + : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESEG, (ACPI_NATIVE_INT) TrNormalizeNameSeg ($1));} ; */ NameSeg - : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, + : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESEG, (ACPI_NATIVE_INT) AslCompilerlval.s);} ; @@ -242,8 +242,8 @@ Term : Object {} | Type1Opcode {} | Type2Opcode {} - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} - | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} + | Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);} + | Type2StringOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);} | Type2BufferOpcode {} | Type2BufferOrStringOpcode {} | error {$$ = AslDoError(); yyclearin;} @@ -256,45 +256,45 @@ SuperName ; Target - : {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ - | ',' {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ - | ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} + : {$$ = TrCreateNullTargetOp ();} /* Placeholder is a ZeroOp object */ + | ',' {$$ = TrCreateNullTargetOp ();} /* Placeholder is a ZeroOp object */ + | ',' SuperName {$$ = TrSetOpFlags ($2, OP_IS_TARGET);} ; RequiredTarget - : ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} + : ',' SuperName {$$ = TrSetOpFlags ($2, OP_IS_TARGET);} ; TermArg - : SimpleName {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - | Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - | DataObject {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} + : SimpleName {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);} + | Type2Opcode {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);} + | DataObject {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);} | PARSEOP_OPEN_PAREN TermArg - PARSEOP_CLOSE_PAREN {$$ = TrSetNodeFlags ($2, NODE_IS_TERM_ARG);} + PARSEOP_CLOSE_PAREN {$$ = TrSetOpFlags ($2, OP_IS_TERM_ARG);} ; /* NOTE: Removed from TermArg due to reduce/reduce conflicts: - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} + | Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);} + | Type2StringOpcode {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);} + | Type2BufferOpcode {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);} + | Type2BufferOrStringOpcode {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);} */ MethodInvocationTerm : NameString - PARSEOP_OPEN_PAREN {TrUpdateNode (PARSEOP_METHODCALL, $1); COMMENT_CAPTURE_OFF;} + PARSEOP_OPEN_PAREN {TrSetOpIntegerValue (PARSEOP_METHODCALL, $1); COMMENT_CAPTURE_OFF;} ArgList - PARSEOP_CLOSE_PAREN {$$ = TrLinkChildNode ($1,$4); COMMENT_CAPTURE_ON;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildOp ($1,$4); COMMENT_CAPTURE_ON;} ; /* OptionalCount must appear before ByteList or an incorrect reduction will result */ OptionalCount - : {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ - | ',' {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ + : {$$ = TrCreateLeafOp (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ + | ',' {$$ = TrCreateLeafOp (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ | ',' TermArg {$$ = $2;} ; @@ -334,14 +334,14 @@ OptionalDataCount TermList : {$$ = NULL;} - | TermList Term {$$ = TrLinkPeerNode ( - TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$2);} - | TermList Term ';' {$$ = TrLinkPeerNode ( - TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$2);} - | TermList ';' Term {$$ = TrLinkPeerNode ( - TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$3);} - | TermList ';' Term ';' {$$ = TrLinkPeerNode ( - TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$3);} + | TermList Term {$$ = TrLinkPeerOp ( + TrSetOpFlags ($1, OP_RESULT_NOT_USED),$2);} + | TermList Term ';' {$$ = TrLinkPeerOp ( + TrSetOpFlags ($1, OP_RESULT_NOT_USED),$2);} + | TermList ';' Term {$$ = TrLinkPeerOp ( + TrSetOpFlags ($1, OP_RESULT_NOT_USED),$3);} + | TermList ';' Term ';' {$$ = TrLinkPeerOp ( + TrSetOpFlags ($1, OP_RESULT_NOT_USED),$3);} ; ArgList @@ -349,7 +349,7 @@ ArgList | TermArg | ArgList ',' /* Allows a trailing comma at list end */ | ArgList ',' - TermArg {$$ = TrLinkPeerNode ($1,$3);} + TermArg {$$ = TrLinkPeerOp ($1,$3);} ; ByteList @@ -357,7 +357,7 @@ ByteList | ByteConstExpr | ByteList ',' /* Allows a trailing comma at list end */ | ByteList ',' - ByteConstExpr {$$ = TrLinkPeerNode ($1,$3);} + ByteConstExpr {$$ = TrLinkPeerOp ($1,$3);} ; DWordList @@ -365,7 +365,7 @@ DWordList | DWordConstExpr | DWordList ',' /* Allows a trailing comma at list end */ | DWordList ',' - DWordConstExpr {$$ = TrLinkPeerNode ($1,$3);} + DWordConstExpr {$$ = TrLinkPeerOp ($1,$3);} ; FieldUnitList @@ -373,7 +373,7 @@ FieldUnitList | FieldUnit | FieldUnitList ',' /* Allows a trailing comma at list end */ | FieldUnitList ',' - FieldUnit {$$ = TrLinkPeerNode ($1,$3);} + FieldUnit {$$ = TrLinkPeerOp ($1,$3);} ; FieldUnit @@ -384,9 +384,9 @@ FieldUnit ; FieldUnitEntry - : ',' AmlPackageLengthTerm {$$ = TrCreateNode (PARSEOP_RESERVED_BYTES,1,$2);} + : ',' AmlPackageLengthTerm {$$ = TrCreateOp (PARSEOP_RESERVED_BYTES,1,$2);} | NameSeg ',' - AmlPackageLengthTerm {$$ = TrLinkChildNode ($1,$3);} + AmlPackageLengthTerm {$$ = TrLinkChildOp ($1,$3);} ; Object @@ -401,7 +401,7 @@ PackageList | PackageElement | PackageList ',' /* Allows a trailing comma at list end */ | PackageList ',' - PackageElement {$$ = TrLinkPeerNode ($1,$3);} + PackageElement {$$ = TrLinkPeerOp ($1,$3);} ; PackageElement @@ -415,7 +415,7 @@ ParameterTypePackage : {$$ = NULL;} | ObjectTypeKeyword {$$ = $1;} | ParameterTypePackage ',' - ObjectTypeKeyword {$$ = TrLinkPeerNodes (2,$1,$3);} + ObjectTypeKeyword {$$ = TrLinkPeerOps (2,$1,$3);} ; ParameterTypePackageList @@ -425,9 +425,9 @@ ParameterTypePackageList ; OptionalParameterTypePackage - : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} - | ',' ParameterTypePackageList {$$ = TrLinkChildren ( - TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} + : {$$ = TrCreateLeafOp (PARSEOP_DEFAULT_ARG);} + | ',' ParameterTypePackageList {$$ = TrLinkOpChildren ( + TrCreateLeafOp (PARSEOP_DEFAULT_ARG),1,$2);} ; /* Rules for specifying the types for method arguments */ @@ -435,7 +435,7 @@ OptionalParameterTypePackage ParameterTypesPackage : ParameterTypePackageList {$$ = $1;} | ParameterTypesPackage ',' - ParameterTypePackageList {$$ = TrLinkPeerNodes (2,$1,$3);} + ParameterTypePackageList {$$ = TrLinkPeerOps (2,$1,$3);} ; ParameterTypesPackageList @@ -445,9 +445,9 @@ ParameterTypesPackageList ; OptionalParameterTypesPackage - : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} - | ',' ParameterTypesPackageList {$$ = TrLinkChildren ( - TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} + : {$$ = TrCreateLeafOp (PARSEOP_DEFAULT_ARG);} + | ',' ParameterTypesPackageList {$$ = TrLinkOpChildren ( + TrCreateLeafOp (PARSEOP_DEFAULT_ARG),1,$2);} ; /* @@ -458,9 +458,9 @@ CaseDefaultTermList | CaseTerm {} | DefaultTerm {} | CaseDefaultTermList - CaseTerm {$$ = TrLinkPeerNode ($1,$2);} + CaseTerm {$$ = TrLinkPeerOp ($1,$2);} | CaseDefaultTermList - DefaultTerm {$$ = TrLinkPeerNode ($1,$2);} + DefaultTerm {$$ = TrLinkPeerOp ($1,$2);} /* Original - attempts to force zero or one default term within the switch */ @@ -469,16 +469,16 @@ CaseDefaultTermList : {$$ = NULL;} | CaseTermList DefaultTerm - CaseTermList {$$ = TrLinkPeerNode ($1,TrLinkPeerNode ($2, $3));} + CaseTermList {$$ = TrLinkPeerOp ($1,TrLinkPeerOp ($2, $3));} | CaseTermList - CaseTerm {$$ = TrLinkPeerNode ($1,$2);} + CaseTerm {$$ = TrLinkPeerOp ($1,$2);} ; CaseTermList : {$$ = NULL;} | CaseTerm {} | CaseTermList - CaseTerm {$$ = TrLinkPeerNode ($1,$2);} + CaseTerm {$$ = TrLinkPeerOp ($1,$2);} ; */ @@ -497,9 +497,9 @@ DataObject ; BufferData - : Type5Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} - | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} - | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} + : Type5Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);} + | Type2BufferOrStringOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);} + | Type2BufferOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);} | BufferTerm {} ; @@ -508,35 +508,35 @@ PackageData ; IntegerData - : Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} - | Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} + : Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);} + | Type3Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);} | Integer {} | ConstTerm {} ; StringData - : Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} + : Type2StringOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);} | String {} ; ByteConst - : Integer {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} + : Integer {$$ = TrSetOpIntegerValue (PARSEOP_BYTECONST, $1);} ; WordConst - : Integer {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} + : Integer {$$ = TrSetOpIntegerValue (PARSEOP_WORDCONST, $1);} ; DWordConst - : Integer {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} + : Integer {$$ = TrSetOpIntegerValue (PARSEOP_DWORDCONST, $1);} ; QWordConst - : Integer {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} + : Integer {$$ = TrSetOpIntegerValue (PARSEOP_QWORDCONST, $1);} ; /* - * The NODE_COMPILE_TIME_CONST flag in the following constant expressions + * The OP_COMPILE_TIME_CONST flag in the following constant expressions * enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes * to simple integers. It is an error if these types of expressions cannot be * reduced, since the AML grammar for ****ConstExpr requires a simple constant. @@ -544,63 +544,63 @@ QWordConst * constant folding code in the node AmlLength field. */ ByteConstExpr - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); - TrSetNodeAmlLength ($1, 1);} - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); - TrSetNodeAmlLength ($1, 1);} - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} + : Type3Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST); + TrSetOpAmlLength ($1, 1);} + | Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST); + TrSetOpAmlLength ($1, 1);} + | ConstExprTerm {$$ = TrSetOpIntegerValue (PARSEOP_BYTECONST, $1);} | ByteConst {} ; WordConstExpr - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); - TrSetNodeAmlLength ($1, 2);} - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); - TrSetNodeAmlLength ($1, 2);} - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} + : Type3Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST); + TrSetOpAmlLength ($1, 2);} + | Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST); + TrSetOpAmlLength ($1, 2);} + | ConstExprTerm {$$ = TrSetOpIntegerValue (PARSEOP_WORDCONST, $1);} | WordConst {} ; DWordConstExpr - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); - TrSetNodeAmlLength ($1, 4);} - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); - TrSetNodeAmlLength ($1, 4);} - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} + : Type3Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST); + TrSetOpAmlLength ($1, 4);} + | Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST); + TrSetOpAmlLength ($1, 4);} + | ConstExprTerm {$$ = TrSetOpIntegerValue (PARSEOP_DWORDCONST, $1);} | DWordConst {} ; QWordConstExpr - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); - TrSetNodeAmlLength ($1, 8);} - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); - TrSetNodeAmlLength ($1, 8);} - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} + : Type3Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST); + TrSetOpAmlLength ($1, 8);} + | Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST); + TrSetOpAmlLength ($1, 8);} + | ConstExprTerm {$$ = TrSetOpIntegerValue (PARSEOP_QWORDCONST, $1);} | QWordConst {} ; ConstTerm : ConstExprTerm {} - | PARSEOP_REVISION {$$ = TrCreateLeafNode (PARSEOP_REVISION);} + | PARSEOP_REVISION {$$ = TrCreateLeafOp (PARSEOP_REVISION);} ; ConstExprTerm - : PARSEOP_ZERO {$$ = TrCreateValuedLeafNode (PARSEOP_ZERO, 0);} - | PARSEOP_ONE {$$ = TrCreateValuedLeafNode (PARSEOP_ONE, 1);} - | PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_UINT64_MAX);} - | PARSEOP___DATE__ {$$ = TrCreateConstantLeafNode (PARSEOP___DATE__);} - | PARSEOP___FILE__ {$$ = TrCreateConstantLeafNode (PARSEOP___FILE__);} - | PARSEOP___LINE__ {$$ = TrCreateConstantLeafNode (PARSEOP___LINE__);} - | PARSEOP___PATH__ {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);} + : PARSEOP_ZERO {$$ = TrCreateValuedLeafOp (PARSEOP_ZERO, 0);} + | PARSEOP_ONE {$$ = TrCreateValuedLeafOp (PARSEOP_ONE, 1);} + | PARSEOP_ONES {$$ = TrCreateValuedLeafOp (PARSEOP_ONES, ACPI_UINT64_MAX);} + | PARSEOP___DATE__ {$$ = TrCreateConstantLeafOp (PARSEOP___DATE__);} + | PARSEOP___FILE__ {$$ = TrCreateConstantLeafOp (PARSEOP___FILE__);} + | PARSEOP___LINE__ {$$ = TrCreateConstantLeafOp (PARSEOP___LINE__);} + | PARSEOP___PATH__ {$$ = TrCreateConstantLeafOp (PARSEOP___PATH__);} ; Integer - : PARSEOP_INTEGER {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, + : PARSEOP_INTEGER {$$ = TrCreateValuedLeafOp (PARSEOP_INTEGER, AslCompilerlval.i);} ; String - : PARSEOP_STRING_LITERAL {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, + : PARSEOP_STRING_LITERAL {$$ = TrCreateValuedLeafOp (PARSEOP_STRING_LITERAL, (ACPI_NATIVE_INT) AslCompilerlval.s);} ; @@ -739,7 +739,7 @@ Type2Opcode * Type 3/4/5 opcodes */ Type2IntegerOpcode /* "Type3" opcodes */ - : Expression {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} + : Expression {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);} | AddTerm {} | AndTerm {} | DecTerm {} @@ -788,7 +788,7 @@ Type2BufferOpcode /* "Type5" Opcodes */ ; Type2BufferOrStringOpcode - : ConcatTerm {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} + : ConcatTerm {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);} | PrintfTerm {} | FprintfTerm {} | MidTerm {} @@ -838,7 +838,7 @@ Type6Opcode ******************************************************************************/ AmlPackageLengthTerm - : Integer {$$ = TrUpdateNode (PARSEOP_PACKAGE_LENGTH, + : Integer {$$ = TrSetOpIntegerValue (PARSEOP_PACKAGE_LENGTH, (ACPI_PARSE_OBJECT *) $1);} ; @@ -853,14 +853,14 @@ TermArgItem ; OptionalReference - : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ - | ',' {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ + : {$$ = TrCreateLeafOp (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ + | ',' {$$ = TrCreateLeafOp (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ | ',' TermArg {$$ = $2;} ; OptionalReturnArg - : {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), - NODE_IS_NULL_RETURN);} /* Placeholder is a ZeroOp object */ + : {$$ = TrSetOpFlags (TrCreateLeafOp (PARSEOP_ZERO), + OP_IS_NULL_RETURN);} /* Placeholder is a ZeroOp object */ | TermArg {$$ = $1;} ; @@ -871,7 +871,7 @@ OptionalSerializeRuleKeyword ; OptionalTermArg - : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} + : {$$ = TrCreateLeafOp (PARSEOP_DEFAULT_ARG);} | TermArg {$$ = $1;} ; diff --git a/source/compiler/aslstartup.c b/source/compiler/aslstartup.c index 2f037bf87287..72c0d641e1ff 100644 --- a/source/compiler/aslstartup.c +++ b/source/compiler/aslstartup.c @@ -237,7 +237,7 @@ AslInitializeGlobals ( { Gbl_CommentState.SpacesBefore = 0; Gbl_CommentState.CommentType = 1; - Gbl_CommentState.Latest_Parse_Node = NULL; + Gbl_CommentState.LatestParseOp = NULL; Gbl_CommentState.ParsingParenBraceNode = NULL; Gbl_CommentState.CaptureComments = TRUE; } diff --git a/source/compiler/aslsupport.y b/source/compiler/aslsupport.y index 0eefb7bed039..bcced923e9d6 100644 --- a/source/compiler/aslsupport.y +++ b/source/compiler/aslsupport.y @@ -195,7 +195,7 @@ AslDoError ( void) { - return (TrCreateLeafNode (PARSEOP_ERRORNODE)); + return (TrCreateLeafOp (PARSEOP_ERRORNODE)); } diff --git a/source/compiler/asltransform.c b/source/compiler/asltransform.c index 7dc1f72b81d6..d3ed53a14dcd 100644 --- a/source/compiler/asltransform.c +++ b/source/compiler/asltransform.c @@ -602,7 +602,7 @@ TrDoSwitch ( { /* Add an ELSE to complete the previous CASE */ - NewOp = TrCreateLeafNode (PARSEOP_ELSE); + NewOp = TrCreateLeafOp (PARSEOP_ELSE); NewOp->Asl.Parent = Conditional->Asl.Parent; TrAmlInitLineNumbers (NewOp, NewOp->Asl.Parent); @@ -627,49 +627,49 @@ TrDoSwitch ( * If (LNotEqual (Match (Package(<size>){<data>}, * MEQ, _T_x, MTR, Zero, Zero), Ones)) */ - NewOp2 = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ); + NewOp2 = TrCreateLeafOp (PARSEOP_MATCHTYPE_MEQ); Predicate->Asl.Next = NewOp2; TrAmlInitLineNumbers (NewOp2, Conditional); NewOp = NewOp2; - NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, + NewOp2 = TrCreateValuedLeafOp (PARSEOP_NAMESTRING, (UINT64) ACPI_TO_INTEGER (PredicateValueName)); NewOp->Asl.Next = NewOp2; TrAmlInitLineNumbers (NewOp2, Predicate); NewOp = NewOp2; - NewOp2 = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR); + NewOp2 = TrCreateLeafOp (PARSEOP_MATCHTYPE_MTR); NewOp->Asl.Next = NewOp2; TrAmlInitLineNumbers (NewOp2, Predicate); NewOp = NewOp2; - NewOp2 = TrCreateLeafNode (PARSEOP_ZERO); + NewOp2 = TrCreateLeafOp (PARSEOP_ZERO); NewOp->Asl.Next = NewOp2; TrAmlInitLineNumbers (NewOp2, Predicate); NewOp = NewOp2; - NewOp2 = TrCreateLeafNode (PARSEOP_ZERO); + NewOp2 = TrCreateLeafOp (PARSEOP_ZERO); NewOp->Asl.Next = NewOp2; TrAmlInitLineNumbers (NewOp2, Predicate); - NewOp2 = TrCreateLeafNode (PARSEOP_MATCH); + NewOp2 = TrCreateLeafOp (PARSEOP_MATCH); NewOp2->Asl.Child = Predicate; /* PARSEOP_PACKAGE */ TrAmlInitLineNumbers (NewOp2, Conditional); TrAmlSetSubtreeParent (Predicate, NewOp2); NewOp = NewOp2; - NewOp2 = TrCreateLeafNode (PARSEOP_ONES); + NewOp2 = TrCreateLeafOp (PARSEOP_ONES); NewOp->Asl.Next = NewOp2; TrAmlInitLineNumbers (NewOp2, Conditional); - NewOp2 = TrCreateLeafNode (PARSEOP_LEQUAL); + NewOp2 = TrCreateLeafOp (PARSEOP_LEQUAL); NewOp2->Asl.Child = NewOp; NewOp->Asl.Parent = NewOp2; TrAmlInitLineNumbers (NewOp2, Conditional); TrAmlSetSubtreeParent (NewOp, NewOp2); NewOp = NewOp2; - NewOp2 = TrCreateLeafNode (PARSEOP_LNOT); + NewOp2 = TrCreateLeafOp (PARSEOP_LNOT); NewOp2->Asl.Child = NewOp; NewOp2->Asl.Parent = Conditional; NewOp->Asl.Parent = NewOp2; @@ -690,12 +690,12 @@ TrDoSwitch ( * CaseOp->Child is the case value * CaseOp->Child->Peer is the beginning of the case block */ - NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, + NewOp = TrCreateValuedLeafOp (PARSEOP_NAMESTRING, (UINT64) ACPI_TO_INTEGER (PredicateValueName)); NewOp->Asl.Next = Predicate; TrAmlInitLineNumbers (NewOp, Predicate); - NewOp2 = TrCreateLeafNode (PARSEOP_LEQUAL); + NewOp2 = TrCreateLeafOp (PARSEOP_LEQUAL); NewOp2->Asl.Parent = Conditional; NewOp2->Asl.Child = NewOp; TrAmlInitLineNumbers (NewOp2, Conditional); @@ -792,7 +792,7 @@ TrDoSwitch ( /* Create the Name node */ Predicate = StartNode->Asl.Child; - NewOp = TrCreateLeafNode (PARSEOP_NAME); + NewOp = TrCreateLeafOp (PARSEOP_NAME); TrAmlInitLineNumbers (NewOp, StartNode); /* Find the parent method */ @@ -805,7 +805,7 @@ TrDoSwitch ( } MethodOp = Next; - NewOp->Asl.CompileFlags |= NODE_COMPILER_EMITTED; + NewOp->Asl.CompileFlags |= OP_COMPILER_EMITTED; NewOp->Asl.Parent = Next; /* Insert name after the method name and arguments */ @@ -836,10 +836,10 @@ TrDoSwitch ( /* Create the NameSeg child for the Name node */ - NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESEG, + NewOp2 = TrCreateValuedLeafOp (PARSEOP_NAMESEG, (UINT64) ACPI_TO_INTEGER (PredicateValueName)); TrAmlInitLineNumbers (NewOp2, NewOp); - NewOp2->Asl.CompileFlags |= NODE_IS_NAME_DECLARATION; + NewOp2->Asl.CompileFlags |= OP_IS_NAME_DECLARATION; NewOp->Asl.Child = NewOp2; /* Create the initial value for the Name. Btype was already validated above */ @@ -848,31 +848,32 @@ TrDoSwitch ( { case ACPI_BTYPE_INTEGER: - NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_ZERO, + NewOp2->Asl.Next = TrCreateValuedLeafOp (PARSEOP_ZERO, (UINT64) 0); TrAmlInitLineNumbers (NewOp2->Asl.Next, NewOp); break; case ACPI_BTYPE_STRING: - NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, + NewOp2->Asl.Next = TrCreateValuedLeafOp (PARSEOP_STRING_LITERAL, (UINT64) ACPI_TO_INTEGER ("")); TrAmlInitLineNumbers (NewOp2->Asl.Next, NewOp); break; case ACPI_BTYPE_BUFFER: - (void) TrLinkPeerNode (NewOp2, TrCreateValuedLeafNode (PARSEOP_BUFFER, + (void) TrLinkPeerOp (NewOp2, TrCreateValuedLeafOp (PARSEOP_BUFFER, (UINT64) 0)); Next = NewOp2->Asl.Next; TrAmlInitLineNumbers (Next, NewOp2); - (void) TrLinkChildren (Next, 1, TrCreateValuedLeafNode (PARSEOP_ZERO, + + (void) TrLinkOpChildren (Next, 1, TrCreateValuedLeafOp (PARSEOP_ZERO, (UINT64) 1)); TrAmlInitLineNumbers (Next->Asl.Child, Next); - BufferOp = TrCreateValuedLeafNode (PARSEOP_DEFAULT_ARG, (UINT64) 0); + BufferOp = TrCreateValuedLeafOp (PARSEOP_DEFAULT_ARG, (UINT64) 0); TrAmlInitLineNumbers (BufferOp, Next->Asl.Child); - (void) TrLinkPeerNode (Next->Asl.Child, BufferOp); + (void) TrLinkPeerOp (Next->Asl.Child, BufferOp); TrAmlSetSubtreeParent (Next->Asl.Child, Next); break; @@ -891,7 +892,7 @@ TrDoSwitch ( * where _T_x is the temp variable. */ TrAmlInitNode (StartNode, PARSEOP_WHILE); - NewOp = TrCreateLeafNode (PARSEOP_ONE); + NewOp = TrCreateLeafOp (PARSEOP_ONE); TrAmlInitLineNumbers (NewOp, StartNode); NewOp->Asl.Next = Predicate->Asl.Next; NewOp->Asl.Parent = StartNode; @@ -899,7 +900,7 @@ TrDoSwitch ( /* Create a Store() node */ - StoreOp = TrCreateLeafNode (PARSEOP_STORE); + StoreOp = TrCreateLeafOp (PARSEOP_STORE); TrAmlInitLineNumbers (StoreOp, NewOp); StoreOp->Asl.Parent = StartNode; TrAmlInsertPeer (NewOp, StoreOp); @@ -909,7 +910,7 @@ TrDoSwitch ( StoreOp->Asl.Child = Predicate; Predicate->Asl.Parent = StoreOp; - NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESEG, + NewOp = TrCreateValuedLeafOp (PARSEOP_NAMESEG, (UINT64) ACPI_TO_INTEGER (PredicateValueName)); TrAmlInitLineNumbers (NewOp, StoreOp); NewOp->Asl.Parent = StoreOp; @@ -923,7 +924,7 @@ TrDoSwitch ( Conditional = Conditional->Asl.Next; } - BreakOp = TrCreateLeafNode (PARSEOP_BREAK); + BreakOp = TrCreateLeafOp (PARSEOP_BREAK); TrAmlInitLineNumbers (BreakOp, NewOp); BreakOp->Asl.Parent = StartNode; TrAmlInsertPeer (Conditional, BreakOp); diff --git a/source/compiler/asltree.c b/source/compiler/asltree.c index b80a42263fc9..8b709df72745 100644 --- a/source/compiler/asltree.c +++ b/source/compiler/asltree.c @@ -1,6 +1,6 @@ /****************************************************************************** * - * Module Name: asltree - parse tree management + * Module Name: asltree - Parse tree management * *****************************************************************************/ @@ -152,253 +152,27 @@ #include "aslcompiler.h" #include "aslcompiler.y.h" #include "acapps.h" -#include "acconvert.h" -#include <time.h> #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("asltree") -/* Local prototypes */ - -static ACPI_PARSE_OBJECT * -TrGetNextNode ( - void); - - -/******************************************************************************* - * - * FUNCTION: TrSetParent - * - * PARAMETERS: Op - To be set to new parent - * ParentOp - The parent - * - * RETURN: None, sets Op parent directly - * - * DESCRIPTION: Change the parent of a parse op. - * - ******************************************************************************/ - -void -TrSetParent ( - ACPI_PARSE_OBJECT *Op, - ACPI_PARSE_OBJECT *ParentOp) -{ - - Op->Asl.Parent = ParentOp; -} - /******************************************************************************* * - * FUNCTION: TrGetNextNode + * FUNCTION: TrSetOpIntegerValue * - * PARAMETERS: None + * PARAMETERS: ParseOpcode - New opcode to be assigned to the op + * Op - An existing parse op * - * RETURN: New parse node. Aborts on allocation failure + * RETURN: The updated op * - * DESCRIPTION: Allocate a new parse node for the parse tree. Bypass the local - * dynamic memory manager for performance reasons (This has a - * major impact on the speed of the compiler.) - * - ******************************************************************************/ - -static ACPI_PARSE_OBJECT * -TrGetNextNode ( - void) -{ - ASL_CACHE_INFO *Cache; - - - if (Gbl_ParseOpCacheNext >= Gbl_ParseOpCacheLast) - { - /* Allocate a new buffer */ - - Cache = UtLocalCalloc (sizeof (Cache->Next) + - (sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE)); - - /* Link new cache buffer to head of list */ - - Cache->Next = Gbl_ParseOpCacheList; - Gbl_ParseOpCacheList = Cache; - - /* Setup cache management pointers */ - - Gbl_ParseOpCacheNext = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Cache->Buffer); - Gbl_ParseOpCacheLast = Gbl_ParseOpCacheNext + ASL_PARSEOP_CACHE_SIZE; - } - - Gbl_ParseOpCount++; - return (Gbl_ParseOpCacheNext++); -} - - -/******************************************************************************* - * - * FUNCTION: TrAllocateNode - * - * PARAMETERS: ParseOpcode - Opcode to be assigned to the node - * - * RETURN: New parse node. Aborts on allocation failure - * - * DESCRIPTION: Allocate and initialize a new parse node for the parse tree + * DESCRIPTION: Used to set the integer value of a op, + * usually to a specific size (8, 16, 32, or 64 bits) * ******************************************************************************/ ACPI_PARSE_OBJECT * -TrAllocateNode ( - UINT32 ParseOpcode) -{ - ACPI_PARSE_OBJECT *Op; - ACPI_PARSE_OBJECT *LatestNode; - - - Op = TrGetNextNode (); - - Op->Asl.ParseOpcode = (UINT16) ParseOpcode; - Op->Asl.Filename = Gbl_Files[ASL_FILE_INPUT].Filename; - Op->Asl.LineNumber = Gbl_CurrentLineNumber; - Op->Asl.LogicalLineNumber = Gbl_LogicalLineNumber; - Op->Asl.LogicalByteOffset = Gbl_CurrentLineOffset; - Op->Asl.Column = Gbl_CurrentColumn; - - UtSetParseOpName (Op); - - /* The following is for capturing comments */ - - if(Gbl_CaptureComments) - { - LatestNode = Gbl_CommentState.Latest_Parse_Node; - Op->Asl.InlineComment = NULL; - Op->Asl.EndNodeComment = NULL; - Op->Asl.CommentList = NULL; - Op->Asl.FileChanged = FALSE; - - /* - * Check to see if the file name has changed before resetting the - * latest parse node. - */ - if (LatestNode && - (ParseOpcode != PARSEOP_INCLUDE) && - (ParseOpcode != PARSEOP_INCLUDE_END) && - strcmp (LatestNode->Asl.Filename, Op->Asl.Filename)) - { - CvDbgPrint ("latest node: %s\n", LatestNode->Asl.ParseOpName); - Op->Asl.FileChanged = TRUE; - if (Gbl_IncludeFileStack) - { - Op->Asl.ParentFilename = Gbl_IncludeFileStack->Filename; - } - else - { - Op->Asl.ParentFilename = NULL; - } - } - - Gbl_CommentState.Latest_Parse_Node = Op; - CvDbgPrint ("trallocatenode=Set latest parse node to this node.\n"); - CvDbgPrint (" Op->Asl.ParseOpName = %s\n", - Gbl_CommentState.Latest_Parse_Node->Asl.ParseOpName); - CvDbgPrint (" Op->Asl.ParseOpcode = 0x%x\n", ParseOpcode); - - if (Op->Asl.FileChanged) - { - CvDbgPrint(" file has been changed!\n"); - } - - /* - * if this parse op's syntax uses () and {} (i.e. Package(1){0x00}) then - * set a flag in the comment state. This facilitates paring comments for - * these types of opcodes. - */ - if ((CvParseOpBlockType(Op) == (BLOCK_PAREN | BLOCK_BRACE)) && - (ParseOpcode != PARSEOP_DEFINITION_BLOCK)) - { - CvDbgPrint ("Parsing paren/Brace node now!\n"); - Gbl_CommentState.ParsingParenBraceNode = Op; - } - - if (Gbl_Comment_List_Head) - { - CvDbgPrint ("Transferring...\n"); - Op->Asl.CommentList = Gbl_Comment_List_Head; - Gbl_Comment_List_Head = NULL; - Gbl_Comment_List_Tail = NULL; - CvDbgPrint (" Transferred current comment list to this node.\n"); - CvDbgPrint (" %s\n", Op->Asl.CommentList->Comment); - } - if (Gbl_Inline_Comment_Buffer) - { - Op->Asl.InlineComment = Gbl_Inline_Comment_Buffer; - Gbl_Inline_Comment_Buffer = NULL; - CvDbgPrint ("Transferred current inline comment list to this node.\n"); - } - - } - - return (Op); -} - - -/******************************************************************************* - * - * FUNCTION: TrReleaseNode - * - * PARAMETERS: Op - Op to be released - * - * RETURN: None - * - * DESCRIPTION: "release" a node. In truth, nothing is done since the node - * is part of a larger buffer - * - ******************************************************************************/ - -void -TrReleaseNode ( - ACPI_PARSE_OBJECT *Op) -{ - - return; -} - - -/******************************************************************************* - * - * FUNCTION: TrSetCurrentFilename - * - * PARAMETERS: Op - An existing parse node - * - * RETURN: None - * - * DESCRIPTION: Save the include file filename. Used for debug output only. - * - ******************************************************************************/ - -void -TrSetCurrentFilename ( - ACPI_PARSE_OBJECT *Op) -{ - Op->Asl.Filename = Gbl_PreviousIncludeFilename; -} - - -/******************************************************************************* - * - * FUNCTION: TrUpdateNode - * - * PARAMETERS: ParseOpcode - New opcode to be assigned to the node - * Op - An existing parse node - * - * RETURN: The updated node - * - * DESCRIPTION: Change the parse opcode assigned to a node. Usually used to - * change an opcode to DEFAULT_ARG so that the node is ignored - * during the code generation. Also used to set generic integers - * to a specific size (8, 16, 32, or 64 bits) - * - ******************************************************************************/ - -ACPI_PARSE_OBJECT * -TrUpdateNode ( +TrSetOpIntegerValue ( UINT32 ParseOpcode, ACPI_PARSE_OBJECT *Op) { @@ -409,7 +183,7 @@ TrUpdateNode ( } DbgPrint (ASL_PARSE_OUTPUT, - "\nUpdateNode: Old - %s, New - %s\n", + "\nUpdateOp: Old - %s, New - %s\n", UtGetOpName (Op->Asl.ParseOpcode), UtGetOpName (ParseOpcode)); @@ -477,7 +251,8 @@ TrUpdateNode ( break; } - /* Converter: if this is a method invocation, turn off capture comments. */ + /* Converter: if this is a method invocation, turn off capture comments */ + if (Gbl_CaptureComments && (ParseOpcode == PARSEOP_METHODCALL)) { @@ -490,164 +265,19 @@ TrUpdateNode ( /******************************************************************************* * - * FUNCTION: TrPrintNodeCompileFlags - * - * PARAMETERS: Flags - Flags word to be decoded - * - * RETURN: None - * - * DESCRIPTION: Decode a flags word to text. Displays all flags that are set. - * - ******************************************************************************/ - -void -TrPrintNodeCompileFlags ( - UINT32 Flags) -{ - UINT32 i; - UINT32 FlagBit = 1; - char *FlagName = NULL; - - - for (i = 0; i < 32; i++) - { - switch (Flags & FlagBit) - { - case NODE_VISITED: - - FlagName = "NODE_VISITED"; - break; - - case NODE_AML_PACKAGE: - - FlagName = "NODE_AML_PACKAGE"; - break; - - case NODE_IS_TARGET: - - FlagName = "NODE_IS_TARGET"; - break; - - case NODE_IS_RESOURCE_DESC: - - FlagName = "NODE_IS_RESOURCE_DESC"; - break; - - case NODE_IS_RESOURCE_FIELD: - - FlagName = "NODE_IS_RESOURCE_FIELD"; - break; - - case NODE_HAS_NO_EXIT: - - FlagName = "NODE_HAS_NO_EXIT"; - break; - - case NODE_IF_HAS_NO_EXIT: - - FlagName = "NODE_IF_HAS_NO_EXIT"; - break; - - case NODE_NAME_INTERNALIZED: - - FlagName = "NODE_NAME_INTERNALIZED"; - break; - - case NODE_METHOD_NO_RETVAL: - - FlagName = "NODE_METHOD_NO_RETVAL"; - break; - - case NODE_METHOD_SOME_NO_RETVAL: - - FlagName = "NODE_METHOD_SOME_NO_RETVAL"; - break; - - case NODE_RESULT_NOT_USED: - - FlagName = "NODE_RESULT_NOT_USED"; - break; - - case NODE_METHOD_TYPED: - - FlagName = "NODE_METHOD_TYPED"; - break; - - case NODE_COULD_NOT_REDUCE: - - FlagName = "NODE_COULD_NOT_REDUCE"; - break; - - case NODE_COMPILE_TIME_CONST: - - FlagName = "NODE_COMPILE_TIME_CONST"; - break; - - case NODE_IS_TERM_ARG: - - FlagName = "NODE_IS_TERM_ARG"; - break; - - case NODE_WAS_ONES_OP: - - FlagName = "NODE_WAS_ONES_OP"; - break; - - case NODE_IS_NAME_DECLARATION: - - FlagName = "NODE_IS_NAME_DECLARATION"; - break; - - case NODE_COMPILER_EMITTED: - - FlagName = "NODE_COMPILER_EMITTED"; - break; - - case NODE_IS_DUPLICATE: - - FlagName = "NODE_IS_DUPLICATE"; - break; - - case NODE_IS_RESOURCE_DATA: - - FlagName = "NODE_IS_RESOURCE_DATA"; - break; - - case NODE_IS_NULL_RETURN: - - FlagName = "NODE_IS_NULL_RETURN"; - break; - - default: - break; - } - - if (FlagName) - { - DbgPrint (ASL_PARSE_OUTPUT, " %s", FlagName); - FlagName = NULL; - } - - FlagBit <<= 1; - } -} - - -/******************************************************************************* - * - * FUNCTION: TrSetNodeFlags + * FUNCTION: TrSetOpFlags * - * PARAMETERS: Op - An existing parse node + * PARAMETERS: Op - An existing parse op * Flags - New flags word * * RETURN: The updated parser op * - * DESCRIPTION: Set bits in the node flags word. Will not clear bits, only set + * DESCRIPTION: Set bits in the op flags word. Will not clear bits, only set * ******************************************************************************/ ACPI_PARSE_OBJECT * -TrSetNodeFlags ( +TrSetOpFlags ( ACPI_PARSE_OBJECT *Op, UINT32 Flags) { @@ -658,9 +288,9 @@ TrSetNodeFlags ( } DbgPrint (ASL_PARSE_OUTPUT, - "\nSetNodeFlags: %s Op %p, %8.8X", Op->Asl.ParseOpName, Op, Flags); + "\nSetOpFlags: %s Op %p, %8.8X", Op->Asl.ParseOpName, Op, Flags); - TrPrintNodeCompileFlags (Flags); + TrPrintOpFlags (Flags, ASL_PARSE_OUTPUT); DbgPrint (ASL_PARSE_OUTPUT, "\n\n"); Op->Asl.CompileFlags |= Flags; @@ -670,27 +300,27 @@ TrSetNodeFlags ( /******************************************************************************* * - * FUNCTION: TrSetNodeAmlLength + * FUNCTION: TrSetOpAmlLength * - * PARAMETERS: Op - An existing parse node + * PARAMETERS: Op - An existing parse op * Length - AML Length * * RETURN: The updated parser op * - * DESCRIPTION: Set the AML Length in a node. Used by the parser to indicate - * the presence of a node that must be reduced to a fixed length + * DESCRIPTION: Set the AML Length in a op. Used by the parser to indicate + * the presence of a op that must be reduced to a fixed length * constant. * ******************************************************************************/ ACPI_PARSE_OBJECT * -TrSetNodeAmlLength ( +TrSetOpAmlLength ( ACPI_PARSE_OBJECT *Op, UINT32 Length) { DbgPrint (ASL_PARSE_OUTPUT, - "\nSetNodeAmlLength: Op %p, %8.8X\n", Op, Length); + "\nSetOpAmlLength: Op %p, %8.8X\n", Op, Length); if (!Op) { @@ -704,646 +334,95 @@ TrSetNodeAmlLength ( /******************************************************************************* * - * FUNCTION: TrSetEndLineNumber + * FUNCTION: TrSetOpParent * - * PARAMETERS: Op - An existing parse node + * PARAMETERS: Op - To be set to new parent + * ParentOp - The parent * - * RETURN: None. + * RETURN: None, sets Op parent directly * - * DESCRIPTION: Set the ending line numbers (file line and logical line) of a - * parse node to the current line numbers. + * DESCRIPTION: Change the parent of a parse op. * ******************************************************************************/ void -TrSetEndLineNumber ( - ACPI_PARSE_OBJECT *Op) -{ - - /* If the end line # is already set, just return */ - - if (Op->Asl.EndLine) - { - return; - } - - Op->Asl.EndLine = Gbl_CurrentLineNumber; - Op->Asl.EndLogicalLine = Gbl_LogicalLineNumber; -} - - -/******************************************************************************* - * - * FUNCTION: TrCreateAssignmentNode - * - * PARAMETERS: Target - Assignment target - * Source - Assignment source - * - * RETURN: Pointer to the new node. Aborts on allocation failure - * - * DESCRIPTION: Implements the C-style '=' operator. It changes the parse - * tree if possible to utilize the last argument of the math - * operators which is a target operand -- thus saving invocation - * of and additional Store() operator. An optimization. - * - ******************************************************************************/ - -ACPI_PARSE_OBJECT * -TrCreateAssignmentNode ( - ACPI_PARSE_OBJECT *Target, - ACPI_PARSE_OBJECT *Source) -{ - ACPI_PARSE_OBJECT *TargetOp; - ACPI_PARSE_OBJECT *SourceOp1; - ACPI_PARSE_OBJECT *SourceOp2; - ACPI_PARSE_OBJECT *Operator; - - - DbgPrint (ASL_PARSE_OUTPUT, - "\nTrCreateAssignmentNode Line [%u to %u] Source %s Target %s\n", - Source->Asl.LineNumber, Source->Asl.EndLine, - UtGetOpName (Source->Asl.ParseOpcode), - UtGetOpName (Target->Asl.ParseOpcode)); - - TrSetNodeFlags (Target, NODE_IS_TARGET); - - switch (Source->Asl.ParseOpcode) - { - /* - * Only these operators can be optimized because they have - * a target operand - */ - case PARSEOP_ADD: - case PARSEOP_AND: - case PARSEOP_DIVIDE: - case PARSEOP_INDEX: - case PARSEOP_MOD: - case PARSEOP_MULTIPLY: - case PARSEOP_NOT: - case PARSEOP_OR: - case PARSEOP_SHIFTLEFT: - case PARSEOP_SHIFTRIGHT: - case PARSEOP_SUBTRACT: - case PARSEOP_XOR: - - break; - - /* Otherwise, just create a normal Store operator */ - - default: - - goto CannotOptimize; - } - - /* - * Transform the parse tree such that the target is moved to the - * last operand of the operator - */ - SourceOp1 = Source->Asl.Child; - SourceOp2 = SourceOp1->Asl.Next; - - /* NOT only has one operand, but has a target */ - - if (Source->Asl.ParseOpcode == PARSEOP_NOT) - { - SourceOp2 = SourceOp1; - } - - /* DIVIDE has an extra target operand (remainder) */ - - if (Source->Asl.ParseOpcode == PARSEOP_DIVIDE) - { - SourceOp2 = SourceOp2->Asl.Next; - } - - TargetOp = SourceOp2->Asl.Next; - - /* - * Can't perform this optimization if there already is a target - * for the operator (ZERO is a "no target" placeholder). - */ - if (TargetOp->Asl.ParseOpcode != PARSEOP_ZERO) - { - goto CannotOptimize; - } - - /* Link in the target as the final operand */ - - SourceOp2->Asl.Next = Target; - Target->Asl.Parent = Source; - - return (Source); - - -CannotOptimize: - - Operator = TrAllocateNode (PARSEOP_STORE); - TrLinkChildren (Operator, 2, Source, Target); - - /* Set the appropriate line numbers for the new node */ - - Operator->Asl.LineNumber = Target->Asl.LineNumber; - Operator->Asl.LogicalLineNumber = Target->Asl.LogicalLineNumber; - Operator->Asl.LogicalByteOffset = Target->Asl.LogicalByteOffset; - Operator->Asl.Column = Target->Asl.Column; - - return (Operator); -} - - -/******************************************************************************* - * - * FUNCTION: TrCreateLeafNode - * - * PARAMETERS: ParseOpcode - New opcode to be assigned to the node - * - * RETURN: Pointer to the new node. Aborts on allocation failure - * - * DESCRIPTION: Create a simple leaf node (no children or peers, and no value - * assigned to the node) - * - ******************************************************************************/ - -ACPI_PARSE_OBJECT * -TrCreateLeafNode ( - UINT32 ParseOpcode) -{ - ACPI_PARSE_OBJECT *Op; - - - Op = TrAllocateNode (ParseOpcode); - - DbgPrint (ASL_PARSE_OUTPUT, - "\nCreateLeafNode Ln/Col %u/%u NewNode %p Op %s\n\n", - Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode)); - - return (Op); -} - - -/******************************************************************************* - * - * FUNCTION: TrCreateNullTarget - * - * PARAMETERS: None - * - * RETURN: Pointer to the new node. Aborts on allocation failure - * - * DESCRIPTION: Create a "null" target node. This is defined by the ACPI - * specification to be a zero AML opcode, and indicates that - * no target has been specified for the parent operation - * - ******************************************************************************/ - -ACPI_PARSE_OBJECT * -TrCreateNullTarget ( - void) -{ - ACPI_PARSE_OBJECT *Op; - - - Op = TrAllocateNode (PARSEOP_ZERO); - Op->Asl.CompileFlags |= (NODE_IS_TARGET | NODE_COMPILE_TIME_CONST); - - DbgPrint (ASL_PARSE_OUTPUT, - "\nCreateNullTarget Ln/Col %u/%u NewNode %p Op %s\n", - Op->Asl.LineNumber, Op->Asl.Column, Op, - UtGetOpName (Op->Asl.ParseOpcode)); - - return (Op); -} - - -/******************************************************************************* - * - * FUNCTION: TrCreateConstantLeafNode - * - * PARAMETERS: ParseOpcode - The constant opcode - * - * RETURN: Pointer to the new node. Aborts on allocation failure - * - * DESCRIPTION: Create a leaf node (no children or peers) for one of the - * special constants - __LINE__, __FILE__, and __DATE__. - * - * Note: An implemenation of __FUNC__ cannot happen here because we don't - * have a full parse tree at this time and cannot find the parent control - * method. If it is ever needed, __FUNC__ must be implemented later, after - * the parse tree has been fully constructed. - * - ******************************************************************************/ - -ACPI_PARSE_OBJECT * -TrCreateConstantLeafNode ( - UINT32 ParseOpcode) -{ - ACPI_PARSE_OBJECT *Op = NULL; - time_t CurrentTime; - char *StaticTimeString; - char *TimeString; - char *Filename; - - - switch (ParseOpcode) - { - case PARSEOP___LINE__: - - Op = TrAllocateNode (PARSEOP_INTEGER); - Op->Asl.Value.Integer = Op->Asl.LineNumber; - break; - - case PARSEOP___PATH__: - - Op = TrAllocateNode (PARSEOP_STRING_LITERAL); - - /* Op.Asl.Filename contains the full pathname to the file */ - - Op->Asl.Value.String = Op->Asl.Filename; - break; - - case PARSEOP___FILE__: - - Op = TrAllocateNode (PARSEOP_STRING_LITERAL); - - /* Get the simple filename from the full path */ - - FlSplitInputPathname (Op->Asl.Filename, NULL, &Filename); - Op->Asl.Value.String = Filename; - break; - - case PARSEOP___DATE__: - - Op = TrAllocateNode (PARSEOP_STRING_LITERAL); - - /* Get a copy of the current time */ - - CurrentTime = time (NULL); - StaticTimeString = ctime (&CurrentTime); - TimeString = UtLocalCalloc (strlen (StaticTimeString) + 1); - strcpy (TimeString, StaticTimeString); - - TimeString[strlen(TimeString) -1] = 0; /* Remove trailing newline */ - Op->Asl.Value.String = TimeString; - break; - - default: /* This would be an internal error */ - - return (NULL); - } - - DbgPrint (ASL_PARSE_OUTPUT, - "\nCreateConstantLeafNode Ln/Col %u/%u NewNode %p " - "Op %s Value %8.8X%8.8X \n", - Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode), - ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer)); - return (Op); -} - - -/******************************************************************************* - * - * FUNCTION: TrCreateTargetOperand - * - * PARAMETERS: OriginalOp - Op to be copied - * - * RETURN: Pointer to the new node. Aborts on allocation failure - * - * DESCRIPTION: Copy an existing node (and subtree). Used in ASL+ (C-style) - * expressions where the target is the same as one of the - * operands. A new node and subtree must be created from the - * original so that the parse tree can be linked properly. - * - * NOTE: This code is specific to target operands that are the last - * operand in an ASL/AML operator. Meaning that the top-level - * parse Op in a possible subtree has a NULL Next pointer. - * This simplifies the recursion. - * - * Subtree example: - * DeRefOf (Local1) += 32 - * - * This gets converted to: - * Add (DeRefOf (Local1), 32, DeRefOf (Local1)) - * - * Each DeRefOf has a single child, Local1. Even more complex - * subtrees can be created via the Index and DeRefOf operators. - * - ******************************************************************************/ - -ACPI_PARSE_OBJECT * -TrCreateTargetOperand ( - ACPI_PARSE_OBJECT *OriginalOp, +TrSetOpParent ( + ACPI_PARSE_OBJECT *Op, ACPI_PARSE_OBJECT *ParentOp) { - ACPI_PARSE_OBJECT *Op; - - - if (!OriginalOp) - { - return (NULL); - } - - Op = TrGetNextNode (); - - /* Copy the pertinent values (omit link pointer fields) */ - - Op->Asl.Value = OriginalOp->Asl.Value; - Op->Asl.Filename = OriginalOp->Asl.Filename; - Op->Asl.LineNumber = OriginalOp->Asl.LineNumber; - Op->Asl.LogicalLineNumber = OriginalOp->Asl.LogicalLineNumber; - Op->Asl.LogicalByteOffset = OriginalOp->Asl.LogicalByteOffset; - Op->Asl.Column = OriginalOp->Asl.Column; - Op->Asl.Flags = OriginalOp->Asl.Flags; - Op->Asl.CompileFlags = OriginalOp->Asl.CompileFlags; - Op->Asl.AmlOpcode = OriginalOp->Asl.AmlOpcode; - Op->Asl.ParseOpcode = OriginalOp->Asl.ParseOpcode; - Op->Asl.Parent = ParentOp; - UtSetParseOpName (Op); - - /* Copy a possible subtree below this node */ - - if (OriginalOp->Asl.Child) - { - Op->Asl.Child = TrCreateTargetOperand (OriginalOp->Asl.Child, Op); - } - - if (OriginalOp->Asl.Next) /* Null for top-level node */ - { - Op->Asl.Next = TrCreateTargetOperand (OriginalOp->Asl.Next, ParentOp); - } - return (Op); + Op->Asl.Parent = ParentOp; } /******************************************************************************* * - * FUNCTION: TrCreateValuedLeafNode + * FUNCTION: TrSetOpCurrentFilename * - * PARAMETERS: ParseOpcode - New opcode to be assigned to the node - * Value - Value to be assigned to the node + * PARAMETERS: Op - An existing parse op * - * RETURN: Pointer to the new node. Aborts on allocation failure + * RETURN: None * - * DESCRIPTION: Create a leaf node (no children or peers) with a value - * assigned to it + * DESCRIPTION: Save the include file filename. Used for debug output only. * ******************************************************************************/ -ACPI_PARSE_OBJECT * -TrCreateValuedLeafNode ( - UINT32 ParseOpcode, - UINT64 Value) +void +TrSetOpCurrentFilename ( + ACPI_PARSE_OBJECT *Op) { - ACPI_PARSE_OBJECT *Op; - - - Op = TrAllocateNode (ParseOpcode); - - DbgPrint (ASL_PARSE_OUTPUT, - "\nCreateValuedLeafNode Ln/Col %u/%u NewNode %p " - "Op %s Value %8.8X%8.8X ", - Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode), - ACPI_FORMAT_UINT64 (Value)); - Op->Asl.Value.Integer = Value; - - switch (ParseOpcode) - { - case PARSEOP_STRING_LITERAL: - - DbgPrint (ASL_PARSE_OUTPUT, "STRING->%s", Value); - break; - case PARSEOP_NAMESEG: - - DbgPrint (ASL_PARSE_OUTPUT, "NAMESEG->%s", Value); - break; - - case PARSEOP_NAMESTRING: - - DbgPrint (ASL_PARSE_OUTPUT, "NAMESTRING->%s", Value); - break; - - case PARSEOP_EISAID: - - DbgPrint (ASL_PARSE_OUTPUT, "EISAID->%s", Value); - break; - - case PARSEOP_METHOD: - - DbgPrint (ASL_PARSE_OUTPUT, "METHOD"); - break; - - case PARSEOP_INTEGER: - - DbgPrint (ASL_PARSE_OUTPUT, "INTEGER->%8.8X%8.8X", - ACPI_FORMAT_UINT64 (Value)); - break; - - default: - - break; - } - - DbgPrint (ASL_PARSE_OUTPUT, "\n\n"); - return (Op); + Op->Asl.Filename = Gbl_PreviousIncludeFilename; } /******************************************************************************* * - * FUNCTION: TrCreateNode + * FUNCTION: TrSetOpEndLineNumber * - * PARAMETERS: ParseOpcode - Opcode to be assigned to the node - * NumChildren - Number of children to follow - * ... - A list of child nodes to link to the new - * node. NumChildren long. + * PARAMETERS: Op - An existing parse op * - * RETURN: Pointer to the new node. Aborts on allocation failure + * RETURN: None. * - * DESCRIPTION: Create a new parse node and link together a list of child - * nodes underneath the new node. + * DESCRIPTION: Set the ending line numbers (file line and logical line) of a + * parse op to the current line numbers. * ******************************************************************************/ -ACPI_PARSE_OBJECT * -TrCreateNode ( - UINT32 ParseOpcode, - UINT32 NumChildren, - ...) +void +TrSetOpEndLineNumber ( + ACPI_PARSE_OBJECT *Op) { - ACPI_PARSE_OBJECT *Op; - ACPI_PARSE_OBJECT *Child; - ACPI_PARSE_OBJECT *PrevChild; - va_list ap; - UINT32 i; - BOOLEAN FirstChild; + /* If the end line # is already set, just return */ - va_start (ap, NumChildren); - - /* Allocate one new node */ - - Op = TrAllocateNode (ParseOpcode); - - DbgPrint (ASL_PARSE_OUTPUT, - "\nCreateNode Ln/Col %u/%u NewParent %p Child %u Op %s ", - Op->Asl.LineNumber, Op->Asl.Column, Op, - NumChildren, UtGetOpName(ParseOpcode)); - - /* Some extra debug output based on the parse opcode */ - - switch (ParseOpcode) - { - case PARSEOP_ASL_CODE: - - Gbl_ParseTreeRoot = Op; - Op->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; - DbgPrint (ASL_PARSE_OUTPUT, "ASLCODE (Tree Completed)->"); - break; - - case PARSEOP_DEFINITION_BLOCK: - - DbgPrint (ASL_PARSE_OUTPUT, "DEFINITION_BLOCK (Tree Completed)->"); - break; - - case PARSEOP_OPERATIONREGION: - - DbgPrint (ASL_PARSE_OUTPUT, "OPREGION->"); - break; - - case PARSEOP_OR: - - DbgPrint (ASL_PARSE_OUTPUT, "OR->"); - break; - - default: - - /* Nothing to do for other opcodes */ - - break; - } - - /* Link the new node to its children */ - - PrevChild = NULL; - FirstChild = TRUE; - for (i = 0; i < NumChildren; i++) + if (Op->Asl.EndLine) { - /* Get the next child */ - - Child = va_arg (ap, ACPI_PARSE_OBJECT *); - DbgPrint (ASL_PARSE_OUTPUT, "%p, ", Child); - - /* - * If child is NULL, this means that an optional argument - * was omitted. We must create a placeholder with a special - * opcode (DEFAULT_ARG) so that the code generator will know - * that it must emit the correct default for this argument - */ - if (!Child) - { - Child = TrAllocateNode (PARSEOP_DEFAULT_ARG); - } - - /* Link first child to parent */ - - if (FirstChild) - { - FirstChild = FALSE; - Op->Asl.Child = Child; - - /* - * For the ASL-/ASL+ converter: if the ParseOp is a connection, - * external, offset or accessAs, it means that the comments in the - * FirstChild belongs to their parent due to the parsing order in - * the .y files. To correct this, take the comments in the - * FirstChild place it in the parent. This also means that - * legitimate comments for the child gets put to the parent. - */ - if (Gbl_CaptureComments && - ((ParseOpcode == PARSEOP_CONNECTION) || - (ParseOpcode == PARSEOP_EXTERNAL) || - (ParseOpcode == PARSEOP_OFFSET) || - (ParseOpcode == PARSEOP_ACCESSAS))) - { - Op->Asl.CommentList = Child->Asl.CommentList; - Op->Asl.EndBlkComment = Child->Asl.EndBlkComment; - Op->Asl.InlineComment = Child->Asl.InlineComment; - Op->Asl.FileChanged = Child->Asl.FileChanged; - - Child->Asl.CommentList = NULL; - Child->Asl.EndBlkComment = NULL; - Child->Asl.InlineComment = NULL; - Child->Asl.FileChanged = FALSE; - - /* - * These do not need to be "passed off". They can be copied - * because the code for these opcodes should be printed in the - * same file. - */ - Op->Asl.Filename = Child->Asl.Filename; - Op->Asl.ParentFilename = Child->Asl.ParentFilename; - } - } - - /* Point all children to parent */ - - Child->Asl.Parent = Op; - - /* Link children in a peer list */ - - if (PrevChild) - { - PrevChild->Asl.Next = Child; - }; - - /* Get the comment from last child in the resource template call */ - - if (Gbl_CaptureComments && - (Op->Asl.ParseOpcode == PARSEOP_RESOURCETEMPLATE)) - { - CvDbgPrint ("Transferred current comment list to this node.\n"); - Op->Asl.CommentList = Child->Asl.CommentList; - Child->Asl.CommentList = NULL; - Op->Asl.InlineComment = Child->Asl.InlineComment; - Child->Asl.InlineComment = NULL; - } - - /* - * This child might be a list, point all nodes in the list - * to the same parent - */ - while (Child->Asl.Next) - { - Child = Child->Asl.Next; - Child->Asl.Parent = Op; - } - - PrevChild = Child; + return; } - va_end(ap); - DbgPrint (ASL_PARSE_OUTPUT, "\n"); - return (Op); + Op->Asl.EndLine = Gbl_CurrentLineNumber; + Op->Asl.EndLogicalLine = Gbl_LogicalLineNumber; } /******************************************************************************* * - * FUNCTION: TrLinkChildren + * FUNCTION: TrLinkOpChildren * - * PARAMETERS: Op - An existing parse node + * PARAMETERS: Op - An existing parse op * NumChildren - Number of children to follow - * ... - A list of child nodes to link to the new - * node. NumChildren long. + * ... - A list of child ops to link to the new + * op. NumChildren long. * - * RETURN: The updated (linked) node + * RETURN: The updated (linked) op * - * DESCRIPTION: Link a group of nodes to an existing parse node + * DESCRIPTION: Link a group of ops to an existing parse op * ******************************************************************************/ ACPI_PARSE_OBJECT * -TrLinkChildren ( +TrLinkOpChildren ( ACPI_PARSE_OBJECT *Op, UINT32 NumChildren, ...) @@ -1357,8 +436,7 @@ TrLinkChildren ( va_start (ap, NumChildren); - - TrSetEndLineNumber (Op); + TrSetOpEndLineNumber (Op); DbgPrint (ASL_PARSE_OUTPUT, "\nLinkChildren Line [%u to %u] NewParent %p Child %u Op %s ", @@ -1403,19 +481,19 @@ TrLinkChildren ( /* * If there are "regular comments" detected at this point, * then is an endBlk comment. Categorize it as so and distribute - * all regular comments to this parse node. + * all regular comments to this parse op. */ - if (Gbl_Comment_List_Head) + if (Gbl_CommentListHead) { - Op->Asl.EndBlkComment = Gbl_Comment_List_Head; + Op->Asl.EndBlkComment = Gbl_CommentListHead; CvDbgPrint ("EndBlk Comment for %s: %s", - Op->Asl.ParseOpName, Gbl_Comment_List_Head->Comment); - Gbl_Comment_List_Head = NULL; - Gbl_Comment_List_Tail = NULL; + Op->Asl.ParseOpName, Gbl_CommentListHead->Comment); + Gbl_CommentListHead = NULL; + Gbl_CommentListTail = NULL; } } - /* Link the new node to it's children */ + /* Link the new op to it's children */ PrevChild = NULL; FirstChild = TRUE; @@ -1426,7 +504,7 @@ TrLinkChildren ( if ((Child == PrevChild) && (Child != NULL)) { AslError (ASL_WARNING, ASL_MSG_COMPILER_INTERNAL, Child, - "Child node list invalid"); + "Child op list invalid"); va_end(ap); return (Op); } @@ -1441,7 +519,7 @@ TrLinkChildren ( */ if (!Child) { - Child = TrAllocateNode (PARSEOP_DEFAULT_ARG); + Child = TrAllocateOp (PARSEOP_DEFAULT_ARG); } /* Link first child to parent */ @@ -1461,10 +539,10 @@ TrLinkChildren ( if (PrevChild) { PrevChild->Asl.Next = Child; - }; + } /* - * This child might be a list, point all nodes in the list + * This child might be a list, point all ops in the list * to the same parent */ while (Child->Asl.Next) @@ -1479,31 +557,31 @@ TrLinkChildren ( va_end(ap); DbgPrint (ASL_PARSE_OUTPUT, "\n\n"); - if(Gbl_CaptureComments) { - Gbl_CommentState.Latest_Parse_Node = Op; - CvDbgPrint ("trlinkchildren=====Set latest parse node to this node.\n"); + Gbl_CommentState.LatestParseOp = Op; + CvDbgPrint ("TrLinkOpChildren=====Set latest parse op to this op.\n"); } + return (Op); } /******************************************************************************* * - * FUNCTION: TrLinkPeerNode + * FUNCTION: TrLinkPeerOp * * PARAMETERS: Op1 - First peer * Op2 - Second peer * - * RETURN: Op1 or the non-null node. + * RETURN: Op1 or the non-null op. * - * DESCRIPTION: Link two nodes as peers. Handles cases where one peer is null. + * DESCRIPTION: Link two ops as peers. Handles cases where one peer is null. * ******************************************************************************/ ACPI_PARSE_OBJECT * -TrLinkPeerNode ( +TrLinkPeerOp ( ACPI_PARSE_OBJECT *Op1, ACPI_PARSE_OBJECT *Op2) { @@ -1511,18 +589,18 @@ TrLinkPeerNode ( DbgPrint (ASL_PARSE_OUTPUT, - "\nLinkPeerNode: 1=%p (%s), 2=%p (%s)\n", + "\nLinkPeerOp: 1=%p (%s), 2=%p (%s)\n", Op1, Op1 ? UtGetOpName(Op1->Asl.ParseOpcode) : NULL, Op2, Op2 ? UtGetOpName(Op2->Asl.ParseOpcode) : NULL); if ((!Op1) && (!Op2)) { - DbgPrint (ASL_PARSE_OUTPUT, "\nTwo Null nodes!\n"); + DbgPrint (ASL_PARSE_OUTPUT, "\nTwo Null ops!\n"); return (Op1); } - /* If one of the nodes is null, just return the non-null node */ + /* If one of the ops is null, just return the non-null op */ if (!Op2) { @@ -1537,10 +615,10 @@ TrLinkPeerNode ( if (Op1 == Op2) { DbgPrint (ASL_DEBUG_OUTPUT, - "\n************* Internal error, linking node to itself %p\n", + "\n************* Internal error, linking op to itself %p\n", Op1); AslError (ASL_WARNING, ASL_MSG_COMPILER_INTERNAL, Op1, - "Linking node to itself"); + "Linking op to itself"); return (Op1); } @@ -1564,19 +642,19 @@ TrLinkPeerNode ( /******************************************************************************* * - * FUNCTION: TrLinkPeerNodes + * FUNCTION: TrLinkPeerOps * - * PARAMETERS: NumPeers - The number of nodes in the list to follow - * ... - A list of nodes to link together as peers + * PARAMETERS: NumPeers - The number of ops in the list to follow + * ... - A list of ops to link together as peers * - * RETURN: The first node in the list (head of the peer list) + * RETURN: The first op in the list (head of the peer list) * - * DESCRIPTION: Link together an arbitrary number of peer nodes. + * DESCRIPTION: Link together an arbitrary number of peer ops. * ******************************************************************************/ ACPI_PARSE_OBJECT * -TrLinkPeerNodes ( +TrLinkPeerOps ( UINT32 NumPeers, ...) { @@ -1588,7 +666,7 @@ TrLinkPeerNodes ( DbgPrint (ASL_PARSE_OUTPUT, - "\nLinkPeerNodes: (%u) ", NumPeers); + "\nLinkPeerOps: (%u) ", NumPeers); va_start (ap, NumPeers); This = va_arg (ap, ACPI_PARSE_OBJECT *); @@ -1606,21 +684,21 @@ TrLinkPeerNodes ( This = This->Asl.Next; } - /* Get another peer node */ + /* Get another peer op */ Next = va_arg (ap, ACPI_PARSE_OBJECT *); if (!Next) { - Next = TrAllocateNode (PARSEOP_DEFAULT_ARG); + Next = TrAllocateOp (PARSEOP_DEFAULT_ARG); } - /* link new node to the current node */ + /* link new op to the current op */ This->Asl.Next = Next; This = Next; } - va_end (ap); + va_end (ap); DbgPrint (ASL_PARSE_OUTPUT,"\n"); return (Start); } @@ -1628,19 +706,19 @@ TrLinkPeerNodes ( /******************************************************************************* * - * FUNCTION: TrLinkChildNode + * FUNCTION: TrLinkChildOp * - * PARAMETERS: Op1 - Parent node + * PARAMETERS: Op1 - Parent op * Op2 - Op to become a child * - * RETURN: The parent node + * RETURN: The parent op * - * DESCRIPTION: Link two nodes together as a parent and child + * DESCRIPTION: Link two ops together as a parent and child * ******************************************************************************/ ACPI_PARSE_OBJECT * -TrLinkChildNode ( +TrLinkChildOp ( ACPI_PARSE_OBJECT *Op1, ACPI_PARSE_OBJECT *Op2) { @@ -1648,12 +726,12 @@ TrLinkChildNode ( DbgPrint (ASL_PARSE_OUTPUT, - "\nLinkChildNode: Parent=%p (%s), Child=%p (%s)\n", + "\nLinkChildOp: Parent=%p (%s), Child=%p (%s)\n", Op1, Op1 ? UtGetOpName(Op1->Asl.ParseOpcode): NULL, Op2, Op2 ? UtGetOpName(Op2->Asl.ParseOpcode): NULL); /* - * Converter: if TrLinkChildNode is called to link a method call, + * Converter: if TrLinkChildOp is called to link a method call, * turn on capture comments as it signifies that we are done parsing * a method call. */ @@ -1663,8 +741,9 @@ TrLinkChildNode ( { Gbl_CommentState.CaptureComments = TRUE; } - Gbl_CommentState.Latest_Parse_Node = Op1; + Gbl_CommentState.LatestParseOp = Op1; } + if (!Op1 || !Op2) { return (Op1); @@ -1689,7 +768,8 @@ TrLinkChildNode ( * * FUNCTION: TrWalkParseTree * - * PARAMETERS: Visitation - Type of walk + * PARAMETERS: Op - Walk starting point + * Visitation - Type of walk * DescendingCallback - Called during tree descent * AscendingCallback - Called during tree ascent * Context - To be passed to the callbacks @@ -1709,7 +789,7 @@ TrWalkParseTree ( void *Context) { UINT32 Level; - BOOLEAN NodePreviouslyVisited; + BOOLEAN OpPreviouslyVisited; ACPI_PARSE_OBJECT *StartOp = Op; ACPI_STATUS Status; @@ -1720,7 +800,7 @@ TrWalkParseTree ( } Level = 0; - NodePreviouslyVisited = FALSE; + OpPreviouslyVisited = FALSE; switch (Visitation) { @@ -1728,9 +808,9 @@ TrWalkParseTree ( while (Op) { - if (!NodePreviouslyVisited) + if (!OpPreviouslyVisited) { - /* Let the callback process the node. */ + /* Let the callback process the op. */ Status = DescendingCallback (Op, Level, Context); if (ACPI_SUCCESS (Status)) @@ -1764,7 +844,7 @@ TrWalkParseTree ( if (Op->Asl.Next) { Op = Op->Asl.Next; - NodePreviouslyVisited = FALSE; + OpPreviouslyVisited = FALSE; } else { @@ -1775,7 +855,7 @@ TrWalkParseTree ( Level--; } Op = Op->Asl.Parent; - NodePreviouslyVisited = TRUE; + OpPreviouslyVisited = TRUE; } } break; @@ -1784,12 +864,12 @@ TrWalkParseTree ( while (Op) { - /* Visit leaf node (no children) or parent node on return trip */ + /* Visit leaf op (no children) or parent op on return trip */ if ((!Op->Asl.Child) || - (NodePreviouslyVisited)) + (OpPreviouslyVisited)) { - /* Let the callback process the node. */ + /* Let the callback process the op. */ Status = AscendingCallback (Op, Level, Context); if (ACPI_FAILURE (Status)) @@ -1818,7 +898,7 @@ TrWalkParseTree ( if (Op->Asl.Next) { Op = Op->Asl.Next; - NodePreviouslyVisited = FALSE; + OpPreviouslyVisited = FALSE; } else { @@ -1829,7 +909,7 @@ TrWalkParseTree ( Level--; } Op = Op->Asl.Parent; - NodePreviouslyVisited = TRUE; + OpPreviouslyVisited = TRUE; } } break; @@ -1838,7 +918,7 @@ TrWalkParseTree ( while (Op) { - if (NodePreviouslyVisited) + if (OpPreviouslyVisited) { Status = AscendingCallback (Op, Level, Context); if (ACPI_FAILURE (Status)) @@ -1848,7 +928,7 @@ TrWalkParseTree ( } else { - /* Let the callback process the node. */ + /* Let the callback process the op. */ Status = DescendingCallback (Op, Level, Context); if (ACPI_SUCCESS (Status)) @@ -1882,7 +962,7 @@ TrWalkParseTree ( if (Op->Asl.Next) { Op = Op->Asl.Next; - NodePreviouslyVisited = FALSE; + OpPreviouslyVisited = FALSE; } else { @@ -1893,7 +973,7 @@ TrWalkParseTree ( Level--; } Op = Op->Asl.Parent; - NodePreviouslyVisited = TRUE; + OpPreviouslyVisited = TRUE; } } break; diff --git a/source/compiler/asltypes.h b/source/compiler/asltypes.h index d8fafe0d5259..4c2a27729fd1 100644 --- a/source/compiler/asltypes.h +++ b/source/compiler/asltypes.h @@ -162,27 +162,29 @@ /* Op flags for the ACPI_PARSE_OBJECT */ -#define NODE_VISITED 0x00000001 -#define NODE_AML_PACKAGE 0x00000002 -#define NODE_IS_TARGET 0x00000004 -#define NODE_IS_RESOURCE_DESC 0x00000008 -#define NODE_IS_RESOURCE_FIELD 0x00000010 -#define NODE_HAS_NO_EXIT 0x00000020 -#define NODE_IF_HAS_NO_EXIT 0x00000040 -#define NODE_NAME_INTERNALIZED 0x00000080 -#define NODE_METHOD_NO_RETVAL 0x00000100 -#define NODE_METHOD_SOME_NO_RETVAL 0x00000200 -#define NODE_RESULT_NOT_USED 0x00000400 -#define NODE_METHOD_TYPED 0x00000800 -#define NODE_COULD_NOT_REDUCE 0x00001000 -#define NODE_COMPILE_TIME_CONST 0x00002000 -#define NODE_IS_TERM_ARG 0x00004000 -#define NODE_WAS_ONES_OP 0x00008000 -#define NODE_IS_NAME_DECLARATION 0x00010000 -#define NODE_COMPILER_EMITTED 0x00020000 -#define NODE_IS_DUPLICATE 0x00040000 -#define NODE_IS_RESOURCE_DATA 0x00080000 -#define NODE_IS_NULL_RETURN 0x00100000 +#define OP_VISITED 0x00000001 +#define OP_AML_PACKAGE 0x00000002 +#define OP_IS_TARGET 0x00000004 +#define OP_IS_RESOURCE_DESC 0x00000008 +#define OP_IS_RESOURCE_FIELD 0x00000010 +#define OP_HAS_NO_EXIT 0x00000020 +#define OP_IF_HAS_NO_EXIT 0x00000040 +#define OP_NAME_INTERNALIZED 0x00000080 +#define OP_METHOD_NO_RETVAL 0x00000100 +#define OP_METHOD_SOME_NO_RETVAL 0x00000200 +#define OP_RESULT_NOT_USED 0x00000400 +#define OP_METHOD_TYPED 0x00000800 +#define OP_COULD_NOT_REDUCE 0x00001000 +#define OP_COMPILE_TIME_CONST 0x00002000 +#define OP_IS_TERM_ARG 0x00004000 +#define OP_WAS_ONES_OP 0x00008000 +#define OP_IS_NAME_DECLARATION 0x00010000 +#define OP_COMPILER_EMITTED 0x00020000 +#define OP_IS_DUPLICATE 0x00040000 +#define OP_IS_RESOURCE_DATA 0x00080000 +#define OP_IS_NULL_RETURN 0x00100000 + +#define ACPI_NUM_OP_FLAGS 0x21 /* Keeps information about individual control methods */ diff --git a/source/compiler/aslwalks.c b/source/compiler/aslwalks.c index b35261f87477..811e203908f2 100644 --- a/source/compiler/aslwalks.c +++ b/source/compiler/aslwalks.c @@ -195,7 +195,7 @@ AnMethodTypingWalkEnd ( { case PARSEOP_METHOD: - Op->Asl.CompileFlags |= NODE_METHOD_TYPED; + Op->Asl.CompileFlags |= OP_METHOD_TYPED; break; case PARSEOP_RETURN: diff --git a/source/compiler/aslxref.c b/source/compiler/aslxref.c index 62933ec1be70..ebd356e62ade 100644 --- a/source/compiler/aslxref.c +++ b/source/compiler/aslxref.c @@ -533,7 +533,7 @@ XfNamespaceLocateBegin ( * references to other objects within the namespace and the parent objects * of name declarations */ - if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION) + if (Op->Asl.CompileFlags & OP_IS_NAME_DECLARATION) { return_ACPI_STATUS (AE_OK); } @@ -559,7 +559,7 @@ XfNamespaceLocateBegin ( RegisterNumber = Op->Asl.AmlOpcode & 0x0007; /* 0x60 through 0x67 */ MethodLocals = Node->MethodLocals; - if (Op->Asl.CompileFlags & NODE_IS_TARGET) + if (Op->Asl.CompileFlags & OP_IS_TARGET) { /* Local is being initialized */ @@ -603,7 +603,7 @@ XfNamespaceLocateBegin ( MethodArgs[RegisterNumber].Flags |= ASL_ARG_REFERENCED; MethodArgs[RegisterNumber].Op = Op; - if (Op->Asl.CompileFlags & NODE_IS_TARGET) + if (Op->Asl.CompileFlags & OP_IS_TARGET) { /* Arg is being initialized */ @@ -676,7 +676,7 @@ XfNamespaceLocateBegin ( /* Name must appear as the last parameter */ NextOp = Op->Asl.Child; - while (!(NextOp->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)) + while (!(NextOp->Asl.CompileFlags & OP_IS_NAME_DECLARATION)) { NextOp = NextOp->Asl.Next; } @@ -916,7 +916,7 @@ XfNamespaceLocateBegin ( Op->Asl.AmlLength = 0; Op->Asl.ParseOpcode = PARSEOP_INTEGER; Op->Asl.Value.Integer = (UINT64) Offset; - Op->Asl.CompileFlags |= NODE_IS_RESOURCE_FIELD; + Op->Asl.CompileFlags |= OP_IS_RESOURCE_FIELD; OpcGenerateAmlOpcode (Op); } diff --git a/source/compiler/cvcompiler.c b/source/compiler/cvcompiler.c index fab9fb946d7d..afb6ea1bce57 100644 --- a/source/compiler/cvcompiler.c +++ b/source/compiler/cvcompiler.c @@ -164,7 +164,7 @@ * StringBuffer Buffer containing the comment being processed * c1 Current input * - * RETURN: none + * RETURN: None * * DESCRIPTION: Process a single line comment of a c Style comment. This * function captures a line of a c style comment in a char* and @@ -217,14 +217,15 @@ CvProcessComment ( { FinalLineToken[strlen(FinalLineToken)-1] = 0; } + CvAddToCommentList (FinalLineToken); LineToken = strtok (NULL, "\n"); while (LineToken != NULL) { /* * It is assumed that each line has some sort of indentation. - * This means that we need to find the first character that is not - * a white space within each line. + * This means that we need to find the first character that + * is not a white space within each line. */ CharStart = FALSE; for (i = 0; (i < (strlen (LineToken) + 1)) && !CharStart; i++) @@ -236,6 +237,7 @@ CvProcessComment ( LineToken [0] = ' '; /* Pad for Formatting */ } } + FinalLineToken = UtStringCacheCalloc (strlen (LineToken) + 1); strcat (FinalLineToken, LineToken); @@ -245,32 +247,36 @@ CvProcessComment ( { FinalLineToken[strlen(FinalLineToken) - 1] = 0; } + CvAddToCommentList (FinalLineToken); LineToken = strtok (NULL,"\n"); } } /* - * If this only spans a single line, check to see whether if this comment - * appears on the same line as a line of code. If does, retain it's - * position for stylistic reasons. If it doesn't, add it to the comment - * List so that it can be associated with the next node that's created. + * If this only spans a single line, check to see whether if this + * comment appears on the same line as a line of code. If does, + * retain it's position for stylistic reasons. If it doesn't, + * add it to the comment list so that it can be associated with + * the next node that's created. */ else { /* - * if this is not a regular comment, pad with extra spaces that appeared - * in the original source input to retain the original spacing. + * If this is not a regular comment, pad with extra spaces that + * appeared in the original source input to retain the original + * spacing. */ FinalCommentString = UtStringCacheCalloc (strlen (CommentString) + CurrentState.SpacesBefore + 1); - for (i=0; (CurrentState.CommentType != ASL_COMMENT_STANDARD) && - (i < CurrentState.SpacesBefore); ++i) + for (i = 0; (CurrentState.CommentType != ASL_COMMENT_STANDARD) && + (i < CurrentState.SpacesBefore); i++) { FinalCommentString[i] = ' '; } + strcat (FinalCommentString, CommentString); CvPlaceComment (CurrentState.CommentType, FinalCommentString); } @@ -310,10 +316,10 @@ CvProcessCommentType2 ( CommentString = UtStringCacheCalloc (strlen (MsgBuffer) + 1); strcpy (CommentString, MsgBuffer); - /* If this comment lies on the same line as the latest parse node, - * assign it to that node's CommentAfter field. Saving in this field - * will allow us to support comments that come after code on the same - * line as the code itself. For example, + /* If this comment lies on the same line as the latest parse op, + * assign it to that op's CommentAfter field. Saving in this field + * will allow us to support comments that come after code on the + * same line as the code itself. For example, * Name(A,"") //comment * * will be retained rather than transformed into @@ -330,7 +336,8 @@ CvProcessCommentType2 ( * Create a new string with the approperiate spaces. Since we need * to account for the proper spacing, the actual comment, * extra 2 spaces so that this comment can be converted to the "/ *" - * style and the null terminator, the string would look something like + * style and the null terminator, the string would look something + * like: * * [ (spaces) (comment) ( * /) ('\0') ] * @@ -338,23 +345,27 @@ CvProcessCommentType2 ( FinalCommentString = UtStringCacheCalloc (CurrentState.SpacesBefore + strlen (CommentString) + 3 + 1); - for (i=0; (CurrentState.CommentType!=1) && (i<CurrentState.SpacesBefore); ++i) + for (i = 0; (CurrentState.CommentType != 1) && + (i < CurrentState.SpacesBefore); i++) { FinalCommentString[i] = ' '; } + strcat (FinalCommentString, CommentString); /* convert to a "/ *" style comment */ strcat (FinalCommentString, " */"); - FinalCommentString [CurrentState.SpacesBefore + strlen (CommentString) + 3] = 0; + FinalCommentString [CurrentState.SpacesBefore + + strlen (CommentString) + 3] = 0; /* get rid of the carriage return */ if (FinalCommentString[strlen (FinalCommentString) - 1] == 0x0D) { - FinalCommentString[strlen(FinalCommentString)-1] = 0; + FinalCommentString[strlen(FinalCommentString) - 1] = 0; } + CvPlaceComment (CurrentState.CommentType, FinalCommentString); } } @@ -366,9 +377,9 @@ CvProcessCommentType2 ( * * PARAMETERS: Op - Calculate all comments of this Op * - * RETURN: TotalCommentLength - Length of all comments within this node. + * RETURN: TotalCommentLength - Length of all comments within this op. * - * DESCRIPTION: calculate the length that the each comment takes up within Op. + * DESCRIPTION: Calculate the length that the each comment takes up within Op. * Comments look like the follwoing: [0xA9 OptionBtye comment 0x00] * therefore, we add 1 + 1 + strlen (comment) + 1 to get the actual * length of this comment. @@ -389,7 +400,9 @@ CvCalculateCommentLengths( return (0); } - CvDbgPrint ("==Calculating comment lengths for %s\n", Op->Asl.ParseOpName); + CvDbgPrint ("==Calculating comment lengths for %s\n", + Op->Asl.ParseOpName); + if (Op->Asl.FileChanged) { TotalCommentLength += strlen (Op->Asl.Filename) + 3; @@ -400,6 +413,7 @@ CvCalculateCommentLengths( TotalCommentLength += strlen (Op->Asl.ParentFilename) + 3; } } + if (Op->Asl.CommentList) { Current = Op->Asl.CommentList; @@ -412,6 +426,7 @@ CvCalculateCommentLengths( Current = Current->Next; } } + if (Op->Asl.EndBlkComment) { Current = Op->Asl.EndBlkComment; @@ -424,6 +439,7 @@ CvCalculateCommentLengths( Current = Current->Next; } } + if (Op->Asl.InlineComment) { CommentLength = strlen (Op->Asl.InlineComment)+3; @@ -431,6 +447,7 @@ CvCalculateCommentLengths( CvDbgPrint (" Comment string: %s\n\n", Op->Asl.InlineComment); TotalCommentLength += CommentLength; } + if (Op->Asl.EndNodeComment) { CommentLength = strlen(Op->Asl.EndNodeComment)+3; @@ -448,9 +465,7 @@ CvCalculateCommentLengths( } CvDbgPrint("\n\n"); - - return TotalCommentLength; - + return (TotalCommentLength); } @@ -490,7 +505,7 @@ CgWriteAmlDefBlockComment( CvDbgPrint ("Printing comments for a definition block..\n"); - /* first, print the file name comment after changing .asl to .dsl */ + /* First, print the file name comment after changing .asl to .dsl */ NewFilename = UtStringCacheCalloc (strlen (Op->Asl.Filename)); strcpy (NewFilename, Op->Asl.Filename); @@ -518,15 +533,17 @@ CgWriteAmlDefBlockComment( Current = Op->Asl.CommentList; CommentOption = STD_DEFBLK_COMMENT; + while (Current) { CgWriteOneAmlComment(Op, Current->Comment, CommentOption); CvDbgPrint ("Printing comment: %s\n", Current->Comment); Current = Current->Next; } + Op->Asl.CommentList = NULL; - /* print any Inline comments associated with this node */ + /* Print any Inline comments associated with this node */ if (Op->Asl.CloseBraceComment) { @@ -557,8 +574,8 @@ CgWriteOneAmlComment( char* CommentToPrint, UINT8 InputOption) { - UINT8 CommentOption = InputOption; - UINT8 CommentOpcode = (UINT8)AML_COMMENT_OP; + UINT8 CommentOption = InputOption; + UINT8 CommentOpcode = (UINT8) AML_COMMENT_OP; if (!CommentToPrint) @@ -583,8 +600,7 @@ CgWriteOneAmlComment( * * RETURN: None * - * DESCRIPTION: write all comments pertaining to the - * current parse op + * DESCRIPTION: Write all comments pertaining to the current parse op * ******************************************************************************/ @@ -609,7 +625,7 @@ CgWriteAmlComment( if (Op->Asl.FileChanged) { - /* first, print the file name comment after changing .asl to .dsl */ + /* First, print the file name comment after changing .asl to .dsl */ NewFilename = FlGenerateFilename (Op->Asl.Filename, FILE_SUFFIX_DISASSEMBLY); @@ -629,7 +645,7 @@ CgWriteAmlComment( CgWriteOneAmlComment(Op, ParentFilename, PARENTFILENAME_COMMENT); } - /* prevent multiple writes of the same comment */ + /* Prevent multiple writes of the same comment */ Op->Asl.FileChanged = FALSE; } @@ -654,6 +670,7 @@ CgWriteAmlComment( CgWriteOneAmlComment(Op, Current->Comment, CommentOption); Current = Current->Next; } + Op->Asl.CommentList = NULL; Current = Op->Asl.EndBlkComment; @@ -663,9 +680,10 @@ CgWriteAmlComment( CgWriteOneAmlComment(Op, Current->Comment, CommentOption); Current = Current->Next; } + Op->Asl.EndBlkComment = NULL; - /* print any Inline comments associated with this node */ + /* Print any Inline comments associated with this node */ if (Op->Asl.InlineComment) { @@ -694,7 +712,7 @@ CgWriteAmlComment( * * FUNCTION: CvCommentNodeCalloc * - * PARAMETERS: none + * PARAMETERS: None * * RETURN: Pointer to the comment node. Aborts on allocation failure * @@ -733,6 +751,7 @@ UINT32 CvParseOpBlockType ( ACPI_PARSE_OBJECT *Op) { + if (!Op) { return (BLOCK_NONE); @@ -740,8 +759,7 @@ CvParseOpBlockType ( switch (Op->Asl.ParseOpcode) { - - /* from aslprimaries.y */ + /* From aslprimaries.y */ case PARSEOP_VAR_PACKAGE: case PARSEOP_BANKFIELD: @@ -763,7 +781,7 @@ CvParseOpBlockType ( case PARSEOP_THERMALZONE: case PARSEOP_WHILE: - /* from aslresources.y */ + /* From aslresources.y */ case PARSEOP_RESOURCETEMPLATE: /* optional parens */ case PARSEOP_VENDORLONG: @@ -775,13 +793,12 @@ CvParseOpBlockType ( case PARSEOP_GPIO_IO: case PARSEOP_DMA: - /*from aslrules.y */ + /* From aslrules.y */ case PARSEOP_DEFINITION_BLOCK: return (BLOCK_PAREN | BLOCK_BRACE); default: - return (BLOCK_NONE); } } @@ -791,7 +808,7 @@ CvParseOpBlockType ( * * FUNCTION: CvProcessCommentState * - * PARAMETERS: char + * PARAMETERS: Input - Input character * * RETURN: None * @@ -803,15 +820,15 @@ CvParseOpBlockType ( void CvProcessCommentState ( - char input) + char Input) { - if (input != ' ') + if (Input != ' ') { Gbl_CommentState.SpacesBefore = 0; } - switch (input) + switch (Input) { case '\n': @@ -856,7 +873,6 @@ CvProcessCommentState ( Gbl_CommentState.CommentType = ASLCOMMENT_INLINE; break; - } } @@ -865,7 +881,7 @@ CvProcessCommentState ( * * FUNCTION: CvAddToCommentList * - * PARAMETERS: toAdd - Contains the comment to be inserted + * PARAMETERS: ToAdd - Contains the comment to be inserted * * RETURN: None * @@ -876,24 +892,24 @@ CvProcessCommentState ( void CvAddToCommentList ( - char* ToAdd) + char *ToAdd) { - if (Gbl_Comment_List_Head) + + if (Gbl_CommentListHead) { - Gbl_Comment_List_Tail->Next = CvCommentNodeCalloc (); - Gbl_Comment_List_Tail = Gbl_Comment_List_Tail->Next; + Gbl_CommentListTail->Next = CvCommentNodeCalloc (); + Gbl_CommentListTail = Gbl_CommentListTail->Next; } else { - Gbl_Comment_List_Head = CvCommentNodeCalloc (); - Gbl_Comment_List_Tail = Gbl_Comment_List_Head; + Gbl_CommentListHead = CvCommentNodeCalloc (); + Gbl_CommentListTail = Gbl_CommentListHead; } - Gbl_Comment_List_Tail->Comment = ToAdd; - - return; + Gbl_CommentListTail->Comment = ToAdd; } + /******************************************************************************* * * FUNCTION: CvAppendInlineComment @@ -907,7 +923,7 @@ CvAddToCommentList ( * ******************************************************************************/ -char* +char * CvAppendInlineComment ( char *InlineComment, char *ToAdd) @@ -918,21 +934,22 @@ CvAppendInlineComment ( if (!InlineComment) { - return ToAdd; + return (ToAdd); } + if (!ToAdd) { - return InlineComment; + return (InlineComment); } Size = strlen (ToAdd); Size += strlen (InlineComment); - Str = UtStringCacheCalloc (Size+1); + Str = UtStringCacheCalloc (Size + 1); + strcpy (Str, InlineComment); strcat (Str, ToAdd); - Str[Size+1] = 0; - - return Str; + Str[Size +1] = 0; + return (Str); } @@ -940,8 +957,8 @@ CvAppendInlineComment ( * * FUNCTION: CvPlaceComment * - * PARAMETERS: Int - Type - * char* - CommentString + * PARAMETERS: UINT8 - Type + * char * - CommentString * * RETURN: None * @@ -959,7 +976,7 @@ CvPlaceComment( ACPI_PARSE_OBJECT *ParenBraceNode; - LatestParseNode = Gbl_CommentState.Latest_Parse_Node; + LatestParseNode = Gbl_CommentState.LatestParseOp; ParenBraceNode = Gbl_CommentState.ParsingParenBraceNode; CvDbgPrint ("Placing comment %s for type %d\n", CommentString, Type); @@ -979,8 +996,8 @@ CvPlaceComment( case ASL_COMMENT_OPEN_PAREN: - Gbl_Inline_Comment_Buffer = - CvAppendInlineComment(Gbl_Inline_Comment_Buffer, + Gbl_InlineCommentBuffer = + CvAppendInlineComment(Gbl_InlineCommentBuffer, CommentString); break; @@ -1008,6 +1025,5 @@ CvPlaceComment( default: break; - } } diff --git a/source/compiler/cvdisasm.c b/source/compiler/cvdisasm.c index 6e9b73f0a367..8682f04e5178 100644 --- a/source/compiler/cvdisasm.c +++ b/source/compiler/cvdisasm.c @@ -156,6 +156,8 @@ #include "acconvert.h" +/* Local prototypes */ + static void CvPrintInclude( ACPI_FILE_NODE *FNode, @@ -198,6 +200,7 @@ CvPrintOneCommentList ( AcpiOsPrintf("%s\n", Current->Comment); Current->Comment = NULL; } + Current = Current->Next; AcpiOsReleaseObject(AcpiGbl_RegCommentCache, Previous); } @@ -208,7 +211,7 @@ CvPrintOneCommentList ( * * FUNCTION: CvListIsSingleton * - * PARAMETERS: CommentList -- check to see if this is a single item list. + * PARAMETERS: CommentList - check to see if this is a single item list. * * RETURN: BOOLEAN * @@ -221,16 +224,17 @@ CvListIsSingleton ( ACPI_COMMENT_NODE *CommentList) { + if (!CommentList) { - return FALSE; + return (FALSE); } else if (CommentList->Next) { - return FALSE; + return (FALSE); } - return TRUE; + return (TRUE); } @@ -275,6 +279,7 @@ CvPrintOneCommentType ( { CvPrintOneCommentList (Op->Common.CommentList, Level); } + Op->Common.CommentList = NULL; return; @@ -333,7 +338,7 @@ CvPrintOneCommentType ( * PARAMETERS: Op * Level * - * RETURN: none + * RETURN: None * * DESCRIPTION: Print a close brace } and any open brace comments associated * with this parse object. @@ -346,6 +351,7 @@ CvCloseBraceWriteComment( ACPI_PARSE_OBJECT *Op, UINT32 Level) { + if (!Gbl_CaptureComments) { AcpiOsPrintf ("}"); @@ -365,7 +371,7 @@ CvCloseBraceWriteComment( * PARAMETERS: Op * Level * - * RETURN: none + * RETURN: None * * DESCRIPTION: Print a closing paren ) and any end node comments associated * with this parse object. @@ -378,6 +384,7 @@ CvCloseParenWriteComment( ACPI_PARSE_OBJECT *Op, UINT32 Level) { + if (!Gbl_CaptureComments) { AcpiOsPrintf (")"); @@ -427,13 +434,15 @@ BOOLEAN CvFileHasSwitched( ACPI_PARSE_OBJECT *Op) { + if (Op->Common.CvFilename && AcpiGbl_CurrentFilename && AcpiUtStricmp(Op->Common.CvFilename, AcpiGbl_CurrentFilename)) { - return TRUE; + return (TRUE); } - return FALSE; + + return (FALSE); } @@ -459,17 +468,21 @@ CvPrintInclude( ACPI_FILE_NODE *FNode, UINT32 Level) { + if (!FNode || FNode->IncludeWritten) { return; } - CvDbgPrint ("Writing include for %s within %s\n", FNode->Filename, FNode->Parent->Filename); + CvDbgPrint ("Writing include for %s within %s\n", + FNode->Filename, FNode->Parent->Filename); AcpiOsRedirectOutput (FNode->Parent->File); CvPrintOneCommentList (FNode->IncludeComment, Level); + AcpiDmIndent (Level); AcpiOsPrintf ("Include (\"%s\")\n", FNode->Filename); - CvDbgPrint ("emitted the following: Include (\"%s\")\n", FNode->Filename); + CvDbgPrint ("emitted the following: Include (\"%s\")\n", + FNode->Filename); FNode->IncludeWritten = TRUE; } @@ -478,7 +491,7 @@ CvPrintInclude( * * FUNCTION: CvSwitchFiles * - * PARAMETERS: Level - indentation level + * PARAMETERS: Level - indentation level * Op * * RETURN: None @@ -498,7 +511,9 @@ CvSwitchFiles( ACPI_FILE_NODE *FNode; ACPI_FILE_NODE *Current; - CvDbgPrint ("Switching from %s to %s\n", AcpiGbl_CurrentFilename, Filename); + + CvDbgPrint ("Switching from %s to %s\n", AcpiGbl_CurrentFilename, + Filename); FNode = CvFilenameExists (Filename, AcpiGbl_FileTreeRoot); if (!FNode) { @@ -507,10 +522,13 @@ CvSwitchFiles( * if it does not exist, then abort. */ FlDeleteFile (ASL_FILE_AML_OUTPUT); - sprintf (MsgBuffer, "\"Cannot find %s\" - %s", Filename, strerror (errno)); - AslCommonError (ASL_ERROR, ASL_MSG_OPEN, 0, 0, 0, 0, NULL, MsgBuffer); + sprintf (MsgBuffer, "\"Cannot find %s\" - %s", + Filename, strerror (errno)); + AslCommonError (ASL_ERROR, ASL_MSG_OPEN, 0, 0, 0, 0, + NULL, MsgBuffer); AslAbort (); } + Current = FNode; /* diff --git a/source/compiler/cvparser.c b/source/compiler/cvparser.c index 060e8aedec9c..9941582a56db 100644 --- a/source/compiler/cvparser.c +++ b/source/compiler/cvparser.c @@ -204,23 +204,24 @@ CvIsFilename ( char *Filename) { UINT64 Length = strlen(Filename); - UINT64 i; char *FileExt = Filename + Length - 4; + UINT64 i; if ((Length > 4) && AcpiUtStricmp (FileExt, ".dsl")) { - return FALSE; + return (FALSE); } for(i = 0; i<Length; ++i) { if (!isprint ((int) Filename[i])) { - return FALSE; + return (FALSE); } } - return TRUE; + + return (TRUE); } @@ -232,7 +233,7 @@ CvIsFilename ( * AmlStart - Address of the starting point of the AML. * AmlLength - Length of the AML file. * - * RETURN: none + * RETURN: None * * DESCRIPTION: Initialize the file dependency tree by scanning the AML. * This is referred as ASL_CV_INIT_FILETREE. @@ -263,6 +264,7 @@ CvInitFileTree ( CvDbgPrint ("AmlEnd?: %p\n", AmlStart+AmlLength); AcpiGbl_FileTreeRoot = AcpiOsAcquireObject (AcpiGbl_FileCache); + AcpiGbl_FileTreeRoot->FileStart = (char *)(AmlStart); AcpiGbl_FileTreeRoot->FileEnd = (char *)(AmlStart + Table->Length); AcpiGbl_FileTreeRoot->Next = NULL; @@ -293,25 +295,27 @@ CvInitFileTree ( * raw data that doesn't outline a filename. */ if ((*TreeAml == AML_COMMENT_OP) && - (*(TreeAml+1) == FILENAME_COMMENT) && - (CvIsFilename ((char *)(TreeAml+2)))) + (*(TreeAml +1) == FILENAME_COMMENT) && + (CvIsFilename ((char *)(TreeAml +2)))) { CvDbgPrint ("A9 and a 08 file\n"); PreviousFilename = Filename; - Filename = (char *) (TreeAml+2); + Filename = (char *) (TreeAml +2); + CvAddToFileTree (Filename, PreviousFilename); ChildFilename = Filename; CvDbgPrint ("%s\n", Filename); } else if ((*TreeAml == AML_COMMENT_OP) && - (*(TreeAml+1) == PARENTFILENAME_COMMENT) && - (CvIsFilename ((char *)(TreeAml+2)))) + (*(TreeAml +1) == PARENTFILENAME_COMMENT) && + (CvIsFilename ((char *)(TreeAml +2)))) { CvDbgPrint ("A9 and a 09 file\n"); - ParentFilename = (char *)(TreeAml+2); + ParentFilename = (char *)(TreeAml +2); CvSetFileParent (ChildFilename, ParentFilename); CvDbgPrint ("%s\n", ParentFilename); } + ++TreeAml; } } @@ -323,7 +327,7 @@ CvInitFileTree ( * * PARAMETERS: Op -- clear all comments within this Op * - * RETURN: none + * RETURN: None * * DESCRIPTION: Clear all converter-related fields of the given Op. * This is referred as ASL_CV_CLEAR_OP_COMMENTS. @@ -334,6 +338,7 @@ void CvClearOpComments ( ACPI_PARSE_OBJECT *Op) { + Op->Common.InlineComment = NULL; Op->Common.EndNodeComment = NULL; Op->Common.NameComment = NULL; @@ -349,12 +354,12 @@ CvClearOpComments ( * * FUNCTION: CvCommentExists * - * PARAMETERS: address - check if this address appears in the list + * PARAMETERS: Address - check if this address appears in the list * * RETURN: BOOLEAN - TRUE if the address exists. * - * DESCRIPTION: look at the pointer address and check if this appears in the - * list of all addresses. If it exitsts in the list, return TRUE + * DESCRIPTION: Look at the pointer address and check if this appears in the + * list of all addresses. If it exists in the list, return TRUE * if it exists. Otherwise add to the list and return FALSE. * ******************************************************************************/ @@ -371,13 +376,15 @@ CvCommentExists ( { return (FALSE); } + Option = *(Address + 1); /* - * FILENAME_COMMENT and PARENTFILENAME_COMMENT are not treated as comments. - * They serve as markers for where the file starts and ends. + * FILENAME_COMMENT and PARENTFILENAME_COMMENT are not treated as + * comments. They serve as markers for where the file starts and ends. */ - if ((Option == FILENAME_COMMENT) || (Option == PARENTFILENAME_COMMENT)) + if ((Option == FILENAME_COMMENT) || + (Option == PARENTFILENAME_COMMENT)) { return (FALSE); } @@ -405,13 +412,14 @@ CvCommentExists ( } /* - * If the execution gets to this point, it means that this address - * does not exists in the list. Add this address to the + * If the execution gets to this point, it means that this + * address does not exists in the list. Add this address to the * beginning of the list. */ Current = AcpiGbl_CommentAddrListHead; AcpiGbl_CommentAddrListHead = AcpiOsAcquireObject (AcpiGbl_RegCommentCache); + AcpiGbl_CommentAddrListHead->Addr = Address; AcpiGbl_CommentAddrListHead->Next = Current; return (FALSE); @@ -451,6 +459,7 @@ CvFilenameExists( { return (Current); } + Current = Current->Next; } return (NULL); @@ -464,7 +473,7 @@ CvFilenameExists( * PARAMETERS: Address - address to look up * Head - file dependency tree * - * RETURN: ACPI_FLE_NODE - pointer to a file node containing the address + * RETURN: ACPI_FILE_NODE - pointer to a file node containing the address * * DESCRIPTION: Look for the given address in the file dependency tree. * Returns the first file node where the given address is within @@ -472,7 +481,7 @@ CvFilenameExists( * ******************************************************************************/ -static ACPI_FILE_NODE* +static ACPI_FILE_NODE * CvFileAddressLookup( char *Address, ACPI_FILE_NODE *Head) @@ -488,6 +497,7 @@ CvFileAddressLookup( { return (Current); } + Current = Current->Next; } @@ -522,7 +532,8 @@ CvLabelFileNode( return; } - Node = CvFileAddressLookup ((char *)Op->Common.Aml, AcpiGbl_FileTreeRoot); + Node = CvFileAddressLookup ((char *) + Op->Common.Aml, AcpiGbl_FileTreeRoot); if (!Node) { return; @@ -549,7 +560,7 @@ CvLabelFileNode( * PreviousFilename - Address containing the name of the previous * filename * - * RETURN: void + * RETURN: None * * DESCRIPTION: Add this filename to the AcpiGbl_FileTree if it does not exist. * @@ -586,9 +597,9 @@ CvAddToFileTree ( if (Node && PreviousFilename) { /* - * Update the end of the previous file and all of their parents' ending - * Addresses. This is done to ensure that parent file ranges extend to - * the end of their childrens' files. + * Update the end of the previous file and all of their parents' + * ending addresses. This is done to ensure that parent file + * ranges extend to the end of their childrens' files. */ Node = CvFilenameExists (PreviousFilename, AcpiGbl_FileTreeRoot); if (Node && (Node->FileEnd < Filename)) @@ -601,6 +612,7 @@ CvAddToFileTree ( { Node->FileEnd = Filename; } + Node = Node->Parent; } } @@ -609,6 +621,7 @@ CvAddToFileTree ( { Node = AcpiGbl_FileTreeRoot; AcpiGbl_FileTreeRoot = AcpiOsAcquireObject (AcpiGbl_FileCache); + AcpiGbl_FileTreeRoot->Next = Node; AcpiGbl_FileTreeRoot->Parent = NULL; AcpiGbl_FileTreeRoot->Filename = Filename; @@ -626,7 +639,8 @@ CvAddToFileTree ( FlDeleteFile (ASL_FILE_AML_OUTPUT); sprintf (MsgBuffer, "\"%s\" - %s", Filename, strerror (errno)); - AslCommonError (ASL_ERROR, ASL_MSG_OPEN, 0, 0, 0, 0, NULL, MsgBuffer); + AslCommonError (ASL_ERROR, ASL_MSG_OPEN, 0, 0, 0, 0, + NULL, MsgBuffer); AslAbort (); } } @@ -640,9 +654,9 @@ CvAddToFileTree ( * PARAMETERS: ChildFile - contains the filename of the child file * ParentFile - contains the filename of the parent file. * - * RETURN: none + * RETURN: None * - * DESCRIPTION: point the parent pointer of the Child to the node that + * DESCRIPTION: Point the parent pointer of the Child to the node that * corresponds with the parent file node. * ******************************************************************************/ @@ -658,6 +672,7 @@ CvSetFileParent ( Child = CvFilenameExists (ChildFile, AcpiGbl_FileTreeRoot); Parent = CvFilenameExists (ParentFile, AcpiGbl_FileTreeRoot); + if (Child && Parent) { Child->Parent = Parent; @@ -668,6 +683,7 @@ CvSetFileParent ( { Child->Parent->FileEnd = Child->FileStart; } + Child = Child->Parent; } } @@ -680,9 +696,9 @@ CvSetFileParent ( * * PARAMETERS: ParserState - A parser state object * - * RETURN: none + * RETURN: None * - * DESCRIPTION: look at the aml that the parser state is pointing to, + * DESCRIPTION: Look at the aml that the parser state is pointing to, * capture any AML_COMMENT_OP and it's arguments and increment the * aml pointer past the comment. Comments are transferred to parse * nodes through CvTransferComments() as well as @@ -720,13 +736,15 @@ CvCaptureCommentsOnly ( } else { - CommentOption = *(Aml+1); - - /* Increment past the comment option and point the approperiate char pointers.*/ + CommentOption = *(Aml +1); + /* + * Increment past the comment option and point the + * appropriate char pointers + */ Aml += 2; - /* found a comment. Now, set pointers to these comments. */ + /* Found a comment. Now, set pointers to these comments. */ switch (CommentOption) { @@ -734,9 +752,12 @@ CvCaptureCommentsOnly ( StdDefBlockFlag = TRUE; - /* add to a linked list of nodes. This list will be taken by the parse node created next. */ - - CommentNode = AcpiOsAcquireObject (AcpiGbl_RegCommentCache); + /* + * Add to a linked list of nodes. This list will be + * taken by the parse node created next. + */ + CommentNode = AcpiOsAcquireObject ( + AcpiGbl_RegCommentCache); CommentNode->Comment = ACPI_CAST_PTR (char, Aml); CommentNode->Next = NULL; @@ -748,7 +769,8 @@ CvCaptureCommentsOnly ( else { AcpiGbl_DefBlkCommentListTail->Next = CommentNode; - AcpiGbl_DefBlkCommentListTail = AcpiGbl_DefBlkCommentListTail->Next; + AcpiGbl_DefBlkCommentListTail = + AcpiGbl_DefBlkCommentListTail->Next; } break; @@ -756,9 +778,12 @@ CvCaptureCommentsOnly ( CvDbgPrint ("found regular comment.\n"); - /* add to a linked list of nodes. This list will be taken by the parse node created next. */ - - CommentNode = AcpiOsAcquireObject (AcpiGbl_RegCommentCache); + /* + * Add to a linked list of nodes. This list will be + * taken by the parse node created next. + */ + CommentNode = AcpiOsAcquireObject ( + AcpiGbl_RegCommentCache); CommentNode->Comment = ACPI_CAST_PTR (char, Aml); CommentNode->Next = NULL; @@ -770,7 +795,8 @@ CvCaptureCommentsOnly ( else { AcpiGbl_RegCommentListTail->Next = CommentNode; - AcpiGbl_RegCommentListTail = AcpiGbl_RegCommentListTail->Next; + AcpiGbl_RegCommentListTail = + AcpiGbl_RegCommentListTail->Next; } break; @@ -778,9 +804,11 @@ CvCaptureCommentsOnly ( CvDbgPrint ("found endblk comment.\n"); - /* add to a linked list of nodes. This will be taken by the next created parse node. */ - - CommentNode = AcpiOsAcquireObject (AcpiGbl_RegCommentCache); + /* Add to a linked list of nodes. This will be + * taken by the next created parse node. + */ + CommentNode = AcpiOsAcquireObject ( + AcpiGbl_RegCommentCache); CommentNode->Comment = ACPI_CAST_PTR (char, Aml); CommentNode->Next = NULL; @@ -792,38 +820,46 @@ CvCaptureCommentsOnly ( else { AcpiGbl_EndBlkCommentListTail->Next = CommentNode; - AcpiGbl_EndBlkCommentListTail = AcpiGbl_EndBlkCommentListTail->Next; + AcpiGbl_EndBlkCommentListTail = + AcpiGbl_EndBlkCommentListTail->Next; } break; case INLINE_COMMENT: CvDbgPrint ("found inline comment.\n"); - AcpiGbl_CurrentInlineComment = ACPI_CAST_PTR (char, Aml); + AcpiGbl_CurrentInlineComment = + ACPI_CAST_PTR (char, Aml); break; case ENDNODE_COMMENT: CvDbgPrint ("found EndNode comment.\n"); - AcpiGbl_CurrentEndNodeComment = ACPI_CAST_PTR (char, Aml); + AcpiGbl_CurrentEndNodeComment = + ACPI_CAST_PTR (char, Aml); break; case CLOSE_BRACE_COMMENT: CvDbgPrint ("found close brace comment.\n"); - AcpiGbl_CurrentCloseBraceComment = ACPI_CAST_PTR (char, Aml); + AcpiGbl_CurrentCloseBraceComment = + ACPI_CAST_PTR (char, Aml); break; case END_DEFBLK_COMMENT: - CvDbgPrint ("Found comment that belongs after the } for a definition block.\n"); - AcpiGbl_CurrentScope->Common.CloseBraceComment = ACPI_CAST_PTR (char, Aml); + CvDbgPrint ("Found comment that belongs after" + " the } for a definition block.\n"); + AcpiGbl_CurrentScope->Common.CloseBraceComment = + ACPI_CAST_PTR (char, Aml); break; case FILENAME_COMMENT: - CvDbgPrint ("Found a filename: %s\n", ACPI_CAST_PTR (char, Aml)); - FileNode = CvFilenameExists (ACPI_CAST_PTR (char, Aml), AcpiGbl_FileTreeRoot); + CvDbgPrint ("Found a filename: %s\n", + ACPI_CAST_PTR (char, Aml)); + FileNode = CvFilenameExists ( + ACPI_CAST_PTR (char, Aml), AcpiGbl_FileTreeRoot); /* * If there is an INCLUDE_COMMENT followed by a @@ -851,7 +887,8 @@ CvCaptureCommentsOnly ( * parse node created next. See the FILENAME_COMMENT case * for more details */ - CommentNode = AcpiOsAcquireObject (AcpiGbl_RegCommentCache); + CommentNode = AcpiOsAcquireObject ( + AcpiGbl_RegCommentCache); CommentNode->Comment = ACPI_CAST_PTR (char, Aml); CommentNode->Next = NULL; @@ -863,10 +900,12 @@ CvCaptureCommentsOnly ( else { AcpiGbl_IncCommentListTail->Next = CommentNode; - AcpiGbl_IncCommentListTail = AcpiGbl_IncCommentListTail->Next; + AcpiGbl_IncCommentListTail = + AcpiGbl_IncCommentListTail->Next; } - CvDbgPrint ("Found a include comment: %s\n", CommentNode->Comment); + CvDbgPrint ("Found a include comment: %s\n", + CommentNode->Comment); break; default: @@ -875,13 +914,12 @@ CvCaptureCommentsOnly ( Aml -= 2; goto DefBlock; - break; - } /* end switch statement */ + } /* End switch statement */ - } /* end else */ + } /* End else */ - /* determine the length and move forward that amount */ + /* Determine the length and move forward that amount */ Length = 0; while (ParserState->Aml[Length]) @@ -891,12 +929,10 @@ CvCaptureCommentsOnly ( ParserState->Aml += Length + 1; - /* Peek at the next Opcode. */ Aml = ParserState->Aml; Opcode = (UINT16) ACPI_GET8 (Aml); - } DefBlock: @@ -921,7 +957,7 @@ DefBlock: * * PARAMETERS: ParserState - A parser state object * - * RETURN: none + * RETURN: None * * DESCRIPTION: Wrapper function for CvCaptureCommentsOnly * This is referred as ASL_CV_CAPTURE_COMMENTS. @@ -943,8 +979,8 @@ CvCaptureComments ( } /* - * Before parsing, check to see that comments that come directly after - * deferred opcodes aren't being processed. + * Before parsing, check to see that comments that come directly + * after deferred opcodes aren't being processed. */ Aml = WalkState->ParserState.Aml; Opcode = (UINT16) ACPI_GET8 (Aml); @@ -965,9 +1001,9 @@ CvCaptureComments ( * * FUNCTION: CvTransferComments * - * PARAMETERS: Op - Transfer comments to this Op + * PARAMETERS: Op - Transfer comments to this Op * - * RETURN: none + * RETURN: None * * DESCRIPTION: Transfer all of the commments stored in global containers to the * given Op. This will be invoked shortly after the parser creates @@ -980,6 +1016,7 @@ void CvTransferComments ( ACPI_PARSE_OBJECT *Op) { + Op->Common.InlineComment = AcpiGbl_CurrentInlineComment; AcpiGbl_CurrentInlineComment = NULL; @@ -996,5 +1033,4 @@ CvTransferComments ( Op->Common.EndBlkComment = AcpiGbl_EndBlkCommentListHead; AcpiGbl_EndBlkCommentListHead = NULL; AcpiGbl_EndBlkCommentListTail = NULL; - } diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c index 8d9b532a795e..8e4a0d5f7113 100644 --- a/source/components/disassembler/dmopcode.c +++ b/source/components/disassembler/dmopcode.c @@ -528,25 +528,30 @@ AcpiDmFieldPredefinedDescription ( /* Major cheat: We previously put the Tag ptr in the Node field */ Tag = ACPI_CAST_PTR (char, IndexOp->Common.Node); - if (!Tag) + if (!Tag || (*Tag == 0)) { return; } - /* Match the name in the info table */ + /* Is the tag a predefined name? */ Info = AcpiAhMatchPredefinedName (Tag); - if (Info) + if (!Info) { - AcpiOsPrintf (" // %4.4s: %s", Tag, - ACPI_CAST_PTR (char, Info->Description)); + /* Not a predefined name (does not start with underscore) */ + + return; } - /* AML buffer (String) was allocated in AcpiGetTagPathname */ + AcpiOsPrintf (" // %4.4s: %s", Tag, + ACPI_CAST_PTR (char, Info->Description)); - ACPI_FREE (IndexOp->Common.Value.String); + /* String contains the prefix path, free it */ + ACPI_FREE (IndexOp->Common.Value.String); + IndexOp->Common.Value.String = NULL; #endif + return; } diff --git a/source/components/dispatcher/dspkginit.c b/source/components/dispatcher/dspkginit.c deleted file mode 100755 index efbc0f3a8043..000000000000 --- a/source/components/dispatcher/dspkginit.c +++ /dev/null @@ -1,638 +0,0 @@ -/****************************************************************************** - * - * Module Name: dspkginit - Completion of deferred package initialization - * - *****************************************************************************/ - -/****************************************************************************** - * - * 1. Copyright Notice - * - * Some or all of this work - Copyright (c) 1999 - 2017, Intel Corp. - * All rights reserved. - * - * 2. License - * - * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided - * you this software, covering your right to use that party's intellectual - * property rights. - * - * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a - * copy of the source code appearing in this file ("Covered Code") an - * irrevocable, perpetual, worldwide license under Intel's copyrights in the - * base code distributed originally by Intel ("Original Intel Code") to copy, - * make derivatives, distribute, use and display any portion of the Covered - * Code in any form, with the right to sublicense such rights; and - * - * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent - * license (with the right to sublicense), under only those claims of Intel - * patents that are infringed by the Original Intel Code, to make, use, sell, - * offer to sell, and import the Covered Code and derivative works thereof - * solely to the minimum extent necessary to exercise the above copyright - * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right - * is granted directly or by implication, estoppel or otherwise; - * - * The above copyright and patent license is granted only if the following - * conditions are met: - * - * 3. Conditions - * - * 3.1. Redistribution of Source with Rights to Further Distribute Source. - * Redistribution of source code of any substantial portion of the Covered - * Code or modification with rights to further distribute source must include - * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, - * Licensee must cause all Covered Code to which Licensee contributes to - * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee - * must include a prominent statement that the modification is derived, - * directly or indirectly, from Original Intel Code. - * - * 3.2. Redistribution of Source with no Rights to Further Distribute Source. - * Redistribution of source code of any substantial portion of the Covered - * Code or modification without rights to further distribute source must - * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In - * addition, Licensee may not authorize further sublicense of source of any - * portion of the Covered Code, and must include terms to the effect that the - * license from Licensee to its licensee is limited to the intellectual - * property embodied in the software Licensee provides to its licensee, and - * not to intellectual property embodied in modifications its licensee may - * make. - * - * 3.3. Redistribution of Executable. Redistribution in executable form of any - * substantial portion of the Covered Code or modification must reproduce the - * above Copyright Notice, and the following Disclaimer and Export Compliance - * provision in the documentation and/or other materials provided with the - * distribution. - * - * 3.4. Intel retains all right, title, and interest in and to the Original - * Intel Code. - * - * 3.5. Neither the name Intel nor any other trademark owned or controlled by - * Intel shall be used in advertising or otherwise to promote the sale, use or - * other dealings in products derived from or relating to the Covered Code - * without prior written authorization from Intel. - * - * 4. Disclaimer and Export Compliance - * - * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A - * PARTICULAR PURPOSE. - * - * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES - * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR - * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, - * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY - * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS - * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY - * LIMITED REMEDY. - * - * 4.3. Licensee shall not export, either directly or indirectly, any of this - * software or system incorporating such software without first obtaining any - * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the - * event Licensee exports any such software from the United States or - * re-exports any such software from a foreign destination, Licensee shall - * ensure that the distribution and export/re-export of the software is in - * compliance with all laws, regulations, orders, or other restrictions of the - * U.S. Export Administration Regulations. Licensee agrees that neither it nor - * any of its subsidiaries will export/re-export any technical data, process, - * software, or service, directly or indirectly, to any country for which the - * United States government or any agency thereof requires an export license, - * other governmental approval, or letter of assurance, without first obtaining - * such license, approval or letter. - * - ***************************************************************************** - * - * Alternatively, you may choose to be licensed under the terms of the - * following license: - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification. - * 2. Redistributions in binary form must reproduce at minimum a disclaimer - * substantially similar to the "NO WARRANTY" disclaimer below - * ("Disclaimer") and any redistribution must be conditioned upon - * including a substantially similar Disclaimer requirement for further - * binary redistribution. - * 3. Neither the names of the above-listed copyright holders nor the names - * of any contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Alternatively, you may choose to be licensed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - *****************************************************************************/ - -#include "acpi.h" -#include "accommon.h" -#include "acnamesp.h" -#include "amlcode.h" -#include "acdispat.h" -#include "acinterp.h" - - -#define _COMPONENT ACPI_NAMESPACE - ACPI_MODULE_NAME ("dspkginit") - - -/* Local prototypes */ - -static void -AcpiDsResolvePackageElement ( - ACPI_OPERAND_OBJECT **Element); - - -/******************************************************************************* - * - * FUNCTION: AcpiDsBuildInternalPackageObj - * - * PARAMETERS: WalkState - Current walk state - * Op - Parser object to be translated - * ElementCount - Number of elements in the package - this is - * the NumElements argument to Package() - * ObjDescPtr - Where the ACPI internal object is returned - * - * RETURN: Status - * - * DESCRIPTION: Translate a parser Op package object to the equivalent - * namespace object - * - * NOTE: The number of elements in the package will be always be the NumElements - * count, regardless of the number of elements in the package list. If - * NumElements is smaller, only that many package list elements are used. - * if NumElements is larger, the Package object is padded out with - * objects of type Uninitialized (as per ACPI spec.) - * - * Even though the ASL compilers do not allow NumElements to be smaller - * than the Package list length (for the fixed length package opcode), some - * BIOS code modifies the AML on the fly to adjust the NumElements, and - * this code compensates for that. This also provides compatibility with - * other AML interpreters. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiDsBuildInternalPackageObj ( - ACPI_WALK_STATE *WalkState, - ACPI_PARSE_OBJECT *Op, - UINT32 ElementCount, - ACPI_OPERAND_OBJECT **ObjDescPtr) -{ - ACPI_PARSE_OBJECT *Arg; - ACPI_PARSE_OBJECT *Parent; - ACPI_OPERAND_OBJECT *ObjDesc = NULL; - ACPI_STATUS Status = AE_OK; - UINT16 Index; - UINT16 ReferenceCount; - UINT32 i; - - - ACPI_FUNCTION_TRACE (DsBuildInternalPackageObj); - - - /* Find the parent of a possibly nested package */ - - Parent = Op->Common.Parent; - while ((Parent->Common.AmlOpcode == AML_PACKAGE_OP) || - (Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP)) - { - Parent = Parent->Common.Parent; - } - - /* - * If we are evaluating a Named package object of the form: - * Name (xxxx, Package) - * the package object already exists, otherwise it must be created. - */ - ObjDesc = *ObjDescPtr; - if (!ObjDesc) - { - ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_PACKAGE); - *ObjDescPtr = ObjDesc; - if (!ObjDesc) - { - return_ACPI_STATUS (AE_NO_MEMORY); - } - -printf ("****DS: BuildPkg - Create package object %p\n", ObjDesc); - - ObjDesc->Package.Node = Parent->Common.Node; - } - -// -printf ("****DS: BuildPkg, from DsEvalDataObjectOperands - Valid: %X, Pass %u, %p\n", - ObjDesc->Package.Flags & AOPOBJ_DATA_VALID, - WalkState->PassNumber, ObjDesc); - -// just in case -if (ObjDesc->Package.Flags & AOPOBJ_DATA_VALID) -{ - return_ACPI_STATUS (AE_OK); -} - - /* - * Allocate the element array (array of pointers to the individual - * objects) based on the NumElements parameter. Add an extra pointer slot - * so that the list is always null terminated. - */ - ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED ( - ((ACPI_SIZE) ElementCount + 1) * sizeof (void *)); - - if (!ObjDesc->Package.Elements) - { - AcpiUtDeleteObjectDesc (ObjDesc); - return_ACPI_STATUS (AE_NO_MEMORY); - } - - ObjDesc->Package.Count = ElementCount; - - /* - * Initialize the elements of the package, up to the NumElements count. - * Package is automatically padded with uninitialized (NULL) elements - * if NumElements is greater than the package list length. Likewise, - * Package is truncated if NumElements is less than the list length. - */ - Arg = Op->Common.Value.Arg; - Arg = Arg->Common.Next; - - if (Arg) - { - printf ("****DS: Mark package evaluated\n"); - ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID; - } - - for (i = 0; Arg && (i < ElementCount); i++) - { -printf ("****DS: Eval package element\n"); - - if (Arg->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP) - { -// Maybe this is just temp code: -/* -if (!Arg->Common.Node) -{ - printf ("****DS: No attached NS node\n"); - return_ACPI_STATUS (AE_AML_INTERNAL); -} -else */ if (Arg->Common.Node->Type == ACPI_TYPE_METHOD) - { - - /* - * A method reference "looks" to the parser to be a method - * invocation, so we special case it here - */ - Arg->Common.AmlOpcode = AML_INT_NAMEPATH_OP; - Status = AcpiDsBuildInternalObject ( - WalkState, Arg, &ObjDesc->Package.Elements[i]); - } - else - { - /* This package element is already built, just get it */ - - ObjDesc->Package.Elements[i] = - ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node); - } - } - else - { - Status = AcpiDsBuildInternalObject ( - WalkState, Arg, &ObjDesc->Package.Elements[i]); - if (Status == AE_NOT_FOUND) - { -// remove or fix - ACPI_ERROR ((AE_INFO, "%-48s", "****DS namepath not found")); - } - - /* - * Initialize this package element. This function handles the - * resolution of named references within the package. - */ - AcpiDsInitPackageElement (0, ObjDesc->Package.Elements[i], - NULL, &ObjDesc->Package.Elements[i]); - } - - if (*ObjDescPtr) - { - /* Existing package, get existing reference count */ - - ReferenceCount = (*ObjDescPtr)->Common.ReferenceCount; - if (ReferenceCount > 1) - { - /* Make new element ref count match original ref count */ - - for (Index = 0; Index < (ReferenceCount - 1); Index++) - { - AcpiUtAddReference ((ObjDesc->Package.Elements[i])); - } - } - } - - Arg = Arg->Common.Next; - } - - /* Check for match between NumElements and actual length of PackageList */ - - if (Arg) - { - //ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID; - - - /* - * NumElements was exhausted, but there are remaining elements in the - * PackageList. Truncate the package to NumElements. - * - * Note: technically, this is an error, from ACPI spec: "It is an error - * for NumElements to be less than the number of elements in the - * PackageList". However, we just print a message and - * no exception is returned. This provides Windows compatibility. Some - * BIOSs will alter the NumElements on the fly, creating this type - * of ill-formed package object. - */ - while (Arg) - { - /* - * We must delete any package elements that were created earlier - * and are not going to be used because of the package truncation. - */ - if (Arg->Common.Node) - { - AcpiUtRemoveReference ( - ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node)); - Arg->Common.Node = NULL; - } - - /* Find out how many elements there really are */ - - i++; - Arg = Arg->Common.Next; - } - - ACPI_INFO (( - "Actual Package length (%u) is larger than " - "NumElements field (%u), truncated", - i, ElementCount)); - } - else if (i < ElementCount) - { - /* - * Arg list (elements) was exhausted, but we did not reach - * NumElements count. - * - * Note: this is not an error, the package is padded out - * with NULLs. - */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Package List length (%u) smaller than NumElements " - "count (%u), padded with null elements\n", - i, ElementCount)); - } - - Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjDesc); - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDsInitPackageElement - * - * PARAMETERS: ACPI_PKG_CALLBACK - * - * RETURN: Status - * - * DESCRIPTION: Resolve a named reference element within a package object - * - ******************************************************************************/ - -ACPI_STATUS -AcpiDsInitPackageElement ( - UINT8 ObjectType, - ACPI_OPERAND_OBJECT *SourceObject, - ACPI_GENERIC_STATE *State, - void *Context) -{ - ACPI_OPERAND_OBJECT **ElementPtr; - - - if (!SourceObject) - { - return (AE_OK); - } - - /* - * The following code is a bit of a hack to workaround a (current) - * limitation of the ACPI_PKG_CALLBACK interface. We need a pointer - * to the location within the element array because a new object - * may be created and stored there. - */ - if (Context) - { - /* A direct call was made to this function */ - - ElementPtr = (ACPI_OPERAND_OBJECT **) Context; - } - else - { - /* Call came from AcpiUtWalkPackageTree */ - - ElementPtr = State->Pkg.ThisTargetObj; - } - - /* We are only interested in reference objects/elements */ - - if (SourceObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) - { - /* Resolve the (named) reference to a namespace node */ - - AcpiDsResolvePackageElement (ElementPtr); - } - else if (SourceObject->Common.Type == ACPI_TYPE_PACKAGE) - { - SourceObject->Package.Flags |= AOPOBJ_DATA_VALID; - } - - return (AE_OK); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDsResolvePackageElement - * - * PARAMETERS: ElementPtr - Pointer to a reference object - * - * RETURN: Status - * - * DESCRIPTION: Resolve a package element that is a reference to a named - * object. - * - ******************************************************************************/ - -static void -AcpiDsResolvePackageElement ( - ACPI_OPERAND_OBJECT **ElementPtr) -{ - ACPI_STATUS Status; - ACPI_GENERIC_STATE ScopeInfo; - ACPI_OPERAND_OBJECT *Element = *ElementPtr; - ACPI_NAMESPACE_NODE *ResolvedNode; - ACPI_OBJECT_TYPE Type; - - - ACPI_FUNCTION_TRACE (DsResolvePackageElement); - - - /* Check if reference element is already resolved */ - - if (Element->Reference.Resolved) - { - return_VOID; - } - - /* Element must be a reference object of correct type */ - - ScopeInfo.Scope.Node = Element->Reference.Node; /* Prefix node */ - - Status = AcpiNsLookup (&ScopeInfo, - (char *) Element->Reference.Aml, /* Pointer to AML path */ - ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS2, - ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, - NULL, &ResolvedNode); - - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, - "Could not resolve package element")); - return_VOID; - } - - else if (ResolvedNode->Type == ACPI_TYPE_ANY) - { - /* Named reference not resolved, return a NULL package element */ - - ACPI_ERROR ((AE_INFO, - "Could not resolve package element [%4.4s] in [%4.4s]", - ResolvedNode->Name.Ascii, ScopeInfo.Scope.Node->Name.Ascii)); - *ElementPtr = NULL; - return_VOID; - } - - else if (ResolvedNode->Flags & ANOBJ_TEMPORARY) - { - /* - * A temporary node found here indicates that the reference is - * to a node that was created within this method. We are not - * going to allow it (especially if the package is returned - * from the method) -- the temporary node will be deleted out - * from under the method. (05/2017). - */ - ACPI_ERROR ((AE_INFO, - "Package element is a temporary name [%4.4s], " - "returning NULL element", - ResolvedNode->Name.Ascii)); - *ElementPtr = NULL; - return_VOID; - } - - /* Update the reference object */ - - Element->Reference.Resolved = TRUE; - Element->Reference.Node = ResolvedNode; - Type = Element->Reference.Node->Type; - - /* - * Attempt to resolve the node to a value before we insert it into - * the package. If this is a reference to a common data type, - * resolve it immediately. According to the ACPI spec, package - * elements can only be "data objects" or method references. - * Attempt to resolve to an Integer, Buffer, String or Package. - * If cannot, return the named reference (for things like Devices, - * Methods, etc.) Buffer Fields and Fields will resolve to simple - * objects (int/buf/str/pkg). - * - * NOTE: References to things like Devices, Methods, Mutexes, etc. - * will remain as named references. This behavior is not described - * in the ACPI spec, but it appears to be an oversight. - */ - Status = AcpiExResolveNodeToValue (&ResolvedNode, NULL); - if (ACPI_FAILURE (Status)) - { - return_VOID; - } - -#if 0 - /* - * Special handling for Alias objects. We need to setup the type - * and the Op->Common.Node to point to the Alias target. Note, - * Alias has at most one level of indirection internally. - */ - Type = Op->Common.Node->Type; - if (Type == ACPI_TYPE_LOCAL_ALIAS) - { - Type = ObjDesc->Common.Type; - Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, - Op->Common.Node->Object); - } -#endif - - switch (Type) - { - /* - * These object types are a result of named references, so we will - * leave them as reference objects. In other words, these types - * have no intrinsic "value". - */ - case ACPI_TYPE_DEVICE: - case ACPI_TYPE_THERMAL: - - /* TBD: This may not be necesssary */ - - AcpiUtAddReference (ResolvedNode->Object); - break; - - case ACPI_TYPE_MUTEX: - case ACPI_TYPE_METHOD: - case ACPI_TYPE_POWER: - case ACPI_TYPE_PROCESSOR: - case ACPI_TYPE_EVENT: - case ACPI_TYPE_REGION: - - break; - - default: - /* - * For all other types - the node was resolved to an actual - * operand object with a value, return the object - */ - *ElementPtr = (ACPI_OPERAND_OBJECT *) ResolvedNode; - break; - } - - return_VOID; -} diff --git a/source/components/executer/excreate.c b/source/components/executer/excreate.c index a5148dbb49df..15b38574a1da 100644 --- a/source/components/executer/excreate.c +++ b/source/components/executer/excreate.c @@ -203,6 +203,12 @@ AcpiExCreateAlias ( TargetNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, TargetNode->Object); } + /* Ensure that the target node is valid */ + if (!TargetNode) + { + return_ACPI_STATUS (AE_NULL_OBJECT); + } + /* * For objects that can never change (i.e., the NS node will * permanently point to the same object), we can simply attach diff --git a/source/components/hardware/hwxfsleep.c b/source/components/hardware/hwxfsleep.c index 4b858b425ca6..c9d445fd983f 100644 --- a/source/components/hardware/hwxfsleep.c +++ b/source/components/hardware/hwxfsleep.c @@ -184,9 +184,18 @@ AcpiHwSleepDispatch ( static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[] = { - {ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacySleep), AcpiHwExtendedSleep}, - {ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep), AcpiHwExtendedWakePrep}, - {ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake), AcpiHwExtendedWake} + {ACPI_STRUCT_INIT (legacy_function, + ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacySleep)), + ACPI_STRUCT_INIT (extended_function, + AcpiHwExtendedSleep) }, + {ACPI_STRUCT_INIT (legacy_function, + ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep)), + ACPI_STRUCT_INIT (extended_function, + AcpiHwExtendedWakePrep) }, + {ACPI_STRUCT_INIT (legacy_function, + ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake)), + ACPI_STRUCT_INIT (extended_function, + AcpiHwExtendedWake) } }; diff --git a/source/components/namespace/nsaccess.c b/source/components/namespace/nsaccess.c index 1404eabf67ad..89d766b4bdd3 100644 --- a/source/components/namespace/nsaccess.c +++ b/source/components/namespace/nsaccess.c @@ -764,6 +764,13 @@ AcpiNsLookup ( ThisNode = (ACPI_NAMESPACE_NODE *) ThisNode->Object; } } +#ifdef ACPI_ASL_COMPILER + if (!AcpiGbl_DisasmFlag && + (ThisNode->Flags & ANOBJ_IS_EXTERNAL)) + { + ThisNode->Flags |= IMPLICIT_EXTERNAL; + } +#endif } /* Special handling for the last segment (NumSegments == 0) */ diff --git a/source/components/parser/psobject.c b/source/components/parser/psobject.c index 5d59492a7ba8..8f31750c5f7e 100644 --- a/source/components/parser/psobject.c +++ b/source/components/parser/psobject.c @@ -487,6 +487,31 @@ AcpiPsCreateOp ( { Status = AcpiPsBuildNamedOp (WalkState, AmlOpStart, Op, &NamedOp); AcpiPsFreeOp (Op); + +#ifdef ACPI_ASL_COMPILER + if (AcpiGbl_DisasmFlag && WalkState->Opcode == AML_EXTERNAL_OP && + Status == AE_NOT_FOUND) + { + /* + * If parsing of AML_EXTERNAL_OP's name path fails, then skip + * past this opcode and keep parsing. This is a much better + * alternative than to abort the entire disassembler. At this + * point, the ParserState is at the end of the namepath of the + * external declaration opcode. Setting WalkState->Aml to + * WalkState->ParserState.Aml + 2 moves increments the + * WalkState->Aml past the object type and the paramcount of the + * external opcode. For the error message, only print the AML + * offset. We could attempt to print the name but this may cause + * a segmentation fault when printing the namepath because the + * AML may be incorrect. + */ + AcpiOsPrintf ( + "// Invalid external declaration at AML offset 0x%x.\n", + WalkState->Aml - WalkState->ParserState.AmlStart); + WalkState->Aml = WalkState->ParserState.Aml + 2; + return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE); + } +#endif if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); diff --git a/source/components/tables/tbdata.c b/source/components/tables/tbdata.c index 55713a8ea1fd..47096186fa1c 100644 --- a/source/components/tables/tbdata.c +++ b/source/components/tables/tbdata.c @@ -158,6 +158,66 @@ #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbdata") +/* Local prototypes */ + +static ACPI_STATUS +AcpiTbCheckDuplication ( + ACPI_TABLE_DESC *TableDesc, + UINT32 *TableIndex); + +static BOOLEAN +AcpiTbCompareTables ( + ACPI_TABLE_DESC *TableDesc, + UINT32 TableIndex); + + +/******************************************************************************* + * + * FUNCTION: AcpiTbCompareTables + * + * PARAMETERS: TableDesc - Table 1 descriptor to be compared + * TableIndex - Index of table 2 to be compared + * + * RETURN: TRUE if both tables are identical. + * + * DESCRIPTION: This function compares a table with another table that has + * already been installed in the root table list. + * + ******************************************************************************/ + +static BOOLEAN +AcpiTbCompareTables ( + ACPI_TABLE_DESC *TableDesc, + UINT32 TableIndex) +{ + ACPI_STATUS Status = AE_OK; + BOOLEAN IsIdentical; + ACPI_TABLE_HEADER *Table; + UINT32 TableLength; + UINT8 TableFlags; + + + Status = AcpiTbAcquireTable (&AcpiGbl_RootTableList.Tables[TableIndex], + &Table, &TableLength, &TableFlags); + if (ACPI_FAILURE (Status)) + { + return (FALSE); + } + + /* + * Check for a table match on the entire table length, + * not just the header. + */ + IsIdentical = (BOOLEAN)((TableDesc->Length != TableLength || + memcmp (TableDesc->Pointer, Table, TableLength)) ? + FALSE : TRUE); + + /* Release the acquired table */ + + AcpiTbReleaseTable (Table, TableLength, TableFlags); + return (IsIdentical); +} + /******************************************************************************* * @@ -477,7 +537,7 @@ AcpiTbValidateTempTable ( ACPI_TABLE_DESC *TableDesc) { - if (!TableDesc->Pointer && !AcpiGbl_VerifyTableChecksum) + if (!TableDesc->Pointer && !AcpiGbl_EnableTableValidation) { /* * Only validates the header of the table. @@ -495,12 +555,94 @@ AcpiTbValidateTempTable ( } +/******************************************************************************* + * + * FUNCTION: AcpiTbCheckDuplication + * + * PARAMETERS: TableDesc - Table descriptor + * TableIndex - Where the table index is returned + * + * RETURN: Status + * + * DESCRIPTION: Avoid installing duplicated tables. However table override and + * user aided dynamic table load is allowed, thus comparing the + * address of the table is not sufficient, and checking the entire + * table content is required. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiTbCheckDuplication ( + ACPI_TABLE_DESC *TableDesc, + UINT32 *TableIndex) +{ + UINT32 i; + + + ACPI_FUNCTION_TRACE (TbCheckDuplication); + + + /* Check if table is already registered */ + + for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) + { + /* Do not compare with unverified tables */ + + if (!(AcpiGbl_RootTableList.Tables[i].Flags & ACPI_TABLE_IS_VERIFIED)) + { + continue; + } + + /* + * Check for a table match on the entire table length, + * not just the header. + */ + if (!AcpiTbCompareTables (TableDesc, i)) + { + continue; + } + + /* + * Note: the current mechanism does not unregister a table if it is + * dynamically unloaded. The related namespace entries are deleted, + * but the table remains in the root table list. + * + * The assumption here is that the number of different tables that + * will be loaded is actually small, and there is minimal overhead + * in just keeping the table in case it is needed again. + * + * If this assumption changes in the future (perhaps on large + * machines with many table load/unload operations), tables will + * need to be unregistered when they are unloaded, and slots in the + * root table list should be reused when empty. + */ + if (AcpiGbl_RootTableList.Tables[i].Flags & + ACPI_TABLE_IS_LOADED) + { + /* Table is still loaded, this is an error */ + + return_ACPI_STATUS (AE_ALREADY_EXISTS); + } + else + { + *TableIndex = i; + return_ACPI_STATUS (AE_CTRL_TERMINATE); + } + } + + /* Indicate no duplication to the caller */ + + return_ACPI_STATUS (AE_OK); +} + + /****************************************************************************** * * FUNCTION: AcpiTbVerifyTempTable * * PARAMETERS: TableDesc - Table descriptor * Signature - Table signature to verify + * TableIndex - Where the table index is returned * * RETURN: Status * @@ -512,7 +654,8 @@ AcpiTbValidateTempTable ( ACPI_STATUS AcpiTbVerifyTempTable ( ACPI_TABLE_DESC *TableDesc, - char *Signature) + char *Signature, + UINT32 *TableIndex) { ACPI_STATUS Status = AE_OK; @@ -540,10 +683,10 @@ AcpiTbVerifyTempTable ( goto InvalidateAndExit; } - /* Verify the checksum */ - - if (AcpiGbl_VerifyTableChecksum) + if (AcpiGbl_EnableTableValidation) { + /* Verify the checksum */ + Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length); if (ACPI_FAILURE (Status)) { @@ -556,9 +699,32 @@ AcpiTbVerifyTempTable ( goto InvalidateAndExit; } + + /* Avoid duplications */ + + if (TableIndex) + { + Status = AcpiTbCheckDuplication (TableDesc, TableIndex); + if (ACPI_FAILURE (Status)) + { + if (Status != AE_CTRL_TERMINATE) + { + ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY, + "%4.4s 0x%8.8X%8.8X" + " Table is duplicated", + AcpiUtValidNameseg (TableDesc->Signature.Ascii) ? + TableDesc->Signature.Ascii : "????", + ACPI_FORMAT_UINT64 (TableDesc->Address))); + } + + goto InvalidateAndExit; + } + } + + TableDesc->Flags |= ACPI_TABLE_IS_VERIFIED; } - return_ACPI_STATUS (AE_OK); + return_ACPI_STATUS (Status); InvalidateAndExit: AcpiTbInvalidateTable (TableDesc); @@ -584,6 +750,8 @@ AcpiTbResizeRootTableList ( { ACPI_TABLE_DESC *Tables; UINT32 TableCount; + UINT32 CurrentTableCount, MaxTableCount; + UINT32 i; ACPI_FUNCTION_TRACE (TbResizeRootTableList); @@ -608,9 +776,9 @@ AcpiTbResizeRootTableList ( TableCount = AcpiGbl_RootTableList.CurrentTableCount; } + MaxTableCount = TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT; Tables = ACPI_ALLOCATE_ZEROED ( - ((ACPI_SIZE) TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT) * - sizeof (ACPI_TABLE_DESC)); + ((ACPI_SIZE) MaxTableCount) * sizeof (ACPI_TABLE_DESC)); if (!Tables) { ACPI_ERROR ((AE_INFO, "Could not allocate new root table array")); @@ -619,10 +787,19 @@ AcpiTbResizeRootTableList ( /* Copy and free the previous table array */ + CurrentTableCount = 0; if (AcpiGbl_RootTableList.Tables) { - memcpy (Tables, AcpiGbl_RootTableList.Tables, - (ACPI_SIZE) TableCount * sizeof (ACPI_TABLE_DESC)); + for (i = 0; i < TableCount; i++) + { + if (AcpiGbl_RootTableList.Tables[i].Address) + { + memcpy (Tables + CurrentTableCount, + AcpiGbl_RootTableList.Tables + i, + sizeof (ACPI_TABLE_DESC)); + CurrentTableCount++; + } + } if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) { @@ -631,8 +808,8 @@ AcpiTbResizeRootTableList ( } AcpiGbl_RootTableList.Tables = Tables; - AcpiGbl_RootTableList.MaxTableCount = - TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT; + AcpiGbl_RootTableList.MaxTableCount = MaxTableCount; + AcpiGbl_RootTableList.CurrentTableCount = CurrentTableCount; AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED; return_ACPI_STATUS (AE_OK); @@ -1029,14 +1206,9 @@ AcpiTbLoadTable ( AcpiEvUpdateGpes (OwnerId); } - /* Invoke table handler if present */ - - if (AcpiGbl_TableHandler) - { - (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table, - AcpiGbl_TableHandlerContext); - } + /* Invoke table handler */ + AcpiTbNotifyTable (ACPI_TABLE_EVENT_LOAD, Table); return_ACPI_STATUS (Status); } @@ -1070,24 +1242,19 @@ AcpiTbInstallAndLoadTable ( ACPI_FUNCTION_TRACE (TbInstallAndLoadTable); - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - /* Install the table and load it into the namespace */ Status = AcpiTbInstallStandardTable (Address, Flags, TRUE, Override, &i); if (ACPI_FAILURE (Status)) { - goto UnlockAndExit; + goto Exit; } - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); Status = AcpiTbLoadTable (i, AcpiGbl_RootNode); - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); -UnlockAndExit: +Exit: *TableIndex = i; - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); return_ACPI_STATUS (Status); } @@ -1122,16 +1289,12 @@ AcpiTbUnloadTable ( return_ACPI_STATUS (AE_NOT_EXIST); } - /* Invoke table handler if present */ + /* Invoke table handler */ - if (AcpiGbl_TableHandler) + Status = AcpiGetTableByIndex (TableIndex, &Table); + if (ACPI_SUCCESS (Status)) { - Status = AcpiGetTableByIndex (TableIndex, &Table); - if (ACPI_SUCCESS (Status)) - { - (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_UNLOAD, Table, - AcpiGbl_TableHandlerContext); - } + AcpiTbNotifyTable (ACPI_TABLE_EVENT_UNLOAD, Table); } /* Delete the portion of the namespace owned by this table */ @@ -1146,3 +1309,31 @@ AcpiTbUnloadTable ( AcpiTbSetTableLoadedFlag (TableIndex, FALSE); return_ACPI_STATUS (Status); } + + +/******************************************************************************* + * + * FUNCTION: AcpiTbNotifyTable + * + * PARAMETERS: Event - Table event + * Table - Validated table pointer + * + * RETURN: None + * + * DESCRIPTION: Notify a table event to the users. + * + ******************************************************************************/ + +void +AcpiTbNotifyTable ( + UINT32 Event, + void *Table) +{ + /* Invoke table handler if present */ + + if (AcpiGbl_TableHandler) + { + (void) AcpiGbl_TableHandler (Event, Table, + AcpiGbl_TableHandlerContext); + } +} diff --git a/source/components/tables/tbinstal.c b/source/components/tables/tbinstal.c index d012f38a2975..54ea58d009fb 100644 --- a/source/components/tables/tbinstal.c +++ b/source/components/tables/tbinstal.c @@ -156,61 +156,6 @@ #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbinstal") -/* Local prototypes */ - -static BOOLEAN -AcpiTbCompareTables ( - ACPI_TABLE_DESC *TableDesc, - UINT32 TableIndex); - - -/******************************************************************************* - * - * FUNCTION: AcpiTbCompareTables - * - * PARAMETERS: TableDesc - Table 1 descriptor to be compared - * TableIndex - Index of table 2 to be compared - * - * RETURN: TRUE if both tables are identical. - * - * DESCRIPTION: This function compares a table with another table that has - * already been installed in the root table list. - * - ******************************************************************************/ - -static BOOLEAN -AcpiTbCompareTables ( - ACPI_TABLE_DESC *TableDesc, - UINT32 TableIndex) -{ - ACPI_STATUS Status = AE_OK; - BOOLEAN IsIdentical; - ACPI_TABLE_HEADER *Table; - UINT32 TableLength; - UINT8 TableFlags; - - - Status = AcpiTbAcquireTable (&AcpiGbl_RootTableList.Tables[TableIndex], - &Table, &TableLength, &TableFlags); - if (ACPI_FAILURE (Status)) - { - return (FALSE); - } - - /* - * Check for a table match on the entire table length, - * not just the header. - */ - IsIdentical = (BOOLEAN)((TableDesc->Length != TableLength || - memcmp (TableDesc->Pointer, Table, TableLength)) ? - FALSE : TRUE); - - /* Release the acquired table */ - - AcpiTbReleaseTable (Table, TableLength, TableFlags); - return (IsIdentical); -} - /******************************************************************************* * @@ -337,105 +282,48 @@ AcpiTbInstallStandardTable ( goto ReleaseAndExit; } + /* Acquire the table lock */ + + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); + /* Validate and verify a table before installation */ - Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL); + Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL, &i); if (ACPI_FAILURE (Status)) { - goto ReleaseAndExit; - } - - if (Reload) - { - /* - * Validate the incoming table signature. - * - * 1) Originally, we checked the table signature for "SSDT" or "PSDT". - * 2) We added support for OEMx tables, signature "OEM". - * 3) Valid tables were encountered with a null signature, so we just - * gave up on validating the signature, (05/2008). - * 4) We encountered non-AML tables such as the MADT, which caused - * interpreter errors and kernel faults. So now, we once again allow - * only "SSDT", "OEMx", and now, also a null signature. (05/2011). - */ - if ((NewTableDesc.Signature.Ascii[0] != 0x00) && - (!ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT)) && - (strncmp (NewTableDesc.Signature.Ascii, "OEM", 3))) - { - ACPI_BIOS_ERROR ((AE_INFO, - "Table has invalid signature [%4.4s] (0x%8.8X), " - "must be SSDT or OEMx", - AcpiUtValidNameseg (NewTableDesc.Signature.Ascii) ? - NewTableDesc.Signature.Ascii : "????", - NewTableDesc.Signature.Integer)); - - Status = AE_BAD_SIGNATURE; - goto ReleaseAndExit; - } - - /* Check if table is already registered */ - - for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) + if (Status == AE_CTRL_TERMINATE) { /* - * Check for a table match on the entire table length, - * not just the header. + * Table was unloaded, allow it to be reloaded. + * As we are going to return AE_OK to the caller, we should + * take the responsibility of freeing the input descriptor. + * Refill the input descriptor to ensure + * AcpiTbInstallTableWithOverride() can be called again to + * indicate the re-installation. */ - if (!AcpiTbCompareTables (&NewTableDesc, i)) - { - continue; - } - - /* - * Note: the current mechanism does not unregister a table if it is - * dynamically unloaded. The related namespace entries are deleted, - * but the table remains in the root table list. - * - * The assumption here is that the number of different tables that - * will be loaded is actually small, and there is minimal overhead - * in just keeping the table in case it is needed again. - * - * If this assumption changes in the future (perhaps on large - * machines with many table load/unload operations), tables will - * need to be unregistered when they are unloaded, and slots in the - * root table list should be reused when empty. - */ - if (AcpiGbl_RootTableList.Tables[i].Flags & - ACPI_TABLE_IS_LOADED) - { - /* Table is still loaded, this is an error */ - - Status = AE_ALREADY_EXISTS; - goto ReleaseAndExit; - } - else - { - /* - * Table was unloaded, allow it to be reloaded. - * As we are going to return AE_OK to the caller, we should - * take the responsibility of freeing the input descriptor. - * Refill the input descriptor to ensure - * AcpiTbInstallTableWithOverride() can be called again to - * indicate the re-installation. - */ - AcpiTbUninstallTable (&NewTableDesc); - *TableIndex = i; - return_ACPI_STATUS (AE_OK); - } + AcpiTbUninstallTable (&NewTableDesc); + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + *TableIndex = i; + return_ACPI_STATUS (AE_OK); } + goto UnlockAndExit; } /* Add the table to the global root table list */ AcpiTbInstallTableWithOverride (&NewTableDesc, Override, TableIndex); - /* Invoke table handler if present */ + /* Invoke table handler */ - if (AcpiGbl_TableHandler) - { - (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_INSTALL, - NewTableDesc.Pointer, AcpiGbl_TableHandlerContext); - } + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + AcpiTbNotifyTable (ACPI_TABLE_EVENT_INSTALL, NewTableDesc.Pointer); + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); + +UnlockAndExit: + + /* Release the table lock */ + + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); ReleaseAndExit: @@ -503,9 +391,11 @@ AcpiTbOverrideTable ( FinishOverride: - /* Validate and verify a table before overriding */ - - Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL); + /* + * Validate and verify a table before overriding, no nested table + * duplication check as it's too complicated and unnecessary. + */ + Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL, NULL); if (ACPI_FAILURE (Status)) { return; diff --git a/source/components/tables/tbutils.c b/source/components/tables/tbutils.c index c7e0ee75372e..db3fe56de46f 100644 --- a/source/components/tables/tbutils.c +++ b/source/components/tables/tbutils.c @@ -559,14 +559,19 @@ AcpiTbGetTable ( } } - TableDesc->ValidationCount++; - if (TableDesc->ValidationCount == 0) + if (TableDesc->ValidationCount < ACPI_MAX_TABLE_VALIDATIONS) { - ACPI_ERROR ((AE_INFO, - "Table %p, Validation count is zero after increment\n", - TableDesc)); - TableDesc->ValidationCount--; - return_ACPI_STATUS (AE_LIMIT); + TableDesc->ValidationCount++; + + /* + * Detect ValidationCount overflows to ensure that the warning + * message will only be printed once. + */ + if (TableDesc->ValidationCount >= ACPI_MAX_TABLE_VALIDATIONS) + { + ACPI_WARNING((AE_INFO, + "Table %p, Validation count overflows\n", TableDesc)); + } } *OutTable = TableDesc->Pointer; @@ -597,14 +602,21 @@ AcpiTbPutTable ( ACPI_FUNCTION_TRACE (AcpiTbPutTable); - if (TableDesc->ValidationCount == 0) + if (TableDesc->ValidationCount < ACPI_MAX_TABLE_VALIDATIONS) { - ACPI_WARNING ((AE_INFO, - "Table %p, Validation count is zero before decrement\n", - TableDesc)); - return_VOID; + TableDesc->ValidationCount--; + + /* + * Detect ValidationCount underflows to ensure that the warning + * message will only be printed once. + */ + if (TableDesc->ValidationCount >= ACPI_MAX_TABLE_VALIDATIONS) + { + ACPI_WARNING ((AE_INFO, + "Table %p, Validation count underflows\n", TableDesc)); + return_VOID; + } } - TableDesc->ValidationCount--; if (TableDesc->ValidationCount == 0) { diff --git a/source/components/tables/tbxface.c b/source/components/tables/tbxface.c index 3f4992885e86..5fd178f55a89 100644 --- a/source/components/tables/tbxface.c +++ b/source/components/tables/tbxface.c @@ -292,6 +292,7 @@ AcpiReallocateRootTable ( void) { ACPI_STATUS Status; + ACPI_TABLE_DESC *TableDesc; UINT32 i; @@ -307,6 +308,8 @@ AcpiReallocateRootTable ( return_ACPI_STATUS (AE_SUPPORT); } + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); + /* * Ensure OS early boot logic, which is required by some hosts. If the * table state is reported to be wrong, developers should fix the @@ -315,17 +318,41 @@ AcpiReallocateRootTable ( */ for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) { - if (AcpiGbl_RootTableList.Tables[i].Pointer) + TableDesc = &AcpiGbl_RootTableList.Tables[i]; + if (TableDesc->Pointer) { ACPI_ERROR ((AE_INFO, "Table [%4.4s] is not invalidated during early boot stage", - AcpiGbl_RootTableList.Tables[i].Signature.Ascii)); + TableDesc->Signature.Ascii)); } } - AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ALLOW_RESIZE; + if (!AcpiGbl_EnableTableValidation) + { + /* + * Now it's safe to do full table validation. We can do deferred + * table initilization here once the flag is set. + */ + AcpiGbl_EnableTableValidation = TRUE; + for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) + { + TableDesc = &AcpiGbl_RootTableList.Tables[i]; + if (!(TableDesc->Flags & ACPI_TABLE_IS_VERIFIED)) + { + Status = AcpiTbVerifyTempTable (TableDesc, NULL, NULL); + if (ACPI_FAILURE (Status)) + { + AcpiTbUninstallTable (TableDesc); + } + } + } + } + AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ALLOW_RESIZE; Status = AcpiTbResizeRootTableList (); + AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED; + + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); return_ACPI_STATUS (Status); } @@ -522,6 +549,11 @@ AcpiPutTable ( ACPI_FUNCTION_TRACE (AcpiPutTable); + if (!Table) + { + return_VOID; + } + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); /* Walk the root table list */ diff --git a/source/components/tables/tbxfload.c b/source/components/tables/tbxfload.c index 6b79793488f2..57720067a2ad 100644 --- a/source/components/tables/tbxfload.c +++ b/source/components/tables/tbxfload.c @@ -336,11 +336,11 @@ AcpiTbLoadNamespace ( { Table = &AcpiGbl_RootTableList.Tables[i]; - if (!AcpiGbl_RootTableList.Tables[i].Address || + if (!Table->Address || (!ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_SSDT) && !ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_PSDT) && !ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_OSDT)) || - ACPI_FAILURE (AcpiTbValidateTable (Table))) + ACPI_FAILURE (AcpiTbValidateTable (Table))) { continue; } diff --git a/source/components/utilities/utresrc.c b/source/components/utilities/utresrc.c index 8131cde2f834..e34662c809d1 100644 --- a/source/components/utilities/utresrc.c +++ b/source/components/utilities/utresrc.c @@ -303,11 +303,9 @@ AcpiUtWalkAmlResources ( ACPI_FUNCTION_TRACE (UtWalkAmlResources); - /* - * The absolute minimum resource template is one EndTag descriptor. - * However, we will treat a lone EndTag as just a simple buffer. - */ - if (AmlLength <= sizeof (AML_RESOURCE_END_TAG)) + /* The absolute minimum resource template is one EndTag descriptor */ + + if (AmlLength < sizeof (AML_RESOURCE_END_TAG)) { return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG); } @@ -378,10 +376,8 @@ AcpiUtWalkAmlResources ( *Context = Aml; } - /* - * Normal exit. Note: We allow the buffer to be larger than - * the resource template, as long as the END_TAG exists. - */ + /* Normal exit */ + return_ACPI_STATUS (AE_OK); } diff --git a/source/include/acapps.h b/source/include/acapps.h index 6ef98550601c..4ca3e80fb31e 100644 --- a/source/include/acapps.h +++ b/source/include/acapps.h @@ -226,6 +226,10 @@ AcGetAllTablesFromFile ( UINT8 GetOnlyAmlTables, ACPI_NEW_TABLE_DESC **ReturnListHead); +void +AcDeleteTableList ( + ACPI_NEW_TABLE_DESC *ListHead); + BOOLEAN AcIsFileBinary ( FILE *File); diff --git a/source/include/aclocal.h b/source/include/aclocal.h index 1d94a59198fe..399e4c0691ca 100644 --- a/source/include/aclocal.h +++ b/source/include/aclocal.h @@ -328,6 +328,7 @@ typedef struct acpi_namespace_node #define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */ #define ANOBJ_ALLOCATED_BUFFER 0x40 /* Method AML buffer is dynamic (InstallMethod) */ +#define IMPLICIT_EXTERNAL 0x02 /* iASL only: This object created implicitly via External */ #define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */ #define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */ #define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* iASL only: Method has at least one return value */ @@ -1146,7 +1147,7 @@ typedef struct acpi_parse_obj_named /* This version is used by the iASL compiler only */ -#define ACPI_MAX_PARSEOP_NAME 20 +#define ACPI_MAX_PARSEOP_NAME 20 typedef struct acpi_parse_obj_asl { @@ -1190,11 +1191,12 @@ typedef union acpi_parse_object typedef struct asl_comment_state { - UINT8 CommentType; - UINT32 SpacesBefore; - ACPI_PARSE_OBJECT *Latest_Parse_Node; - ACPI_PARSE_OBJECT *ParsingParenBraceNode; - BOOLEAN CaptureComments; + UINT8 CommentType; + UINT32 SpacesBefore; + ACPI_PARSE_OBJECT *LatestParseOp; + ACPI_PARSE_OBJECT *ParsingParenBraceNode; + BOOLEAN CaptureComments; + } ASL_COMMENT_STATE; diff --git a/source/include/acobject.h b/source/include/acobject.h index 25d749637250..f03760977ea0 100644 --- a/source/include/acobject.h +++ b/source/include/acobject.h @@ -241,7 +241,9 @@ typedef struct acpi_object_integer UINT32 Length; -typedef struct acpi_object_string /* Null terminated, ASCII characters only */ +/* Null terminated, ASCII characters only */ + +typedef struct acpi_object_string { ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO (char) /* String in AML stream or allocated string */ @@ -359,8 +361,9 @@ typedef struct acpi_object_method union acpi_operand_object *NotifyList[2]; /* Handlers for system/device notifies */\ union acpi_operand_object *Handler; /* Handler for Address space */ +/* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ -typedef struct acpi_object_notify_common /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ +typedef struct acpi_object_notify_common { ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO @@ -431,8 +434,9 @@ typedef struct acpi_object_thermal_zone UINT8 StartFieldBitOffset;/* Bit offset within first field datum (0-63) */\ UINT8 AccessLength; /* For serial regions/fields */ +/* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ -typedef struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ +typedef struct acpi_object_field_common { ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO diff --git a/source/include/acpixf.h b/source/include/acpixf.h index 934e668369b0..7aad838661fd 100644 --- a/source/include/acpixf.h +++ b/source/include/acpixf.h @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20170531 +#define ACPI_CA_VERSION 0x20170629 #include "acconfig.h" #include "actypes.h" @@ -270,13 +270,14 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CreateOsiMethod, TRUE); ACPI_INIT_GLOBAL (UINT8, AcpiGbl_UseDefaultRegisterWidths, TRUE); /* - * Whether or not to verify the table checksum before installation. Set - * this to TRUE to verify the table checksum before install it to the table - * manager. Note that enabling this option causes errors to happen in some - * OSPMs during early initialization stages. Default behavior is to do such - * verification. + * Whether or not to validate (map) an entire table to verify + * checksum/duplication in early stage before install. Set this to TRUE to + * allow early table validation before install it to the table manager. + * Note that enabling this option causes errors to happen in some OSPMs + * during early initialization stages. Default behavior is to allow such + * validation. */ -ACPI_INIT_GLOBAL (UINT8, AcpiGbl_VerifyTableChecksum, TRUE); +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableTableValidation, TRUE); /* * Optionally enable output from the AML Debug Object. diff --git a/source/include/actables.h b/source/include/actables.h index 8f5a3948c1dd..05a69ffebb38 100644 --- a/source/include/actables.h +++ b/source/include/actables.h @@ -206,7 +206,8 @@ AcpiTbValidateTempTable ( ACPI_STATUS AcpiTbVerifyTempTable ( ACPI_TABLE_DESC *TableDesc, - char *Signature); + char *Signature, + UINT32 *TableIndex); BOOLEAN AcpiTbIsTableLoaded ( @@ -303,6 +304,11 @@ AcpiTbUnloadTable ( UINT32 TableIndex); void +AcpiTbNotifyTable ( + UINT32 Event, + void *Table); + +void AcpiTbTerminate ( void); diff --git a/source/include/actbl.h b/source/include/actbl.h index ea522cf9be9a..b72c3bfb303c 100644 --- a/source/include/actbl.h +++ b/source/include/actbl.h @@ -517,12 +517,27 @@ typedef struct acpi_table_desc } ACPI_TABLE_DESC; +/* + * Maximum value of the ValidationCount field in ACPI_TABLE_DESC. + * When reached, ValidationCount cannot be changed any more and the table will + * be permanently regarded as validated. + * + * This is to prevent situations in which unbalanced table get/put operations + * may cause premature table unmapping in the OS to happen. + * + * The maximum validation count can be defined to any value, but should be + * greater than the maximum number of OS early stage mapping slots to avoid + * leaking early stage table mappings to the late stage. + */ +#define ACPI_MAX_TABLE_VALIDATIONS ACPI_UINT16_MAX + /* Masks for Flags field above */ #define ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL (0) /* Virtual address, external maintained */ #define ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL (1) /* Physical address, internally mapped */ #define ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL (2) /* Virtual address, internallly allocated */ #define ACPI_TABLE_ORIGIN_MASK (3) +#define ACPI_TABLE_IS_VERIFIED (4) #define ACPI_TABLE_IS_LOADED (8) diff --git a/source/include/actbl2.h b/source/include/actbl2.h index 80495d8fa9c0..1e91ffc51699 100644 --- a/source/include/actbl2.h +++ b/source/include/actbl2.h @@ -874,7 +874,7 @@ typedef struct acpi_ibft_target * IORT - IO Remapping Table * * Conforms to "IO Remapping Table System Software on ARM Platforms", - * Document number: ARM DEN 0049B, October 2015 + * Document number: ARM DEN 0049C, May 2017 * ******************************************************************************/ @@ -1013,6 +1013,8 @@ typedef struct acpi_iort_smmu #define ACPI_IORT_SMMU_V2 0x00000001 /* Generic SMMUv2 */ #define ACPI_IORT_SMMU_CORELINK_MMU400 0x00000002 /* ARM Corelink MMU-400 */ #define ACPI_IORT_SMMU_CORELINK_MMU500 0x00000003 /* ARM Corelink MMU-500 */ +#define ACPI_IORT_SMMU_CORELINK_MMU401 0x00000004 /* ARM Corelink MMU-401 */ +#define ACPI_IORT_SMMU_CAVIUM_THUNDERX 0x00000005 /* Cavium ThunderX SMMUv2 */ /* Masks for Flags field above */ @@ -1036,18 +1038,28 @@ typedef struct acpi_iort_smmu_v3 UINT32 Flags; UINT32 Reserved; UINT64 VatosAddress; - UINT32 Model; /* O: generic SMMUv3 */ + UINT32 Model; UINT32 EventGsiv; UINT32 PriGsiv; UINT32 GerrGsiv; UINT32 SyncGsiv; + UINT8 Pxm; + UINT8 Reserved1; + UINT16 Reserved2; } ACPI_IORT_SMMU_V3; +/* Values for Model field above */ + +#define ACPI_IORT_SMMU_V3_GENERIC 0x00000000 /* Generic SMMUv3 */ +#define ACPI_IORT_SMMU_V3_HISILICON_HI161X 0x00000001 /* HiSilicon Hi161x SMMUv3 */ +#define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX 0x00000002 /* Cavium CN99xx SMMUv3 */ + /* Masks for Flags field above */ #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE (1) #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE (1<<1) +#define ACPI_IORT_SMMU_V3_PXM_VALID (1<<3) /******************************************************************************* diff --git a/source/include/platform/acenv.h b/source/include/platform/acenv.h index 5bec576b13fb..df4048e004bf 100644 --- a/source/include/platform/acenv.h +++ b/source/include/platform/acenv.h @@ -398,6 +398,11 @@ #define ACPI_INLINE #endif +/* Use ordered initialization if compiler doesn't support designated. */ +#ifndef ACPI_STRUCT_INIT +#define ACPI_STRUCT_INIT(field, value) value +#endif + /* * Configurable calling conventions: * diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h index 2c520ee1a5d0..b287e4d9373f 100644 --- a/source/include/platform/aclinux.h +++ b/source/include/platform/aclinux.h @@ -287,6 +287,11 @@ #define ACPI_MSG_BIOS_ERROR KERN_ERR "ACPI BIOS Error (bug): " #define ACPI_MSG_BIOS_WARNING KERN_WARNING "ACPI BIOS Warning (bug): " +/* + * Linux wants to use designated initializers for function pointer structs. + */ +#define ACPI_STRUCT_INIT(field, value) .field = value + #else /* !__KERNEL__ */ #define ACPI_USE_STANDARD_HEADERS diff --git a/source/tools/acpiexec/aeexception.c b/source/tools/acpiexec/aeexception.c index a5a3293ad304..62e9db0a0122 100644 --- a/source/tools/acpiexec/aeexception.c +++ b/source/tools/acpiexec/aeexception.c @@ -259,21 +259,16 @@ AeExceptionHandler ( Cleanup: - /* Global overrides */ - if (AcpiGbl_IgnoreErrors) { + /* Global option to ignore all method errors, just return OK */ + NewAmlStatus = AE_OK; } - else if (AmlStatus == AE_AML_INTERNAL) - { - NewAmlStatus = AE_AML_INTERNAL; - AcpiOsPrintf (AE_PREFIX - "Cannot override status %s\n\n", - AcpiFormatException (NewAmlStatus)); - } - else if (NewAmlStatus != AmlStatus) + if (NewAmlStatus != AmlStatus) { + /* Request to override actual status with a different status */ + AcpiOsPrintf (AE_PREFIX "Exception override, new status %s\n\n", AcpiFormatException (NewAmlStatus)); diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c index 2601d3369b89..3ea512100da4 100644 --- a/source/tools/acpiexec/aemain.c +++ b/source/tools/acpiexec/aemain.c @@ -792,5 +792,6 @@ NormalExit: ErrorExit: (void) AcpiOsTerminate (); + AcDeleteTableList (ListHead); return (ExitCode); } diff --git a/source/tools/acpinames/anmain.c b/source/tools/acpinames/anmain.c index ff341df328fe..256acaa97df8 100644 --- a/source/tools/acpinames/anmain.c +++ b/source/tools/acpinames/anmain.c @@ -409,5 +409,6 @@ AnDumpEntireNamespace ( Status = AcpiGetHandle (NULL, "\\_GPE", &Handle); ACPI_CHECK_OK (AcpiGetHandle, Status); + AcDeleteTableList (ListHead); return (0); } diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c index fe07e44cb47f..e0215e97a459 100644 --- a/source/tools/acpisrc/astable.c +++ b/source/tools/acpisrc/astable.c @@ -488,8 +488,14 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_RESOURCE_INFO", SRC_TYPE_STRUCT}, {"ACPI_RESOURCE_IO", SRC_TYPE_STRUCT}, {"ACPI_RESOURCE_IRQ", SRC_TYPE_STRUCT}, + {"ACPI_RESOURCE_LABEL", SRC_TYPE_STRUCT}, {"ACPI_RESOURCE_MEMORY24", SRC_TYPE_STRUCT}, {"ACPI_RESOURCE_MEMORY32", SRC_TYPE_STRUCT}, + {"ACPI_RESOURCE_PIN_CONFIG", SRC_TYPE_STRUCT}, + {"ACPI_RESOURCE_PIN_FUNCTION", SRC_TYPE_STRUCT}, + {"ACPI_RESOURCE_PIN_GROUP", SRC_TYPE_STRUCT}, + {"ACPI_RESOURCE_PIN_GROUP_CONFIG", SRC_TYPE_STRUCT}, + {"ACPI_RESOURCE_PIN_GROUP_FUNCTION", SRC_TYPE_STRUCT}, {"ACPI_RESOURCE_SOURCE", SRC_TYPE_STRUCT}, {"ACPI_RESOURCE_SPI_SERIALBUS", SRC_TYPE_STRUCT}, {"ACPI_RESOURCE_START_DEPENDENT", SRC_TYPE_STRUCT}, @@ -584,6 +590,11 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"AML_RESOURCE_LARGE_HEADER", SRC_TYPE_STRUCT}, {"AML_RESOURCE_MEMORY24", SRC_TYPE_STRUCT}, {"AML_RESOURCE_MEMORY32", SRC_TYPE_STRUCT}, + {"AML_RESOURCE_PIN_CONFIG", SRC_TYPE_STRUCT}, + {"AML_RESOURCE_PIN_FUNCTION", SRC_TYPE_STRUCT}, + {"AML_RESOURCE_PIN_GROUP", SRC_TYPE_STRUCT}, + {"AML_RESOURCE_PIN_GROUP_CONFIG", SRC_TYPE_STRUCT}, + {"AML_RESOURCE_PIN_GROUP_FUNCTION", SRC_TYPE_STRUCT}, {"AML_RESOURCE_SMALL_HEADER", SRC_TYPE_STRUCT}, {"AML_RESOURCE_SPI_SERIALBUS", SRC_TYPE_STRUCT}, {"AML_RESOURCE_START_DEPENDENT", SRC_TYPE_STRUCT}, @@ -730,8 +741,9 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_HEST_GENERIC_DATA_V300", SRC_TYPE_STRUCT}, {"ACPI_HEST_IA_DEFERRED_CHECK", SRC_TYPE_STRUCT}, {"ACPI_HMAT_ADDRESS_RANGE", SRC_TYPE_STRUCT}, - {"ACPI_HMAT_LOCALITY", SRC_TYPE_STRUCT}, {"ACPI_HMAT_CACHE", SRC_TYPE_STRUCT}, + {"ACPI_HMAT_LOCALITY", SRC_TYPE_STRUCT}, + {"ACPI_HMAT_STRUCTURE", SRC_TYPE_STRUCT}, {"ACPI_IBFT_HEADER", SRC_TYPE_STRUCT}, {"ACPI_IBFT_CONTROL", SRC_TYPE_STRUCT}, {"ACPI_IBFT_INITIATOR", SRC_TYPE_STRUCT}, |