Message ID | 20161117181352.27414-2-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 2016-11-17 10:13 AM, Colin King wrote: > From: Colin Ian King<colin.king@canonical.com> > > Changes in this release of ACPICA are detailed at the following > link on the ACPICA developer mailing list: > > https://lists.acpica.org/pipermail/devel/2016-November/001058.html > > Signed-off-by: Colin Ian King<colin.king@canonical.com> Acked-by: Alex Hung <alex.hung@canonical.com>
On 11/18/2016 02:13 AM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > Changes in this release of ACPICA are detailed at the following > link on the ACPICA developer mailing list: > > https://lists.acpica.org/pipermail/devel/2016-November/001058.html > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/acpica/source/common/acfileio.c | 24 +- > src/acpica/source/common/dmtbdump.c | 184 ++-- > src/acpica/source/common/dmtbinfo.c | 28 +- > src/acpica/source/compiler/aslbtypes.c | 1 - > src/acpica/source/compiler/aslcompiler.l | 16 +- > src/acpica/source/compiler/aslcstyle.y | 42 +- > src/acpica/source/compiler/aslexternal.c | 15 + > src/acpica/source/compiler/aslkeywords.y | 15 +- > src/acpica/source/compiler/aslopcodes.c | 10 +- > src/acpica/source/compiler/aslprimaries.y | 1021 ++++++++++++-------- > src/acpica/source/compiler/aslresources.y | 365 ++++--- > src/acpica/source/compiler/aslrestype2.c | 5 + > src/acpica/source/compiler/aslrules.y | 161 +-- > src/acpica/source/compiler/aslstubs.c | 3 +- > src/acpica/source/compiler/asltokens.y | 3 + > src/acpica/source/compiler/asltypes.y | 7 +- > src/acpica/source/compiler/aslwalks.c | 13 +- > src/acpica/source/compiler/dttable.c | 70 +- > .../source/components/disassembler/dmbuffer.c | 27 +- > .../source/components/disassembler/dmcstyle.c | 348 ++++--- > .../source/components/disassembler/dmresrc.c | 30 +- > src/acpica/source/components/dispatcher/dsinit.c | 10 +- > src/acpica/source/components/dispatcher/dsmethod.c | 50 +- > src/acpica/source/components/dispatcher/dsopcode.c | 2 +- > src/acpica/source/components/dispatcher/dswload2.c | 17 +- > src/acpica/source/components/events/evrgnini.c | 57 +- > src/acpica/source/components/executer/exconfig.c | 40 +- > src/acpica/source/components/executer/exconvrt.c | 1 - > src/acpica/source/components/executer/exresop.c | 1 - > src/acpica/source/components/namespace/nsload.c | 2 + > src/acpica/source/components/namespace/nsnames.c | 52 + > src/acpica/source/components/namespace/nsxfname.c | 42 +- > src/acpica/source/components/parser/psargs.c | 77 +- > src/acpica/source/components/parser/psloop.c | 3 + > src/acpica/source/components/parser/psobject.c | 8 +- > src/acpica/source/components/parser/pstree.c | 10 +- > src/acpica/source/components/tables/tbdata.c | 86 +- > src/acpica/source/components/tables/tbfadt.c | 23 +- > src/acpica/source/components/tables/tbutils.c | 96 ++ > src/acpica/source/components/tables/tbxface.c | 133 ++- > src/acpica/source/components/tables/tbxfload.c | 35 +- > src/acpica/source/components/utilities/utdecode.c | 54 ++ > src/acpica/source/components/utilities/utresrc.c | 19 +- > src/acpica/source/include/acdisasm.h | 5 +- > src/acpica/source/include/acevents.h | 3 +- > src/acpica/source/include/acnamesp.h | 5 + > src/acpica/source/include/acopcode.h | 22 +- > src/acpica/source/include/acpixf.h | 7 +- > src/acpica/source/include/actables.h | 14 +- > src/acpica/source/include/actbl.h | 165 ++-- > src/acpica/source/include/acutils.h | 4 + > src/acpica/source/include/amlcode.h | 22 +- > 52 files changed, 2096 insertions(+), 1357 deletions(-) > > diff --git a/src/acpica/source/common/acfileio.c b/src/acpica/source/common/acfileio.c > index 6cb9536..9b4564e 100644 > --- a/src/acpica/source/common/acfileio.c > +++ b/src/acpica/source/common/acfileio.c > @@ -184,7 +184,7 @@ AcGetAllTablesFromFile ( > if (FileSize == ACPI_UINT32_MAX) > { > Status = AE_ERROR; > - goto ErrorExit; > + goto Exit; > } > > fprintf (stderr, > @@ -196,7 +196,7 @@ AcGetAllTablesFromFile ( > if (FileSize < sizeof (ACPI_TABLE_HEADER)) > { > Status = AE_BAD_HEADER; > - goto ErrorExit; > + goto Exit; > } > > /* Check for an non-binary file */ > @@ -206,7 +206,8 @@ AcGetAllTablesFromFile ( > fprintf (stderr, > " %s: File does not appear to contain a valid AML table\n", > Filename); > - return (AE_TYPE); > + Status = AE_TYPE; > + goto Exit; > } > > /* Read all tables within the file */ > @@ -225,23 +226,31 @@ AcGetAllTablesFromFile ( > } > else if (Status == AE_TYPE) > { > - return (AE_OK); > + Status = AE_OK; > + goto Exit; > } > else if (ACPI_FAILURE (Status)) > { > - goto ErrorExit; > + goto Exit; > } > > /* Print table header for iASL/disassembler only */ > > #ifdef ACPI_ASL_COMPILER > > - AcpiTbPrintTableHeader (0, Table); > + AcpiTbPrintTableHeader (0, Table); > #endif > > /* Allocate and link a table descriptor */ > > TableDesc = AcpiOsAllocate (sizeof (ACPI_NEW_TABLE_DESC)); > + if (!TableDesc) > + { > + AcpiOsFree (Table); > + Status = AE_NO_MEMORY; > + goto Exit; > + } > + > TableDesc->Table = Table; > TableDesc->Next = NULL; > > @@ -276,7 +285,7 @@ AcGetAllTablesFromFile ( > *ReturnListHead = ListHead; > } > > -ErrorExit: > +Exit: > fclose(File); > return (Status); > } > @@ -334,7 +343,6 @@ AcGetOneTableFromFile ( > return (Status); > } > > - > if (GetOnlyAmlTables) > { > /* > diff --git a/src/acpica/source/common/dmtbdump.c b/src/acpica/source/common/dmtbdump.c > index fe4ce2f..ae48276 100644 > --- a/src/acpica/source/common/dmtbdump.c > +++ b/src/acpica/source/common/dmtbdump.c > @@ -124,31 +124,12 @@ > ACPI_MODULE_NAME ("dmtbdump") > > > -/* Table of revision-dependent FADT sizes */ > +/* Local prototypes */ > > -static const UINT32 FadtRevisionLength [ACPI_FADT_MAX_VERSION + 1] = > -{ > - 0, /* 0 - illegal */ > - ACPI_FADT_V1_SIZE, /* 1 - ACPI 1.0 */ > - 0, /* 2 - illegal */ > - ACPI_FADT_V3_SIZE, /* 3 - ACPI 2.0 */ > - ACPI_FADT_V4_SIZE, /* 4 - ACPI 3.0 and ACPI 4.0 */ > - ACPI_FADT_V5_SIZE, /* 5 - ACPI 5.0 */ > - ACPI_FADT_V6_SIZE /* 6 - ACPI 6.0 */ > -}; > - > -/* Table of revision-dependent FADT info tables */ > - > -ACPI_DMTABLE_INFO *FadtRevisionInfo [ACPI_FADT_MAX_VERSION + 1] = > -{ > - NULL, /* 0 - illegal */ > - AcpiDmTableInfoFadt1, /* 1 - ACPI 1.0 */ > - NULL, /* 2 - illegal */ > - AcpiDmTableInfoFadt3, /* 3 - ACPI 2.0 */ > - AcpiDmTableInfoFadt4, /* 4 - ACPI 3.0 and ACPI 4.0 */ > - AcpiDmTableInfoFadt5, /* 5 - ACPI 5.0 */ > - AcpiDmTableInfoFadt6 /* 6 - ACPI 6.0 */ > -}; > +static void > +AcpiDmValidateFadtLength ( > + UINT32 Revision, > + UINT32 Length); > > > /******************************************************************************* > @@ -438,11 +419,6 @@ AcpiDmDumpXsdt ( > * > * DESCRIPTION: Format the contents of a FADT > * > - * Check the FADT revision against the expected table length for > - * that revision. Issue a warning if the length is not what was > - * expected. This seems to be such a common BIOS bug that the > - * FADT revision has been rendered virtually meaningless. > - * > * NOTE: We cannot depend on the FADT version to indicate the actual > * contents of the FADT because of BIOS bugs. The table length > * is the only reliable indicator. > @@ -454,72 +430,142 @@ AcpiDmDumpFadt ( > ACPI_TABLE_HEADER *Table) > { > ACPI_STATUS Status; > - UINT8 FadtRevision; > - UINT32 ExpectedLength; > - UINT32 i; > - > > - FadtRevision = Table->Revision; > > - /* FADT revision/length validation */ > + /* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */ > > - if ((FadtRevision == 0) || > - (FadtRevision == 2)) > + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, > + AcpiDmTableInfoFadt1); > + if (ACPI_FAILURE (Status)) > { > - AcpiOsPrintf ( > - "// ACPI Warning: Invalid or unsupported FADT revision: %u\n", > - FadtRevision); > return; > } > > - if (FadtRevision > ACPI_FADT_MAX_VERSION) > - { > - AcpiOsPrintf ("// ACPI Warning: Revision %u is not fully supported, " > - "disassembling known fields (up to revision %u)\n\n", > - FadtRevision, ACPI_FADT_MAX_VERSION); > - } > - else > + /* Check for FADT revision 2 fields (ACPI 1.0B MS extensions) */ > + > + if ((Table->Length > ACPI_FADT_V1_SIZE) && > + (Table->Length <= ACPI_FADT_V2_SIZE)) > { > - ExpectedLength = FadtRevisionLength[FadtRevision]; > - if (Table->Length != ExpectedLength) > + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, > + AcpiDmTableInfoFadt2); > + if (ACPI_FAILURE (Status)) > { > - AcpiOsPrintf ( > - "// ACPI Warning: Input FADT revision %X does not match " > - "expected length: found 0x%X expected 0x%X\n", > - FadtRevision, Table->Length, ExpectedLength); > + return; > } > } > > - /* > - * Dump the input table on a per-version basis, but is actually > - * based upon the length of the table. Table length must > - * be larger than the required length of the previous version. > - */ > - for (i = 1; i <= ACPI_FADT_MAX_VERSION; i++) > + /* Check for FADT revision 3/4 fields and up (ACPI 2.0+ extended data) */ > + > + else if (Table->Length > ACPI_FADT_V2_SIZE) > { > - if (!FadtRevisionLength[i]) /* Skip any empty slots */ > + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, > + AcpiDmTableInfoFadt3); > + if (ACPI_FAILURE (Status)) > { > - continue; > + return; > } > > - /* Dump the fields specific to FADT revision[i] */ > + /* Check for FADT revision 5 fields and up (ACPI 5.0+) */ > > - Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, > - FadtRevisionInfo[i]); > - if (ACPI_FAILURE (Status)) > + if (Table->Length > ACPI_FADT_V3_SIZE) > { > - return; > + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, > + AcpiDmTableInfoFadt5); > + if (ACPI_FAILURE (Status)) > + { > + return; > + } > } > > - if (Table->Length <= FadtRevisionLength[i]) > + /* Check for FADT revision 6 fields and up (ACPI 6.0+) */ > + > + if (Table->Length > ACPI_FADT_V3_SIZE) > { > - break; /* End of table */ > + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, > + AcpiDmTableInfoFadt6); > + if (ACPI_FAILURE (Status)) > + { > + return; > + } > } > } > > - /* Build a local FADT to test some FADT values */ > + /* Validate various fields in the FADT, including length */ > > AcpiTbCreateLocalFadt (Table, Table->Length); > + > + /* Validate FADT length against the revision */ > + > + AcpiDmValidateFadtLength (Table->Revision, Table->Length); > +} > + > + > +/******************************************************************************* > + * > + * FUNCTION: AcpiDmValidateFadtLength > + * > + * PARAMETERS: Revision - FADT revision (Header->Revision) > + * Length - FADT length (Header->Length > + * > + * RETURN: None > + * > + * DESCRIPTION: Check the FADT revision against the expected table length for > + * that revision. Issue a warning if the length is not what was > + * expected. This seems to be such a common BIOS bug that the > + * FADT revision has been rendered virtually meaningless. > + * > + ******************************************************************************/ > + > +static void > +AcpiDmValidateFadtLength ( > + UINT32 Revision, > + UINT32 Length) > +{ > + UINT32 ExpectedLength; > + > + > + switch (Revision) > + { > + case 0: > + > + AcpiOsPrintf ("// ACPI Warning: Invalid FADT revision: 0\n"); > + return; > + > + case 1: > + > + ExpectedLength = ACPI_FADT_V1_SIZE; > + break; > + > + case 2: > + > + ExpectedLength = ACPI_FADT_V2_SIZE; > + break; > + > + case 3: > + case 4: > + > + ExpectedLength = ACPI_FADT_V3_SIZE; > + break; > + > + case 5: > + > + ExpectedLength = ACPI_FADT_V5_SIZE; > + break; > + > + default: > + > + return; > + } > + > + if (Length == ExpectedLength) > + { > + return; > + } > + > + AcpiOsPrintf ( > + "\n// ACPI Warning: FADT revision %X does not match length: " > + "found %X expected %X\n", > + Revision, Length, ExpectedLength); > } > > > diff --git a/src/acpica/source/common/dmtbinfo.c b/src/acpica/source/common/dmtbinfo.c > index e920724..522ed00 100644 > --- a/src/acpica/source/common/dmtbinfo.c > +++ b/src/acpica/source/common/dmtbinfo.c > @@ -472,7 +472,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFacs[] = > * > ******************************************************************************/ > > -/* FADT version 1 (ACPI 1.0) */ > +/* ACPI 1.0 FADT (Version 1) */ > > ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[] = > { > @@ -558,7 +558,18 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[] = > ACPI_DMT_TERMINATOR > }; > > -/* FADT version 3 (ACPI 2.0) */ > +/* ACPI 1.0 MS Extensions (FADT version 2) */ > + > +ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[] = > +{ > + {ACPI_DMT_GAS, ACPI_FADT_OFFSET (ResetRegister), "Reset Register", 0}, > + {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (ResetValue), "Value to cause reset", 0}, > + {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (ArmBootFlags), "Reserved", 0}, > + {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (MinorRevision), "Reserved", 0}, > + ACPI_DMT_TERMINATOR > +}; > + > +/* ACPI 2.0+ Extensions (FADT version 3, 4, and 5) */ > > ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[] = > { > @@ -582,23 +593,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[] = > ACPI_DMT_TERMINATOR > }; > > -/* FADT version 4 (ACPI 3.0 and ACPI 4.0) */ > - > -ACPI_DMTABLE_INFO AcpiDmTableInfoFadt4[] = > -{ > - {ACPI_DMT_GAS, ACPI_FADT_OFFSET (SleepControl), "Sleep Control Register", 0}, > - ACPI_DMT_TERMINATOR > -}; > - > -/* FADT version 5 (ACPI 5.0) */ > +/* ACPI 5.0 Extensions (FADT version 5) */ > > ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[] = > { > + {ACPI_DMT_GAS, ACPI_FADT_OFFSET (SleepControl), "Sleep Control Register", 0}, > {ACPI_DMT_GAS, ACPI_FADT_OFFSET (SleepStatus), "Sleep Status Register", 0}, > ACPI_DMT_TERMINATOR > }; > > -/* FADT version 6 (ACPI 6.0) */ > +/* ACPI 6.0 Extensions (FADT version 6) */ > > ACPI_DMTABLE_INFO AcpiDmTableInfoFadt6[] = > { > diff --git a/src/acpica/source/compiler/aslbtypes.c b/src/acpica/source/compiler/aslbtypes.c > index cad5b66..0a70481 100644 > --- a/src/acpica/source/compiler/aslbtypes.c > +++ b/src/acpica/source/compiler/aslbtypes.c > @@ -223,7 +223,6 @@ AnMapArgTypeToBtype ( > return (ACPI_BTYPE_DATA | ACPI_BTYPE_DEBUG_OBJECT | > ACPI_BTYPE_REFERENCE_OBJECT); > > - case ARGI_FIXED_TARGET: > case ARGI_SIMPLE_TARGET: > > return (ACPI_BTYPE_OBJECTS_AND_REFS); > diff --git a/src/acpica/source/compiler/aslcompiler.l b/src/acpica/source/compiler/aslcompiler.l > index ab7a050..9a396ec 100644 > --- a/src/acpica/source/compiler/aslcompiler.l > +++ b/src/acpica/source/compiler/aslcompiler.l > @@ -228,8 +228,14 @@ NamePathTail [.]{NameSeg} > "^=" { count (3); return (PARSEOP_EXP_XOR_EQ); } > "|=" { count (3); return (PARSEOP_EXP_OR_EQ); } > > -"[" { count (3); return(PARSEOP_EXP_INDEX_LEFT); } > -"]" { count (0); return(PARSEOP_EXP_INDEX_RIGHT); } > +"[" { count (3); return (PARSEOP_EXP_INDEX_LEFT); } > +"]" { count (0); return (PARSEOP_EXP_INDEX_RIGHT); } > +"(" { count (0); return (PARSEOP_OPEN_PAREN); } > +")" { count (0); return (PARSEOP_CLOSE_PAREN); } > + > +"{" { count (0); return ('{'); } > +"}" { count (0); return ('}'); } > +"," { count (0); return (','); } > > > /* > @@ -763,12 +769,6 @@ NamePathTail [.]{NameSeg} > "__PATH__" { count (0); return (PARSEOP___PATH__); } > > > -"{" { count (0); return('{'); } > -"}" { count (0); return('}'); } > -"," { count (0); return(','); } > -"(" { count (0); return('('); } > -")" { count (0); return(')'); } > - > {NameSeg} { char *s; > count (0); > s=UtStringCacheCalloc (ACPI_NAME_SIZE + 1); > diff --git a/src/acpica/source/compiler/aslcstyle.y b/src/acpica/source/compiler/aslcstyle.y > index 305d60d..508af32 100644 > --- a/src/acpica/source/compiler/aslcstyle.y > +++ b/src/acpica/source/compiler/aslcstyle.y > @@ -221,21 +221,30 @@ Expression > > /* Parentheses */ > > - | '(' TermArg ')' { $$ = $2;} > + | PARSEOP_OPEN_PAREN > + Expression > + PARSEOP_CLOSE_PAREN {$$ = $2;} > > /* Index term -- "= BUF1[5]" on right-hand side of an equals (source) */ > > - | SuperName PARSEOP_EXP_INDEX_LEFT > - TermArg PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafNode (PARSEOP_INDEX); > - TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());} > + | IndexExpTerm > ; > > - /* Index term -- "BUF1[5] = " on left-hand side of an equals (target) */ > - > + /* > + * Index term -- "BUF1[5] = " or " = BUF1[5] on either the left side > + * of an equals (target) or the right side (source) > + * Currently used in these terms: > + * Expression > + * ObjectTypeSource > + * DerefOfSource > + * Type6Opcode > + */ > IndexExpTerm > > - : SuperName PARSEOP_EXP_INDEX_LEFT > - TermArg PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafNode (PARSEOP_INDEX); > + : SuperName > + PARSEOP_EXP_INDEX_LEFT > + TermArg > + PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafNode (PARSEOP_INDEX); > TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());} > ; > > @@ -249,11 +258,26 @@ IndexExpTerm > > EqualsTerm > > + /* Allow parens anywhere */ > + > + : PARSEOP_OPEN_PAREN > + EqualsTerm > + PARSEOP_CLOSE_PAREN {$$ = $2;} > + > /* Simple Store() operation */ > > - : SuperName PARSEOP_EXP_EQUALS > + | SuperName > + PARSEOP_EXP_EQUALS > TermArg {$$ = TrCreateAssignmentNode ($1, $3);} > > + /* Chained equals: (a=RefOf)=b, a=b=c=d etc. */ > + > + | PARSEOP_OPEN_PAREN > + EqualsTerm > + PARSEOP_CLOSE_PAREN > + PARSEOP_EXP_EQUALS > + TermArg {$$ = TrCreateAssignmentNode ($2, $5);} > + > /* Compound assignments -- Add (operand, operand, target) */ > > | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} > diff --git a/src/acpica/source/compiler/aslexternal.c b/src/acpica/source/compiler/aslexternal.c > index ff7b785..ca1d4b2 100644 > --- a/src/acpica/source/compiler/aslexternal.c > +++ b/src/acpica/source/compiler/aslexternal.c > @@ -397,6 +397,7 @@ ExMoveExternals ( > ACPI_PARSE_OBJECT *NextOp; > ACPI_PARSE_OBJECT *Prev; > ACPI_PARSE_OBJECT *Next; > + char *ExternalName; > ACPI_OBJECT_TYPE ObjType; > UINT32 i; > > @@ -417,6 +418,12 @@ ExMoveExternals ( > */ > ExternalOp = NextOp->Asl.Child; > > + /* Get/set the fully qualified name */ > + > + ExternalName = AcpiNsGetNormalizedPathname (ExternalOp->Asl.Node, TRUE); > + ExternalOp->Asl.ExternalName = ExternalName; > + ExternalOp->Asl.Namepath = ExternalName; > + > /* Set line numbers (for listings, etc.) */ > > ExternalOp->Asl.LineNumber = 0; > @@ -426,6 +433,14 @@ ExMoveExternals ( > Next->Asl.LineNumber = 0; > Next->Asl.LogicalLineNumber = 0; > > + if (Next->Asl.ParseOpcode == PARSEOP_NAMESEG) > + { > + Next->Asl.ParseOpcode = PARSEOP_NAMESTRING; > + } > + Next->Asl.ExternalName = ExternalName; > + UtInternalizeName (ExternalName, &Next->Asl.Value.String); > + Next->Asl.AmlLength = strlen (Next->Asl.Value.String); > + > Next = Next->Asl.Next; > Next->Asl.LineNumber = 0; > Next->Asl.LogicalLineNumber = 0; > diff --git a/src/acpica/source/compiler/aslkeywords.y b/src/acpica/source/compiler/aslkeywords.y > index 644a1a1..b22c3db 100644 > --- a/src/acpica/source/compiler/aslkeywords.y > +++ b/src/acpica/source/compiler/aslkeywords.y > @@ -130,15 +130,18 @@ AccessAttribKeyword > | 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_MULTIBYTE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);} > + | PARSEOP_ACCESSATTRIB_MULTIBYTE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);} > ByteConst > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_ACCESSATTRIB_RAW_BYTES '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_ACCESSATTRIB_RAW_BYTES > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);} > ByteConst > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_ACCESSATTRIB_RAW_PROCESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_ACCESSATTRIB_RAW_PROCESS > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);} > ByteConst > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} > ; > > AccessTypeKeyword > diff --git a/src/acpica/source/compiler/aslopcodes.c b/src/acpica/source/compiler/aslopcodes.c > index 8445ca1..aecd37c 100644 > --- a/src/acpica/source/compiler/aslopcodes.c > +++ b/src/acpica/source/compiler/aslopcodes.c > @@ -361,7 +361,7 @@ OpcSetOptimalIntegerSize ( > Op->Asl.AmlOpcode = AML_DWORD_OP; > return (4); > } > - else > + else /* 64-bit integer */ > { > if (AcpiGbl_IntegerByteWidth == 4) > { > @@ -371,8 +371,12 @@ OpcSetOptimalIntegerSize ( > if (!Gbl_IgnoreErrors) > { > /* Truncate the integer to 32-bit */ > - Op->Asl.AmlOpcode = AML_DWORD_OP; > - return (4); > + > + Op->Asl.Value.Integer &= ACPI_UINT32_MAX; > + > + /* Now set the optimal integer size */ > + > + return (OpcSetOptimalIntegerSize (Op)); > } > } > > diff --git a/src/acpica/source/compiler/aslprimaries.y b/src/acpica/source/compiler/aslprimaries.y > index 605c889..97e400f 100644 > --- a/src/acpica/source/compiler/aslprimaries.y > +++ b/src/acpica/source/compiler/aslprimaries.y > @@ -124,51 +124,61 @@ NoEcho(' > ******************************************************************************/ > > AccessAsTerm > - : PARSEOP_ACCESSAS '(' > + : PARSEOP_ACCESSAS > + PARSEOP_OPEN_PAREN > AccessTypeKeyword > OptionalAccessAttribTerm > - ')' {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);} > - | PARSEOP_ACCESSAS '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);} > + | PARSEOP_ACCESSAS > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > AcquireTerm > - : PARSEOP_ACQUIRE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} > + : PARSEOP_ACQUIRE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} > SuperName > ',' WordConstExpr > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$6);} > - | PARSEOP_ACQUIRE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$6);} > + | PARSEOP_ACQUIRE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > AddTerm > - : PARSEOP_ADD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} > + : PARSEOP_ADD > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} > TermArg > TermArgItem > Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_ADD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_ADD > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > AliasTerm > - : PARSEOP_ALIAS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);} > + : PARSEOP_ALIAS > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);} > NameString > NameStringItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4, > TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} > - | PARSEOP_ALIAS '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_ALIAS > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > AndTerm > - : PARSEOP_AND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} > + : PARSEOP_AND > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} > TermArg > TermArgItem > Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_AND '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_AND > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ArgTerm > @@ -182,18 +192,21 @@ ArgTerm > ; > > BankFieldTerm > - : PARSEOP_BANKFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BANKFIELD);} > + : PARSEOP_BANKFIELD > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_BANKFIELD);} > NameString > NameStringItem > TermArgItem > ',' AccessTypeKeyword > ',' LockRuleKeyword > ',' UpdateRuleKeyword > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,7, > $4,$5,$6,$8,$10,$12,$15);} > - | PARSEOP_BANKFIELD '(' > - error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_BANKFIELD > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN > + '{' error '}' {$$ = AslDoError(); yyclearin;} > ; > > BreakTerm > @@ -216,58 +229,69 @@ BufferTermData > ; > > CaseTerm > - : PARSEOP_CASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);} > + : PARSEOP_CASE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);} > DataObject > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_CASE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_CASE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ConcatTerm > - : PARSEOP_CONCATENATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} > + : PARSEOP_CONCATENATE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} > TermArg > TermArgItem > Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_CONCATENATE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_CONCATENATE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ConcatResTerm > - : PARSEOP_CONCATENATERESTEMPLATE '(' {$<n>$ = TrCreateLeafNode ( > - PARSEOP_CONCATENATERESTEMPLATE);} > + : PARSEOP_CONCATENATERESTEMPLATE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode ( > + PARSEOP_CONCATENATERESTEMPLATE);} > TermArg > TermArgItem > Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_CONCATENATERESTEMPLATE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_CONCATENATERESTEMPLATE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > + ; > + > +CondRefOfTerm > + : PARSEOP_CONDREFOF > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} > + CondRefOfSource > + Target > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_CONDREFOF > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ConnectionTerm > - : PARSEOP_CONNECTION '(' > + : PARSEOP_CONNECTION > + PARSEOP_OPEN_PAREN > NameString > - ')' {$$ = TrCreateNode (PARSEOP_CONNECTION,1,$3);} > - | PARSEOP_CONNECTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONNECTION);} > + PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_CONNECTION,1,$3);} > + | PARSEOP_CONNECTION > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CONNECTION);} > ResourceMacroTerm > - ')' {$$ = TrLinkChildren ($<n>3, 1, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3, 1, > TrLinkChildren ( > TrCreateLeafNode (PARSEOP_RESOURCETEMPLATE), 3, > TrCreateLeafNode (PARSEOP_DEFAULT_ARG), > TrCreateLeafNode (PARSEOP_DEFAULT_ARG), > $4));} > - | PARSEOP_CONNECTION '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -CondRefOfTerm > - : PARSEOP_CONDREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} > - SuperName > - Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_CONDREFOF '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_CONNECTION > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ContinueTerm > @@ -275,92 +299,108 @@ ContinueTerm > ; > > CopyObjectTerm > - : PARSEOP_COPYOBJECT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} > + : PARSEOP_COPYOBJECT > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} > TermArg > - ',' SimpleTarget > - ')' {$$ = TrLinkChildren ($<n>3,2,$4, > + ',' SimpleName > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4, > TrSetNodeFlags ($6, NODE_IS_TARGET));} > - | PARSEOP_COPYOBJECT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_COPYOBJECT > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > CreateBitFieldTerm > - : PARSEOP_CREATEBITFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} > + : PARSEOP_CREATEBITFIELD > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} > TermArg > TermArgItem > NameStringItem > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5, > TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} > - | PARSEOP_CREATEBITFIELD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_CREATEBITFIELD > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > CreateByteFieldTerm > - : PARSEOP_CREATEBYTEFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBYTEFIELD);} > + : PARSEOP_CREATEBYTEFIELD > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBYTEFIELD);} > TermArg > TermArgItem > NameStringItem > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5, > TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} > - | PARSEOP_CREATEBYTEFIELD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_CREATEBYTEFIELD > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > CreateDWordFieldTerm > - : PARSEOP_CREATEDWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEDWORDFIELD);} > + : PARSEOP_CREATEDWORDFIELD > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEDWORDFIELD);} > TermArg > TermArgItem > NameStringItem > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5, > TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} > - | PARSEOP_CREATEDWORDFIELD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_CREATEDWORDFIELD > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > CreateFieldTerm > - : PARSEOP_CREATEFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEFIELD);} > + : PARSEOP_CREATEFIELD > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEFIELD);} > TermArg > TermArgItem > TermArgItem > NameStringItem > - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6, > TrSetNodeFlags ($7, NODE_IS_NAME_DECLARATION));} > - | PARSEOP_CREATEFIELD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_CREATEFIELD > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > CreateQWordFieldTerm > - : PARSEOP_CREATEQWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEQWORDFIELD);} > + : PARSEOP_CREATEQWORDFIELD > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEQWORDFIELD);} > TermArg > TermArgItem > NameStringItem > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5, > TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} > - | PARSEOP_CREATEQWORDFIELD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_CREATEQWORDFIELD > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > CreateWordFieldTerm > - : PARSEOP_CREATEWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEWORDFIELD);} > + : PARSEOP_CREATEWORDFIELD > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEWORDFIELD);} > TermArg > TermArgItem > NameStringItem > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5, > TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} > - | PARSEOP_CREATEWORDFIELD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_CREATEWORDFIELD > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > DataRegionTerm > - : PARSEOP_DATATABLEREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATATABLEREGION);} > + : PARSEOP_DATATABLEREGION > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DATATABLEREGION);} > NameString > TermArgItem > TermArgItem > TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,4, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4, > TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$6,$7);} > - | PARSEOP_DATATABLEREGION '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_DATATABLEREGION > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > DebugTerm > @@ -368,11 +408,13 @@ DebugTerm > ; > > DecTerm > - : PARSEOP_DECREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} > + : PARSEOP_DECREMENT > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} > SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_DECREMENT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_DECREMENT > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > DefaultTerm > @@ -383,39 +425,48 @@ DefaultTerm > ; > > DerefOfTerm > - : PARSEOP_DEREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);} > - TermArg > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_DEREFOF '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + : PARSEOP_DEREFOF > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);} > + DerefOfSource > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_DEREFOF > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > DeviceTerm > - : PARSEOP_DEVICE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);} > + : PARSEOP_DEVICE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);} > NameString > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > TermList '}' {$$ = TrLinkChildren ($<n>3,2, > TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} > - | PARSEOP_DEVICE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_DEVICE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > DivideTerm > - : PARSEOP_DIVIDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} > + : PARSEOP_DIVIDE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} > TermArg > TermArgItem > Target > Target > - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} > - | PARSEOP_DIVIDE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} > + | PARSEOP_DIVIDE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > EISAIDTerm > - : PARSEOP_EISAID '(' > - StringData ')' {$$ = TrUpdateNode (PARSEOP_EISAID, $3);} > - | PARSEOP_EISAID '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + : PARSEOP_EISAID > + PARSEOP_OPEN_PAREN > + StringData > + PARSEOP_CLOSE_PAREN {$$ = TrUpdateNode (PARSEOP_EISAID, $3);} > + | PARSEOP_EISAID > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ElseIfTerm > @@ -433,88 +484,105 @@ ElseTerm > | PARSEOP_ELSE > error {$$ = AslDoError(); yyclearin;} > > - | PARSEOP_ELSEIF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} > + | PARSEOP_ELSEIF > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} > TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > TermList '}' {TrLinkChildren ($<n>5,2,$4,$8);} > ElseTerm {TrLinkPeerNode ($<n>5,$11);} > {$$ = TrLinkChildren ($<n>3,1,$<n>5);} > > - | PARSEOP_ELSEIF '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_ELSEIF > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > > | PARSEOP_ELSEIF > error {$$ = AslDoError(); yyclearin;} > ; > > EventTerm > - : PARSEOP_EVENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EVENT);} > + : PARSEOP_EVENT > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EVENT);} > NameString > - ')' {$$ = TrLinkChildren ($<n>3,1, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1, > TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION));} > - | PARSEOP_EVENT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_EVENT > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ExternalTerm > - : PARSEOP_EXTERNAL '(' > + : PARSEOP_EXTERNAL > + PARSEOP_OPEN_PAREN > NameString > OptionalObjectTypeKeyword > OptionalParameterTypePackage > OptionalParameterTypesPackage > - ')' {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);} > - | PARSEOP_EXTERNAL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);} > + | PARSEOP_EXTERNAL > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > FatalTerm > - : PARSEOP_FATAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);} > + : PARSEOP_FATAL > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);} > ByteConstExpr > ',' DWordConstExpr > TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} > - | PARSEOP_FATAL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} > + | PARSEOP_FATAL > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > FieldTerm > - : PARSEOP_FIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIELD);} > + : PARSEOP_FIELD > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FIELD);} > NameString > ',' AccessTypeKeyword > ',' LockRuleKeyword > ',' UpdateRuleKeyword > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$8,$10,$13);} > - | PARSEOP_FIELD '(' > - error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_FIELD > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN > + '{' error '}' {$$ = AslDoError(); yyclearin;} > ; > > FindSetLeftBitTerm > - : PARSEOP_FINDSETLEFTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} > + : PARSEOP_FINDSETLEFTBIT > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} > TermArg > Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_FINDSETLEFTBIT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_FINDSETLEFTBIT > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > FindSetRightBitTerm > - : PARSEOP_FINDSETRIGHTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} > + : PARSEOP_FINDSETRIGHTBIT > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} > TermArg > Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_FINDSETRIGHTBIT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_FINDSETRIGHTBIT > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > /* Convert a For() loop to a While() loop */ > ForTerm > - : PARSEOP_FOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} > + : PARSEOP_FOR > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} > OptionalTermArg ',' {} > OptionalPredicate ',' > OptionalTermArg {$<n>$ = TrLinkPeerNode ($4,$<n>3); > - TrSetParent ($9,$<n>3);} /* New parent is WHILE */ > - ')' '{' TermList '}' {$<n>$ = TrLinkChildren ($<n>3,2,$7,$13);} > + TrSetParent ($9,$<n>3);} /* New parent is WHILE */ > + PARSEOP_CLOSE_PAREN > + '{' TermList '}' {$<n>$ = TrLinkChildren ($<n>3,2,$7,$13);} > {$<n>$ = TrLinkPeerNode ($13,$9); > $$ = $<n>10;} > ; > @@ -525,52 +593,62 @@ OptionalPredicate > ; > > FprintfTerm > - : PARSEOP_FPRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);} > + : PARSEOP_FPRINTF > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);} > TermArg ',' > StringData > PrintfArgList > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} > - | PARSEOP_FPRINTF '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} > + | PARSEOP_FPRINTF > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > FromBCDTerm > - : PARSEOP_FROMBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);} > + : PARSEOP_FROMBCD > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);} > TermArg > Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_FROMBCD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_FROMBCD > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > FunctionTerm > - : PARSEOP_FUNCTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} > + : PARSEOP_FUNCTION > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} > NameString > OptionalParameterTypePackage > OptionalParameterTypesPackage > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > 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,$9);} > - | PARSEOP_FUNCTION '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_FUNCTION > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > IfTerm > - : PARSEOP_IF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} > + : PARSEOP_IF > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} > TermArg > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > > - | PARSEOP_IF '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_IF > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > IncludeTerm > - : PARSEOP_INCLUDE '(' > - String ')' {$$ = TrUpdateNode (PARSEOP_INCLUDE, $3); > + : PARSEOP_INCLUDE > + PARSEOP_OPEN_PAREN > + String > + PARSEOP_CLOSE_PAREN {$$ = TrUpdateNode (PARSEOP_INCLUDE, $3); > FlOpenIncludeFile ($3);} > ; > > @@ -580,130 +658,157 @@ IncludeEndTerm > ; > > IncTerm > - : PARSEOP_INCREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} > + : PARSEOP_INCREMENT > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} > SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_INCREMENT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_INCREMENT > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > IndexFieldTerm > - : PARSEOP_INDEXFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} > + : PARSEOP_INDEXFIELD > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} > NameString > NameStringItem > ',' AccessTypeKeyword > ',' LockRuleKeyword > ',' UpdateRuleKeyword > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$7,$9,$11,$14);} > - | PARSEOP_INDEXFIELD '(' > - error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_INDEXFIELD > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN > + '{' error '}' {$$ = AslDoError(); yyclearin;} > ; > > IndexTerm > - : PARSEOP_INDEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);} > + : PARSEOP_INDEX > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);} > TermArg > TermArgItem > Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_INDEX '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_INDEX > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > LAndTerm > - : PARSEOP_LAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} > + : PARSEOP_LAND > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} > TermArg > TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_LAND '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_LAND > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > LEqualTerm > - : PARSEOP_LEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} > + : PARSEOP_LEQUAL > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} > TermArg > TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_LEQUAL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_LEQUAL > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > LGreaterEqualTerm > - : PARSEOP_LGREATEREQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} > + : PARSEOP_LGREATEREQUAL > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} > TermArg > TermArgItem > - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, > + PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_LNOT, 1, > TrLinkChildren ($<n>3,2,$4,$5));} > - | PARSEOP_LGREATEREQUAL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_LGREATEREQUAL > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > LGreaterTerm > - : PARSEOP_LGREATER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} > + : PARSEOP_LGREATER > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} > TermArg > TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_LGREATER '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_LGREATER > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > LLessEqualTerm > - : PARSEOP_LLESSEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} > + : PARSEOP_LLESSEQUAL > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} > TermArg > TermArgItem > - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, > + PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_LNOT, 1, > TrLinkChildren ($<n>3,2,$4,$5));} > - | PARSEOP_LLESSEQUAL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_LLESSEQUAL > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > LLessTerm > - : PARSEOP_LLESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} > + : PARSEOP_LLESS > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} > TermArg > TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_LLESS '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_LLESS > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > LNotEqualTerm > - : PARSEOP_LNOTEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} > + : PARSEOP_LNOTEQUAL > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} > TermArg > TermArgItem > - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, > + PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_LNOT, 1, > TrLinkChildren ($<n>3,2,$4,$5));} > - | PARSEOP_LNOTEQUAL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_LNOTEQUAL > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > LNotTerm > - : PARSEOP_LNOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} > + : PARSEOP_LNOT > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} > TermArg > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_LNOT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_LNOT > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > LoadTableTerm > - : PARSEOP_LOADTABLE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOADTABLE);} > + : PARSEOP_LOADTABLE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LOADTABLE);} > TermArg > TermArgItem > TermArgItem > OptionalListString > OptionalListString > OptionalReference > - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$6,$7,$8,$9);} > - | PARSEOP_LOADTABLE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$5,$6,$7,$8,$9);} > + | PARSEOP_LOADTABLE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > LoadTerm > - : PARSEOP_LOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOAD);} > + : PARSEOP_LOAD > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LOAD);} > NameString > RequiredTarget > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_LOAD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_LOAD > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > LocalTerm > @@ -718,102 +823,120 @@ LocalTerm > ; > > LOrTerm > - : PARSEOP_LOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} > + : PARSEOP_LOR > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} > TermArg > TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_LOR '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_LOR > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > MatchTerm > - : PARSEOP_MATCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MATCH);} > + : PARSEOP_MATCH > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MATCH);} > TermArg > ',' MatchOpKeyword > TermArgItem > ',' MatchOpKeyword > TermArgItem > TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);} > - | PARSEOP_MATCH '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);} > + | PARSEOP_MATCH > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > MethodTerm > - : PARSEOP_METHOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} > + : PARSEOP_METHOD > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} > NameString > OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} > OptionalSerializeRuleKeyword > OptionalByteConstExpr > OptionalParameterTypePackage > OptionalParameterTypesPackage > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > TermList '}' {$$ = TrLinkChildren ($<n>3,7, > TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION), > $5,$7,$8,$9,$10,$13);} > - | PARSEOP_METHOD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_METHOD > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > MidTerm > - : PARSEOP_MID '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MID);} > + : PARSEOP_MID > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MID);} > TermArg > TermArgItem > TermArgItem > Target > - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} > - | PARSEOP_MID '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} > + | PARSEOP_MID > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ModTerm > - : PARSEOP_MOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} > + : PARSEOP_MOD > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} > TermArg > TermArgItem > Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_MOD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_MOD > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > MultiplyTerm > - : PARSEOP_MULTIPLY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} > + : PARSEOP_MULTIPLY > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} > TermArg > TermArgItem > Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_MULTIPLY '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_MULTIPLY > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > MutexTerm > - : PARSEOP_MUTEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);} > + : PARSEOP_MUTEX > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);} > NameString > ',' ByteConstExpr > - ')' {$$ = TrLinkChildren ($<n>3,2, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2, > TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} > - | PARSEOP_MUTEX '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_MUTEX > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > NameTerm > - : PARSEOP_NAME '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);} > + : PARSEOP_NAME > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);} > NameString > ',' DataObject > - ')' {$$ = TrLinkChildren ($<n>3,2, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2, > TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} > - | PARSEOP_NAME '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_NAME > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > NAndTerm > - : PARSEOP_NAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);} > + : PARSEOP_NAND > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);} > TermArg > TermArgItem > Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_NAND '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_NAND > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > NoOpTerm > @@ -821,60 +944,72 @@ NoOpTerm > ; > > NOrTerm > - : PARSEOP_NOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);} > + : PARSEOP_NOR > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);} > TermArg > TermArgItem > Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_NOR '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_NOR > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > NotifyTerm > - : PARSEOP_NOTIFY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);} > + : PARSEOP_NOTIFY > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);} > SuperName > TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_NOTIFY '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_NOTIFY > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > NotTerm > - : PARSEOP_NOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} > + : PARSEOP_NOT > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} > TermArg > Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_NOT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_NOT > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ObjectTypeTerm > - : PARSEOP_OBJECTTYPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} > - ObjectTypeName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_OBJECTTYPE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + : PARSEOP_OBJECTTYPE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} > + ObjectTypeSource > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_OBJECTTYPE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > OffsetTerm > - : PARSEOP_OFFSET '(' > + : PARSEOP_OFFSET > + PARSEOP_OPEN_PAREN > AmlPackageLengthTerm > - ')' {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);} > - | PARSEOP_OFFSET '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);} > + | PARSEOP_OFFSET > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > OpRegionTerm > - : PARSEOP_OPERATIONREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} > + : PARSEOP_OPERATIONREGION > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} > NameString > ',' OpRegionSpaceIdTerm > TermArgItem > TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,4, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4, > TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION), > $6,$7,$8);} > - | PARSEOP_OPERATIONREGION '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_OPERATIONREGION > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > OpRegionSpaceIdTerm > @@ -883,13 +1018,15 @@ OpRegionSpaceIdTerm > ; > > OrTerm > - : PARSEOP_OR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} > + : PARSEOP_OR > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} > TermArg > TermArgItem > Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_OR '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_OR > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > PackageTerm > @@ -898,25 +1035,29 @@ PackageTerm > '{' PackageList '}' {$$ = TrLinkChildren ($<n>2,2,$3,$5);} > > PowerResTerm > - : PARSEOP_POWERRESOURCE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} > + : PARSEOP_POWERRESOURCE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} > NameString > ',' ByteConstExpr > ',' WordConstExpr > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > TermList '}' {$$ = TrLinkChildren ($<n>3,4, > TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION), > $6,$8,$11);} > - | PARSEOP_POWERRESOURCE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_POWERRESOURCE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > PrintfTerm > - : PARSEOP_PRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);} > + : PARSEOP_PRINTF > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);} > StringData > PrintfArgList > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_PRINTF '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_PRINTF > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > PrintfArgList > @@ -927,26 +1068,30 @@ PrintfArgList > ; > > ProcessorTerm > - : PARSEOP_PROCESSOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} > + : PARSEOP_PROCESSOR > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} > NameString > ',' ByteConstExpr > OptionalDWordConstExpr > OptionalByteConstExpr > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > TermList '}' {$$ = TrLinkChildren ($<n>3,5, > TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION), > $6,$7,$8,$11);} > - | PARSEOP_PROCESSOR '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_PROCESSOR > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > RawDataBufferTerm > - : PARSEOP_DATABUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} > + : PARSEOP_DATABUFFER > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} > OptionalWordConst > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_DATABUFFER '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_DATABUFFER > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > /* > @@ -954,204 +1099,247 @@ RawDataBufferTerm > * we've taken a pointer to it. (hard to tell if a local becomes initialized this way.) > */ > RefOfTerm > - : PARSEOP_REFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REFOF);} > - SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1, > + : PARSEOP_REFOF > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_REFOF);} > + RefOfSource > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1, > TrSetNodeFlags ($4, NODE_IS_TARGET));} > - | PARSEOP_REFOF '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_REFOF > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ReleaseTerm > - : PARSEOP_RELEASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);} > + : PARSEOP_RELEASE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);} > SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_RELEASE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_RELEASE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ResetTerm > - : PARSEOP_RESET '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);} > + : PARSEOP_RESET > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);} > SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_RESET '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_RESET > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ReturnTerm > - : PARSEOP_RETURN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);} > + : PARSEOP_RETURN > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);} > OptionalReturnArg > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} > | PARSEOP_RETURN {$$ = TrLinkChildren ( > TrCreateLeafNode (PARSEOP_RETURN),1, > TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), > NODE_IS_NULL_RETURN));} > - | PARSEOP_RETURN '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_RETURN > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ScopeTerm > - : PARSEOP_SCOPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);} > + : PARSEOP_SCOPE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);} > NameString > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > TermList '}' {$$ = TrLinkChildren ($<n>3,2, > TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} > - | PARSEOP_SCOPE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_SCOPE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ShiftLeftTerm > - : PARSEOP_SHIFTLEFT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} > + : PARSEOP_SHIFTLEFT > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} > TermArg > TermArgItem > Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_SHIFTLEFT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_SHIFTLEFT > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ShiftRightTerm > - : PARSEOP_SHIFTRIGHT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} > + : PARSEOP_SHIFTRIGHT > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} > TermArg > TermArgItem > Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_SHIFTRIGHT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_SHIFTRIGHT > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > SignalTerm > - : PARSEOP_SIGNAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);} > + : PARSEOP_SIGNAL > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);} > SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_SIGNAL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_SIGNAL > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > SizeOfTerm > - : PARSEOP_SIZEOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);} > + : PARSEOP_SIZEOF > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);} > SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_SIZEOF '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_SIZEOF > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > SleepTerm > - : PARSEOP_SLEEP '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);} > + : PARSEOP_SLEEP > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);} > TermArg > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_SLEEP '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_SLEEP > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > StallTerm > - : PARSEOP_STALL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);} > + : PARSEOP_STALL > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);} > TermArg > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_STALL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_STALL > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > StoreTerm > - : PARSEOP_STORE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STORE);} > + : PARSEOP_STORE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STORE);} > TermArg > ',' SuperName > - ')' {$$ = TrLinkChildren ($<n>3,2,$4, > - TrSetNodeFlags ($6, NODE_IS_TARGET));} > - | PARSEOP_STORE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4, > + TrSetNodeFlags ($6, NODE_IS_TARGET));} > + | PARSEOP_STORE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > SubtractTerm > - : PARSEOP_SUBTRACT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} > + : PARSEOP_SUBTRACT > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} > TermArg > TermArgItem > Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_SUBTRACT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_SUBTRACT > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > SwitchTerm > - : PARSEOP_SWITCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);} > + : PARSEOP_SWITCH > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);} > TermArg > - ')' '{' > - CaseDefaultTermList '}' > - {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_SWITCH '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN '{' > + CaseDefaultTermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > + | PARSEOP_SWITCH > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ThermalZoneTerm > - : PARSEOP_THERMALZONE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} > + : PARSEOP_THERMALZONE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} > NameString > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > TermList '}' {$$ = TrLinkChildren ($<n>3,2, > TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} > - | PARSEOP_THERMALZONE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_THERMALZONE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > TimerTerm > - : PARSEOP_TIMER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);} > - ')' {$$ = TrLinkChildren ($<n>3,0);} > + : PARSEOP_TIMER > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,0);} > | PARSEOP_TIMER {$$ = TrLinkChildren ( > TrCreateLeafNode (PARSEOP_TIMER),0);} > - | PARSEOP_TIMER '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_TIMER > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ToBCDTerm > - : PARSEOP_TOBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBCD);} > + : PARSEOP_TOBCD > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOBCD);} > TermArg > Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_TOBCD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_TOBCD > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ToBufferTerm > - : PARSEOP_TOBUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} > + : PARSEOP_TOBUFFER > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} > TermArg > Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_TOBUFFER '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_TOBUFFER > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ToDecimalStringTerm > - : PARSEOP_TODECIMALSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} > + : PARSEOP_TODECIMALSTRING > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} > TermArg > Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_TODECIMALSTRING '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_TODECIMALSTRING > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ToHexStringTerm > - : PARSEOP_TOHEXSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} > + : PARSEOP_TOHEXSTRING > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} > TermArg > Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_TOHEXSTRING '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_TOHEXSTRING > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ToIntegerTerm > - : PARSEOP_TOINTEGER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} > + : PARSEOP_TOINTEGER > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} > TermArg > Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_TOINTEGER '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_TOINTEGER > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ToPLDTerm > - : PARSEOP_TOPLD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);} > + : PARSEOP_TOPLD > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);} > PldKeywordList > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_TOPLD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_TOPLD > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > PldKeywordList > @@ -1171,62 +1359,77 @@ PldKeywordList > > > ToStringTerm > - : PARSEOP_TOSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);} > + : PARSEOP_TOSTRING > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);} > TermArg > OptionalCount > Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_TOSTRING '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_TOSTRING > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ToUUIDTerm > - : PARSEOP_TOUUID '(' > - StringData ')' {$$ = TrUpdateNode (PARSEOP_TOUUID, $3);} > - | PARSEOP_TOUUID '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + : PARSEOP_TOUUID > + PARSEOP_OPEN_PAREN > + StringData > + PARSEOP_CLOSE_PAREN {$$ = TrUpdateNode (PARSEOP_TOUUID, $3);} > + | PARSEOP_TOUUID > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > UnicodeTerm > - : PARSEOP_UNICODE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);} > + : PARSEOP_UNICODE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);} > StringData > - ')' {$$ = TrLinkChildren ($<n>3,2,0,$4);} > - | PARSEOP_UNICODE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,0,$4);} > + | PARSEOP_UNICODE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > UnloadTerm > - : PARSEOP_UNLOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);} > + : PARSEOP_UNLOAD > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);} > SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_UNLOAD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_UNLOAD > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > WaitTerm > - : PARSEOP_WAIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);} > + : PARSEOP_WAIT > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);} > SuperName > TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_WAIT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_WAIT > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > XOrTerm > - : PARSEOP_XOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} > + : PARSEOP_XOR > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} > TermArg > TermArgItem > Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_XOR '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_XOR > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > WhileTerm > - : PARSEOP_WHILE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} > + : PARSEOP_WHILE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} > TermArg > - ')' '{' TermList '}' > - {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_WHILE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN > + '{' TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > + | PARSEOP_WHILE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > diff --git a/src/acpica/source/compiler/aslresources.y b/src/acpica/source/compiler/aslresources.y > index 9f5fb02..de45100 100644 > --- a/src/acpica/source/compiler/aslresources.y > +++ b/src/acpica/source/compiler/aslresources.y > @@ -128,7 +128,8 @@ NoEcho(' > * Also, insert the EndTag at the end of the template. > */ > ResourceTemplateTerm > - : PARSEOP_RESOURCETEMPLATE OptionalParentheses > + : PARSEOP_RESOURCETEMPLATE > + OptionalParentheses > '{' > ResourceMacroList '}' {$$ = TrCreateNode (PARSEOP_RESOURCETEMPLATE,4, > TrCreateLeafNode (PARSEOP_DEFAULT_ARG), > @@ -139,7 +140,8 @@ ResourceTemplateTerm > > OptionalParentheses > : {$$ = NULL;} > - | '(' ')' {$$ = NULL;} > + | PARSEOP_OPEN_PAREN > + PARSEOP_CLOSE_PAREN {$$ = NULL;} > ; > > ResourceMacroList > @@ -188,19 +190,22 @@ ResourceMacroTerm > ; > > DMATerm > - : PARSEOP_DMA '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DMA);} > + : PARSEOP_DMA > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DMA);} > DMATypeKeyword > OptionalBusMasterKeyword > ',' XferTypeKeyword > OptionalNameString_Last > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$5,$7,$8,$11);} > - | PARSEOP_DMA '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_DMA > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > DWordIOTerm > - : PARSEOP_DWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDIO);} > + : PARSEOP_DWORDIO > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDIO);} > OptionalResourceType_First > OptionalMinType > OptionalMaxType > @@ -216,14 +221,16 @@ DWordIOTerm > OptionalNameString > OptionalType > OptionalTranslationType_Last > - ')' {$$ = TrLinkChildren ($<n>3,15, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, > $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} > - | PARSEOP_DWORDIO '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_DWORDIO > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > DWordMemoryTerm > - : PARSEOP_DWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);} > + : PARSEOP_DWORDMEMORY > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);} > OptionalResourceType_First > OptionalDecodeType > OptionalMinType > @@ -240,14 +247,16 @@ DWordMemoryTerm > OptionalNameString > OptionalAddressRange > OptionalType_Last > - ')' {$$ = TrLinkChildren ($<n>3,16, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,16, > $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);} > - | PARSEOP_DWORDMEMORY '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_DWORDMEMORY > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > DWordSpaceTerm > - : PARSEOP_DWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);} > + : PARSEOP_DWORDSPACE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);} > ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} > OptionalResourceType > OptionalDecodeType > @@ -262,21 +271,25 @@ DWordSpaceTerm > OptionalByteConstExpr > OptionalStringData > OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,14, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, > $4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} > - | PARSEOP_DWORDSPACE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_DWORDSPACE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > EndDependentFnTerm > - : PARSEOP_ENDDEPENDENTFN '(' > - ')' {$$ = TrCreateLeafNode (PARSEOP_ENDDEPENDENTFN);} > - | PARSEOP_ENDDEPENDENTFN '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + : PARSEOP_ENDDEPENDENTFN > + PARSEOP_OPEN_PAREN > + PARSEOP_CLOSE_PAREN {$$ = TrCreateLeafNode (PARSEOP_ENDDEPENDENTFN);} > + | PARSEOP_ENDDEPENDENTFN > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ExtendedIOTerm > - : PARSEOP_EXTENDEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);} > + : PARSEOP_EXTENDEDIO > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);} > OptionalResourceType_First > OptionalMinType > OptionalMaxType > @@ -291,14 +304,16 @@ ExtendedIOTerm > OptionalNameString > OptionalType > OptionalTranslationType_Last > - ')' {$$ = TrLinkChildren ($<n>3,14, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, > $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22);} > - | PARSEOP_EXTENDEDIO '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_EXTENDEDIO > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ExtendedMemoryTerm > - : PARSEOP_EXTENDEDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);} > + : PARSEOP_EXTENDEDMEMORY > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);} > OptionalResourceType_First > OptionalDecodeType > OptionalMinType > @@ -314,14 +329,15 @@ ExtendedMemoryTerm > OptionalNameString > OptionalAddressRange > OptionalType_Last > - ')' {$$ = TrLinkChildren ($<n>3,15, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, > $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24);} > - | PARSEOP_EXTENDEDMEMORY '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_EXTENDEDMEMORY > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > ExtendedSpaceTerm > - : PARSEOP_EXTENDEDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);} > + : PARSEOP_EXTENDEDSPACE PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);} > ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} > OptionalResourceType > OptionalDecodeType > @@ -335,35 +351,41 @@ ExtendedSpaceTerm > ',' QWordConstExpr > OptionalQWordConstExpr > OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,13, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,13, > $4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23);} > - | PARSEOP_EXTENDEDSPACE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_EXTENDEDSPACE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > FixedDmaTerm > - : PARSEOP_FIXEDDMA '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDDMA);} > + : PARSEOP_FIXEDDMA > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDDMA);} > WordConstExpr /* 04: DMA RequestLines */ > ',' WordConstExpr /* 06: DMA Channels */ > OptionalXferSize /* 07: DMA TransferSize */ > OptionalNameString /* 08: DescriptorName */ > - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$6,$7,$8);} > - | PARSEOP_FIXEDDMA '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$6,$7,$8);} > + | PARSEOP_FIXEDDMA > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > FixedIOTerm > - : PARSEOP_FIXEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDIO);} > + : PARSEOP_FIXEDIO > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDIO);} > WordConstExpr > ',' ByteConstExpr > OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} > - | PARSEOP_FIXEDIO '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} > + | PARSEOP_FIXEDIO > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > GpioIntTerm > - : PARSEOP_GPIO_INT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);} > + : PARSEOP_GPIO_INT > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);} > InterruptTypeKeyword /* 04: InterruptType */ > ',' InterruptLevel /* 06: InterruptLevel */ > OptionalShareType /* 07: SharedType */ > @@ -374,15 +396,17 @@ GpioIntTerm > OptionalResourceType /* 14: ResourceType */ > OptionalNameString /* 15: DescriptorName */ > OptionalBuffer_Last /* 16: VendorData */ > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > DWordConstExpr '}' {$$ = TrLinkChildren ($<n>3,11, > $4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);} > - | PARSEOP_GPIO_INT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_GPIO_INT > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > GpioIoTerm > - : PARSEOP_GPIO_IO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);} > + : PARSEOP_GPIO_IO > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);} > OptionalShareType_First /* 04: SharedType */ > ',' PinConfigByte /* 06: PinConfig */ > OptionalWordConstExpr /* 07: DebounceTimeout */ > @@ -393,15 +417,17 @@ GpioIoTerm > OptionalResourceType /* 13: ResourceType */ > OptionalNameString /* 14: DescriptorName */ > OptionalBuffer_Last /* 15: VendorData */ > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > DWordList '}' {$$ = TrLinkChildren ($<n>3,11, > $4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);} > - | PARSEOP_GPIO_IO '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_GPIO_IO > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > I2cSerialBusTerm > - : PARSEOP_I2C_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);} > + : PARSEOP_I2C_SERIALBUS > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);} > WordConstExpr /* 04: SlaveAddress */ > OptionalSlaveMode /* 05: SlaveMode */ > ',' DWordConstExpr /* 07: ConnectionSpeed */ > @@ -411,15 +437,17 @@ I2cSerialBusTerm > OptionalResourceType /* 12: ResourceType */ > OptionalNameString /* 13: DescriptorName */ > OptionalBuffer_Last /* 14: VendorData */ > - ')' {$$ = TrLinkChildren ($<n>3,10, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,10, > $4,$5,$7,$8,$10,$11,$12,$13, > TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$14);} > - | PARSEOP_I2C_SERIALBUS '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_I2C_SERIALBUS > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > I2cSerialBusTermV2 > - : PARSEOP_I2C_SERIALBUS_V2 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS_V2);} > + : PARSEOP_I2C_SERIALBUS_V2 > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS_V2);} > WordConstExpr /* 04: SlaveAddress */ > OptionalSlaveMode /* 05: SlaveMode */ > ',' DWordConstExpr /* 07: ConnectionSpeed */ > @@ -430,14 +458,16 @@ I2cSerialBusTermV2 > OptionalNameString /* 13: DescriptorName */ > OptionalShareType /* 14: Share */ > OptionalBuffer_Last /* 15: VendorData */ > - ')' {$$ = TrLinkChildren ($<n>3,10, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,10, > $4,$5,$7,$8,$10,$11,$12,$13,$14,$15);} > - | PARSEOP_I2C_SERIALBUS_V2 '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_I2C_SERIALBUS_V2 > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > InterruptTerm > - : PARSEOP_INTERRUPT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} > + : PARSEOP_INTERRUPT > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} > OptionalResourceType_First > ',' InterruptTypeKeyword > ',' InterruptLevel > @@ -445,86 +475,100 @@ InterruptTerm > OptionalByteConstExpr > OptionalStringData > OptionalNameString_Last > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > DWordList '}' {$$ = TrLinkChildren ($<n>3,8, > $4,$6,$8,$9,$10,$11,$12,$15);} > - | PARSEOP_INTERRUPT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_INTERRUPT > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > IOTerm > - : PARSEOP_IO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IO);} > + : PARSEOP_IO > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IO);} > IODecodeKeyword > ',' WordConstExpr > ',' WordConstExpr > ',' ByteConstExpr > ',' ByteConstExpr > OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} > - | PARSEOP_IO '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} > + | PARSEOP_IO > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > IRQNoFlagsTerm > - : PARSEOP_IRQNOFLAGS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);} > + : PARSEOP_IRQNOFLAGS > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);} > OptionalNameString_First > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_IRQNOFLAGS '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_IRQNOFLAGS > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > IRQTerm > - : PARSEOP_IRQ '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQ);} > + : PARSEOP_IRQ > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IRQ);} > InterruptTypeKeyword > ',' InterruptLevel > OptionalShareType > OptionalNameString_Last > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$7,$8,$11);} > - | PARSEOP_IRQ '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_IRQ > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > Memory24Term > - : PARSEOP_MEMORY24 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY24);} > + : PARSEOP_MEMORY24 > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY24);} > OptionalReadWriteKeyword > ',' WordConstExpr > ',' WordConstExpr > ',' WordConstExpr > ',' WordConstExpr > OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} > - | PARSEOP_MEMORY24 '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} > + | PARSEOP_MEMORY24 > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > Memory32FixedTerm > - : PARSEOP_MEMORY32FIXED '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);} > + : PARSEOP_MEMORY32FIXED > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);} > OptionalReadWriteKeyword > ',' DWordConstExpr > ',' DWordConstExpr > OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$6,$8,$9);} > - | PARSEOP_MEMORY32FIXED '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$6,$8,$9);} > + | PARSEOP_MEMORY32FIXED > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > Memory32Term > - : PARSEOP_MEMORY32 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32);} > + : PARSEOP_MEMORY32 > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32);} > OptionalReadWriteKeyword > ',' DWordConstExpr > ',' DWordConstExpr > ',' DWordConstExpr > ',' DWordConstExpr > OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} > - | PARSEOP_MEMORY32 '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} > + | PARSEOP_MEMORY32 > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > QWordIOTerm > - : PARSEOP_QWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDIO);} > + : PARSEOP_QWORDIO > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDIO);} > OptionalResourceType_First > OptionalMinType > OptionalMaxType > @@ -540,14 +584,16 @@ QWordIOTerm > OptionalNameString > OptionalType > OptionalTranslationType_Last > - ')' {$$ = TrLinkChildren ($<n>3,15, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, > $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} > - | PARSEOP_QWORDIO '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_QWORDIO > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > QWordMemoryTerm > - : PARSEOP_QWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);} > + : PARSEOP_QWORDMEMORY > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);} > OptionalResourceType_First > OptionalDecodeType > OptionalMinType > @@ -564,14 +610,16 @@ QWordMemoryTerm > OptionalNameString > OptionalAddressRange > OptionalType_Last > - ')' {$$ = TrLinkChildren ($<n>3,16, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,16, > $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);} > - | PARSEOP_QWORDMEMORY '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_QWORDMEMORY > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > QWordSpaceTerm > - : PARSEOP_QWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);} > + : PARSEOP_QWORDSPACE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);} > ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} > OptionalResourceType > OptionalDecodeType > @@ -586,27 +634,31 @@ QWordSpaceTerm > OptionalByteConstExpr > OptionalStringData > OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,14, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, > $4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} > - | PARSEOP_QWORDSPACE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_QWORDSPACE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > RegisterTerm > - : PARSEOP_REGISTER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REGISTER);} > + : PARSEOP_REGISTER > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_REGISTER);} > AddressSpaceKeyword > ',' ByteConstExpr > ',' ByteConstExpr > ',' QWordConstExpr > OptionalAccessSize > OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$11,$12);} > - | PARSEOP_REGISTER '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$11,$12);} > + | PARSEOP_REGISTER > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > SpiSerialBusTerm > - : PARSEOP_SPI_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);} > + : PARSEOP_SPI_SERIALBUS > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);} > WordConstExpr /* 04: DeviceSelection */ > OptionalDevicePolarity /* 05: DevicePolarity */ > OptionalWireMode /* 06: WireMode */ > @@ -620,15 +672,17 @@ SpiSerialBusTerm > OptionalResourceType /* 19: ResourceType */ > OptionalNameString /* 20: DescriptorName */ > OptionalBuffer_Last /* 21: VendorData */ > - ')' {$$ = TrLinkChildren ($<n>3,14, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, > $4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20, > TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$21);} > - | PARSEOP_SPI_SERIALBUS '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_SPI_SERIALBUS > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > SpiSerialBusTermV2 > - : PARSEOP_SPI_SERIALBUS_V2 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS_V2);} > + : PARSEOP_SPI_SERIALBUS_V2 > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS_V2);} > WordConstExpr /* 04: DeviceSelection */ > OptionalDevicePolarity /* 05: DevicePolarity */ > OptionalWireMode /* 06: WireMode */ > @@ -643,32 +697,38 @@ SpiSerialBusTermV2 > OptionalNameString /* 20: DescriptorName */ > OptionalShareType /* 21: Share */ > OptionalBuffer_Last /* 22: VendorData */ > - ')' {$$ = TrLinkChildren ($<n>3,14, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, > $4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21,$22);} > - | PARSEOP_SPI_SERIALBUS_V2 '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_SPI_SERIALBUS_V2 > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > StartDependentFnNoPriTerm > - : PARSEOP_STARTDEPENDENTFN_NOPRI '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} > - ')' '{' > + : PARSEOP_STARTDEPENDENTFN_NOPRI > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} > + PARSEOP_CLOSE_PAREN '{' > ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,1,$6);} > - | PARSEOP_STARTDEPENDENTFN_NOPRI '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_STARTDEPENDENTFN_NOPRI > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > StartDependentFnTerm > - : PARSEOP_STARTDEPENDENTFN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);} > + : PARSEOP_STARTDEPENDENTFN > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);} > ByteConstExpr > ',' ByteConstExpr > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$9);} > - | PARSEOP_STARTDEPENDENTFN '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_STARTDEPENDENTFN > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > UartSerialBusTerm > - : PARSEOP_UART_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);} > + : PARSEOP_UART_SERIALBUS > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);} > DWordConstExpr /* 04: ConnectionSpeed */ > OptionalBitsPerByte /* 05: BitsPerByte */ > OptionalStopBits /* 06: StopBits */ > @@ -683,15 +743,17 @@ UartSerialBusTerm > OptionalResourceType /* 19: ResourceType */ > OptionalNameString /* 20: DescriptorName */ > OptionalBuffer_Last /* 21: VendorData */ > - ')' {$$ = TrLinkChildren ($<n>3,15, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, > $4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20, > TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$21);} > - | PARSEOP_UART_SERIALBUS '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_UART_SERIALBUS > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > UartSerialBusTermV2 > - : PARSEOP_UART_SERIALBUS_V2 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS_V2);} > + : PARSEOP_UART_SERIALBUS_V2 > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS_V2);} > DWordConstExpr /* 04: ConnectionSpeed */ > OptionalBitsPerByte /* 05: BitsPerByte */ > OptionalStopBits /* 06: StopBits */ > @@ -707,32 +769,38 @@ UartSerialBusTermV2 > OptionalNameString /* 20: DescriptorName */ > OptionalShareType /* 21: Share */ > OptionalBuffer_Last /* 22: VendorData */ > - ')' {$$ = TrLinkChildren ($<n>3,15, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, > $4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21,$22);} > - | PARSEOP_UART_SERIALBUS_V2 '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_UART_SERIALBUS_V2 > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > VendorLongTerm > - : PARSEOP_VENDORLONG '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORLONG);} > + : PARSEOP_VENDORLONG > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORLONG);} > OptionalNameString_First > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_VENDORLONG '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_VENDORLONG > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > VendorShortTerm > - : PARSEOP_VENDORSHORT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);} > + : PARSEOP_VENDORSHORT > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);} > OptionalNameString_First > - ')' '{' > + PARSEOP_CLOSE_PAREN '{' > ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_VENDORSHORT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_VENDORSHORT > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > WordBusNumberTerm > - : PARSEOP_WORDBUSNUMBER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);} > + : PARSEOP_WORDBUSNUMBER > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);} > OptionalResourceType_First > OptionalMinType > OptionalMaxType > @@ -745,14 +813,16 @@ WordBusNumberTerm > OptionalByteConstExpr > OptionalStringData > OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,12, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,12, > $4,$5,$6,$7,$9,$11,$13,$15,$17,$18,$19,$20);} > - | PARSEOP_WORDBUSNUMBER '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_WORDBUSNUMBER > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > WordIOTerm > - : PARSEOP_WORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDIO);} > + : PARSEOP_WORDIO > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WORDIO);} > OptionalResourceType_First > OptionalMinType > OptionalMaxType > @@ -768,14 +838,16 @@ WordIOTerm > OptionalNameString > OptionalType > OptionalTranslationType_Last > - ')' {$$ = TrLinkChildren ($<n>3,15, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, > $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} > - | PARSEOP_WORDIO '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_WORDIO > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > > WordSpaceTerm > - : PARSEOP_WORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDSPACE);} > + : PARSEOP_WORDSPACE > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WORDSPACE);} > ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} > OptionalResourceType > OptionalDecodeType > @@ -790,8 +862,9 @@ WordSpaceTerm > OptionalByteConstExpr > OptionalStringData > OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,14, > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, > $4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} > - | PARSEOP_WORDSPACE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + | PARSEOP_WORDSPACE > + PARSEOP_OPEN_PAREN > + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} > ; > diff --git a/src/acpica/source/compiler/aslrestype2.c b/src/acpica/source/compiler/aslrestype2.c > index 9fc77b0..cbec1b3 100644 > --- a/src/acpica/source/compiler/aslrestype2.c > +++ b/src/acpica/source/compiler/aslrestype2.c > @@ -199,6 +199,11 @@ RsDoGeneralRegisterDescriptor ( > RsCreateByteField (InitializerOp, ACPI_RESTAG_ACCESSSIZE, > CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.AccessSize)); > > + if (Descriptor->GenericReg.AddressSpaceId == ACPI_ADR_SPACE_PLATFORM_COMM) > + { > + break; > + } > + > if (Descriptor->GenericReg.AccessSize > AML_FIELD_ACCESS_QWORD) > { > AslError (ASL_ERROR, ASL_MSG_INVALID_ACCESS_SIZE, > diff --git a/src/acpica/source/compiler/aslrules.y b/src/acpica/source/compiler/aslrules.y > index 4bcbbf2..db75164 100644 > --- a/src/acpica/source/compiler/aslrules.y > +++ b/src/acpica/source/compiler/aslrules.y > @@ -153,14 +153,15 @@ AslCode > * The ObjectList term is obsolete and has been removed. > */ > DefinitionBlockTerm > - : PARSEOP_DEFINITION_BLOCK '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITION_BLOCK);} > + : PARSEOP_DEFINITION_BLOCK > + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITION_BLOCK);} > String ',' > String ',' > ByteConst ',' > String ',' > String ',' > DWordConst > - ')' {TrSetEndLineNumber ($<n>3);} > + PARSEOP_CLOSE_PAREN {TrSetEndLineNumber ($<n>3);} > '{' TermList '}' {$$ = TrLinkChildren ($<n>3,7, > $4,$6,$8,$10,$12,$14,$18);} > ; > @@ -171,6 +172,9 @@ DefinitionBlockList > DefinitionBlockList {$$ = TrLinkPeerNodes (2, $1,$2);} > ; > > + > +/******* Basic ASCII identifiers **************************************************/ > + > /* Allow IO, DMA, IRQ Resource macro and FOR macro names to also be used as identifiers */ > > NameString > @@ -184,20 +188,31 @@ NameString > /* > NameSeg > : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, (ACPI_NATIVE_INT) > - TrNormalizeNameSeg ($1));} > + TrNormalizeNameSeg ($1));} > ; > */ > > NameSeg > : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, > - (ACPI_NATIVE_INT) AslCompilerlval.s);} > + (ACPI_NATIVE_INT) AslCompilerlval.s);} > ; > > > +/******* Fundamental argument/statement types ***********************************/ > + > +Term > + : Object {} > + | Type1Opcode {} > + | Type2Opcode {} > + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > + | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > + | Type2BufferOpcode {} > + | Type2BufferOrStringOpcode {} > + | error {$$ = AslDoError(); yyclearin;} > + ; > + > SuperName > - : NameString {} > - | ArgTerm {} > - | LocalTerm {} > + : SimpleName {} > | DebugTerm {} > | Type6Opcode {} > ; > @@ -208,14 +223,19 @@ Target > | ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} > ; > > +RequiredTarget > + : ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} > + ; > + > TermArg > - : Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > + : SimpleName {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > + | Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > | DataObject {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > - | NameString {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > - | ArgTerm {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > - | LocalTerm {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > - > - > +/* > + | PARSEOP_OPEN_PAREN > + TermArg > + PARSEOP_CLOSE_PAREN {} > +*/ > ; > > /* > @@ -228,8 +248,10 @@ TermArg > */ > > MethodInvocationTerm > - : NameString '(' {TrUpdateNode (PARSEOP_METHODCALL, $1);} > - ArgList ')' {$$ = TrLinkChildNode ($1,$4);} > + : NameString > + PARSEOP_OPEN_PAREN {TrUpdateNode (PARSEOP_METHODCALL, $1);} > + ArgList > + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildNode ($1,$4);} > ; > > /* OptionalCount must appear before ByteList or an incorrect reduction will result */ > @@ -248,23 +270,44 @@ OptionalDataCount > > /* Legacy ASL */ > : {$$ = NULL;} > - | '(' TermArg ')' {$$ = $2;} > - | '(' ')' {$$ = NULL;} > + | PARSEOP_OPEN_PAREN > + TermArg > + PARSEOP_CLOSE_PAREN {$$ = $2;} > + | PARSEOP_OPEN_PAREN > + PARSEOP_CLOSE_PAREN {$$ = NULL;} > > /* C-style (ASL+) -- adds equals term */ > > | PARSEOP_EXP_EQUALS {$$ = NULL;} > > - | '(' TermArg ')' > + | PARSEOP_OPEN_PAREN > + TermArg > + PARSEOP_CLOSE_PAREN > PARSEOP_EXP_EQUALS {$$ = $2;} > > - | '(' ')' String > + | PARSEOP_OPEN_PAREN > + PARSEOP_CLOSE_PAREN > + String > PARSEOP_EXP_EQUALS {$$ = NULL;} > ; > > > /******* List Terms **************************************************/ > > + /* ACPI 3.0 -- allow semicolons between terms */ > + > +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);} > + ; > + > ArgList > : {$$ = NULL;} > | TermArg > @@ -371,38 +414,13 @@ OptionalParameterTypesPackage > TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} > ; > > - /* ACPI 3.0 -- allow semicolons between terms */ > - > -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);} > - ; > - > -Term > - : Object {} > - | Type1Opcode {} > - | Type2Opcode {} > - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > - | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > - | Type2BufferOpcode {} > - | Type2BufferOrStringOpcode {} > - | error {$$ = AslDoError(); yyclearin;} > - ; > - > /* > * Case-Default list; allow only one Default term and unlimited Case terms > */ > CaseDefaultTermList > : {$$ = NULL;} > - | CaseTerm {} > - | DefaultTerm {} > + | CaseTerm {} > + | DefaultTerm {} > | CaseDefaultTermList > CaseTerm {$$ = TrLinkPeerNode ($1,$2);} > | CaseDefaultTermList > @@ -592,32 +610,59 @@ NameSpaceModifier > | ScopeTerm {} > ; > > -/* For ObjectType: SuperName except for MethodInvocationTerm */ > - > -ObjectTypeName > +SimpleName > : NameString {} > - | ArgTerm {} > | LocalTerm {} > + | ArgTerm {} > + ; > + > +/* For ObjectType(), SuperName except for MethodInvocationTerm */ > + > +ObjectTypeSource > + : SimpleName {} > | DebugTerm {} > | RefOfTerm {} > | DerefOfTerm {} > | IndexTerm {} > | IndexExpTerm {} > -/* | MethodInvocationTerm {} */ /* Caused reduce/reduce with Type6Opcode->MethodInvocationTerm */ > ; > > -RequiredTarget > - : ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} > +/* For DeRefOf(), SuperName except for DerefOf and Debug */ > + > +DerefOfSource > + : SimpleName {} > + | RefOfTerm {} > + | DerefOfTerm {} > + | IndexTerm {} > + | IndexExpTerm {} > + | StoreTerm {} > + | EqualsTerm {} > + | MethodInvocationTerm {} > ; > > -SimpleTarget > - : NameString {} > - | LocalTerm {} > - | ArgTerm {} > +/* For RefOf(), SuperName except for RefOf and MethodInvocationTerm */ > + > +RefOfSource > + : SimpleName {} > + | DebugTerm {} > + | DerefOfTerm {} > + | IndexTerm {} > + | IndexExpTerm {} > ; > > -/* Opcode types */ > +/* For CondRefOf(), SuperName except for RefOf and MethodInvocationTerm */ > + > +CondRefOfSource > + : SimpleName {} > + | DebugTerm {} > + | DerefOfTerm {} > + | IndexTerm {} > + | IndexExpTerm {} > + ; > > +/* > + * Opcode types, as defined in the ACPI specification > + */ > Type1Opcode > : BreakTerm {} > | BreakPointTerm {} > diff --git a/src/acpica/source/compiler/aslstubs.c b/src/acpica/source/compiler/aslstubs.c > index 995d355..9c84865 100644 > --- a/src/acpica/source/compiler/aslstubs.c > +++ b/src/acpica/source/compiler/aslstubs.c > @@ -260,8 +260,7 @@ AcpiEvReleaseGlobalLock ( > > ACPI_STATUS > AcpiEvInitializeRegion ( > - ACPI_OPERAND_OBJECT *RegionObj, > - BOOLEAN AcpiNsLocked) > + ACPI_OPERAND_OBJECT *RegionObj) > { > return (AE_OK); > } > diff --git a/src/acpica/source/compiler/asltokens.y b/src/acpica/source/compiler/asltokens.y > index 04e21ff..eaf5331 100644 > --- a/src/acpica/source/compiler/asltokens.y > +++ b/src/acpica/source/compiler/asltokens.y > @@ -537,6 +537,9 @@ NoEcho(' > %left <i> PARSEOP_EXP_INCREMENT > PARSEOP_EXP_DECREMENT > > +%left <i> PARSEOP_OPEN_PAREN > + PARSEOP_CLOSE_PAREN > + > /* Brackets for Index() support */ > > %left <i> PARSEOP_EXP_INDEX_LEFT > diff --git a/src/acpica/source/compiler/asltypes.y b/src/acpica/source/compiler/asltypes.y > index 811bed6..ec1a21c 100644 > --- a/src/acpica/source/compiler/asltypes.y > +++ b/src/acpica/source/compiler/asltypes.y > @@ -140,7 +140,7 @@ NoEcho(' > %type <n> ParameterTypesPackage > %type <n> ParameterTypesPackageList > %type <n> RequiredTarget > -%type <n> SimpleTarget > +%type <n> SimpleName > %type <n> StringData > %type <n> Target > %type <n> Term > @@ -324,7 +324,10 @@ NoEcho(' > /* Types */ > > %type <n> SuperName > -%type <n> ObjectTypeName > +%type <n> ObjectTypeSource > +%type <n> DerefOfSource > +%type <n> RefOfSource > +%type <n> CondRefOfSource > %type <n> ArgTerm > %type <n> LocalTerm > %type <n> DebugTerm > diff --git a/src/acpica/source/compiler/aslwalks.c b/src/acpica/source/compiler/aslwalks.c > index bb743c6..c86b5e2 100644 > --- a/src/acpica/source/compiler/aslwalks.c > +++ b/src/acpica/source/compiler/aslwalks.c > @@ -934,21 +934,10 @@ AnAnalyzeStoreOperator ( > case PARSEOP_DEREFOF: > case PARSEOP_REFOF: > case PARSEOP_INDEX: > + case PARSEOP_STORE: > > return; > > - case PARSEOP_METHODCALL: > - /* > - * A target is not allowed to be a method call. > - * It is not supported by the ACPICA interpreter, nor is it > - * supported by the MS ASL compiler or the MS interpreter. > - * Although legal syntax up until ACPI 6.1, support for this > - * will be removed for ACPI 6.2 (02/2016) > - */ > - AslError (ASL_ERROR, ASL_MSG_SYNTAX, > - TargetOperandOp, "Illegal method invocation as a target operand"); > - return; > - > default: > break; > } > diff --git a/src/acpica/source/compiler/dttable.c b/src/acpica/source/compiler/dttable.c > index ee3d26d..561c5ce 100644 > --- a/src/acpica/source/compiler/dttable.c > +++ b/src/acpica/source/compiler/dttable.c > @@ -201,12 +201,9 @@ DtCompileFadt ( > DT_SUBTABLE *ParentTable; > DT_FIELD **PFieldList = (DT_FIELD **) List; > ACPI_TABLE_HEADER *Table; > - UINT8 FadtRevision; > - UINT32 i; > + UINT8 Revision; > > > - /* Minimum table is the FADT version 1 (ACPI 1.0) */ > - > Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt1, > &Subtable, TRUE); > if (ACPI_FAILURE (Status)) > @@ -218,41 +215,22 @@ DtCompileFadt ( > DtInsertSubtable (ParentTable, Subtable); > > Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer); > - FadtRevision = Table->Revision; > - > - /* Revision 0 and 2 are illegal */ > - > - if ((FadtRevision == 0) || > - (FadtRevision == 2)) > - { > - DtError (ASL_ERROR, 0, NULL, > - "Invalid value for FADT revision"); > - > - return (AE_BAD_VALUE); > - } > - > - /* Revision out of supported range? */ > + Revision = Table->Revision; > > - if (FadtRevision > ACPI_FADT_MAX_VERSION) > + if (Revision == 2) > { > - DtError (ASL_ERROR, 0, NULL, > - "Unknown or unsupported value for FADT revision"); > - > - return (AE_BAD_VALUE); > - } > - > - /* Compile individual sub-parts of the FADT, per-revision */ > - > - for (i = 3; i <= ACPI_FADT_MAX_VERSION; i++) > - { > - if (i > FadtRevision) > + Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt2, > + &Subtable, TRUE); > + if (ACPI_FAILURE (Status)) > { > - break; > + return (Status); > } > > - /* Compile the fields specific to this FADT revision */ > - > - Status = DtCompileTable (PFieldList, FadtRevisionInfo[i], > + DtInsertSubtable (ParentTable, Subtable); > + } > + else if (Revision >= 2) > + { > + Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt3, > &Subtable, TRUE); > if (ACPI_FAILURE (Status)) > { > @@ -260,6 +238,30 @@ DtCompileFadt ( > } > > DtInsertSubtable (ParentTable, Subtable); > + > + if (Revision >= 5) > + { > + Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt5, > + &Subtable, TRUE); > + if (ACPI_FAILURE (Status)) > + { > + return (Status); > + } > + > + DtInsertSubtable (ParentTable, Subtable); > + } > + > + if (Revision >= 6) > + { > + Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt6, > + &Subtable, TRUE); > + if (ACPI_FAILURE (Status)) > + { > + return (Status); > + } > + > + DtInsertSubtable (ParentTable, Subtable); > + } > } > > return (AE_OK); > diff --git a/src/acpica/source/components/disassembler/dmbuffer.c b/src/acpica/source/components/disassembler/dmbuffer.c > index 7b2fcc4..d1c16e5 100644 > --- a/src/acpica/source/components/disassembler/dmbuffer.c > +++ b/src/acpica/source/components/disassembler/dmbuffer.c > @@ -511,12 +511,16 @@ AcpiDmIsUnicodeBuffer ( > return (FALSE); > } > > - /* For each word, 1st byte must be ascii (1-0x7F), 2nd byte must be zero */ > - > + /* > + * For each word, 1st byte must be printable ascii, and the > + * 2nd byte must be zero. This does not allow for escape > + * sequences, but it is the most secure way to detect a > + * unicode string. > + */ > for (i = 0; i < (ByteCount - 2); i += 2) > { > if ((ByteData[i] == 0) || > - (ByteData[i] > 0x7F) || > + !(isprint (ByteData[i])) || > (ByteData[(ACPI_SIZE) i + 1] != 0)) > { > return (FALSE); > @@ -579,12 +583,27 @@ AcpiDmIsStringBuffer ( > return (FALSE); > } > > + /* > + * Check for a possible standalone resource EndTag, ignore it > + * here. However, this sequence is also the string "Y", but > + * this seems rare enough to be acceptable. > + */ > + if ((ByteCount == 2) && (ByteData[0] == 0x79)) > + { > + return (FALSE); > + } > + > + /* Check all bytes for ASCII */ > + > for (i = 0; i < (ByteCount - 1); i++) > { > - /* TBD: allow some escapes (non-ascii chars). > + /* > + * TBD: allow some escapes (non-ascii chars). > * they will be handled in the string output routine > */ > > + /* Not a string if not printable ascii */ > + > if (!isprint (ByteData[i])) > { > return (FALSE); > diff --git a/src/acpica/source/components/disassembler/dmcstyle.c b/src/acpica/source/components/disassembler/dmcstyle.c > index dcfc044..7bdc19f 100644 > --- a/src/acpica/source/components/disassembler/dmcstyle.c > +++ b/src/acpica/source/components/disassembler/dmcstyle.c > @@ -145,6 +145,11 @@ AcpiDmIsTargetAnOperand ( > ACPI_PARSE_OBJECT *Operand, > BOOLEAN TopLevel); > > +static BOOLEAN > +AcpiDmIsOptimizationIgnored ( > + ACPI_PARSE_OBJECT *StoreOp, > + ACPI_PARSE_OBJECT *StoreArgument); > + > > /******************************************************************************* > * > @@ -167,12 +172,10 @@ AcpiDmCheckForSymbolicOpcode ( > ACPI_OP_WALK_INFO *Info) > { > char *OperatorSymbol = NULL; > - ACPI_PARSE_OBJECT *Child1; > - ACPI_PARSE_OBJECT *Child2; > + ACPI_PARSE_OBJECT *Argument1; > + ACPI_PARSE_OBJECT *Argument2; > ACPI_PARSE_OBJECT *Target; > - ACPI_PARSE_OBJECT *GrandChild1; > - ACPI_PARSE_OBJECT *GrandChild2; > - ACPI_PARSE_OBJECT *GrandTarget = NULL; > + ACPI_PARSE_OBJECT *Target2; > > > /* Exit immediately if ASL+ not enabled */ > @@ -182,25 +185,17 @@ AcpiDmCheckForSymbolicOpcode ( > return (FALSE); > } > > - /* Check for a non-ASL+ statement, propagate the flag */ > - > - if (Op->Common.Parent->Common.DisasmFlags & ACPI_PARSEOP_LEGACY_ASL_ONLY) > - { > - Op->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; > - return (FALSE); > - } > - > /* Get the first operand */ > > - Child1 = AcpiPsGetArg (Op, 0); > - if (!Child1) > + Argument1 = AcpiPsGetArg (Op, 0); > + if (!Argument1) > { > return (FALSE); > } > > /* Get the second operand */ > > - Child2 = Child1->Common.Next; > + Argument2 = Argument1->Common.Next; > > /* Setup the operator string for this opcode */ > > @@ -274,7 +269,7 @@ AcpiDmCheckForSymbolicOpcode ( > * LNotEqual, LLessEqual, and LGreaterEqual. There are > * no actual AML opcodes for these operators. > */ > - switch (Child1->Common.AmlOpcode) > + switch (Argument1->Common.AmlOpcode) > { > case AML_LEQUAL_OP: > OperatorSymbol = " != "; > @@ -296,19 +291,18 @@ AcpiDmCheckForSymbolicOpcode ( > return (TRUE); > } > > - Child1->Common.DisasmOpcode = ACPI_DASM_LNOT_SUFFIX; > + Argument1->Common.DisasmOpcode = ACPI_DASM_LNOT_SUFFIX; > Op->Common.DisasmOpcode = ACPI_DASM_LNOT_PREFIX; > - Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND_ASSIGNMENT; > > /* Save symbol string in the next child (not peer) */ > > - Child2 = AcpiPsGetArg (Child1, 0); > - if (!Child2) > + Argument2 = AcpiPsGetArg (Argument1, 0); > + if (!Argument2) > { > return (FALSE); > } > > - Child2->Common.OperatorSymbol = OperatorSymbol; > + Argument2->Common.OperatorSymbol = OperatorSymbol; > return (TRUE); > > case AML_INDEX_OP: > @@ -318,10 +312,10 @@ AcpiDmCheckForSymbolicOpcode ( > * the symbolic operators for Index(). It doesn't make sense to > * use Index() with a constant anyway. > */ > - if ((Child1->Common.AmlOpcode == AML_STRING_OP) || > - (Child1->Common.AmlOpcode == AML_BUFFER_OP) || > - (Child1->Common.AmlOpcode == AML_PACKAGE_OP) || > - (Child1->Common.AmlOpcode == AML_VAR_PACKAGE_OP)) > + if ((Argument1->Common.AmlOpcode == AML_STRING_OP) || > + (Argument1->Common.AmlOpcode == AML_BUFFER_OP) || > + (Argument1->Common.AmlOpcode == AML_PACKAGE_OP) || > + (Argument1->Common.AmlOpcode == AML_VAR_PACKAGE_OP)) > { > Op->Common.DisasmFlags |= ACPI_PARSEOP_CLOSING_PAREN; > return (FALSE); > @@ -329,8 +323,8 @@ AcpiDmCheckForSymbolicOpcode ( > > /* Index operator is [] */ > > - Child1->Common.OperatorSymbol = " ["; > - Child2->Common.OperatorSymbol = "]"; > + Argument1->Common.OperatorSymbol = " ["; > + Argument2->Common.OperatorSymbol = "]"; > break; > > /* Unary operators */ > @@ -352,7 +346,7 @@ AcpiDmCheckForSymbolicOpcode ( > return (FALSE); > } > > - if (Child1->Common.DisasmOpcode == ACPI_DASM_LNOT_SUFFIX) > + if (Argument1->Common.DisasmOpcode == ACPI_DASM_LNOT_SUFFIX) > { > return (TRUE); > } > @@ -363,9 +357,9 @@ AcpiDmCheckForSymbolicOpcode ( > * deferring symbol output until after the first operand has been > * emitted. > */ > - if (!Child1->Common.OperatorSymbol) > + if (!Argument1->Common.OperatorSymbol) > { > - Child1->Common.OperatorSymbol = OperatorSymbol; > + Argument1->Common.OperatorSymbol = OperatorSymbol; > } > > /* > @@ -395,23 +389,58 @@ AcpiDmCheckForSymbolicOpcode ( > > /* Target is 3rd operand */ > > - Target = Child2->Common.Next; > + Target = Argument2->Common.Next; > if (Op->Common.AmlOpcode == AML_DIVIDE_OP) > { > + Target2 = Target->Common.Next; > + > /* > * Divide has an extra target operand (Remainder). > - * If this extra target is specified, it cannot be converted > - * to a C-style operator > + * Default behavior is to simply ignore ASL+ conversion > + * if the remainder target (modulo) is specified. > */ > - if (AcpiDmIsValidTarget (Target)) > + if (!AcpiGbl_DoDisassemblerOptimizations) > { > - Child1->Common.OperatorSymbol = NULL; > - Op->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; > - return (FALSE); > + if (AcpiDmIsValidTarget (Target)) > + { > + Argument1->Common.OperatorSymbol = NULL; > + Op->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; > + return (FALSE); > + } > + > + Target->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; > + Target = Target2; > } > + else > + { > + /* > + * Divide has an extra target operand (Remainder). > + * If both targets are specified, it cannot be converted > + * to a C-style operator. > + */ > + if (AcpiDmIsValidTarget (Target) && > + AcpiDmIsValidTarget (Target2)) > + { > + Argument1->Common.OperatorSymbol = NULL; > + Op->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; > + return (FALSE); > + } > + > + if (AcpiDmIsValidTarget (Target)) /* Only first Target is valid (remainder) */ > + { > + /* Convert the Divide to Modulo */ > + > + Op->Common.AmlOpcode = AML_MOD_OP; > > - Target->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; > - Target = Target->Common.Next; > + Argument1->Common.OperatorSymbol = " % "; > + Target2->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; > + } > + else /* Only second Target (quotient) is valid */ > + { > + Target->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; > + Target = Target2; > + } > + } > } > > /* Parser should ensure there is at least a placeholder target */ > @@ -423,13 +452,6 @@ AcpiDmCheckForSymbolicOpcode ( > > if (!AcpiDmIsValidTarget (Target)) > { > - if (Op->Common.Parent->Common.AmlOpcode == AML_STORE_OP) > - { > - Op->Common.DisasmFlags = 0; > - Child1->Common.OperatorSymbol = NULL; > - return (FALSE); > - } > - > /* Not a valid target (placeholder only, from parser) */ > break; > } > @@ -462,8 +484,8 @@ AcpiDmCheckForSymbolicOpcode ( > * Add (B, A, A) --> A += B > * Add (B, C, A) --> A = (B + C) > */ > - if ((AcpiDmIsTargetAnOperand (Target, Child1, TRUE)) || > - (AcpiDmIsTargetAnOperand (Target, Child2, TRUE))) > + if ((AcpiDmIsTargetAnOperand (Target, Argument1, TRUE)) || > + (AcpiDmIsTargetAnOperand (Target, Argument2, TRUE))) > { > Target->Common.OperatorSymbol = > AcpiDmGetCompoundSymbol (Op->Common.AmlOpcode); > @@ -471,7 +493,7 @@ AcpiDmCheckForSymbolicOpcode ( > /* Convert operator to compound assignment */ > > Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND_ASSIGNMENT; > - Child1->Common.OperatorSymbol = NULL; > + Argument1->Common.OperatorSymbol = NULL; > return (TRUE); > } > break; > @@ -491,7 +513,7 @@ AcpiDmCheckForSymbolicOpcode ( > * Subtract (A, B, A) --> A -= B > * Subtract (B, A, A) --> A = (B - A) > */ > - if ((AcpiDmIsTargetAnOperand (Target, Child1, TRUE))) > + if ((AcpiDmIsTargetAnOperand (Target, Argument1, TRUE))) > { > Target->Common.OperatorSymbol = > AcpiDmGetCompoundSymbol (Op->Common.AmlOpcode); > @@ -499,7 +521,7 @@ AcpiDmCheckForSymbolicOpcode ( > /* Convert operator to compound assignment */ > > Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND_ASSIGNMENT; > - Child1->Common.OperatorSymbol = NULL; > + Argument1->Common.OperatorSymbol = NULL; > return (TRUE); > } > break; > @@ -553,7 +575,7 @@ AcpiDmCheckForSymbolicOpcode ( > > /* Target is optional, 3rd operand */ > > - Target = Child2->Common.Next; > + Target = Argument2->Common.Next; > if (AcpiDmIsValidTarget (Target)) > { > AcpiDmPromoteTarget (Op, Target); > @@ -567,75 +589,23 @@ AcpiDmCheckForSymbolicOpcode ( > > case AML_STORE_OP: > /* > - * Target is the 2nd operand. > - * We know the target is valid, it is not optional. > + * For Store, the Target is the 2nd operand. We know the target > + * is valid, because it is not optional. > * > - * The following block implements "Ignore conversion if a store > - * is followed by a math/bit operator that has no target". Used > - * only for the ASL test suite. > + * Ignore any optimizations/folding if flag is set. > + * Used for iASL/disassembler test suite only. > */ > - if (!AcpiGbl_DoDisassemblerOptimizations) > + if (AcpiDmIsOptimizationIgnored (Op, Argument1)) > { > - switch (Child1->Common.AmlOpcode) > - { > - /* This operator has two operands and two targets */ > - > - case AML_DIVIDE_OP: > - > - GrandChild1 = Child1->Common.Value.Arg; > - GrandChild2 = GrandChild1->Common.Next; > - GrandTarget = GrandChild2->Common.Next; > - > - if (GrandTarget && !AcpiDmIsValidTarget (GrandTarget)) > - { > - Op->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; > - return (FALSE); > - } > - GrandTarget = GrandTarget->Common.Next; > - break; > - > - case AML_ADD_OP: > - case AML_SUBTRACT_OP: > - case AML_MULTIPLY_OP: > - case AML_MOD_OP: > - case AML_SHIFT_LEFT_OP: > - case AML_SHIFT_RIGHT_OP: > - case AML_BIT_AND_OP: > - case AML_BIT_OR_OP: > - case AML_BIT_XOR_OP: > - case AML_INDEX_OP: > - > - /* These operators have two operands and a target */ > - > - GrandChild1 = Child1->Common.Value.Arg; > - GrandChild2 = GrandChild1->Common.Next; > - GrandTarget = GrandChild2->Common.Next; > - break; > - > - case AML_BIT_NOT_OP: > - > - /* This operator has one operand and a target */ > - > - GrandChild1 = Child1->Common.Value.Arg; > - GrandTarget = GrandChild1->Common.Next; > - break; > - > - default: > - break; > - } > - > - if (GrandTarget && !AcpiDmIsValidTarget (GrandTarget)) > - { > - Op->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; > - return (FALSE); > - } > + return (FALSE); > } > > /* > + * Perform conversion. > * In the parse tree, simply swap the target with the > * source so that the target is processed first. > */ > - Target = Child1->Common.Next; > + Target = Argument1->Common.Next; > if (!Target) > { > return (FALSE); > @@ -652,7 +622,7 @@ AcpiDmCheckForSymbolicOpcode ( > > /* Target is optional, 2nd operand */ > > - Target = Child1->Common.Next; > + Target = Argument1->Common.Next; > if (!Target) > { > return (FALSE); > @@ -677,23 +647,129 @@ AcpiDmCheckForSymbolicOpcode ( > break; > } > > + /* All other operators, emit an open paren */ > + > + AcpiOsPrintf ("("); > + return (TRUE); > +} > + > + > +/******************************************************************************* > + * > + * FUNCTION: AcpiDmIsOptimizationIgnored > + * > + * PARAMETERS: StoreOp - Store operator parse object > + * StoreArgument - Target associate with the Op > + * > + * RETURN: TRUE if this Store operator should not be converted/removed. > + * > + * DESCRIPTION: The following function implements "Do not optimize if a > + * store is immediately followed by a math/bit operator that > + * has no target". > + * > + * Function is ignored if DoDisassemblerOptimizations is TRUE. > + * This is the default, ignore this function. > + * > + * Disables these types of optimizations, and simply emits > + * legacy ASL code: > + * Store (Add (INT1, 4), INT2) --> Add (INT1, 4, INT2) > + * --> INT2 = INT1 + 4 > + * > + * Store (Not (INT1), INT2) --> Not (INT1, INT2) > + * --> INT2 = ~INT1 > + * > + * Used only for the ASL test suite. For the test suite, we > + * don't want to perform some optimizations to ensure binary > + * compatibility with the generation of the legacy ASL->AML. > + * In other words, for all test modules we want exactly: > + * (ASL+ -> AML) == (ASL- -> AML) > + * > + ******************************************************************************/ > + > +static BOOLEAN > +AcpiDmIsOptimizationIgnored ( > + ACPI_PARSE_OBJECT *StoreOp, > + ACPI_PARSE_OBJECT *StoreArgument) > +{ > + ACPI_PARSE_OBJECT *Argument1; > + ACPI_PARSE_OBJECT *Argument2; > + ACPI_PARSE_OBJECT *Target; > + > + > + /* No optimizations/folding for the typical case */ > + > + if (AcpiGbl_DoDisassemblerOptimizations) > + { > + return (FALSE); > + } > + > /* > - * Nodes marked with ACPI_PARSEOP_PARAMLIST don't need a parens > - * output here. We also need to check the parent to see if this op > - * is part of a compound test (!=, >=, <=). > + * Only a small subset of ASL/AML operators can be optimized. > + * Can only optimize/fold if there is no target (or targets) > + * specified for the operator. And of course, the operator > + * is surrrounded by a Store() operator. > */ > - if ((Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) || > - ((Op->Common.Parent->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) && > - (Op->Common.DisasmOpcode == ACPI_DASM_LNOT_SUFFIX))) > + switch (StoreArgument->Common.AmlOpcode) > { > - /* Do Nothing. Paren already generated */ > - return (TRUE); > - } > + case AML_ADD_OP: > + case AML_SUBTRACT_OP: > + case AML_MULTIPLY_OP: > + case AML_MOD_OP: > + case AML_SHIFT_LEFT_OP: > + case AML_SHIFT_RIGHT_OP: > + case AML_BIT_AND_OP: > + case AML_BIT_OR_OP: > + case AML_BIT_XOR_OP: > + case AML_INDEX_OP: > > - /* All other operators, emit an open paren */ > + /* These operators have two arguments and one target */ > > - AcpiOsPrintf ("("); > - return (TRUE); > + Argument1 = StoreArgument->Common.Value.Arg; > + Argument2 = Argument1->Common.Next; > + Target = Argument2->Common.Next; > + > + if (!AcpiDmIsValidTarget (Target)) > + { > + StoreOp->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; > + return (TRUE); > + } > + break; > + > + case AML_DIVIDE_OP: > + > + /* This operator has two arguments and two targets */ > + > + Argument1 = StoreArgument->Common.Value.Arg; > + Argument2 = Argument1->Common.Next; > + Target = Argument2->Common.Next; > + > + if (!AcpiDmIsValidTarget (Target) || > + !AcpiDmIsValidTarget (Target->Common.Next)) > + { > + StoreOp->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; > + return (TRUE); > + } > + break; > + > + case AML_BIT_NOT_OP: > + > + /* This operator has one operand and one target */ > + > + Argument1 = StoreArgument->Common.Value.Arg; > + Target = Argument1->Common.Next; > + > + if (!AcpiDmIsValidTarget (Target)) > + { > + StoreOp->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; > + return (TRUE); > + } > + break; > + > + default: > + break; > + } > + > + return (FALSE); > } > > > @@ -715,8 +791,6 @@ void > AcpiDmCloseOperator ( > ACPI_PARSE_OBJECT *Op) > { > - BOOLEAN IsCStyleOp = FALSE; > - > > /* Always emit paren if ASL+ disassembly disabled */ > > @@ -726,8 +800,6 @@ AcpiDmCloseOperator ( > return; > } > > - /* Check for a non-ASL+ statement */ > - > if (Op->Common.DisasmFlags & ACPI_PARSEOP_LEGACY_ASL_ONLY) > { > AcpiOsPrintf (")"); > @@ -767,8 +839,6 @@ AcpiDmCloseOperator ( > { > AcpiOsPrintf (")"); > } > - > - IsCStyleOp = TRUE; > break; > > case AML_INDEX_OP: > @@ -796,21 +866,7 @@ AcpiDmCloseOperator ( > break; > } > > - /* > - * Nodes marked with ACPI_PARSEOP_PARAMLIST don't need a parens > - * output here. We also need to check the parent to see if this op > - * is part of a compound test (!=, >=, <=). > - */ > - if (IsCStyleOp && > - ((Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) || > - ((Op->Common.Parent->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) && > - (Op->Common.DisasmOpcode == ACPI_DASM_LNOT_SUFFIX)))) > - { > - return; > - } > - > AcpiOsPrintf (")"); > - return; > } > > > diff --git a/src/acpica/source/components/disassembler/dmresrc.c b/src/acpica/source/components/disassembler/dmresrc.c > index 7980256..e45cecc 100644 > --- a/src/acpica/source/components/disassembler/dmresrc.c > +++ b/src/acpica/source/components/disassembler/dmresrc.c > @@ -464,7 +464,8 @@ AcpiDmIsResourceTemplate ( > ACPI_PARSE_OBJECT *NextOp; > UINT8 *Aml; > UINT8 *EndAml; > - ACPI_SIZE Length; > + UINT32 BufferLength; > + UINT32 DeclaredBufferLength; > > > /* This op must be a buffer */ > @@ -474,8 +475,10 @@ AcpiDmIsResourceTemplate ( > return (AE_TYPE); > } > > - /* Get the ByteData list and length */ > - > + /* > + * Get the declared length of the buffer. > + * This is the nn in "Buffer (nn)" > + */ > NextOp = Op->Common.Value.Arg; > if (!NextOp) > { > @@ -483,6 +486,10 @@ AcpiDmIsResourceTemplate ( > return (AE_TYPE); > } > > + DeclaredBufferLength = NextOp->Common.Value.Size; > + > + /* Get the length of the raw initialization byte list */ > + > NextOp = NextOp->Common.Next; > if (!NextOp) > { > @@ -490,11 +497,22 @@ AcpiDmIsResourceTemplate ( > } > > Aml = NextOp->Named.Data; > - Length = (ACPI_SIZE) NextOp->Common.Value.Integer; > + BufferLength = NextOp->Common.Value.Size; > + > + /* > + * Not a template if declared buffer length != actual length of the > + * intialization byte list. Because the resource macros will create > + * a buffer of the exact required length (buffer length will be equal > + * to the actual length). > + */ > + if (DeclaredBufferLength != BufferLength) > + { > + return (AE_TYPE); > + } > > /* Walk the byte list, abort on any invalid descriptor type or length */ > > - Status = AcpiUtWalkAmlResources (WalkState, Aml, Length, > + Status = AcpiUtWalkAmlResources (WalkState, Aml, BufferLength, > NULL, ACPI_CAST_INDIRECT_PTR (void, &EndAml)); > if (ACPI_FAILURE (Status)) > { > @@ -507,7 +525,7 @@ AcpiDmIsResourceTemplate ( > * of a ResourceTemplate, the buffer must not have any extra data after > * the EndTag.) > */ > - if ((Aml + Length - sizeof (AML_RESOURCE_END_TAG)) != EndAml) > + if ((Aml + BufferLength - sizeof (AML_RESOURCE_END_TAG)) != EndAml) > { > return (AE_AML_NO_RESOURCE_END_TAG); > } > diff --git a/src/acpica/source/components/dispatcher/dsinit.c b/src/acpica/source/components/dispatcher/dsinit.c > index 390a63f..b9ad5c9 100644 > --- a/src/acpica/source/components/dispatcher/dsinit.c > +++ b/src/acpica/source/components/dispatcher/dsinit.c > @@ -118,6 +118,7 @@ > #include "acdispat.h" > #include "acnamesp.h" > #include "actables.h" > +#include "acinterp.h" > > #define _COMPONENT ACPI_DISPATCHER > ACPI_MODULE_NAME ("dsinit") > @@ -303,23 +304,16 @@ AcpiDsInitializeObjects ( > > /* Walk entire namespace from the supplied root */ > > - Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); > - if (ACPI_FAILURE (Status)) > - { > - return_ACPI_STATUS (Status); > - } > - > /* > * We don't use AcpiWalkNamespace since we do not want to acquire > * the namespace reader lock. > */ > Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, StartNode, ACPI_UINT32_MAX, > - ACPI_NS_WALK_UNLOCK, AcpiDsInitOneObject, NULL, &Info, NULL); > + ACPI_NS_WALK_NO_UNLOCK, AcpiDsInitOneObject, NULL, &Info, NULL); > if (ACPI_FAILURE (Status)) > { > ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace")); > } > - (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); > > Status = AcpiGetTableByIndex (TableIndex, &Table); > if (ACPI_FAILURE (Status)) > diff --git a/src/acpica/source/components/dispatcher/dsmethod.c b/src/acpica/source/components/dispatcher/dsmethod.c > index b60b51f..e7edcf4 100644 > --- a/src/acpica/source/components/dispatcher/dsmethod.c > +++ b/src/acpica/source/components/dispatcher/dsmethod.c > @@ -179,15 +179,12 @@ AcpiDsAutoSerializeMethod ( > "Method auto-serialization parse [%4.4s] %p\n", > AcpiUtGetNodeName (Node), Node)); > > - AcpiExEnterInterpreter (); > - > /* Create/Init a root op for the method parse tree */ > > Op = AcpiPsAllocOp (AML_METHOD_OP, ObjDesc->Method.AmlStart); > if (!Op) > { > - Status = AE_NO_MEMORY; > - goto Unlock; > + return_ACPI_STATUS (AE_NO_MEMORY); > } > > AcpiPsSetName (Op, Node->Name.Integer); > @@ -199,8 +196,7 @@ AcpiDsAutoSerializeMethod ( > if (!WalkState) > { > AcpiPsFreeOp (Op); > - Status = AE_NO_MEMORY; > - goto Unlock; > + return_ACPI_STATUS (AE_NO_MEMORY); > } > > Status = AcpiDsInitAmlWalk (WalkState, Op, Node, > @@ -219,8 +215,6 @@ AcpiDsAutoSerializeMethod ( > Status = AcpiPsParseAml (WalkState); > > AcpiPsDeleteParseTree (Op); > -Unlock: > - AcpiExExitInterpreter (); > return_ACPI_STATUS (Status); > } > > @@ -856,26 +850,6 @@ AcpiDsTerminateControlMethod ( > AcpiDsMethodDataDeleteAll (WalkState); > > /* > - * If method is serialized, release the mutex and restore the > - * current sync level for this thread > - */ > - if (MethodDesc->Method.Mutex) > - { > - /* Acquisition Depth handles recursive calls */ > - > - MethodDesc->Method.Mutex->Mutex.AcquisitionDepth--; > - if (!MethodDesc->Method.Mutex->Mutex.AcquisitionDepth) > - { > - WalkState->Thread->CurrentSyncLevel = > - MethodDesc->Method.Mutex->Mutex.OriginalSyncLevel; > - > - AcpiOsReleaseMutex ( > - MethodDesc->Method.Mutex->Mutex.OsMutex); > - MethodDesc->Method.Mutex->Mutex.ThreadId = 0; > - } > - } > - > - /* > * Delete any namespace objects created anywhere within the > * namespace by the execution of this method. Unless: > * 1) This method is a module-level executable code method, in which > @@ -908,6 +882,26 @@ AcpiDsTerminateControlMethod ( > ~ACPI_METHOD_MODIFIED_NAMESPACE; > } > } > + > + /* > + * If method is serialized, release the mutex and restore the > + * current sync level for this thread > + */ > + if (MethodDesc->Method.Mutex) > + { > + /* Acquisition Depth handles recursive calls */ > + > + MethodDesc->Method.Mutex->Mutex.AcquisitionDepth--; > + if (!MethodDesc->Method.Mutex->Mutex.AcquisitionDepth) > + { > + WalkState->Thread->CurrentSyncLevel = > + MethodDesc->Method.Mutex->Mutex.OriginalSyncLevel; > + > + AcpiOsReleaseMutex ( > + MethodDesc->Method.Mutex->Mutex.OsMutex); > + MethodDesc->Method.Mutex->Mutex.ThreadId = 0; > + } > + } > } > > /* Decrement the thread count on the method */ > diff --git a/src/acpica/source/components/dispatcher/dsopcode.c b/src/acpica/source/components/dispatcher/dsopcode.c > index ea0f11e..42178ad 100644 > --- a/src/acpica/source/components/dispatcher/dsopcode.c > +++ b/src/acpica/source/components/dispatcher/dsopcode.c > @@ -162,7 +162,7 @@ AcpiDsInitializeRegion ( > > /* Namespace is NOT locked */ > > - Status = AcpiEvInitializeRegion (ObjDesc, FALSE); > + Status = AcpiEvInitializeRegion (ObjDesc); > return (Status); > } > > diff --git a/src/acpica/source/components/dispatcher/dswload2.c b/src/acpica/source/components/dispatcher/dswload2.c > index 2497406..3ac19ed 100644 > --- a/src/acpica/source/components/dispatcher/dswload2.c > +++ b/src/acpica/source/components/dispatcher/dswload2.c > @@ -698,23 +698,8 @@ AcpiDsLoad2EndOp ( > } > } > > - AcpiExExitInterpreter (); > Status = AcpiEvInitializeRegion ( > - AcpiNsGetAttachedObject (Node), FALSE); > - AcpiExEnterInterpreter (); > - > - if (ACPI_FAILURE (Status)) > - { > - /* > - * If AE_NOT_EXIST is returned, it is not fatal > - * because many regions get created before a handler > - * is installed for said region. > - */ > - if (AE_NOT_EXIST == Status) > - { > - Status = AE_OK; > - } > - } > + AcpiNsGetAttachedObject (Node)); > break; > > case AML_NAME_OP: > diff --git a/src/acpica/source/components/events/evrgnini.c b/src/acpica/source/components/events/evrgnini.c > index 2e6315c..72ba4f4 100644 > --- a/src/acpica/source/components/events/evrgnini.c > +++ b/src/acpica/source/components/events/evrgnini.c > @@ -117,6 +117,7 @@ > #include "accommon.h" > #include "acevents.h" > #include "acnamesp.h" > +#include "acinterp.h" > > #define _COMPONENT ACPI_EVENTS > ACPI_MODULE_NAME ("evrgnini") > @@ -609,7 +610,6 @@ AcpiEvDefaultRegionSetup ( > * FUNCTION: AcpiEvInitializeRegion > * > * PARAMETERS: RegionObj - Region we are initializing > - * AcpiNsLocked - Is namespace locked? > * > * RETURN: Status > * > @@ -627,21 +627,33 @@ AcpiEvDefaultRegionSetup ( > * MUTEX: Interpreter should be unlocked, because we may run the _REG > * method for this region. > * > + * NOTE: Possible incompliance: > + * There is a behavior conflict in automatic _REG execution: > + * 1. When the interpreter is evaluating a method, we can only > + * automatically run _REG for the following case: > + * Method(_REG, 2) {} > + * OperationRegion (OPR1, 0x80, 0x1000010, 0x4) > + * 2. When the interpreter is loading a table, we can also > + * automatically run _REG for the following case: > + * OperationRegion (OPR1, 0x80, 0x1000010, 0x4) > + * Method(_REG, 2) {} > + * Though this may not be compliant to the de-facto standard, the > + * logic is kept in order not to trigger regressions. And keeping > + * this logic should be taken care by the caller of this function. > + * > ******************************************************************************/ > > ACPI_STATUS > AcpiEvInitializeRegion ( > - ACPI_OPERAND_OBJECT *RegionObj, > - BOOLEAN AcpiNsLocked) > + ACPI_OPERAND_OBJECT *RegionObj) > { > ACPI_OPERAND_OBJECT *HandlerObj; > ACPI_OPERAND_OBJECT *ObjDesc; > ACPI_ADR_SPACE_TYPE SpaceId; > ACPI_NAMESPACE_NODE *Node; > - ACPI_STATUS Status; > > > - ACPI_FUNCTION_TRACE_U32 (EvInitializeRegion, AcpiNsLocked); > + ACPI_FUNCTION_TRACE (EvInitializeRegion); > > > if (!RegionObj) > @@ -713,33 +725,15 @@ AcpiEvInitializeRegion ( > "Found handler %p for region %p in obj %p\n", > HandlerObj, RegionObj, ObjDesc)); > > - Status = AcpiEvAttachRegion (HandlerObj, RegionObj, > - AcpiNsLocked); > + (void) AcpiEvAttachRegion (HandlerObj, RegionObj, FALSE); > > /* > * Tell all users that this region is usable by > * running the _REG method > */ > - if (AcpiNsLocked) > - { > - Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); > - if (ACPI_FAILURE (Status)) > - { > - return_ACPI_STATUS (Status); > - } > - } > - > - Status = AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_CONNECT); > - > - if (AcpiNsLocked) > - { > - Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); > - if (ACPI_FAILURE (Status)) > - { > - return_ACPI_STATUS (Status); > - } > - } > - > + AcpiExExitInterpreter (); > + (void) AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_CONNECT); > + AcpiExEnterInterpreter (); > return_ACPI_STATUS (AE_OK); > } > } > @@ -749,11 +743,14 @@ AcpiEvInitializeRegion ( > Node = Node->Parent; > } > > - /* If we get here, there is no handler for this region */ > - > + /* > + * If we get here, there is no handler for this region. This is not > + * fatal because many regions get created before a handler is installed > + * for said region. > + */ > ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, > "No handler for RegionType %s(%X) (RegionObj %p)\n", > AcpiUtGetRegionName (SpaceId), SpaceId, RegionObj)); > > - return_ACPI_STATUS (AE_NOT_EXIST); > + return_ACPI_STATUS (AE_OK); > } > diff --git a/src/acpica/source/components/executer/exconfig.c b/src/acpica/source/components/executer/exconfig.c > index fb55b67..93c8c5d 100644 > --- a/src/acpica/source/components/executer/exconfig.c > +++ b/src/acpica/source/components/executer/exconfig.c > @@ -553,7 +553,7 @@ AcpiExLoadOp ( > > ACPI_INFO (("Dynamic OEM Table Load:")); > AcpiExExitInterpreter (); > - Status = AcpiTbInstallAndLoadTable (Table, ACPI_PTR_TO_PHYSADDR (Table), > + Status = AcpiTbInstallAndLoadTable (ACPI_PTR_TO_PHYSADDR (Table), > ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, TRUE, &TableIndex); > AcpiExEnterInterpreter (); > if (ACPI_FAILURE (Status)) > @@ -618,7 +618,6 @@ AcpiExUnloadTable ( > ACPI_STATUS Status = AE_OK; > ACPI_OPERAND_OBJECT *TableDesc = DdbHandle; > UINT32 TableIndex; > - ACPI_TABLE_HEADER *Table; > > > ACPI_FUNCTION_TRACE (ExUnloadTable); > @@ -659,42 +658,7 @@ AcpiExUnloadTable ( > * strict order requirement against it. > */ > AcpiExExitInterpreter (); > - > - /* Ensure the table is still loaded */ > - > - if (!AcpiTbIsTableLoaded (TableIndex)) > - { > - Status = AE_NOT_EXIST; > - goto LockAndExit; > - } > - > - /* Invoke table handler if present */ > - > - if (AcpiGbl_TableHandler) > - { > - Status = AcpiGetTableByIndex (TableIndex, &Table); > - if (ACPI_SUCCESS (Status)) > - { > - (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_UNLOAD, Table, > - AcpiGbl_TableHandlerContext); > - } > - } > - > - /* Delete the portion of the namespace owned by this table */ > - > - Status = AcpiTbDeleteNamespaceByOwner (TableIndex); > - if (ACPI_FAILURE (Status)) > - { > - goto LockAndExit; > - } > - > - (void) AcpiTbReleaseOwnerId (TableIndex); > - AcpiTbSetTableLoadedFlag (TableIndex, FALSE); > - > -LockAndExit: > - > - /* Re-acquire the interpreter lock */ > - > + Status = AcpiTbUnloadTable (TableIndex); > AcpiExEnterInterpreter (); > > /* > diff --git a/src/acpica/source/components/executer/exconvrt.c b/src/acpica/source/components/executer/exconvrt.c > index d01657a..b97ed2b 100644 > --- a/src/acpica/source/components/executer/exconvrt.c > +++ b/src/acpica/source/components/executer/exconvrt.c > @@ -717,7 +717,6 @@ AcpiExConvertToTargetType ( > switch (GET_CURRENT_ARG_TYPE (WalkState->OpInfo->RuntimeArgs)) > { > case ARGI_SIMPLE_TARGET: > - case ARGI_FIXED_TARGET: > case ARGI_INTEGER_REF: /* Handles Increment, Decrement cases */ > > switch (DestinationType) > diff --git a/src/acpica/source/components/executer/exresop.c b/src/acpica/source/components/executer/exresop.c > index eacd130..183e131 100644 > --- a/src/acpica/source/components/executer/exresop.c > +++ b/src/acpica/source/components/executer/exresop.c > @@ -393,7 +393,6 @@ AcpiExResolveOperands ( > case ARGI_OBJECT_REF: > case ARGI_DEVICE_REF: > case ARGI_TARGETREF: /* Allows implicit conversion rules before store */ > - case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */ > case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */ > case ARGI_STORE_TARGET: > > diff --git a/src/acpica/source/components/namespace/nsload.c b/src/acpica/source/components/namespace/nsload.c > index f34c48e..1e03215 100644 > --- a/src/acpica/source/components/namespace/nsload.c > +++ b/src/acpica/source/components/namespace/nsload.c > @@ -226,7 +226,9 @@ Unlock: > ACPI_DEBUG_PRINT ((ACPI_DB_INFO, > "**** Begin Table Object Initialization\n")); > > + AcpiExEnterInterpreter (); > Status = AcpiDsInitializeObjects (TableIndex, Node); > + AcpiExExitInterpreter (); > > ACPI_DEBUG_PRINT ((ACPI_DB_INFO, > "**** Completed Table Object Initialization\n")); > diff --git a/src/acpica/source/components/namespace/nsnames.c b/src/acpica/source/components/namespace/nsnames.c > index 8e8fea7..a4e25e3 100644 > --- a/src/acpica/source/components/namespace/nsnames.c > +++ b/src/acpica/source/components/namespace/nsnames.c > @@ -182,6 +182,58 @@ AcpiNsGetPathnameLength ( > > /******************************************************************************* > * > + * FUNCTION: AcpiNsHandleToName > + * > + * PARAMETERS: TargetHandle - Handle of named object whose name is > + * to be found > + * Buffer - Where the name is returned > + * > + * RETURN: Status, Buffer is filled with name if status is AE_OK > + * > + * DESCRIPTION: Build and return a full namespace name > + * > + ******************************************************************************/ > + > +ACPI_STATUS > +AcpiNsHandleToName ( > + ACPI_HANDLE TargetHandle, > + ACPI_BUFFER *Buffer) > +{ > + ACPI_STATUS Status; > + ACPI_NAMESPACE_NODE *Node; > + const char *NodeName; > + > + > + ACPI_FUNCTION_TRACE_PTR (NsHandleToName, TargetHandle); > + > + > + Node = AcpiNsValidateHandle (TargetHandle); > + if (!Node) > + { > + return_ACPI_STATUS (AE_BAD_PARAMETER); > + } > + > + /* Validate/Allocate/Clear caller buffer */ > + > + Status = AcpiUtInitializeBuffer (Buffer, ACPI_PATH_SEGMENT_LENGTH); > + if (ACPI_FAILURE (Status)) > + { > + return_ACPI_STATUS (Status); > + } > + > + /* Just copy the ACPI name from the Node and zero terminate it */ > + > + NodeName = AcpiUtGetNodeName (Node); > + ACPI_MOVE_NAME (Buffer->Pointer, NodeName); > + ((char *) Buffer->Pointer) [ACPI_NAME_SIZE] = 0; > + > + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%4.4s\n", (char *) Buffer->Pointer)); > + return_ACPI_STATUS (AE_OK); > +} > + > + > +/******************************************************************************* > + * > * FUNCTION: AcpiNsHandleToPathname > * > * PARAMETERS: TargetHandle - Handle of named object whose name is > diff --git a/src/acpica/source/components/namespace/nsxfname.c b/src/acpica/source/components/namespace/nsxfname.c > index 9ccdc64..a40444f 100644 > --- a/src/acpica/source/components/namespace/nsxfname.c > +++ b/src/acpica/source/components/namespace/nsxfname.c > @@ -248,8 +248,6 @@ AcpiGetName ( > ACPI_BUFFER *Buffer) > { > ACPI_STATUS Status; > - ACPI_NAMESPACE_NODE *Node; > - const char *NodeName; > > > /* Parameter validation */ > @@ -265,16 +263,6 @@ AcpiGetName ( > return (Status); > } > > - if (NameType == ACPI_FULL_PATHNAME || > - NameType == ACPI_FULL_PATHNAME_NO_TRAILING) > - { > - /* Get the full pathname (From the namespace root) */ > - > - Status = AcpiNsHandleToPathname (Handle, Buffer, > - NameType == ACPI_FULL_PATHNAME ? FALSE : TRUE); > - return (Status); > - } > - > /* > * Wants the single segment ACPI name. > * Validate handle and convert to a namespace Node > @@ -285,30 +273,20 @@ AcpiGetName ( > return (Status); > } > > - Node = AcpiNsValidateHandle (Handle); > - if (!Node) > + if (NameType == ACPI_FULL_PATHNAME || > + NameType == ACPI_FULL_PATHNAME_NO_TRAILING) > { > - Status = AE_BAD_PARAMETER; > - goto UnlockAndExit; > - } > - > - /* Validate/Allocate/Clear caller buffer */ > + /* Get the full pathname (From the namespace root) */ > > - Status = AcpiUtInitializeBuffer (Buffer, ACPI_PATH_SEGMENT_LENGTH); > - if (ACPI_FAILURE (Status)) > - { > - goto UnlockAndExit; > + Status = AcpiNsHandleToPathname (Handle, Buffer, > + NameType == ACPI_FULL_PATHNAME ? FALSE : TRUE); > } > + else > + { > + /* Get the single name */ > > - /* Just copy the ACPI name from the Node and zero terminate it */ > - > - NodeName = AcpiUtGetNodeName (Node); > - ACPI_MOVE_NAME (Buffer->Pointer, NodeName); > - ((char *) Buffer->Pointer) [ACPI_NAME_SIZE] = 0; > - Status = AE_OK; > - > - > -UnlockAndExit: > + Status = AcpiNsHandleToName (Handle, Buffer); > + } > > (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); > return (Status); > diff --git a/src/acpica/source/components/parser/psargs.c b/src/acpica/source/components/parser/psargs.c > index db2fdd8..9b3d6a8 100644 > --- a/src/acpica/source/components/parser/psargs.c > +++ b/src/acpica/source/components/parser/psargs.c > @@ -370,23 +370,12 @@ AcpiPsGetNextNamepath ( > PossibleMethodCall && > (Node->Type == ACPI_TYPE_METHOD)) > { > - if (WalkState->Opcode == AML_UNLOAD_OP) > - { > - /* > - * AcpiPsGetNextNamestring has increased the AML pointer, > - * so we need to restore the saved AML pointer for method call. > - */ > - WalkState->ParserState.Aml = Start; > - WalkState->ArgCount = 1; > - AcpiPsInitOp (Arg, AML_INT_METHODCALL_OP); > - return_ACPI_STATUS (AE_OK); > - } > - > /* This name is actually a control method invocation */ > > MethodDesc = AcpiNsGetAttachedObject (Node); > ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, > - "Control Method - %p Desc %p Path=%p\n", Node, MethodDesc, Path)); > + "Control Method invocation %4.4s - %p Desc %p Path=%p\n", > + Node->Name.Ascii, Node, MethodDesc, Path)); > > NameOp = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, Start); > if (!NameOp) > @@ -843,6 +832,10 @@ AcpiPsGetNextArg ( > ACPI_FUNCTION_TRACE_PTR (PsGetNextArg, ParserState); > > > + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, > + "Expected argument type ARGP: %s (%2.2X)\n", > + AcpiUtGetArgumentTypeName (ArgType), ArgType)); > + > switch (ArgType) > { > case ARGP_BYTEDATA: > @@ -926,11 +919,13 @@ AcpiPsGetNextArg ( > } > break; > > - case ARGP_TARGET: > - case ARGP_SUPERNAME: > case ARGP_SIMPLENAME: > case ARGP_NAME_OR_REF: > > + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, > + "**** SimpleName/NameOrRef: %s (%2.2X)\n", > + AcpiUtGetArgumentTypeName (ArgType), ArgType)); > + > Subop = AcpiPsPeekOpcode (ParserState); > if (Subop == 0 || > AcpiPsIsLeadingChar (Subop) || > @@ -945,28 +940,37 @@ AcpiPsGetNextArg ( > return_ACPI_STATUS (AE_NO_MEMORY); > } > > - /* To support SuperName arg of Unload */ > + Status = AcpiPsGetNextNamepath (WalkState, ParserState, > + Arg, ACPI_NOT_METHOD_CALL); > + } > + else > + { > + /* Single complex argument, nothing returned */ > > - if (WalkState->Opcode == AML_UNLOAD_OP) > - { > - Status = AcpiPsGetNextNamepath (WalkState, ParserState, > - Arg, ACPI_POSSIBLE_METHOD_CALL); > - > - /* > - * If the SuperName argument is a method call, we have > - * already restored the AML pointer, just free this Arg > - */ > - if (Arg->Common.AmlOpcode == AML_INT_METHODCALL_OP) > - { > - AcpiPsFreeOp (Arg); > - Arg = NULL; > - } > - } > - else > + WalkState->ArgCount = 1; > + } > + break; > + > + case ARGP_TARGET: > + case ARGP_SUPERNAME: > + > + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, > + "**** Target/Supername: %s (%2.2X)\n", > + AcpiUtGetArgumentTypeName (ArgType), ArgType)); > + > + Subop = AcpiPsPeekOpcode (ParserState); > + if (Subop == 0) > + { > + /* NULL target (zero). Convert to a NULL namepath */ > + > + Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, ParserState->Aml); > + if (!Arg) > { > - Status = AcpiPsGetNextNamepath (WalkState, ParserState, > - Arg, ACPI_NOT_METHOD_CALL); > + return_ACPI_STATUS (AE_NO_MEMORY); > } > + > + Status = AcpiPsGetNextNamepath (WalkState, ParserState, > + Arg, ACPI_POSSIBLE_METHOD_CALL); > } > else > { > @@ -979,6 +983,11 @@ AcpiPsGetNextArg ( > case ARGP_DATAOBJ: > case ARGP_TERMARG: > > + > + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, > + "**** TermArg/DataObj: %s (%2.2X)\n", > + AcpiUtGetArgumentTypeName (ArgType), ArgType)); > + > /* Single complex argument, nothing returned */ > > WalkState->ArgCount = 1; > diff --git a/src/acpica/source/components/parser/psloop.c b/src/acpica/source/components/parser/psloop.c > index 393becf..067424d 100644 > --- a/src/acpica/source/components/parser/psloop.c > +++ b/src/acpica/source/components/parser/psloop.c > @@ -176,6 +176,9 @@ AcpiPsGetArguments ( > ACPI_FUNCTION_TRACE_PTR (PsGetArguments, WalkState); > > > + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, > + "Get arguments for opcode [%s]\n", Op->Common.AmlOpName)); > + > switch (Op->Common.AmlOpcode) > { > case AML_BYTE_OP: /* AML_BYTEDATA_ARG */ > diff --git a/src/acpica/source/components/parser/psobject.c b/src/acpica/source/components/parser/psobject.c > index adce94c..efefc6e 100644 > --- a/src/acpica/source/components/parser/psobject.c > +++ b/src/acpica/source/components/parser/psobject.c > @@ -445,7 +445,13 @@ AcpiPsCreateOp ( > Op->Common.Flags |= ACPI_PARSEOP_TARGET; > } > } > - else if (ParentScope->Common.AmlOpcode == AML_INCREMENT_OP) > + > + /* > + * Special case for both Increment() and Decrement(), where > + * the lone argument is both a source and a target. > + */ > + else if ((ParentScope->Common.AmlOpcode == AML_INCREMENT_OP) || > + (ParentScope->Common.AmlOpcode == AML_DECREMENT_OP)) > { > Op->Common.Flags |= ACPI_PARSEOP_TARGET; > } > diff --git a/src/acpica/source/components/parser/pstree.c b/src/acpica/source/components/parser/pstree.c > index c9737f2..ec059ec 100644 > --- a/src/acpica/source/components/parser/pstree.c > +++ b/src/acpica/source/components/parser/pstree.c > @@ -214,12 +214,12 @@ AcpiPsAppendArg ( > const ACPI_OPCODE_INFO *OpInfo; > > > - ACPI_FUNCTION_ENTRY (); > + ACPI_FUNCTION_TRACE ("PsAppendArg"); > > > if (!Op) > { > - return; > + return_VOID; > } > > /* Get the info structure for this opcode */ > @@ -231,7 +231,7 @@ AcpiPsAppendArg ( > > ACPI_ERROR ((AE_INFO, "Invalid AML Opcode: 0x%2.2X", > Op->Common.AmlOpcode)); > - return; > + return_VOID; > } > > /* Check if this opcode requires argument sub-objects */ > @@ -240,7 +240,7 @@ AcpiPsAppendArg ( > { > /* Has no linked argument objects */ > > - return; > + return_VOID; > } > > /* Append the argument to the linked argument list */ > @@ -272,6 +272,8 @@ AcpiPsAppendArg ( > > Op->Common.ArgListLength++; > } > + > + return_VOID; > } > > > diff --git a/src/acpica/source/components/tables/tbdata.c b/src/acpica/source/components/tables/tbdata.c > index 4136047..2a096f3 100644 > --- a/src/acpica/source/components/tables/tbdata.c > +++ b/src/acpica/source/components/tables/tbdata.c > @@ -1009,9 +1009,9 @@ AcpiTbLoadTable ( > * > * FUNCTION: AcpiTbInstallAndLoadTable > * > - * PARAMETERS: Table - Pointer to the table > - * Address - Physical address of the table > + * PARAMETERS: Address - Physical address of the table > * Flags - Allocation flags of the table > + * Override - Whether override should be performed > * TableIndex - Where table index is returned > * > * RETURN: Status > @@ -1022,7 +1022,6 @@ AcpiTbLoadTable ( > > ACPI_STATUS > AcpiTbInstallAndLoadTable ( > - ACPI_TABLE_HEADER *Table, > ACPI_PHYSICAL_ADDRESS Address, > UINT8 Flags, > BOOLEAN Override, > @@ -1030,10 +1029,9 @@ AcpiTbInstallAndLoadTable ( > { > ACPI_STATUS Status; > UINT32 i; > - ACPI_OWNER_ID OwnerId; > > > - ACPI_FUNCTION_TRACE (AcpiLoadTable); > + ACPI_FUNCTION_TRACE (TbInstallAndLoadTable); > > > (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); > @@ -1047,48 +1045,68 @@ AcpiTbInstallAndLoadTable ( > goto UnlockAndExit; > } > > - /* > - * Note: Now table is "INSTALLED", it must be validated before > - * using. > - */ > - Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[i]); > - if (ACPI_FAILURE (Status)) > - { > - goto UnlockAndExit; > - } > + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); > + Status = AcpiTbLoadTable (i, AcpiGbl_RootNode); > + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); > > +UnlockAndExit: > + *TableIndex = i; > (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); > - Status = AcpiNsLoadTable (i, AcpiGbl_RootNode); > + return_ACPI_STATUS (Status); > +} > > - /* Execute any module-level code that was found in the table */ > > - if (!AcpiGbl_ParseTableAsTermList && AcpiGbl_GroupModuleLevelCode) > - { > - AcpiNsExecModuleCodeList (); > - } > +/******************************************************************************* > + * > + * FUNCTION: AcpiTbUnloadTable > + * > + * PARAMETERS: TableIndex - Table index > + * > + * RETURN: Status > + * > + * DESCRIPTION: Unload an ACPI table > + * > + ******************************************************************************/ > > - /* > - * Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is > - * responsible for discovering any new wake GPEs by running _PRW methods > - * that may have been loaded by this table. > - */ > - Status = AcpiTbGetOwnerId (i, &OwnerId); > - if (ACPI_SUCCESS (Status)) > +ACPI_STATUS > +AcpiTbUnloadTable ( > + UINT32 TableIndex) > +{ > + ACPI_STATUS Status = AE_OK; > + ACPI_TABLE_HEADER *Table; > + > + > + ACPI_FUNCTION_TRACE (TbUnloadTable); > + > + > + /* Ensure the table is still loaded */ > + > + if (!AcpiTbIsTableLoaded (TableIndex)) > { > - AcpiEvUpdateGpes (OwnerId); > + return_ACPI_STATUS (AE_NOT_EXIST); > } > > /* Invoke table handler if present */ > > if (AcpiGbl_TableHandler) > { > - (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table, > - AcpiGbl_TableHandlerContext); > + Status = AcpiGetTableByIndex (TableIndex, &Table); > + if (ACPI_SUCCESS (Status)) > + { > + (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_UNLOAD, Table, > + AcpiGbl_TableHandlerContext); > + } > } > - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); > > -UnlockAndExit: > - *TableIndex = i; > - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); > + /* Delete the portion of the namespace owned by this table */ > + > + Status = AcpiTbDeleteNamespaceByOwner (TableIndex); > + if (ACPI_FAILURE (Status)) > + { > + return_ACPI_STATUS (Status); > + } > + > + (void) AcpiTbReleaseOwnerId (TableIndex); > + AcpiTbSetTableLoadedFlag (TableIndex, FALSE); > return_ACPI_STATUS (Status); > } > diff --git a/src/acpica/source/components/tables/tbfadt.c b/src/acpica/source/components/tables/tbfadt.c > index 89c6c0e..f3b6c1c 100644 > --- a/src/acpica/source/components/tables/tbfadt.c > +++ b/src/acpica/source/components/tables/tbfadt.c > @@ -413,6 +413,8 @@ AcpiTbParseFadt ( > { > UINT32 Length; > ACPI_TABLE_HEADER *Table; > + ACPI_TABLE_DESC *FadtDesc; > + ACPI_STATUS Status; > > > /* > @@ -422,14 +424,13 @@ AcpiTbParseFadt ( > * Get a local copy of the FADT and convert it to a common format > * Map entire FADT, assumed to be smaller than one page. > */ > - Length = AcpiGbl_RootTableList.Tables[AcpiGbl_FadtIndex].Length; > - > - Table = AcpiOsMapMemory ( > - AcpiGbl_RootTableList.Tables[AcpiGbl_FadtIndex].Address, Length); > - if (!Table) > + FadtDesc = &AcpiGbl_RootTableList.Tables[AcpiGbl_FadtIndex]; > + Status = AcpiTbGetTable (FadtDesc, &Table); > + if (ACPI_FAILURE (Status)) > { > return; > } > + Length = FadtDesc->Length; > > /* > * Validate the FADT checksum before we copy the table. Ignore > @@ -443,7 +444,7 @@ AcpiTbParseFadt ( > > /* All done with the real FADT, unmap it */ > > - AcpiOsUnmapMemory (Table, Length); > + AcpiTbPutTable (FadtDesc); > > /* Obtain the DSDT and FACS tables via their addresses within the FADT */ > > @@ -594,19 +595,17 @@ AcpiTbConvertFadt ( > > > /* > - * For ACPI 1.0 FADTs (revision 1), ensure that reserved fields which > + * For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which > * should be zero are indeed zero. This will workaround BIOSs that > * inadvertently place values in these fields. > * > * The ACPI 1.0 reserved fields that will be zeroed are the bytes located > * at offset 45, 55, 95, and the word located at offset 109, 110. > * > - * Note: The FADT revision value is unreliable because of BIOS errors. > - * The table length is instead used as the final word on the version. > - * > - * Note: FADT revision 3 is the ACPI 2.0 version of the FADT. > + * Note: The FADT revision value is unreliable. Only the length can be > + * trusted. > */ > - if (AcpiGbl_FADT.Header.Length <= ACPI_FADT_V3_SIZE) > + if (AcpiGbl_FADT.Header.Length <= ACPI_FADT_V2_SIZE) > { > AcpiGbl_FADT.PreferredProfile = 0; > AcpiGbl_FADT.PstateControl = 0; > diff --git a/src/acpica/source/components/tables/tbutils.c b/src/acpica/source/components/tables/tbutils.c > index f270b94..6ca5e77 100644 > --- a/src/acpica/source/components/tables/tbutils.c > +++ b/src/acpica/source/components/tables/tbutils.c > @@ -483,3 +483,99 @@ NextTable: > AcpiOsUnmapMemory (Table, Length); > return_ACPI_STATUS (AE_OK); > } > + > + > +/******************************************************************************* > + * > + * FUNCTION: AcpiTbGetTable > + * > + * PARAMETERS: TableDesc - Table descriptor > + * OutTable - Where the pointer to the table is returned > + * > + * RETURN: Status and pointer to the requested table > + * > + * DESCRIPTION: Increase a reference to a table descriptor and return the > + * validated table pointer. > + * If the table descriptor is an entry of the root table list, > + * this API must be invoked with ACPI_MTX_TABLES acquired. > + * > + ******************************************************************************/ > + > +ACPI_STATUS > +AcpiTbGetTable ( > + ACPI_TABLE_DESC *TableDesc, > + ACPI_TABLE_HEADER **OutTable) > +{ > + ACPI_STATUS Status; > + > + > + ACPI_FUNCTION_TRACE (AcpiTbGetTable); > + > + > + if (TableDesc->ValidationCount == 0) > + { > + /* Table need to be "VALIDATED" */ > + > + Status = AcpiTbValidateTable (TableDesc); > + if (ACPI_FAILURE (Status)) > + { > + return_ACPI_STATUS (Status); > + } > + } > + > + TableDesc->ValidationCount++; > + if (TableDesc->ValidationCount == 0) > + { > + ACPI_ERROR ((AE_INFO, > + "Table %p, Validation count is zero after increment\n", > + TableDesc)); > + TableDesc->ValidationCount--; > + return_ACPI_STATUS (AE_LIMIT); > + } > + > + *OutTable = TableDesc->Pointer; > + return_ACPI_STATUS (AE_OK); > +} > + > + > +/******************************************************************************* > + * > + * FUNCTION: AcpiTbPutTable > + * > + * PARAMETERS: TableDesc - Table descriptor > + * > + * RETURN: None > + * > + * DESCRIPTION: Decrease a reference to a table descriptor and release the > + * validated table pointer if no references. > + * If the table descriptor is an entry of the root table list, > + * this API must be invoked with ACPI_MTX_TABLES acquired. > + * > + ******************************************************************************/ > + > +void > +AcpiTbPutTable ( > + ACPI_TABLE_DESC *TableDesc) > +{ > + > + ACPI_FUNCTION_TRACE (AcpiTbPutTable); > + > + > + if (TableDesc->ValidationCount == 0) > + { > + ACPI_WARNING ((AE_INFO, > + "Table %p, Validation count is zero before decrement\n", > + TableDesc)); > + return_VOID; > + } > + TableDesc->ValidationCount--; > + > + if (TableDesc->ValidationCount == 0) > + { > + /* Table need to be "INVALIDATED" */ > + > + AcpiTbInvalidateTable (TableDesc); > + } > + > + return_VOID; > +} > diff --git a/src/acpica/source/components/tables/tbxface.c b/src/acpica/source/components/tables/tbxface.c > index 9ac9dc1..b8026f7 100644 > --- a/src/acpica/source/components/tables/tbxface.c > +++ b/src/acpica/source/components/tables/tbxface.c > @@ -256,6 +256,7 @@ AcpiReallocateRootTable ( > void) > { > ACPI_STATUS Status; > + UINT32 i; > > > ACPI_FUNCTION_TRACE (AcpiReallocateRootTable); > @@ -270,6 +271,22 @@ AcpiReallocateRootTable ( > return_ACPI_STATUS (AE_SUPPORT); > } > > + /* > + * Ensure OS early boot logic, which is required by some hosts. If the > + * table state is reported to be wrong, developers should fix the > + * issue by invoking AcpiPutTable() for the reported table during the > + * early stage. > + */ > + for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) > + { > + if (AcpiGbl_RootTableList.Tables[i].Pointer) > + { > + ACPI_ERROR ((AE_INFO, > + "Table [%4.4s] is not invalidated during early boot stage", > + AcpiGbl_RootTableList.Tables[i].Signature.Ascii)); > + } > + } > + > AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ALLOW_RESIZE; > > Status = AcpiTbResizeRootTableList (); > @@ -379,6 +396,11 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader) > * > * DESCRIPTION: Finds and verifies an ACPI table. Table must be in the > * RSDT/XSDT. > + * Note that an early stage AcpiGetTable() call must be paired > + * with an early stage AcpiPutTable() call. otherwise the table > + * pointer mapped by the early stage mapping implementation may be > + * erroneously unmapped by the late stage unmapping implementation > + * in an AcpiPutTable() invoked during the late stage. > * > ******************************************************************************/ > > @@ -390,7 +412,8 @@ AcpiGetTable ( > { > UINT32 i; > UINT32 j; > - ACPI_STATUS Status; > + ACPI_STATUS Status = AE_NOT_FOUND; > + ACPI_TABLE_DESC *TableDesc; > > > /* Parameter validation */ > @@ -400,12 +423,22 @@ AcpiGetTable ( > return (AE_BAD_PARAMETER); > } > > + /* > + * Note that the following line is required by some OSPMs, they only > + * check if the returned table is NULL instead of the returned status > + * to determined if this function is succeeded. > + */ > + *OutTable = NULL; > + > + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); > + > /* Walk the root table list */ > > for (i = 0, j = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++) > { > - if (!ACPI_COMPARE_NAME ( > - &(AcpiGbl_RootTableList.Tables[i].Signature), Signature)) > + TableDesc = &AcpiGbl_RootTableList.Tables[i]; > + > + if (!ACPI_COMPARE_NAME (&TableDesc->Signature, Signature)) > { > continue; > } > @@ -415,19 +448,66 @@ AcpiGetTable ( > continue; > } > > - Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[i]); > - if (ACPI_SUCCESS (Status)) > + Status = AcpiTbGetTable (TableDesc, OutTable); > + break; > + } > + > + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); > + return (Status); > +} > + > +ACPI_EXPORT_SYMBOL (AcpiGetTable) > + > + > +/******************************************************************************* > + * > + * FUNCTION: AcpiPutTable > + * > + * PARAMETERS: Table - The pointer to the table > + * > + * RETURN: None > + * > + * DESCRIPTION: Release a table returned by AcpiGetTable() and its clones. > + * Note that it is not safe if this function was invoked after an > + * uninstallation happened to the original table descriptor. > + * Currently there is no OSPMs' requirement to handle such > + * situations. > + * > + ******************************************************************************/ > + > +void > +AcpiPutTable ( > + ACPI_TABLE_HEADER *Table) > +{ > + UINT32 i; > + ACPI_TABLE_DESC *TableDesc; > + > + > + ACPI_FUNCTION_TRACE (AcpiPutTable); > + > + > + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); > + > + /* Walk the root table list */ > + > + for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++) > + { > + TableDesc = &AcpiGbl_RootTableList.Tables[i]; > + > + if (TableDesc->Pointer != Table) > { > - *OutTable = AcpiGbl_RootTableList.Tables[i].Pointer; > + continue; > } > > - return (Status); > + AcpiTbPutTable (TableDesc); > + break; > } > > - return (AE_NOT_FOUND); > + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); > + return_VOID; > } > > -ACPI_EXPORT_SYMBOL (AcpiGetTable) > +ACPI_EXPORT_SYMBOL (AcpiPutTable) > > > /******************************************************************************* > @@ -435,7 +515,7 @@ ACPI_EXPORT_SYMBOL (AcpiGetTable) > * FUNCTION: AcpiGetTableByIndex > * > * PARAMETERS: TableIndex - Table index > - * Table - Where the pointer to the table is returned > + * OutTable - Where the pointer to the table is returned > * > * RETURN: Status and pointer to the requested table > * > @@ -447,7 +527,7 @@ ACPI_EXPORT_SYMBOL (AcpiGetTable) > ACPI_STATUS > AcpiGetTableByIndex ( > UINT32 TableIndex, > - ACPI_TABLE_HEADER **Table) > + ACPI_TABLE_HEADER **OutTable) > { > ACPI_STATUS Status; > > @@ -457,37 +537,34 @@ AcpiGetTableByIndex ( > > /* Parameter validation */ > > - if (!Table) > + if (!OutTable) > { > return_ACPI_STATUS (AE_BAD_PARAMETER); > } > > + /* > + * Note that the following line is required by some OSPMs, they only > + * check if the returned table is NULL instead of the returned status > + * to determined if this function is succeeded. > + */ > + *OutTable = NULL; > + > (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); > > /* Validate index */ > > if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount) > { > - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); > - return_ACPI_STATUS (AE_BAD_PARAMETER); > + Status = AE_BAD_PARAMETER; > + goto UnlockAndExit; > } > > - if (!AcpiGbl_RootTableList.Tables[TableIndex].Pointer) > - { > - /* Table is not mapped, map it */ > - > - Status = AcpiTbValidateTable ( > - &AcpiGbl_RootTableList.Tables[TableIndex]); > - if (ACPI_FAILURE (Status)) > - { > - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); > - return_ACPI_STATUS (Status); > - } > - } > + Status = AcpiTbGetTable ( > + &AcpiGbl_RootTableList.Tables[TableIndex], OutTable); > > - *Table = AcpiGbl_RootTableList.Tables[TableIndex].Pointer; > +UnlockAndExit: > (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); > - return_ACPI_STATUS (AE_OK); > + return_ACPI_STATUS (Status); > } > > ACPI_EXPORT_SYMBOL (AcpiGetTableByIndex) > diff --git a/src/acpica/source/components/tables/tbxfload.c b/src/acpica/source/components/tables/tbxfload.c > index aa826fe..f43a400 100644 > --- a/src/acpica/source/components/tables/tbxfload.c > +++ b/src/acpica/source/components/tables/tbxfload.c > @@ -444,7 +444,7 @@ AcpiLoadTable ( > /* Install the table and load it into the namespace */ > > ACPI_INFO (("Host-directed Dynamic ACPI Table Load:")); > - Status = AcpiTbInstallAndLoadTable (Table, ACPI_PTR_TO_PHYSADDR (Table), > + Status = AcpiTbInstallAndLoadTable (ACPI_PTR_TO_PHYSADDR (Table), > ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, FALSE, &TableIndex); > return_ACPI_STATUS (Status); > } > @@ -531,39 +531,8 @@ AcpiUnloadParentTable ( > break; > } > > - /* Ensure the table is actually loaded */ > - > (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); > - if (!AcpiTbIsTableLoaded (i)) > - { > - Status = AE_NOT_EXIST; > - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); > - break; > - } > - > - /* Invoke table handler if present */ > - > - if (AcpiGbl_TableHandler) > - { > - (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_UNLOAD, > - AcpiGbl_RootTableList.Tables[i].Pointer, > - AcpiGbl_TableHandlerContext); > - } > - > - /* > - * Delete all namespace objects owned by this table. Note that > - * these objects can appear anywhere in the namespace by virtue > - * of the AML "Scope" operator. Thus, we need to track ownership > - * by an ID, not simply a position within the hierarchy. > - */ > - Status = AcpiTbDeleteNamespaceByOwner (i); > - if (ACPI_FAILURE (Status)) > - { > - break; > - } > - > - Status = AcpiTbReleaseOwnerId (i); > - AcpiTbSetTableLoadedFlag (i, FALSE); > + Status = AcpiTbUnloadTable (i); > (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); > break; > } > diff --git a/src/acpica/source/components/utilities/utdecode.c b/src/acpica/source/components/utilities/utdecode.c > index dcfdfee..f27bf0f 100644 > --- a/src/acpica/source/components/utilities/utdecode.c > +++ b/src/acpica/source/components/utilities/utdecode.c > @@ -116,6 +116,7 @@ > #include "acpi.h" > #include "accommon.h" > #include "acnamesp.h" > +#include "amlcode.h" > > #define _COMPONENT ACPI_UTILITIES > ACPI_MODULE_NAME ("utdecode") > @@ -676,6 +677,59 @@ AcpiUtGetNotifyName ( > > return ("Hardware-Specific"); > } > + > + > +/******************************************************************************* > + * > + * FUNCTION: AcpiUtGetArgumentTypeName > + * > + * PARAMETERS: ArgType - an ARGP_* parser argument type > + * > + * RETURN: Decoded ARGP_* type > + * > + * DESCRIPTION: Decode an ARGP_* parser type, as defined in the amlcode.h file, > + * and used in the acopcode.h file. For example, ARGP_TERMARG. > + * Used for debug only. > + * > + ******************************************************************************/ > + > +static const char *AcpiGbl_ArgumentType[20] = > +{ > + /* 00 */ "Unknown ARGP", > + /* 01 */ "ByteData", > + /* 02 */ "ByteList", > + /* 03 */ "CharList", > + /* 04 */ "DataObject", > + /* 05 */ "DataObjectList", > + /* 06 */ "DWordData", > + /* 07 */ "FieldList", > + /* 08 */ "Name", > + /* 09 */ "NameString", > + /* 0A */ "ObjectList", > + /* 0B */ "PackageLength", > + /* 0C */ "SuperName", > + /* 0D */ "Target", > + /* 0E */ "TermArg", > + /* 0F */ "TermList", > + /* 10 */ "WordData", > + /* 11 */ "QWordData", > + /* 12 */ "SimpleName", > + /* 13 */ "NameOrRef" > +}; > + > +const char * > +AcpiUtGetArgumentTypeName ( > + UINT32 ArgType) > +{ > + > + if (ArgType > ARGP_MAX) > + { > + return ("Unknown ARGP"); > + } > + > + return (AcpiGbl_ArgumentType[ArgType]); > +} > + > #endif > > > diff --git a/src/acpica/source/components/utilities/utresrc.c b/src/acpica/source/components/utilities/utresrc.c > index de0ca6e..9c3823c 100644 > --- a/src/acpica/source/components/utilities/utresrc.c > +++ b/src/acpica/source/components/utilities/utresrc.c > @@ -540,9 +540,11 @@ AcpiUtWalkAmlResources ( > ACPI_FUNCTION_TRACE (UtWalkAmlResources); > > > - /* The absolute minimum resource template is one EndTag descriptor */ > - > - if (AmlLength < sizeof (AML_RESOURCE_END_TAG)) > + /* > + * 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)) > { > return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG); > } > @@ -575,8 +577,8 @@ AcpiUtWalkAmlResources ( > > if (UserFunction) > { > - Status = UserFunction ( > - Aml, Length, Offset, ResourceIndex, Context); > + Status = UserFunction (Aml, Length, Offset, > + ResourceIndex, Context); > if (ACPI_FAILURE (Status)) > { > return_ACPI_STATUS (Status); > @@ -603,6 +605,13 @@ AcpiUtWalkAmlResources ( > *Context = Aml; > } > > + /* Check if buffer is defined to be longer than the resource length */ > + > + if (AmlLength > (Offset + Length)) > + { > + return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG); > + } > + > /* Normal exit */ > > return_ACPI_STATUS (AE_OK); > diff --git a/src/acpica/source/include/acdisasm.h b/src/acpica/source/include/acdisasm.h > index 640ecf5..9c01d88 100644 > --- a/src/acpica/source/include/acdisasm.h > +++ b/src/acpica/source/include/acdisasm.h > @@ -352,8 +352,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst0[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoFacs[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[]; > +extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[]; > -extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt4[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt6[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt[]; > @@ -497,9 +497,6 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoXenv[]; > > extern ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2]; > > -extern ACPI_DMTABLE_INFO *FadtRevisionInfo [ACPI_FADT_MAX_VERSION + 1]; > - > - > /* > * dmtable and ahtable > */ > diff --git a/src/acpica/source/include/acevents.h b/src/acpica/source/include/acevents.h > index 8a40d28..0f935ea 100644 > --- a/src/acpica/source/include/acevents.h > +++ b/src/acpica/source/include/acevents.h > @@ -408,8 +408,7 @@ AcpiEvDefaultRegionSetup ( > > ACPI_STATUS > AcpiEvInitializeRegion ( > - ACPI_OPERAND_OBJECT *RegionObj, > - BOOLEAN AcpiNsLocked); > + ACPI_OPERAND_OBJECT *RegionObj); > > > /* > diff --git a/src/acpica/source/include/acnamesp.h b/src/acpica/source/include/acnamesp.h > index 9fc9873..6fb0f27 100644 > --- a/src/acpica/source/include/acnamesp.h > +++ b/src/acpica/source/include/acnamesp.h > @@ -457,6 +457,11 @@ AcpiNsNameOfCurrentScope ( > ACPI_WALK_STATE *WalkState); > > ACPI_STATUS > +AcpiNsHandleToName ( > + ACPI_HANDLE TargetHandle, > + ACPI_BUFFER *Buffer); > + > +ACPI_STATUS > AcpiNsHandleToPathname ( > ACPI_HANDLE TargetHandle, > ACPI_BUFFER *Buffer, > diff --git a/src/acpica/source/include/acopcode.h b/src/acpica/source/include/acopcode.h > index 296b789..079e74a 100644 > --- a/src/acpica/source/include/acopcode.h > +++ b/src/acpica/source/include/acopcode.h > @@ -165,7 +165,7 @@ > #define ARGP_BYTELIST_OP ARGP_LIST1 (ARGP_NAMESTRING) > #define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) > #define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) > -#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_NAME_OR_REF,ARGP_TARGET) > +#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SIMPLENAME, ARGP_TARGET) > #define ARGP_CONNECTFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING) > #define ARGP_CONTINUE_OP ARG_NONE > #define ARGP_COPY_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SIMPLENAME) > @@ -178,7 +178,7 @@ > #define ARGP_DATA_REGION_OP ARGP_LIST4 (ARGP_NAME, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG) > #define ARGP_DEBUG_OP ARG_NONE > #define ARGP_DECREMENT_OP ARGP_LIST1 (ARGP_SUPERNAME) > -#define ARGP_DEREF_OF_OP ARGP_LIST1 (ARGP_TERMARG) > +#define ARGP_DEREF_OF_OP ARGP_LIST1 (ARGP_SUPERNAME) > #define ARGP_DEVICE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_OBJLIST) > #define ARGP_DIVIDE_OP ARGP_LIST4 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET, ARGP_TARGET) > #define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA) > @@ -225,14 +225,14 @@ > #define ARGP_NAMEPATH_OP ARGP_LIST1 (ARGP_NAMESTRING) > #define ARGP_NOOP_OP ARG_NONE > #define ARGP_NOTIFY_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_TERMARG) > -#define ARGP_OBJECT_TYPE_OP ARGP_LIST1 (ARGP_NAME_OR_REF) > +#define ARGP_OBJECT_TYPE_OP ARGP_LIST1 (ARGP_SIMPLENAME) > #define ARGP_ONE_OP ARG_NONE > #define ARGP_ONES_OP ARG_NONE > #define ARGP_PACKAGE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_BYTEDATA, ARGP_DATAOBJLIST) > #define ARGP_POWER_RES_OP ARGP_LIST5 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_WORDDATA, ARGP_OBJLIST) > #define ARGP_PROCESSOR_OP ARGP_LIST6 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_BYTEDATA, ARGP_OBJLIST) > #define ARGP_QWORD_OP ARGP_LIST1 (ARGP_QWORDDATA) > -#define ARGP_REF_OF_OP ARGP_LIST1 (ARGP_NAME_OR_REF) > +#define ARGP_REF_OF_OP ARGP_LIST1 (ARGP_SIMPLENAME) > #define ARGP_REGION_OP ARGP_LIST4 (ARGP_NAME, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_TERMARG) > #define ARGP_RELEASE_OP ARGP_LIST1 (ARGP_SUPERNAME) > #define ARGP_RESERVEDFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING) > @@ -323,7 +323,7 @@ > #define ARGI_FIELD_OP ARGI_INVALID_OPCODE > #define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) > #define ARGI_FIND_SET_RIGHT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) > -#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET) > +#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) > #define ARGI_IF_OP ARGI_INVALID_OPCODE > #define ARGI_INCREMENT_OP ARGI_LIST1 (ARGI_TARGETREF) > #define ARGI_INDEX_FIELD_OP ARGI_INVALID_OPCODE > @@ -387,12 +387,12 @@ > #define ARGI_SUBTRACT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) > #define ARGI_THERMAL_ZONE_OP ARGI_INVALID_OPCODE > #define ARGI_TIMER_OP ARG_NONE > -#define ARGI_TO_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET) > -#define ARGI_TO_BUFFER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET) > -#define ARGI_TO_DEC_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET) > -#define ARGI_TO_HEX_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET) > -#define ARGI_TO_INTEGER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET) > -#define ARGI_TO_STRING_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_FIXED_TARGET) > +#define ARGI_TO_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) > +#define ARGI_TO_BUFFER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF) > +#define ARGI_TO_DEC_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF) > +#define ARGI_TO_HEX_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF) > +#define ARGI_TO_INTEGER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF) > +#define ARGI_TO_STRING_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_TARGETREF) > #define ARGI_UNLOAD_OP ARGI_LIST1 (ARGI_DDBHANDLE) > #define ARGI_VAR_PACKAGE_OP ARGI_LIST1 (ARGI_INTEGER) > #define ARGI_WAIT_OP ARGI_LIST2 (ARGI_EVENT, ARGI_INTEGER) > diff --git a/src/acpica/source/include/acpixf.h b/src/acpica/source/include/acpixf.h > index 8efd759..479404b 100644 > --- a/src/acpica/source/include/acpixf.h > +++ b/src/acpica/source/include/acpixf.h > @@ -118,7 +118,7 @@ > > /* Current ACPICA subsystem version in YYYYMMDD format */ > > -#define ACPI_CA_VERSION 0x20160930 > +#define ACPI_CA_VERSION 0x20161117 > > #include "acconfig.h" > #include "actypes.h" > @@ -654,6 +654,11 @@ AcpiGetTable ( > UINT32 Instance, > ACPI_TABLE_HEADER **OutTable)) > > +ACPI_EXTERNAL_RETURN_VOID ( > +void > +AcpiPutTable ( > + ACPI_TABLE_HEADER *Table)) > + > ACPI_EXTERNAL_RETURN_STATUS ( > ACPI_STATUS > AcpiGetTableByIndex ( > diff --git a/src/acpica/source/include/actables.h b/src/acpica/source/include/actables.h > index e73430f..c5e9916 100644 > --- a/src/acpica/source/include/actables.h > +++ b/src/acpica/source/include/actables.h > @@ -257,12 +257,15 @@ AcpiTbLoadTable ( > > ACPI_STATUS > AcpiTbInstallAndLoadTable ( > - ACPI_TABLE_HEADER *Table, > ACPI_PHYSICAL_ADDRESS Address, > UINT8 Flags, > BOOLEAN Override, > UINT32 *TableIndex); > > +ACPI_STATUS > +AcpiTbUnloadTable ( > + UINT32 TableIndex); > + > void > AcpiTbTerminate ( > void); > @@ -325,6 +328,15 @@ ACPI_STATUS > AcpiTbParseRootTable ( > ACPI_PHYSICAL_ADDRESS RsdpAddress); > > +ACPI_STATUS > +AcpiTbGetTable ( > + ACPI_TABLE_DESC *TableDesc, > + ACPI_TABLE_HEADER **OutTable); > + > +void > +AcpiTbPutTable ( > + ACPI_TABLE_DESC *TableDesc); > + > > /* > * tbxfload > diff --git a/src/acpica/source/include/actbl.h b/src/acpica/source/include/actbl.h > index 3c73998..4d7fd8a 100644 > --- a/src/acpica/source/include/actbl.h > +++ b/src/acpica/source/include/actbl.h > @@ -328,72 +328,62 @@ typedef struct acpi_table_facs > > typedef struct acpi_table_fadt > { > - ACPI_TABLE_HEADER Header; /* [V1] Common ACPI table header */ > - UINT32 Facs; /* [V1] 32-bit physical address of FACS */ > - UINT32 Dsdt; /* [V1] 32-bit physical address of DSDT */ > - UINT8 Model; /* [V1] System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */ > - UINT8 PreferredProfile; /* [V1] Conveys preferred power management profile to OSPM. */ > - UINT16 SciInterrupt; /* [V1] System vector of SCI interrupt */ > - UINT32 SmiCommand; /* [V1] 32-bit Port address of SMI command port */ > - UINT8 AcpiEnable; /* [V1] Value to write to SMI_CMD to enable ACPI */ > - UINT8 AcpiDisable; /* [V1] Value to write to SMI_CMD to disable ACPI */ > - UINT8 S4BiosRequest; /* [V1] Value to write to SMI_CMD to enter S4BIOS state */ > - UINT8 PstateControl; /* [V1] Processor performance state control*/ > - UINT32 Pm1aEventBlock; /* [V1] 32-bit port address of Power Mgt 1a Event Reg Blk */ > - UINT32 Pm1bEventBlock; /* [V1] 32-bit port address of Power Mgt 1b Event Reg Blk */ > - UINT32 Pm1aControlBlock; /* [V1] 32-bit port address of Power Mgt 1a Control Reg Blk */ > - UINT32 Pm1bControlBlock; /* [V1] 32-bit port address of Power Mgt 1b Control Reg Blk */ > - UINT32 Pm2ControlBlock; /* [V1] 32-bit port address of Power Mgt 2 Control Reg Blk */ > - UINT32 PmTimerBlock; /* [V1] 32-bit port address of Power Mgt Timer Ctrl Reg Blk */ > - UINT32 Gpe0Block; /* [V1] 32-bit port address of General Purpose Event 0 Reg Blk */ > - UINT32 Gpe1Block; /* [V1] 32-bit port address of General Purpose Event 1 Reg Blk */ > - UINT8 Pm1EventLength; /* [V1] Byte Length of ports at Pm1xEventBlock */ > - UINT8 Pm1ControlLength; /* [V1] Byte Length of ports at Pm1xControlBlock */ > - UINT8 Pm2ControlLength; /* [V1] Byte Length of ports at Pm2ControlBlock */ > - UINT8 PmTimerLength; /* [V1] Byte Length of ports at PmTimerBlock */ > - UINT8 Gpe0BlockLength; /* [V1] Byte Length of ports at Gpe0Block */ > - UINT8 Gpe1BlockLength; /* [V1] Byte Length of ports at Gpe1Block */ > - UINT8 Gpe1Base; /* [V1] Offset in GPE number space where GPE1 events start */ > - UINT8 CstControl; /* [V1] Support for the _CST object and C-States change notification */ > - UINT16 C2Latency; /* [V1] Worst case HW latency to enter/exit C2 state */ > - UINT16 C3Latency; /* [V1] Worst case HW latency to enter/exit C3 state */ > - UINT16 FlushSize; /* [V1] Processor memory cache line width, in bytes */ > - UINT16 FlushStride; /* [V1] Number of flush strides that need to be read */ > - UINT8 DutyOffset; /* [V1] Processor duty cycle index in processor P_CNT reg */ > - UINT8 DutyWidth; /* [V1] Processor duty cycle value bit width in P_CNT register */ > - UINT8 DayAlarm; /* [V1] Index to day-of-month alarm in RTC CMOS RAM */ > - UINT8 MonthAlarm; /* [V1] Index to month-of-year alarm in RTC CMOS RAM */ > - UINT8 Century; /* [V1] Index to century in RTC CMOS RAM */ > - UINT16 BootFlags; /* [V3] IA-PC Boot Architecture Flags (see below for individual flags) */ > - UINT8 Reserved; /* [V1] Reserved, must be zero */ > - UINT32 Flags; /* [V1] Miscellaneous flag bits (see below for individual flags) */ > - /* End of Version 1 FADT fields (ACPI 1.0) */ > - > - ACPI_GENERIC_ADDRESS ResetRegister; /* [V3] 64-bit address of the Reset register */ > - UINT8 ResetValue; /* [V3] Value to write to the ResetRegister port to reset the system */ > - UINT16 ArmBootFlags; /* [V5] ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */ > - UINT8 MinorRevision; /* [V5] FADT Minor Revision (ACPI 5.1) */ > - UINT64 XFacs; /* [V3] 64-bit physical address of FACS */ > - UINT64 XDsdt; /* [V3] 64-bit physical address of DSDT */ > - ACPI_GENERIC_ADDRESS XPm1aEventBlock; /* [V3] 64-bit Extended Power Mgt 1a Event Reg Blk address */ > - ACPI_GENERIC_ADDRESS XPm1bEventBlock; /* [V3] 64-bit Extended Power Mgt 1b Event Reg Blk address */ > - ACPI_GENERIC_ADDRESS XPm1aControlBlock; /* [V3] 64-bit Extended Power Mgt 1a Control Reg Blk address */ > - ACPI_GENERIC_ADDRESS XPm1bControlBlock; /* [V3] 64-bit Extended Power Mgt 1b Control Reg Blk address */ > - ACPI_GENERIC_ADDRESS XPm2ControlBlock; /* [V3] 64-bit Extended Power Mgt 2 Control Reg Blk address */ > - ACPI_GENERIC_ADDRESS XPmTimerBlock; /* [V3] 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */ > - ACPI_GENERIC_ADDRESS XGpe0Block; /* [V3] 64-bit Extended General Purpose Event 0 Reg Blk address */ > - ACPI_GENERIC_ADDRESS XGpe1Block; /* [V3] 64-bit Extended General Purpose Event 1 Reg Blk address */ > - /* End of Version 3 FADT fields (ACPI 2.0) */ > - > - ACPI_GENERIC_ADDRESS SleepControl; /* [V4] 64-bit Sleep Control register (ACPI 5.0) */ > - /* End of Version 4 FADT fields (ACPI 3.0 and ACPI 4.0) (Field was originally reserved in ACPI 3.0) */ > - > - ACPI_GENERIC_ADDRESS SleepStatus; /* [V5] 64-bit Sleep Status register (ACPI 5.0) */ > - /* End of Version 5 FADT fields (ACPI 5.0) */ > - > - UINT64 HypervisorId; /* [V6] Hypervisor Vendor ID (ACPI 6.0) */ > - /* End of Version 6 FADT fields (ACPI 6.0) */ > - > + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ > + UINT32 Facs; /* 32-bit physical address of FACS */ > + UINT32 Dsdt; /* 32-bit physical address of DSDT */ > + UINT8 Model; /* System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */ > + UINT8 PreferredProfile; /* Conveys preferred power management profile to OSPM. */ > + UINT16 SciInterrupt; /* System vector of SCI interrupt */ > + UINT32 SmiCommand; /* 32-bit Port address of SMI command port */ > + UINT8 AcpiEnable; /* Value to write to SMI_CMD to enable ACPI */ > + UINT8 AcpiDisable; /* Value to write to SMI_CMD to disable ACPI */ > + UINT8 S4BiosRequest; /* Value to write to SMI_CMD to enter S4BIOS state */ > + UINT8 PstateControl; /* Processor performance state control*/ > + UINT32 Pm1aEventBlock; /* 32-bit port address of Power Mgt 1a Event Reg Blk */ > + UINT32 Pm1bEventBlock; /* 32-bit port address of Power Mgt 1b Event Reg Blk */ > + UINT32 Pm1aControlBlock; /* 32-bit port address of Power Mgt 1a Control Reg Blk */ > + UINT32 Pm1bControlBlock; /* 32-bit port address of Power Mgt 1b Control Reg Blk */ > + UINT32 Pm2ControlBlock; /* 32-bit port address of Power Mgt 2 Control Reg Blk */ > + UINT32 PmTimerBlock; /* 32-bit port address of Power Mgt Timer Ctrl Reg Blk */ > + UINT32 Gpe0Block; /* 32-bit port address of General Purpose Event 0 Reg Blk */ > + UINT32 Gpe1Block; /* 32-bit port address of General Purpose Event 1 Reg Blk */ > + UINT8 Pm1EventLength; /* Byte Length of ports at Pm1xEventBlock */ > + UINT8 Pm1ControlLength; /* Byte Length of ports at Pm1xControlBlock */ > + UINT8 Pm2ControlLength; /* Byte Length of ports at Pm2ControlBlock */ > + UINT8 PmTimerLength; /* Byte Length of ports at PmTimerBlock */ > + UINT8 Gpe0BlockLength; /* Byte Length of ports at Gpe0Block */ > + UINT8 Gpe1BlockLength; /* Byte Length of ports at Gpe1Block */ > + UINT8 Gpe1Base; /* Offset in GPE number space where GPE1 events start */ > + UINT8 CstControl; /* Support for the _CST object and C-States change notification */ > + UINT16 C2Latency; /* Worst case HW latency to enter/exit C2 state */ > + UINT16 C3Latency; /* Worst case HW latency to enter/exit C3 state */ > + UINT16 FlushSize; /* Processor memory cache line width, in bytes */ > + UINT16 FlushStride; /* Number of flush strides that need to be read */ > + UINT8 DutyOffset; /* Processor duty cycle index in processor P_CNT reg */ > + UINT8 DutyWidth; /* Processor duty cycle value bit width in P_CNT register */ > + UINT8 DayAlarm; /* Index to day-of-month alarm in RTC CMOS RAM */ > + UINT8 MonthAlarm; /* Index to month-of-year alarm in RTC CMOS RAM */ > + UINT8 Century; /* Index to century in RTC CMOS RAM */ > + UINT16 BootFlags; /* IA-PC Boot Architecture Flags (see below for individual flags) */ > + UINT8 Reserved; /* Reserved, must be zero */ > + UINT32 Flags; /* Miscellaneous flag bits (see below for individual flags) */ > + ACPI_GENERIC_ADDRESS ResetRegister; /* 64-bit address of the Reset register */ > + UINT8 ResetValue; /* Value to write to the ResetRegister port to reset the system */ > + UINT16 ArmBootFlags; /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */ > + UINT8 MinorRevision; /* FADT Minor Revision (ACPI 5.1) */ > + UINT64 XFacs; /* 64-bit physical address of FACS */ > + UINT64 XDsdt; /* 64-bit physical address of DSDT */ > + ACPI_GENERIC_ADDRESS XPm1aEventBlock; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */ > + ACPI_GENERIC_ADDRESS XPm1bEventBlock; /* 64-bit Extended Power Mgt 1b Event Reg Blk address */ > + ACPI_GENERIC_ADDRESS XPm1aControlBlock; /* 64-bit Extended Power Mgt 1a Control Reg Blk address */ > + ACPI_GENERIC_ADDRESS XPm1bControlBlock; /* 64-bit Extended Power Mgt 1b Control Reg Blk address */ > + ACPI_GENERIC_ADDRESS XPm2ControlBlock; /* 64-bit Extended Power Mgt 2 Control Reg Blk address */ > + ACPI_GENERIC_ADDRESS XPmTimerBlock; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */ > + ACPI_GENERIC_ADDRESS XGpe0Block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */ > + ACPI_GENERIC_ADDRESS XGpe1Block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */ > + ACPI_GENERIC_ADDRESS SleepControl; /* 64-bit Sleep Control register (ACPI 5.0) */ > + ACPI_GENERIC_ADDRESS SleepStatus; /* 64-bit Sleep Status register (ACPI 5.0) */ > + UINT64 HypervisorId; /* Hypervisor Vendor ID (ACPI 6.0) */ > > } ACPI_TABLE_FADT; > > @@ -409,8 +399,8 @@ typedef struct acpi_table_fadt > > /* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */ > > -#define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5] PSCI 0.2+ is implemented */ > -#define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5] HVC must be used instead of SMC as the PSCI conduit */ > +#define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5+] PSCI 0.2+ is implemented */ > +#define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5+] HVC must be used instead of SMC as the PSCI conduit */ > > /* Masks for FADT flags */ > > @@ -487,6 +477,7 @@ typedef struct acpi_table_desc > ACPI_NAME_UNION Signature; > ACPI_OWNER_ID OwnerId; > UINT8 Flags; > + UINT16 ValidationCount; > > } ACPI_TABLE_DESC; > > @@ -517,34 +508,20 @@ typedef struct acpi_table_desc > * match the expected length. In other words, the length of the > * FADT is the bottom line as to what the version really is. > * > - * NOTE: There is no officialy released V2 of the FADT. This > - * version was used only for prototyping and testing during the > - * 32-bit to 64-bit transition. V3 was the first official 64-bit > - * version of the FADT. > - * > - * Update this list of defines when a new version of the FADT is > - * added to the ACPI specification. Note that the FADT version is > - * only incremented when new fields are appended to the existing > - * version. Therefore, the FADT version is competely independent > - * from the version of the ACPI specification where it is > - * defined. > - * > - * For reference, the various FADT lengths are as follows: > - * FADT V1 size: 0x074 ACPI 1.0 > - * FADT V3 size: 0x0F4 ACPI 2.0 > - * FADT V4 size: 0x100 ACPI 3.0 and ACPI 4.0 > - * FADT V5 size: 0x10C ACPI 5.0 > - * FADT V6 size: 0x114 ACPI 6.0 > + * For reference, the values below are as follows: > + * FADT V1 size: 0x074 > + * FADT V2 size: 0x084 > + * FADT V3 size: 0x0F4 > + * FADT V4 size: 0x0F4 > + * FADT V5 size: 0x10C > + * FADT V6 size: 0x114 > */ > -#define ACPI_FADT_V1_SIZE (UINT32) (ACPI_FADT_OFFSET (Flags) + 4) /* ACPI 1.0 */ > -#define ACPI_FADT_V3_SIZE (UINT32) (ACPI_FADT_OFFSET (SleepControl)) /* ACPI 2.0 */ > -#define ACPI_FADT_V4_SIZE (UINT32) (ACPI_FADT_OFFSET (SleepStatus)) /* ACPI 3.0 and ACPI 4.0 */ > -#define ACPI_FADT_V5_SIZE (UINT32) (ACPI_FADT_OFFSET (HypervisorId)) /* ACPI 5.0 */ > -#define ACPI_FADT_V6_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT)) /* ACPI 6.0 */ > - > -/* Update these when new FADT versions are added */ > +#define ACPI_FADT_V1_SIZE (UINT32) (ACPI_FADT_OFFSET (Flags) + 4) > +#define ACPI_FADT_V2_SIZE (UINT32) (ACPI_FADT_OFFSET (MinorRevision) + 1) > +#define ACPI_FADT_V3_SIZE (UINT32) (ACPI_FADT_OFFSET (SleepControl)) > +#define ACPI_FADT_V5_SIZE (UINT32) (ACPI_FADT_OFFSET (HypervisorId)) > +#define ACPI_FADT_V6_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT)) > > -#define ACPI_FADT_MAX_VERSION 6 > #define ACPI_FADT_CONFORMANCE "ACPI 6.1 (FADT version 6)" > > #endif /* __ACTBL_H__ */ > diff --git a/src/acpica/source/include/acutils.h b/src/acpica/source/include/acutils.h > index 9bc3960..eeedc95 100644 > --- a/src/acpica/source/include/acutils.h > +++ b/src/acpica/source/include/acutils.h > @@ -355,6 +355,10 @@ const char * > AcpiUtGetEventName ( > UINT32 EventId); > > +const char * > +AcpiUtGetArgumentTypeName ( > + UINT32 ArgType); > + > char > AcpiUtHexToAsciiChar ( > UINT64 Integer, > diff --git a/src/acpica/source/include/amlcode.h b/src/acpica/source/include/amlcode.h > index 289d3ec..55354fe 100644 > --- a/src/acpica/source/include/amlcode.h > +++ b/src/acpica/source/include/amlcode.h > @@ -315,6 +315,7 @@ > #define ARGP_QWORDDATA 0x11 > #define ARGP_SIMPLENAME 0x12 /* NameString | LocalTerm | ArgTerm */ > #define ARGP_NAME_OR_REF 0x13 /* For ObjectType only */ > +#define ARGP_MAX 0x13 > > /* > * Resolved argument types for the AML Interpreter > @@ -351,9 +352,24 @@ > #define ARGI_DEVICE_REF 0x0D > #define ARGI_REFERENCE 0x0E > #define ARGI_TARGETREF 0x0F /* Target, subject to implicit conversion */ > -#define ARGI_FIXED_TARGET 0x10 /* Target, no implicit conversion */ > -#define ARGI_SIMPLE_TARGET 0x11 /* Name, Local, Arg -- no implicit conversion */ > -#define ARGI_STORE_TARGET 0x12 /* Target for store is TARGETREF + package objects */ > +#define ARGI_SIMPLE_TARGET 0x10 /* Name, Local, Arg -- no implicit conversion */ > +#define ARGI_STORE_TARGET 0x11 /* Target for store is TARGETREF + package objects */ > +/* > + * #define ARGI_FIXED_TARGET 0x10 Target, no implicit conversion > + * > + * Removed 10/2016. ARGI_FIXED_TARGET was used for these operators: > + * FromBCD > + * ToBCD > + * ToDecimalString > + * ToHexString > + * ToInteger > + * ToBuffer > + * The purpose of this type was to disable "implicit result conversion", > + * but this was incorrect per the ACPI spec and other ACPI implementations. > + * These operators now have the target operand defined as a normal > + * ARGI_TARGETREF. > + */ > + > > /* Multiple/complex types */ > Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff --git a/src/acpica/source/common/acfileio.c b/src/acpica/source/common/acfileio.c index 6cb9536..9b4564e 100644 --- a/src/acpica/source/common/acfileio.c +++ b/src/acpica/source/common/acfileio.c @@ -184,7 +184,7 @@ AcGetAllTablesFromFile ( if (FileSize == ACPI_UINT32_MAX) { Status = AE_ERROR; - goto ErrorExit; + goto Exit; } fprintf (stderr, @@ -196,7 +196,7 @@ AcGetAllTablesFromFile ( if (FileSize < sizeof (ACPI_TABLE_HEADER)) { Status = AE_BAD_HEADER; - goto ErrorExit; + goto Exit; } /* Check for an non-binary file */ @@ -206,7 +206,8 @@ AcGetAllTablesFromFile ( fprintf (stderr, " %s: File does not appear to contain a valid AML table\n", Filename); - return (AE_TYPE); + Status = AE_TYPE; + goto Exit; } /* Read all tables within the file */ @@ -225,23 +226,31 @@ AcGetAllTablesFromFile ( } else if (Status == AE_TYPE) { - return (AE_OK); + Status = AE_OK; + goto Exit; } else if (ACPI_FAILURE (Status)) { - goto ErrorExit; + goto Exit; } /* Print table header for iASL/disassembler only */ #ifdef ACPI_ASL_COMPILER - AcpiTbPrintTableHeader (0, Table); + AcpiTbPrintTableHeader (0, Table); #endif /* Allocate and link a table descriptor */ TableDesc = AcpiOsAllocate (sizeof (ACPI_NEW_TABLE_DESC)); + if (!TableDesc) + { + AcpiOsFree (Table); + Status = AE_NO_MEMORY; + goto Exit; + } + TableDesc->Table = Table; TableDesc->Next = NULL; @@ -276,7 +285,7 @@ AcGetAllTablesFromFile ( *ReturnListHead = ListHead; } -ErrorExit: +Exit: fclose(File); return (Status); } @@ -334,7 +343,6 @@ AcGetOneTableFromFile ( return (Status); } - if (GetOnlyAmlTables) { /* diff --git a/src/acpica/source/common/dmtbdump.c b/src/acpica/source/common/dmtbdump.c index fe4ce2f..ae48276 100644 --- a/src/acpica/source/common/dmtbdump.c +++ b/src/acpica/source/common/dmtbdump.c @@ -124,31 +124,12 @@ ACPI_MODULE_NAME ("dmtbdump") -/* Table of revision-dependent FADT sizes */ +/* Local prototypes */ -static const UINT32 FadtRevisionLength [ACPI_FADT_MAX_VERSION + 1] = -{ - 0, /* 0 - illegal */ - ACPI_FADT_V1_SIZE, /* 1 - ACPI 1.0 */ - 0, /* 2 - illegal */ - ACPI_FADT_V3_SIZE, /* 3 - ACPI 2.0 */ - ACPI_FADT_V4_SIZE, /* 4 - ACPI 3.0 and ACPI 4.0 */ - ACPI_FADT_V5_SIZE, /* 5 - ACPI 5.0 */ - ACPI_FADT_V6_SIZE /* 6 - ACPI 6.0 */ -}; - -/* Table of revision-dependent FADT info tables */ - -ACPI_DMTABLE_INFO *FadtRevisionInfo [ACPI_FADT_MAX_VERSION + 1] = -{ - NULL, /* 0 - illegal */ - AcpiDmTableInfoFadt1, /* 1 - ACPI 1.0 */ - NULL, /* 2 - illegal */ - AcpiDmTableInfoFadt3, /* 3 - ACPI 2.0 */ - AcpiDmTableInfoFadt4, /* 4 - ACPI 3.0 and ACPI 4.0 */ - AcpiDmTableInfoFadt5, /* 5 - ACPI 5.0 */ - AcpiDmTableInfoFadt6 /* 6 - ACPI 6.0 */ -}; +static void +AcpiDmValidateFadtLength ( + UINT32 Revision, + UINT32 Length); /******************************************************************************* @@ -438,11 +419,6 @@ AcpiDmDumpXsdt ( * * DESCRIPTION: Format the contents of a FADT * - * Check the FADT revision against the expected table length for - * that revision. Issue a warning if the length is not what was - * expected. This seems to be such a common BIOS bug that the - * FADT revision has been rendered virtually meaningless. - * * NOTE: We cannot depend on the FADT version to indicate the actual * contents of the FADT because of BIOS bugs. The table length * is the only reliable indicator. @@ -454,72 +430,142 @@ AcpiDmDumpFadt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - UINT8 FadtRevision; - UINT32 ExpectedLength; - UINT32 i; - - FadtRevision = Table->Revision; - /* FADT revision/length validation */ + /* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */ - if ((FadtRevision == 0) || - (FadtRevision == 2)) + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, + AcpiDmTableInfoFadt1); + if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ( - "// ACPI Warning: Invalid or unsupported FADT revision: %u\n", - FadtRevision); return; } - if (FadtRevision > ACPI_FADT_MAX_VERSION) - { - AcpiOsPrintf ("// ACPI Warning: Revision %u is not fully supported, " - "disassembling known fields (up to revision %u)\n\n", - FadtRevision, ACPI_FADT_MAX_VERSION); - } - else + /* Check for FADT revision 2 fields (ACPI 1.0B MS extensions) */ + + if ((Table->Length > ACPI_FADT_V1_SIZE) && + (Table->Length <= ACPI_FADT_V2_SIZE)) { - ExpectedLength = FadtRevisionLength[FadtRevision]; - if (Table->Length != ExpectedLength) + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, + AcpiDmTableInfoFadt2); + if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ( - "// ACPI Warning: Input FADT revision %X does not match " - "expected length: found 0x%X expected 0x%X\n", - FadtRevision, Table->Length, ExpectedLength); + return; } } - /* - * Dump the input table on a per-version basis, but is actually - * based upon the length of the table. Table length must - * be larger than the required length of the previous version. - */ - for (i = 1; i <= ACPI_FADT_MAX_VERSION; i++) + /* Check for FADT revision 3/4 fields and up (ACPI 2.0+ extended data) */ + + else if (Table->Length > ACPI_FADT_V2_SIZE) { - if (!FadtRevisionLength[i]) /* Skip any empty slots */ + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, + AcpiDmTableInfoFadt3); + if (ACPI_FAILURE (Status)) { - continue; + return; } - /* Dump the fields specific to FADT revision[i] */ + /* Check for FADT revision 5 fields and up (ACPI 5.0+) */ - Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, - FadtRevisionInfo[i]); - if (ACPI_FAILURE (Status)) + if (Table->Length > ACPI_FADT_V3_SIZE) { - return; + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, + AcpiDmTableInfoFadt5); + if (ACPI_FAILURE (Status)) + { + return; + } } - if (Table->Length <= FadtRevisionLength[i]) + /* Check for FADT revision 6 fields and up (ACPI 6.0+) */ + + if (Table->Length > ACPI_FADT_V3_SIZE) { - break; /* End of table */ + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, + AcpiDmTableInfoFadt6); + if (ACPI_FAILURE (Status)) + { + return; + } } } - /* Build a local FADT to test some FADT values */ + /* Validate various fields in the FADT, including length */ AcpiTbCreateLocalFadt (Table, Table->Length); + + /* Validate FADT length against the revision */ + + AcpiDmValidateFadtLength (Table->Revision, Table->Length); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmValidateFadtLength + * + * PARAMETERS: Revision - FADT revision (Header->Revision) + * Length - FADT length (Header->Length + * + * RETURN: None + * + * DESCRIPTION: Check the FADT revision against the expected table length for + * that revision. Issue a warning if the length is not what was + * expected. This seems to be such a common BIOS bug that the + * FADT revision has been rendered virtually meaningless. + * + ******************************************************************************/ + +static void +AcpiDmValidateFadtLength ( + UINT32 Revision, + UINT32 Length) +{ + UINT32 ExpectedLength; + + + switch (Revision) + { + case 0: + + AcpiOsPrintf ("// ACPI Warning: Invalid FADT revision: 0\n"); + return; + + case 1: + + ExpectedLength = ACPI_FADT_V1_SIZE; + break; + + case 2: + + ExpectedLength = ACPI_FADT_V2_SIZE; + break; + + case 3: + case 4: + + ExpectedLength = ACPI_FADT_V3_SIZE; + break; + + case 5: + + ExpectedLength = ACPI_FADT_V5_SIZE; + break; + + default: + + return; + } + + if (Length == ExpectedLength) + { + return; + } + + AcpiOsPrintf ( + "\n// ACPI Warning: FADT revision %X does not match length: " + "found %X expected %X\n", + Revision, Length, ExpectedLength); } diff --git a/src/acpica/source/common/dmtbinfo.c b/src/acpica/source/common/dmtbinfo.c index e920724..522ed00 100644 --- a/src/acpica/source/common/dmtbinfo.c +++ b/src/acpica/source/common/dmtbinfo.c @@ -472,7 +472,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFacs[] = * ******************************************************************************/ -/* FADT version 1 (ACPI 1.0) */ +/* ACPI 1.0 FADT (Version 1) */ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[] = { @@ -558,7 +558,18 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[] = ACPI_DMT_TERMINATOR }; -/* FADT version 3 (ACPI 2.0) */ +/* ACPI 1.0 MS Extensions (FADT version 2) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[] = +{ + {ACPI_DMT_GAS, ACPI_FADT_OFFSET (ResetRegister), "Reset Register", 0}, + {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (ResetValue), "Value to cause reset", 0}, + {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (ArmBootFlags), "Reserved", 0}, + {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (MinorRevision), "Reserved", 0}, + ACPI_DMT_TERMINATOR +}; + +/* ACPI 2.0+ Extensions (FADT version 3, 4, and 5) */ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[] = { @@ -582,23 +593,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[] = ACPI_DMT_TERMINATOR }; -/* FADT version 4 (ACPI 3.0 and ACPI 4.0) */ - -ACPI_DMTABLE_INFO AcpiDmTableInfoFadt4[] = -{ - {ACPI_DMT_GAS, ACPI_FADT_OFFSET (SleepControl), "Sleep Control Register", 0}, - ACPI_DMT_TERMINATOR -}; - -/* FADT version 5 (ACPI 5.0) */ +/* ACPI 5.0 Extensions (FADT version 5) */ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[] = { + {ACPI_DMT_GAS, ACPI_FADT_OFFSET (SleepControl), "Sleep Control Register", 0}, {ACPI_DMT_GAS, ACPI_FADT_OFFSET (SleepStatus), "Sleep Status Register", 0}, ACPI_DMT_TERMINATOR }; -/* FADT version 6 (ACPI 6.0) */ +/* ACPI 6.0 Extensions (FADT version 6) */ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt6[] = { diff --git a/src/acpica/source/compiler/aslbtypes.c b/src/acpica/source/compiler/aslbtypes.c index cad5b66..0a70481 100644 --- a/src/acpica/source/compiler/aslbtypes.c +++ b/src/acpica/source/compiler/aslbtypes.c @@ -223,7 +223,6 @@ AnMapArgTypeToBtype ( return (ACPI_BTYPE_DATA | ACPI_BTYPE_DEBUG_OBJECT | ACPI_BTYPE_REFERENCE_OBJECT); - case ARGI_FIXED_TARGET: case ARGI_SIMPLE_TARGET: return (ACPI_BTYPE_OBJECTS_AND_REFS); diff --git a/src/acpica/source/compiler/aslcompiler.l b/src/acpica/source/compiler/aslcompiler.l index ab7a050..9a396ec 100644 --- a/src/acpica/source/compiler/aslcompiler.l +++ b/src/acpica/source/compiler/aslcompiler.l @@ -228,8 +228,14 @@ NamePathTail [.]{NameSeg} "^=" { count (3); return (PARSEOP_EXP_XOR_EQ); } "|=" { count (3); return (PARSEOP_EXP_OR_EQ); } -"[" { count (3); return(PARSEOP_EXP_INDEX_LEFT); } -"]" { count (0); return(PARSEOP_EXP_INDEX_RIGHT); } +"[" { count (3); return (PARSEOP_EXP_INDEX_LEFT); } +"]" { count (0); return (PARSEOP_EXP_INDEX_RIGHT); } +"(" { count (0); return (PARSEOP_OPEN_PAREN); } +")" { count (0); return (PARSEOP_CLOSE_PAREN); } + +"{" { count (0); return ('{'); } +"}" { count (0); return ('}'); } +"," { count (0); return (','); } /* @@ -763,12 +769,6 @@ NamePathTail [.]{NameSeg} "__PATH__" { count (0); return (PARSEOP___PATH__); } -"{" { count (0); return('{'); } -"}" { count (0); return('}'); } -"," { count (0); return(','); } -"(" { count (0); return('('); } -")" { count (0); return(')'); } - {NameSeg} { char *s; count (0); s=UtStringCacheCalloc (ACPI_NAME_SIZE + 1); diff --git a/src/acpica/source/compiler/aslcstyle.y b/src/acpica/source/compiler/aslcstyle.y index 305d60d..508af32 100644 --- a/src/acpica/source/compiler/aslcstyle.y +++ b/src/acpica/source/compiler/aslcstyle.y @@ -221,21 +221,30 @@ Expression /* Parentheses */ - | '(' TermArg ')' { $$ = $2;} + | PARSEOP_OPEN_PAREN + Expression + PARSEOP_CLOSE_PAREN {$$ = $2;} /* Index term -- "= BUF1[5]" on right-hand side of an equals (source) */ - | SuperName PARSEOP_EXP_INDEX_LEFT - TermArg PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafNode (PARSEOP_INDEX); - TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());} + | IndexExpTerm ; - /* Index term -- "BUF1[5] = " on left-hand side of an equals (target) */ - + /* + * Index term -- "BUF1[5] = " or " = BUF1[5] on either the left side + * of an equals (target) or the right side (source) + * Currently used in these terms: + * Expression + * ObjectTypeSource + * DerefOfSource + * Type6Opcode + */ IndexExpTerm - : SuperName PARSEOP_EXP_INDEX_LEFT - TermArg PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafNode (PARSEOP_INDEX); + : SuperName + PARSEOP_EXP_INDEX_LEFT + TermArg + PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafNode (PARSEOP_INDEX); TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());} ; @@ -249,11 +258,26 @@ IndexExpTerm EqualsTerm + /* Allow parens anywhere */ + + : PARSEOP_OPEN_PAREN + EqualsTerm + PARSEOP_CLOSE_PAREN {$$ = $2;} + /* Simple Store() operation */ - : SuperName PARSEOP_EXP_EQUALS + | SuperName + PARSEOP_EXP_EQUALS TermArg {$$ = TrCreateAssignmentNode ($1, $3);} + /* Chained equals: (a=RefOf)=b, a=b=c=d etc. */ + + | PARSEOP_OPEN_PAREN + EqualsTerm + PARSEOP_CLOSE_PAREN + PARSEOP_EXP_EQUALS + TermArg {$$ = TrCreateAssignmentNode ($2, $5);} + /* Compound assignments -- Add (operand, operand, target) */ | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} diff --git a/src/acpica/source/compiler/aslexternal.c b/src/acpica/source/compiler/aslexternal.c index ff7b785..ca1d4b2 100644 --- a/src/acpica/source/compiler/aslexternal.c +++ b/src/acpica/source/compiler/aslexternal.c @@ -397,6 +397,7 @@ ExMoveExternals ( ACPI_PARSE_OBJECT *NextOp; ACPI_PARSE_OBJECT *Prev; ACPI_PARSE_OBJECT *Next; + char *ExternalName; ACPI_OBJECT_TYPE ObjType; UINT32 i; @@ -417,6 +418,12 @@ ExMoveExternals ( */ ExternalOp = NextOp->Asl.Child; + /* Get/set the fully qualified name */ + + ExternalName = AcpiNsGetNormalizedPathname (ExternalOp->Asl.Node, TRUE); + ExternalOp->Asl.ExternalName = ExternalName; + ExternalOp->Asl.Namepath = ExternalName; + /* Set line numbers (for listings, etc.) */ ExternalOp->Asl.LineNumber = 0; @@ -426,6 +433,14 @@ ExMoveExternals ( Next->Asl.LineNumber = 0; Next->Asl.LogicalLineNumber = 0; + if (Next->Asl.ParseOpcode == PARSEOP_NAMESEG) + { + Next->Asl.ParseOpcode = PARSEOP_NAMESTRING; + } + Next->Asl.ExternalName = ExternalName; + UtInternalizeName (ExternalName, &Next->Asl.Value.String); + Next->Asl.AmlLength = strlen (Next->Asl.Value.String); + Next = Next->Asl.Next; Next->Asl.LineNumber = 0; Next->Asl.LogicalLineNumber = 0; diff --git a/src/acpica/source/compiler/aslkeywords.y b/src/acpica/source/compiler/aslkeywords.y index 644a1a1..b22c3db 100644 --- a/src/acpica/source/compiler/aslkeywords.y +++ b/src/acpica/source/compiler/aslkeywords.y @@ -130,15 +130,18 @@ AccessAttribKeyword | 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_MULTIBYTE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);} + | PARSEOP_ACCESSATTRIB_MULTIBYTE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);} ByteConst - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_ACCESSATTRIB_RAW_BYTES '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_ACCESSATTRIB_RAW_BYTES + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);} ByteConst - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_ACCESSATTRIB_RAW_PROCESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_ACCESSATTRIB_RAW_PROCESS + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);} ByteConst - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} ; AccessTypeKeyword diff --git a/src/acpica/source/compiler/aslopcodes.c b/src/acpica/source/compiler/aslopcodes.c index 8445ca1..aecd37c 100644 --- a/src/acpica/source/compiler/aslopcodes.c +++ b/src/acpica/source/compiler/aslopcodes.c @@ -361,7 +361,7 @@ OpcSetOptimalIntegerSize ( Op->Asl.AmlOpcode = AML_DWORD_OP; return (4); } - else + else /* 64-bit integer */ { if (AcpiGbl_IntegerByteWidth == 4) { @@ -371,8 +371,12 @@ OpcSetOptimalIntegerSize ( if (!Gbl_IgnoreErrors) { /* Truncate the integer to 32-bit */ - Op->Asl.AmlOpcode = AML_DWORD_OP; - return (4); + + Op->Asl.Value.Integer &= ACPI_UINT32_MAX; + + /* Now set the optimal integer size */ + + return (OpcSetOptimalIntegerSize (Op)); } } diff --git a/src/acpica/source/compiler/aslprimaries.y b/src/acpica/source/compiler/aslprimaries.y index 605c889..97e400f 100644 --- a/src/acpica/source/compiler/aslprimaries.y +++ b/src/acpica/source/compiler/aslprimaries.y @@ -124,51 +124,61 @@ NoEcho(' ******************************************************************************/ AccessAsTerm - : PARSEOP_ACCESSAS '(' + : PARSEOP_ACCESSAS + PARSEOP_OPEN_PAREN AccessTypeKeyword OptionalAccessAttribTerm - ')' {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);} - | PARSEOP_ACCESSAS '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);} + | PARSEOP_ACCESSAS + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; AcquireTerm - : PARSEOP_ACQUIRE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} + : PARSEOP_ACQUIRE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} SuperName ',' WordConstExpr - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$6);} - | PARSEOP_ACQUIRE '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$6);} + | PARSEOP_ACQUIRE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; AddTerm - : PARSEOP_ADD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} + : PARSEOP_ADD + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} TermArg TermArgItem Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_ADD '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_ADD + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; AliasTerm - : PARSEOP_ALIAS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);} + : PARSEOP_ALIAS + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);} NameString NameStringItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4, TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} - | PARSEOP_ALIAS '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_ALIAS + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; AndTerm - : PARSEOP_AND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} + : PARSEOP_AND + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} TermArg TermArgItem Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_AND '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_AND + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ArgTerm @@ -182,18 +192,21 @@ ArgTerm ; BankFieldTerm - : PARSEOP_BANKFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BANKFIELD);} + : PARSEOP_BANKFIELD + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_BANKFIELD);} NameString NameStringItem TermArgItem ',' AccessTypeKeyword ',' LockRuleKeyword ',' UpdateRuleKeyword - ')' '{' + PARSEOP_CLOSE_PAREN '{' FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,7, $4,$5,$6,$8,$10,$12,$15);} - | PARSEOP_BANKFIELD '(' - error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} + | PARSEOP_BANKFIELD + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN + '{' error '}' {$$ = AslDoError(); yyclearin;} ; BreakTerm @@ -216,58 +229,69 @@ BufferTermData ; CaseTerm - : PARSEOP_CASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);} + : PARSEOP_CASE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);} DataObject - ')' '{' + PARSEOP_CLOSE_PAREN '{' TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_CASE '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_CASE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ConcatTerm - : PARSEOP_CONCATENATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} + : PARSEOP_CONCATENATE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} TermArg TermArgItem Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_CONCATENATE '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_CONCATENATE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ConcatResTerm - : PARSEOP_CONCATENATERESTEMPLATE '(' {$<n>$ = TrCreateLeafNode ( - PARSEOP_CONCATENATERESTEMPLATE);} + : PARSEOP_CONCATENATERESTEMPLATE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode ( + PARSEOP_CONCATENATERESTEMPLATE);} TermArg TermArgItem Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_CONCATENATERESTEMPLATE '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_CONCATENATERESTEMPLATE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} + ; + +CondRefOfTerm + : PARSEOP_CONDREFOF + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} + CondRefOfSource + Target + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_CONDREFOF + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ConnectionTerm - : PARSEOP_CONNECTION '(' + : PARSEOP_CONNECTION + PARSEOP_OPEN_PAREN NameString - ')' {$$ = TrCreateNode (PARSEOP_CONNECTION,1,$3);} - | PARSEOP_CONNECTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONNECTION);} + PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_CONNECTION,1,$3);} + | PARSEOP_CONNECTION + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CONNECTION);} ResourceMacroTerm - ')' {$$ = TrLinkChildren ($<n>3, 1, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3, 1, TrLinkChildren ( TrCreateLeafNode (PARSEOP_RESOURCETEMPLATE), 3, TrCreateLeafNode (PARSEOP_DEFAULT_ARG), TrCreateLeafNode (PARSEOP_DEFAULT_ARG), $4));} - | PARSEOP_CONNECTION '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -CondRefOfTerm - : PARSEOP_CONDREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} - SuperName - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_CONDREFOF '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_CONNECTION + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ContinueTerm @@ -275,92 +299,108 @@ ContinueTerm ; CopyObjectTerm - : PARSEOP_COPYOBJECT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} + : PARSEOP_COPYOBJECT + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} TermArg - ',' SimpleTarget - ')' {$$ = TrLinkChildren ($<n>3,2,$4, + ',' SimpleName + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4, TrSetNodeFlags ($6, NODE_IS_TARGET));} - | PARSEOP_COPYOBJECT '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_COPYOBJECT + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; CreateBitFieldTerm - : PARSEOP_CREATEBITFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} + : PARSEOP_CREATEBITFIELD + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} TermArg TermArgItem NameStringItem - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5, TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} - | PARSEOP_CREATEBITFIELD '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_CREATEBITFIELD + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; CreateByteFieldTerm - : PARSEOP_CREATEBYTEFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBYTEFIELD);} + : PARSEOP_CREATEBYTEFIELD + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBYTEFIELD);} TermArg TermArgItem NameStringItem - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5, TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} - | PARSEOP_CREATEBYTEFIELD '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_CREATEBYTEFIELD + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; CreateDWordFieldTerm - : PARSEOP_CREATEDWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEDWORDFIELD);} + : PARSEOP_CREATEDWORDFIELD + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEDWORDFIELD);} TermArg TermArgItem NameStringItem - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5, TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} - | PARSEOP_CREATEDWORDFIELD '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_CREATEDWORDFIELD + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; CreateFieldTerm - : PARSEOP_CREATEFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEFIELD);} + : PARSEOP_CREATEFIELD + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEFIELD);} TermArg TermArgItem TermArgItem NameStringItem - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6, TrSetNodeFlags ($7, NODE_IS_NAME_DECLARATION));} - | PARSEOP_CREATEFIELD '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_CREATEFIELD + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; CreateQWordFieldTerm - : PARSEOP_CREATEQWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEQWORDFIELD);} + : PARSEOP_CREATEQWORDFIELD + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEQWORDFIELD);} TermArg TermArgItem NameStringItem - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5, TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} - | PARSEOP_CREATEQWORDFIELD '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_CREATEQWORDFIELD + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; CreateWordFieldTerm - : PARSEOP_CREATEWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEWORDFIELD);} + : PARSEOP_CREATEWORDFIELD + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEWORDFIELD);} TermArg TermArgItem NameStringItem - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5, TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} - | PARSEOP_CREATEWORDFIELD '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_CREATEWORDFIELD + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; DataRegionTerm - : PARSEOP_DATATABLEREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATATABLEREGION);} + : PARSEOP_DATATABLEREGION + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DATATABLEREGION);} NameString TermArgItem TermArgItem TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,4, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4, TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$6,$7);} - | PARSEOP_DATATABLEREGION '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_DATATABLEREGION + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; DebugTerm @@ -368,11 +408,13 @@ DebugTerm ; DecTerm - : PARSEOP_DECREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} + : PARSEOP_DECREMENT + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_DECREMENT '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_DECREMENT + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; DefaultTerm @@ -383,39 +425,48 @@ DefaultTerm ; DerefOfTerm - : PARSEOP_DEREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);} - TermArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_DEREFOF '(' - error ')' {$$ = AslDoError(); yyclearin;} + : PARSEOP_DEREFOF + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);} + DerefOfSource + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_DEREFOF + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; DeviceTerm - : PARSEOP_DEVICE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);} + : PARSEOP_DEVICE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);} NameString - ')' '{' + PARSEOP_CLOSE_PAREN '{' TermList '}' {$$ = TrLinkChildren ($<n>3,2, TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} - | PARSEOP_DEVICE '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_DEVICE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; DivideTerm - : PARSEOP_DIVIDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} + : PARSEOP_DIVIDE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} TermArg TermArgItem Target Target - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} - | PARSEOP_DIVIDE '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} + | PARSEOP_DIVIDE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; EISAIDTerm - : PARSEOP_EISAID '(' - StringData ')' {$$ = TrUpdateNode (PARSEOP_EISAID, $3);} - | PARSEOP_EISAID '(' - error ')' {$$ = AslDoError(); yyclearin;} + : PARSEOP_EISAID + PARSEOP_OPEN_PAREN + StringData + PARSEOP_CLOSE_PAREN {$$ = TrUpdateNode (PARSEOP_EISAID, $3);} + | PARSEOP_EISAID + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ElseIfTerm @@ -433,88 +484,105 @@ ElseTerm | PARSEOP_ELSE error {$$ = AslDoError(); yyclearin;} - | PARSEOP_ELSEIF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} + | PARSEOP_ELSEIF + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} - ')' '{' + PARSEOP_CLOSE_PAREN '{' TermList '}' {TrLinkChildren ($<n>5,2,$4,$8);} ElseTerm {TrLinkPeerNode ($<n>5,$11);} {$$ = TrLinkChildren ($<n>3,1,$<n>5);} - | PARSEOP_ELSEIF '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_ELSEIF + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} | PARSEOP_ELSEIF error {$$ = AslDoError(); yyclearin;} ; EventTerm - : PARSEOP_EVENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EVENT);} + : PARSEOP_EVENT + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EVENT);} NameString - ')' {$$ = TrLinkChildren ($<n>3,1, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1, TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION));} - | PARSEOP_EVENT '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_EVENT + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ExternalTerm - : PARSEOP_EXTERNAL '(' + : PARSEOP_EXTERNAL + PARSEOP_OPEN_PAREN NameString OptionalObjectTypeKeyword OptionalParameterTypePackage OptionalParameterTypesPackage - ')' {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);} - | PARSEOP_EXTERNAL '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);} + | PARSEOP_EXTERNAL + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; FatalTerm - : PARSEOP_FATAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);} + : PARSEOP_FATAL + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);} ByteConstExpr ',' DWordConstExpr TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} - | PARSEOP_FATAL '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} + | PARSEOP_FATAL + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; FieldTerm - : PARSEOP_FIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIELD);} + : PARSEOP_FIELD + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FIELD);} NameString ',' AccessTypeKeyword ',' LockRuleKeyword ',' UpdateRuleKeyword - ')' '{' + PARSEOP_CLOSE_PAREN '{' FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$8,$10,$13);} - | PARSEOP_FIELD '(' - error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} + | PARSEOP_FIELD + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN + '{' error '}' {$$ = AslDoError(); yyclearin;} ; FindSetLeftBitTerm - : PARSEOP_FINDSETLEFTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} + : PARSEOP_FINDSETLEFTBIT + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} TermArg Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_FINDSETLEFTBIT '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_FINDSETLEFTBIT + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; FindSetRightBitTerm - : PARSEOP_FINDSETRIGHTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} + : PARSEOP_FINDSETRIGHTBIT + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} TermArg Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_FINDSETRIGHTBIT '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_FINDSETRIGHTBIT + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; /* Convert a For() loop to a While() loop */ ForTerm - : PARSEOP_FOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} + : PARSEOP_FOR + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} OptionalTermArg ',' {} OptionalPredicate ',' OptionalTermArg {$<n>$ = TrLinkPeerNode ($4,$<n>3); - TrSetParent ($9,$<n>3);} /* New parent is WHILE */ - ')' '{' TermList '}' {$<n>$ = TrLinkChildren ($<n>3,2,$7,$13);} + TrSetParent ($9,$<n>3);} /* New parent is WHILE */ + PARSEOP_CLOSE_PAREN + '{' TermList '}' {$<n>$ = TrLinkChildren ($<n>3,2,$7,$13);} {$<n>$ = TrLinkPeerNode ($13,$9); $$ = $<n>10;} ; @@ -525,52 +593,62 @@ OptionalPredicate ; FprintfTerm - : PARSEOP_FPRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);} + : PARSEOP_FPRINTF + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);} TermArg ',' StringData PrintfArgList - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} - | PARSEOP_FPRINTF '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} + | PARSEOP_FPRINTF + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; FromBCDTerm - : PARSEOP_FROMBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);} + : PARSEOP_FROMBCD + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);} TermArg Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_FROMBCD '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_FROMBCD + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; FunctionTerm - : PARSEOP_FUNCTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} + : PARSEOP_FUNCTION + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} NameString OptionalParameterTypePackage OptionalParameterTypesPackage - ')' '{' + PARSEOP_CLOSE_PAREN '{' 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,$9);} - | PARSEOP_FUNCTION '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_FUNCTION + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; IfTerm - : PARSEOP_IF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} + : PARSEOP_IF + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} TermArg - ')' '{' + PARSEOP_CLOSE_PAREN '{' TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_IF '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_IF + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; IncludeTerm - : PARSEOP_INCLUDE '(' - String ')' {$$ = TrUpdateNode (PARSEOP_INCLUDE, $3); + : PARSEOP_INCLUDE + PARSEOP_OPEN_PAREN + String + PARSEOP_CLOSE_PAREN {$$ = TrUpdateNode (PARSEOP_INCLUDE, $3); FlOpenIncludeFile ($3);} ; @@ -580,130 +658,157 @@ IncludeEndTerm ; IncTerm - : PARSEOP_INCREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} + : PARSEOP_INCREMENT + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_INCREMENT '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_INCREMENT + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; IndexFieldTerm - : PARSEOP_INDEXFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} + : PARSEOP_INDEXFIELD + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} NameString NameStringItem ',' AccessTypeKeyword ',' LockRuleKeyword ',' UpdateRuleKeyword - ')' '{' + PARSEOP_CLOSE_PAREN '{' FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$7,$9,$11,$14);} - | PARSEOP_INDEXFIELD '(' - error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} + | PARSEOP_INDEXFIELD + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN + '{' error '}' {$$ = AslDoError(); yyclearin;} ; IndexTerm - : PARSEOP_INDEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);} + : PARSEOP_INDEX + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);} TermArg TermArgItem Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_INDEX '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_INDEX + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; LAndTerm - : PARSEOP_LAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} + : PARSEOP_LAND + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} TermArg TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LAND '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LAND + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; LEqualTerm - : PARSEOP_LEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} + : PARSEOP_LEQUAL + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} TermArg TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LEQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LEQUAL + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; LGreaterEqualTerm - : PARSEOP_LGREATEREQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} + : PARSEOP_LGREATEREQUAL + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} TermArg TermArgItem - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, + PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} - | PARSEOP_LGREATEREQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_LGREATEREQUAL + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; LGreaterTerm - : PARSEOP_LGREATER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} + : PARSEOP_LGREATER + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} TermArg TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LGREATER '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LGREATER + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; LLessEqualTerm - : PARSEOP_LLESSEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} + : PARSEOP_LLESSEQUAL + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} TermArg TermArgItem - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, + PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} - | PARSEOP_LLESSEQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_LLESSEQUAL + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; LLessTerm - : PARSEOP_LLESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} + : PARSEOP_LLESS + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} TermArg TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LLESS '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LLESS + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; LNotEqualTerm - : PARSEOP_LNOTEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} + : PARSEOP_LNOTEQUAL + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} TermArg TermArgItem - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, + PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} - | PARSEOP_LNOTEQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_LNOTEQUAL + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; LNotTerm - : PARSEOP_LNOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} + : PARSEOP_LNOT + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} TermArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_LNOT '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_LNOT + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; LoadTableTerm - : PARSEOP_LOADTABLE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOADTABLE);} + : PARSEOP_LOADTABLE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LOADTABLE);} TermArg TermArgItem TermArgItem OptionalListString OptionalListString OptionalReference - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$6,$7,$8,$9);} - | PARSEOP_LOADTABLE '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$5,$6,$7,$8,$9);} + | PARSEOP_LOADTABLE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; LoadTerm - : PARSEOP_LOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOAD);} + : PARSEOP_LOAD + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LOAD);} NameString RequiredTarget - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LOAD '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LOAD + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; LocalTerm @@ -718,102 +823,120 @@ LocalTerm ; LOrTerm - : PARSEOP_LOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} + : PARSEOP_LOR + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} TermArg TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LOR '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LOR + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; MatchTerm - : PARSEOP_MATCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MATCH);} + : PARSEOP_MATCH + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MATCH);} TermArg ',' MatchOpKeyword TermArgItem ',' MatchOpKeyword TermArgItem TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);} - | PARSEOP_MATCH '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);} + | PARSEOP_MATCH + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; MethodTerm - : PARSEOP_METHOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} + : PARSEOP_METHOD + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} NameString OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} OptionalSerializeRuleKeyword OptionalByteConstExpr OptionalParameterTypePackage OptionalParameterTypesPackage - ')' '{' + PARSEOP_CLOSE_PAREN '{' TermList '}' {$$ = TrLinkChildren ($<n>3,7, TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION), $5,$7,$8,$9,$10,$13);} - | PARSEOP_METHOD '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_METHOD + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; MidTerm - : PARSEOP_MID '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MID);} + : PARSEOP_MID + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MID);} TermArg TermArgItem TermArgItem Target - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} - | PARSEOP_MID '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} + | PARSEOP_MID + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ModTerm - : PARSEOP_MOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} + : PARSEOP_MOD + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} TermArg TermArgItem Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_MOD '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_MOD + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; MultiplyTerm - : PARSEOP_MULTIPLY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} + : PARSEOP_MULTIPLY + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} TermArg TermArgItem Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_MULTIPLY '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_MULTIPLY + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; MutexTerm - : PARSEOP_MUTEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);} + : PARSEOP_MUTEX + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);} NameString ',' ByteConstExpr - ')' {$$ = TrLinkChildren ($<n>3,2, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2, TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} - | PARSEOP_MUTEX '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_MUTEX + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; NameTerm - : PARSEOP_NAME '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);} + : PARSEOP_NAME + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);} NameString ',' DataObject - ')' {$$ = TrLinkChildren ($<n>3,2, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2, TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} - | PARSEOP_NAME '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_NAME + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; NAndTerm - : PARSEOP_NAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);} + : PARSEOP_NAND + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);} TermArg TermArgItem Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_NAND '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_NAND + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; NoOpTerm @@ -821,60 +944,72 @@ NoOpTerm ; NOrTerm - : PARSEOP_NOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);} + : PARSEOP_NOR + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);} TermArg TermArgItem Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_NOR '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_NOR + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; NotifyTerm - : PARSEOP_NOTIFY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);} + : PARSEOP_NOTIFY + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);} SuperName TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_NOTIFY '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_NOTIFY + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; NotTerm - : PARSEOP_NOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} + : PARSEOP_NOT + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} TermArg Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_NOT '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_NOT + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ObjectTypeTerm - : PARSEOP_OBJECTTYPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} - ObjectTypeName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_OBJECTTYPE '(' - error ')' {$$ = AslDoError(); yyclearin;} + : PARSEOP_OBJECTTYPE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} + ObjectTypeSource + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_OBJECTTYPE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; OffsetTerm - : PARSEOP_OFFSET '(' + : PARSEOP_OFFSET + PARSEOP_OPEN_PAREN AmlPackageLengthTerm - ')' {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);} - | PARSEOP_OFFSET '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);} + | PARSEOP_OFFSET + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; OpRegionTerm - : PARSEOP_OPERATIONREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} + : PARSEOP_OPERATIONREGION + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} NameString ',' OpRegionSpaceIdTerm TermArgItem TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,4, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4, TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION), $6,$7,$8);} - | PARSEOP_OPERATIONREGION '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_OPERATIONREGION + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; OpRegionSpaceIdTerm @@ -883,13 +1018,15 @@ OpRegionSpaceIdTerm ; OrTerm - : PARSEOP_OR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} + : PARSEOP_OR + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} TermArg TermArgItem Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_OR '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_OR + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; PackageTerm @@ -898,25 +1035,29 @@ PackageTerm '{' PackageList '}' {$$ = TrLinkChildren ($<n>2,2,$3,$5);} PowerResTerm - : PARSEOP_POWERRESOURCE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} + : PARSEOP_POWERRESOURCE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} NameString ',' ByteConstExpr ',' WordConstExpr - ')' '{' + PARSEOP_CLOSE_PAREN '{' TermList '}' {$$ = TrLinkChildren ($<n>3,4, TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION), $6,$8,$11);} - | PARSEOP_POWERRESOURCE '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_POWERRESOURCE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; PrintfTerm - : PARSEOP_PRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);} + : PARSEOP_PRINTF + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);} StringData PrintfArgList - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_PRINTF '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_PRINTF + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; PrintfArgList @@ -927,26 +1068,30 @@ PrintfArgList ; ProcessorTerm - : PARSEOP_PROCESSOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} + : PARSEOP_PROCESSOR + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} NameString ',' ByteConstExpr OptionalDWordConstExpr OptionalByteConstExpr - ')' '{' + PARSEOP_CLOSE_PAREN '{' TermList '}' {$$ = TrLinkChildren ($<n>3,5, TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION), $6,$7,$8,$11);} - | PARSEOP_PROCESSOR '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_PROCESSOR + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; RawDataBufferTerm - : PARSEOP_DATABUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} + : PARSEOP_DATABUFFER + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} OptionalWordConst - ')' '{' + PARSEOP_CLOSE_PAREN '{' ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_DATABUFFER '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_DATABUFFER + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; /* @@ -954,204 +1099,247 @@ RawDataBufferTerm * we've taken a pointer to it. (hard to tell if a local becomes initialized this way.) */ RefOfTerm - : PARSEOP_REFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REFOF);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1, + : PARSEOP_REFOF + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_REFOF);} + RefOfSource + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1, TrSetNodeFlags ($4, NODE_IS_TARGET));} - | PARSEOP_REFOF '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_REFOF + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ReleaseTerm - : PARSEOP_RELEASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);} + : PARSEOP_RELEASE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);} SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_RELEASE '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_RELEASE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ResetTerm - : PARSEOP_RESET '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);} + : PARSEOP_RESET + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);} SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_RESET '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_RESET + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ReturnTerm - : PARSEOP_RETURN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);} + : PARSEOP_RETURN + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);} OptionalReturnArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} | PARSEOP_RETURN {$$ = TrLinkChildren ( TrCreateLeafNode (PARSEOP_RETURN),1, TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN));} - | PARSEOP_RETURN '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_RETURN + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ScopeTerm - : PARSEOP_SCOPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);} + : PARSEOP_SCOPE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);} NameString - ')' '{' + PARSEOP_CLOSE_PAREN '{' TermList '}' {$$ = TrLinkChildren ($<n>3,2, TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} - | PARSEOP_SCOPE '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_SCOPE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ShiftLeftTerm - : PARSEOP_SHIFTLEFT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} + : PARSEOP_SHIFTLEFT + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} TermArg TermArgItem Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_SHIFTLEFT '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_SHIFTLEFT + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ShiftRightTerm - : PARSEOP_SHIFTRIGHT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} + : PARSEOP_SHIFTRIGHT + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} TermArg TermArgItem Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_SHIFTRIGHT '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_SHIFTRIGHT + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; SignalTerm - : PARSEOP_SIGNAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);} + : PARSEOP_SIGNAL + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);} SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_SIGNAL '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_SIGNAL + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; SizeOfTerm - : PARSEOP_SIZEOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);} + : PARSEOP_SIZEOF + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);} SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_SIZEOF '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_SIZEOF + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; SleepTerm - : PARSEOP_SLEEP '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);} + : PARSEOP_SLEEP + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);} TermArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_SLEEP '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_SLEEP + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; StallTerm - : PARSEOP_STALL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);} + : PARSEOP_STALL + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);} TermArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_STALL '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_STALL + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; StoreTerm - : PARSEOP_STORE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STORE);} + : PARSEOP_STORE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STORE);} TermArg ',' SuperName - ')' {$$ = TrLinkChildren ($<n>3,2,$4, - TrSetNodeFlags ($6, NODE_IS_TARGET));} - | PARSEOP_STORE '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4, + TrSetNodeFlags ($6, NODE_IS_TARGET));} + | PARSEOP_STORE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; SubtractTerm - : PARSEOP_SUBTRACT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} + : PARSEOP_SUBTRACT + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} TermArg TermArgItem Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_SUBTRACT '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_SUBTRACT + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; SwitchTerm - : PARSEOP_SWITCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);} + : PARSEOP_SWITCH + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);} TermArg - ')' '{' - CaseDefaultTermList '}' - {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_SWITCH '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN '{' + CaseDefaultTermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_SWITCH + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ThermalZoneTerm - : PARSEOP_THERMALZONE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} + : PARSEOP_THERMALZONE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} NameString - ')' '{' + PARSEOP_CLOSE_PAREN '{' TermList '}' {$$ = TrLinkChildren ($<n>3,2, TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} - | PARSEOP_THERMALZONE '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_THERMALZONE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; TimerTerm - : PARSEOP_TIMER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);} - ')' {$$ = TrLinkChildren ($<n>3,0);} + : PARSEOP_TIMER + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,0);} | PARSEOP_TIMER {$$ = TrLinkChildren ( TrCreateLeafNode (PARSEOP_TIMER),0);} - | PARSEOP_TIMER '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_TIMER + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ToBCDTerm - : PARSEOP_TOBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBCD);} + : PARSEOP_TOBCD + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOBCD);} TermArg Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_TOBCD '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_TOBCD + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ToBufferTerm - : PARSEOP_TOBUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} + : PARSEOP_TOBUFFER + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} TermArg Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_TOBUFFER '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_TOBUFFER + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ToDecimalStringTerm - : PARSEOP_TODECIMALSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} + : PARSEOP_TODECIMALSTRING + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} TermArg Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_TODECIMALSTRING '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_TODECIMALSTRING + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ToHexStringTerm - : PARSEOP_TOHEXSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} + : PARSEOP_TOHEXSTRING + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} TermArg Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_TOHEXSTRING '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_TOHEXSTRING + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ToIntegerTerm - : PARSEOP_TOINTEGER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} + : PARSEOP_TOINTEGER + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} TermArg Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_TOINTEGER '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_TOINTEGER + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ToPLDTerm - : PARSEOP_TOPLD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);} + : PARSEOP_TOPLD + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);} PldKeywordList - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_TOPLD '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_TOPLD + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; PldKeywordList @@ -1171,62 +1359,77 @@ PldKeywordList ToStringTerm - : PARSEOP_TOSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);} + : PARSEOP_TOSTRING + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);} TermArg OptionalCount Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_TOSTRING '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_TOSTRING + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ToUUIDTerm - : PARSEOP_TOUUID '(' - StringData ')' {$$ = TrUpdateNode (PARSEOP_TOUUID, $3);} - | PARSEOP_TOUUID '(' - error ')' {$$ = AslDoError(); yyclearin;} + : PARSEOP_TOUUID + PARSEOP_OPEN_PAREN + StringData + PARSEOP_CLOSE_PAREN {$$ = TrUpdateNode (PARSEOP_TOUUID, $3);} + | PARSEOP_TOUUID + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; UnicodeTerm - : PARSEOP_UNICODE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);} + : PARSEOP_UNICODE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);} StringData - ')' {$$ = TrLinkChildren ($<n>3,2,0,$4);} - | PARSEOP_UNICODE '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,0,$4);} + | PARSEOP_UNICODE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; UnloadTerm - : PARSEOP_UNLOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);} + : PARSEOP_UNLOAD + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);} SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_UNLOAD '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_UNLOAD + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; WaitTerm - : PARSEOP_WAIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);} + : PARSEOP_WAIT + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);} SuperName TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_WAIT '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_WAIT + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; XOrTerm - : PARSEOP_XOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} + : PARSEOP_XOR + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} TermArg TermArgItem Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_XOR '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_XOR + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; WhileTerm - : PARSEOP_WHILE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} + : PARSEOP_WHILE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} TermArg - ')' '{' TermList '}' - {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_WHILE '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN + '{' TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_WHILE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; diff --git a/src/acpica/source/compiler/aslresources.y b/src/acpica/source/compiler/aslresources.y index 9f5fb02..de45100 100644 --- a/src/acpica/source/compiler/aslresources.y +++ b/src/acpica/source/compiler/aslresources.y @@ -128,7 +128,8 @@ NoEcho(' * Also, insert the EndTag at the end of the template. */ ResourceTemplateTerm - : PARSEOP_RESOURCETEMPLATE OptionalParentheses + : PARSEOP_RESOURCETEMPLATE + OptionalParentheses '{' ResourceMacroList '}' {$$ = TrCreateNode (PARSEOP_RESOURCETEMPLATE,4, TrCreateLeafNode (PARSEOP_DEFAULT_ARG), @@ -139,7 +140,8 @@ ResourceTemplateTerm OptionalParentheses : {$$ = NULL;} - | '(' ')' {$$ = NULL;} + | PARSEOP_OPEN_PAREN + PARSEOP_CLOSE_PAREN {$$ = NULL;} ; ResourceMacroList @@ -188,19 +190,22 @@ ResourceMacroTerm ; DMATerm - : PARSEOP_DMA '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DMA);} + : PARSEOP_DMA + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DMA);} DMATypeKeyword OptionalBusMasterKeyword ',' XferTypeKeyword OptionalNameString_Last - ')' '{' + PARSEOP_CLOSE_PAREN '{' ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$5,$7,$8,$11);} - | PARSEOP_DMA '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_DMA + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; DWordIOTerm - : PARSEOP_DWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDIO);} + : PARSEOP_DWORDIO + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDIO);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -216,14 +221,16 @@ DWordIOTerm OptionalNameString OptionalType OptionalTranslationType_Last - ')' {$$ = TrLinkChildren ($<n>3,15, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} - | PARSEOP_DWORDIO '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_DWORDIO + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; DWordMemoryTerm - : PARSEOP_DWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);} + : PARSEOP_DWORDMEMORY + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);} OptionalResourceType_First OptionalDecodeType OptionalMinType @@ -240,14 +247,16 @@ DWordMemoryTerm OptionalNameString OptionalAddressRange OptionalType_Last - ')' {$$ = TrLinkChildren ($<n>3,16, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,16, $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);} - | PARSEOP_DWORDMEMORY '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_DWORDMEMORY + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; DWordSpaceTerm - : PARSEOP_DWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);} + : PARSEOP_DWORDSPACE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);} ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} OptionalResourceType OptionalDecodeType @@ -262,21 +271,25 @@ DWordSpaceTerm OptionalByteConstExpr OptionalStringData OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,14, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, $4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} - | PARSEOP_DWORDSPACE '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_DWORDSPACE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; EndDependentFnTerm - : PARSEOP_ENDDEPENDENTFN '(' - ')' {$$ = TrCreateLeafNode (PARSEOP_ENDDEPENDENTFN);} - | PARSEOP_ENDDEPENDENTFN '(' - error ')' {$$ = AslDoError(); yyclearin;} + : PARSEOP_ENDDEPENDENTFN + PARSEOP_OPEN_PAREN + PARSEOP_CLOSE_PAREN {$$ = TrCreateLeafNode (PARSEOP_ENDDEPENDENTFN);} + | PARSEOP_ENDDEPENDENTFN + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ExtendedIOTerm - : PARSEOP_EXTENDEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);} + : PARSEOP_EXTENDEDIO + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -291,14 +304,16 @@ ExtendedIOTerm OptionalNameString OptionalType OptionalTranslationType_Last - ')' {$$ = TrLinkChildren ($<n>3,14, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22);} - | PARSEOP_EXTENDEDIO '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_EXTENDEDIO + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ExtendedMemoryTerm - : PARSEOP_EXTENDEDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);} + : PARSEOP_EXTENDEDMEMORY + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);} OptionalResourceType_First OptionalDecodeType OptionalMinType @@ -314,14 +329,15 @@ ExtendedMemoryTerm OptionalNameString OptionalAddressRange OptionalType_Last - ')' {$$ = TrLinkChildren ($<n>3,15, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24);} - | PARSEOP_EXTENDEDMEMORY '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_EXTENDEDMEMORY + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; ExtendedSpaceTerm - : PARSEOP_EXTENDEDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);} + : PARSEOP_EXTENDEDSPACE PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);} ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} OptionalResourceType OptionalDecodeType @@ -335,35 +351,41 @@ ExtendedSpaceTerm ',' QWordConstExpr OptionalQWordConstExpr OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,13, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,13, $4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23);} - | PARSEOP_EXTENDEDSPACE '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_EXTENDEDSPACE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; FixedDmaTerm - : PARSEOP_FIXEDDMA '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDDMA);} + : PARSEOP_FIXEDDMA + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDDMA);} WordConstExpr /* 04: DMA RequestLines */ ',' WordConstExpr /* 06: DMA Channels */ OptionalXferSize /* 07: DMA TransferSize */ OptionalNameString /* 08: DescriptorName */ - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$6,$7,$8);} - | PARSEOP_FIXEDDMA '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$6,$7,$8);} + | PARSEOP_FIXEDDMA + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; FixedIOTerm - : PARSEOP_FIXEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDIO);} + : PARSEOP_FIXEDIO + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDIO);} WordConstExpr ',' ByteConstExpr OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} - | PARSEOP_FIXEDIO '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} + | PARSEOP_FIXEDIO + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; GpioIntTerm - : PARSEOP_GPIO_INT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);} + : PARSEOP_GPIO_INT + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);} InterruptTypeKeyword /* 04: InterruptType */ ',' InterruptLevel /* 06: InterruptLevel */ OptionalShareType /* 07: SharedType */ @@ -374,15 +396,17 @@ GpioIntTerm OptionalResourceType /* 14: ResourceType */ OptionalNameString /* 15: DescriptorName */ OptionalBuffer_Last /* 16: VendorData */ - ')' '{' + PARSEOP_CLOSE_PAREN '{' DWordConstExpr '}' {$$ = TrLinkChildren ($<n>3,11, $4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);} - | PARSEOP_GPIO_INT '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_GPIO_INT + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; GpioIoTerm - : PARSEOP_GPIO_IO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);} + : PARSEOP_GPIO_IO + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);} OptionalShareType_First /* 04: SharedType */ ',' PinConfigByte /* 06: PinConfig */ OptionalWordConstExpr /* 07: DebounceTimeout */ @@ -393,15 +417,17 @@ GpioIoTerm OptionalResourceType /* 13: ResourceType */ OptionalNameString /* 14: DescriptorName */ OptionalBuffer_Last /* 15: VendorData */ - ')' '{' + PARSEOP_CLOSE_PAREN '{' DWordList '}' {$$ = TrLinkChildren ($<n>3,11, $4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);} - | PARSEOP_GPIO_IO '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_GPIO_IO + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; I2cSerialBusTerm - : PARSEOP_I2C_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);} + : PARSEOP_I2C_SERIALBUS + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);} WordConstExpr /* 04: SlaveAddress */ OptionalSlaveMode /* 05: SlaveMode */ ',' DWordConstExpr /* 07: ConnectionSpeed */ @@ -411,15 +437,17 @@ I2cSerialBusTerm OptionalResourceType /* 12: ResourceType */ OptionalNameString /* 13: DescriptorName */ OptionalBuffer_Last /* 14: VendorData */ - ')' {$$ = TrLinkChildren ($<n>3,10, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,10, $4,$5,$7,$8,$10,$11,$12,$13, TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$14);} - | PARSEOP_I2C_SERIALBUS '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_I2C_SERIALBUS + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; I2cSerialBusTermV2 - : PARSEOP_I2C_SERIALBUS_V2 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS_V2);} + : PARSEOP_I2C_SERIALBUS_V2 + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS_V2);} WordConstExpr /* 04: SlaveAddress */ OptionalSlaveMode /* 05: SlaveMode */ ',' DWordConstExpr /* 07: ConnectionSpeed */ @@ -430,14 +458,16 @@ I2cSerialBusTermV2 OptionalNameString /* 13: DescriptorName */ OptionalShareType /* 14: Share */ OptionalBuffer_Last /* 15: VendorData */ - ')' {$$ = TrLinkChildren ($<n>3,10, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,10, $4,$5,$7,$8,$10,$11,$12,$13,$14,$15);} - | PARSEOP_I2C_SERIALBUS_V2 '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_I2C_SERIALBUS_V2 + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; InterruptTerm - : PARSEOP_INTERRUPT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} + : PARSEOP_INTERRUPT + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} OptionalResourceType_First ',' InterruptTypeKeyword ',' InterruptLevel @@ -445,86 +475,100 @@ InterruptTerm OptionalByteConstExpr OptionalStringData OptionalNameString_Last - ')' '{' + PARSEOP_CLOSE_PAREN '{' DWordList '}' {$$ = TrLinkChildren ($<n>3,8, $4,$6,$8,$9,$10,$11,$12,$15);} - | PARSEOP_INTERRUPT '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_INTERRUPT + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; IOTerm - : PARSEOP_IO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IO);} + : PARSEOP_IO + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IO);} IODecodeKeyword ',' WordConstExpr ',' WordConstExpr ',' ByteConstExpr ',' ByteConstExpr OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} - | PARSEOP_IO '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} + | PARSEOP_IO + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; IRQNoFlagsTerm - : PARSEOP_IRQNOFLAGS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);} + : PARSEOP_IRQNOFLAGS + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);} OptionalNameString_First - ')' '{' + PARSEOP_CLOSE_PAREN '{' ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_IRQNOFLAGS '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_IRQNOFLAGS + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; IRQTerm - : PARSEOP_IRQ '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQ);} + : PARSEOP_IRQ + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IRQ);} InterruptTypeKeyword ',' InterruptLevel OptionalShareType OptionalNameString_Last - ')' '{' + PARSEOP_CLOSE_PAREN '{' ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$7,$8,$11);} - | PARSEOP_IRQ '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_IRQ + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; Memory24Term - : PARSEOP_MEMORY24 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY24);} + : PARSEOP_MEMORY24 + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY24);} OptionalReadWriteKeyword ',' WordConstExpr ',' WordConstExpr ',' WordConstExpr ',' WordConstExpr OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} - | PARSEOP_MEMORY24 '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} + | PARSEOP_MEMORY24 + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; Memory32FixedTerm - : PARSEOP_MEMORY32FIXED '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);} + : PARSEOP_MEMORY32FIXED + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);} OptionalReadWriteKeyword ',' DWordConstExpr ',' DWordConstExpr OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$6,$8,$9);} - | PARSEOP_MEMORY32FIXED '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$6,$8,$9);} + | PARSEOP_MEMORY32FIXED + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; Memory32Term - : PARSEOP_MEMORY32 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32);} + : PARSEOP_MEMORY32 + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32);} OptionalReadWriteKeyword ',' DWordConstExpr ',' DWordConstExpr ',' DWordConstExpr ',' DWordConstExpr OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} - | PARSEOP_MEMORY32 '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} + | PARSEOP_MEMORY32 + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; QWordIOTerm - : PARSEOP_QWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDIO);} + : PARSEOP_QWORDIO + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDIO);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -540,14 +584,16 @@ QWordIOTerm OptionalNameString OptionalType OptionalTranslationType_Last - ')' {$$ = TrLinkChildren ($<n>3,15, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} - | PARSEOP_QWORDIO '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_QWORDIO + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; QWordMemoryTerm - : PARSEOP_QWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);} + : PARSEOP_QWORDMEMORY + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);} OptionalResourceType_First OptionalDecodeType OptionalMinType @@ -564,14 +610,16 @@ QWordMemoryTerm OptionalNameString OptionalAddressRange OptionalType_Last - ')' {$$ = TrLinkChildren ($<n>3,16, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,16, $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);} - | PARSEOP_QWORDMEMORY '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_QWORDMEMORY + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; QWordSpaceTerm - : PARSEOP_QWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);} + : PARSEOP_QWORDSPACE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);} ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} OptionalResourceType OptionalDecodeType @@ -586,27 +634,31 @@ QWordSpaceTerm OptionalByteConstExpr OptionalStringData OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,14, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, $4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} - | PARSEOP_QWORDSPACE '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_QWORDSPACE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; RegisterTerm - : PARSEOP_REGISTER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REGISTER);} + : PARSEOP_REGISTER + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_REGISTER);} AddressSpaceKeyword ',' ByteConstExpr ',' ByteConstExpr ',' QWordConstExpr OptionalAccessSize OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$11,$12);} - | PARSEOP_REGISTER '(' - error ')' {$$ = AslDoError(); yyclearin;} + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$11,$12);} + | PARSEOP_REGISTER + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; SpiSerialBusTerm - : PARSEOP_SPI_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);} + : PARSEOP_SPI_SERIALBUS + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);} WordConstExpr /* 04: DeviceSelection */ OptionalDevicePolarity /* 05: DevicePolarity */ OptionalWireMode /* 06: WireMode */ @@ -620,15 +672,17 @@ SpiSerialBusTerm OptionalResourceType /* 19: ResourceType */ OptionalNameString /* 20: DescriptorName */ OptionalBuffer_Last /* 21: VendorData */ - ')' {$$ = TrLinkChildren ($<n>3,14, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, $4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20, TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$21);} - | PARSEOP_SPI_SERIALBUS '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_SPI_SERIALBUS + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; SpiSerialBusTermV2 - : PARSEOP_SPI_SERIALBUS_V2 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS_V2);} + : PARSEOP_SPI_SERIALBUS_V2 + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS_V2);} WordConstExpr /* 04: DeviceSelection */ OptionalDevicePolarity /* 05: DevicePolarity */ OptionalWireMode /* 06: WireMode */ @@ -643,32 +697,38 @@ SpiSerialBusTermV2 OptionalNameString /* 20: DescriptorName */ OptionalShareType /* 21: Share */ OptionalBuffer_Last /* 22: VendorData */ - ')' {$$ = TrLinkChildren ($<n>3,14, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, $4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21,$22);} - | PARSEOP_SPI_SERIALBUS_V2 '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_SPI_SERIALBUS_V2 + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; StartDependentFnNoPriTerm - : PARSEOP_STARTDEPENDENTFN_NOPRI '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} - ')' '{' + : PARSEOP_STARTDEPENDENTFN_NOPRI + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} + PARSEOP_CLOSE_PAREN '{' ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,1,$6);} - | PARSEOP_STARTDEPENDENTFN_NOPRI '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_STARTDEPENDENTFN_NOPRI + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; StartDependentFnTerm - : PARSEOP_STARTDEPENDENTFN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);} + : PARSEOP_STARTDEPENDENTFN + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);} ByteConstExpr ',' ByteConstExpr - ')' '{' + PARSEOP_CLOSE_PAREN '{' ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$9);} - | PARSEOP_STARTDEPENDENTFN '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_STARTDEPENDENTFN + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; UartSerialBusTerm - : PARSEOP_UART_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);} + : PARSEOP_UART_SERIALBUS + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);} DWordConstExpr /* 04: ConnectionSpeed */ OptionalBitsPerByte /* 05: BitsPerByte */ OptionalStopBits /* 06: StopBits */ @@ -683,15 +743,17 @@ UartSerialBusTerm OptionalResourceType /* 19: ResourceType */ OptionalNameString /* 20: DescriptorName */ OptionalBuffer_Last /* 21: VendorData */ - ')' {$$ = TrLinkChildren ($<n>3,15, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, $4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20, TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$21);} - | PARSEOP_UART_SERIALBUS '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_UART_SERIALBUS + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; UartSerialBusTermV2 - : PARSEOP_UART_SERIALBUS_V2 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS_V2);} + : PARSEOP_UART_SERIALBUS_V2 + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS_V2);} DWordConstExpr /* 04: ConnectionSpeed */ OptionalBitsPerByte /* 05: BitsPerByte */ OptionalStopBits /* 06: StopBits */ @@ -707,32 +769,38 @@ UartSerialBusTermV2 OptionalNameString /* 20: DescriptorName */ OptionalShareType /* 21: Share */ OptionalBuffer_Last /* 22: VendorData */ - ')' {$$ = TrLinkChildren ($<n>3,15, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, $4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21,$22);} - | PARSEOP_UART_SERIALBUS_V2 '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_UART_SERIALBUS_V2 + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; VendorLongTerm - : PARSEOP_VENDORLONG '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORLONG);} + : PARSEOP_VENDORLONG + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORLONG);} OptionalNameString_First - ')' '{' + PARSEOP_CLOSE_PAREN '{' ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_VENDORLONG '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_VENDORLONG + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; VendorShortTerm - : PARSEOP_VENDORSHORT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);} + : PARSEOP_VENDORSHORT + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);} OptionalNameString_First - ')' '{' + PARSEOP_CLOSE_PAREN '{' ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_VENDORSHORT '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_VENDORSHORT + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; WordBusNumberTerm - : PARSEOP_WORDBUSNUMBER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);} + : PARSEOP_WORDBUSNUMBER + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -745,14 +813,16 @@ WordBusNumberTerm OptionalByteConstExpr OptionalStringData OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,12, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,12, $4,$5,$6,$7,$9,$11,$13,$15,$17,$18,$19,$20);} - | PARSEOP_WORDBUSNUMBER '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_WORDBUSNUMBER + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; WordIOTerm - : PARSEOP_WORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDIO);} + : PARSEOP_WORDIO + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WORDIO);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -768,14 +838,16 @@ WordIOTerm OptionalNameString OptionalType OptionalTranslationType_Last - ')' {$$ = TrLinkChildren ($<n>3,15, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15, $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} - | PARSEOP_WORDIO '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_WORDIO + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; WordSpaceTerm - : PARSEOP_WORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDSPACE);} + : PARSEOP_WORDSPACE + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WORDSPACE);} ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} OptionalResourceType OptionalDecodeType @@ -790,8 +862,9 @@ WordSpaceTerm OptionalByteConstExpr OptionalStringData OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,14, + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14, $4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} - | PARSEOP_WORDSPACE '(' - error ')' {$$ = AslDoError(); yyclearin;} + | PARSEOP_WORDSPACE + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; diff --git a/src/acpica/source/compiler/aslrestype2.c b/src/acpica/source/compiler/aslrestype2.c index 9fc77b0..cbec1b3 100644 --- a/src/acpica/source/compiler/aslrestype2.c +++ b/src/acpica/source/compiler/aslrestype2.c @@ -199,6 +199,11 @@ RsDoGeneralRegisterDescriptor ( RsCreateByteField (InitializerOp, ACPI_RESTAG_ACCESSSIZE, CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.AccessSize)); + if (Descriptor->GenericReg.AddressSpaceId == ACPI_ADR_SPACE_PLATFORM_COMM) + { + break; + } + if (Descriptor->GenericReg.AccessSize > AML_FIELD_ACCESS_QWORD) { AslError (ASL_ERROR, ASL_MSG_INVALID_ACCESS_SIZE, diff --git a/src/acpica/source/compiler/aslrules.y b/src/acpica/source/compiler/aslrules.y index 4bcbbf2..db75164 100644 --- a/src/acpica/source/compiler/aslrules.y +++ b/src/acpica/source/compiler/aslrules.y @@ -153,14 +153,15 @@ AslCode * The ObjectList term is obsolete and has been removed. */ DefinitionBlockTerm - : PARSEOP_DEFINITION_BLOCK '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITION_BLOCK);} + : PARSEOP_DEFINITION_BLOCK + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITION_BLOCK);} String ',' String ',' ByteConst ',' String ',' String ',' DWordConst - ')' {TrSetEndLineNumber ($<n>3);} + PARSEOP_CLOSE_PAREN {TrSetEndLineNumber ($<n>3);} '{' TermList '}' {$$ = TrLinkChildren ($<n>3,7, $4,$6,$8,$10,$12,$14,$18);} ; @@ -171,6 +172,9 @@ DefinitionBlockList DefinitionBlockList {$$ = TrLinkPeerNodes (2, $1,$2);} ; + +/******* Basic ASCII identifiers **************************************************/ + /* Allow IO, DMA, IRQ Resource macro and FOR macro names to also be used as identifiers */ NameString @@ -184,20 +188,31 @@ NameString /* NameSeg : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, (ACPI_NATIVE_INT) - TrNormalizeNameSeg ($1));} + TrNormalizeNameSeg ($1));} ; */ NameSeg : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, - (ACPI_NATIVE_INT) AslCompilerlval.s);} + (ACPI_NATIVE_INT) AslCompilerlval.s);} ; +/******* Fundamental argument/statement types ***********************************/ + +Term + : Object {} + | Type1Opcode {} + | Type2Opcode {} + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} + | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} + | Type2BufferOpcode {} + | Type2BufferOrStringOpcode {} + | error {$$ = AslDoError(); yyclearin;} + ; + SuperName - : NameString {} - | ArgTerm {} - | LocalTerm {} + : SimpleName {} | DebugTerm {} | Type6Opcode {} ; @@ -208,14 +223,19 @@ Target | ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} ; +RequiredTarget + : ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} + ; + TermArg - : Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} + : SimpleName {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} + | Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} | DataObject {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - | NameString {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - | ArgTerm {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - | LocalTerm {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - - +/* + | PARSEOP_OPEN_PAREN + TermArg + PARSEOP_CLOSE_PAREN {} +*/ ; /* @@ -228,8 +248,10 @@ TermArg */ MethodInvocationTerm - : NameString '(' {TrUpdateNode (PARSEOP_METHODCALL, $1);} - ArgList ')' {$$ = TrLinkChildNode ($1,$4);} + : NameString + PARSEOP_OPEN_PAREN {TrUpdateNode (PARSEOP_METHODCALL, $1);} + ArgList + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildNode ($1,$4);} ; /* OptionalCount must appear before ByteList or an incorrect reduction will result */ @@ -248,23 +270,44 @@ OptionalDataCount /* Legacy ASL */ : {$$ = NULL;} - | '(' TermArg ')' {$$ = $2;} - | '(' ')' {$$ = NULL;} + | PARSEOP_OPEN_PAREN + TermArg + PARSEOP_CLOSE_PAREN {$$ = $2;} + | PARSEOP_OPEN_PAREN + PARSEOP_CLOSE_PAREN {$$ = NULL;} /* C-style (ASL+) -- adds equals term */ | PARSEOP_EXP_EQUALS {$$ = NULL;} - | '(' TermArg ')' + | PARSEOP_OPEN_PAREN + TermArg + PARSEOP_CLOSE_PAREN PARSEOP_EXP_EQUALS {$$ = $2;} - | '(' ')' String + | PARSEOP_OPEN_PAREN + PARSEOP_CLOSE_PAREN + String PARSEOP_EXP_EQUALS {$$ = NULL;} ; /******* List Terms **************************************************/ + /* ACPI 3.0 -- allow semicolons between terms */ + +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);} + ; + ArgList : {$$ = NULL;} | TermArg @@ -371,38 +414,13 @@ OptionalParameterTypesPackage TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} ; - /* ACPI 3.0 -- allow semicolons between terms */ - -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);} - ; - -Term - : Object {} - | Type1Opcode {} - | Type2Opcode {} - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} - | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} - | Type2BufferOpcode {} - | Type2BufferOrStringOpcode {} - | error {$$ = AslDoError(); yyclearin;} - ; - /* * Case-Default list; allow only one Default term and unlimited Case terms */ CaseDefaultTermList : {$$ = NULL;} - | CaseTerm {} - | DefaultTerm {} + | CaseTerm {} + | DefaultTerm {} | CaseDefaultTermList CaseTerm {$$ = TrLinkPeerNode ($1,$2);} | CaseDefaultTermList @@ -592,32 +610,59 @@ NameSpaceModifier | ScopeTerm {} ; -/* For ObjectType: SuperName except for MethodInvocationTerm */ - -ObjectTypeName +SimpleName : NameString {} - | ArgTerm {} | LocalTerm {} + | ArgTerm {} + ; + +/* For ObjectType(), SuperName except for MethodInvocationTerm */ + +ObjectTypeSource + : SimpleName {} | DebugTerm {} | RefOfTerm {} | DerefOfTerm {} | IndexTerm {} | IndexExpTerm {} -/* | MethodInvocationTerm {} */ /* Caused reduce/reduce with Type6Opcode->MethodInvocationTerm */ ; -RequiredTarget - : ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} +/* For DeRefOf(), SuperName except for DerefOf and Debug */ + +DerefOfSource + : SimpleName {} + | RefOfTerm {} + | DerefOfTerm {} + | IndexTerm {} + | IndexExpTerm {} + | StoreTerm {} + | EqualsTerm {} + | MethodInvocationTerm {} ; -SimpleTarget - : NameString {} - | LocalTerm {} - | ArgTerm {} +/* For RefOf(), SuperName except for RefOf and MethodInvocationTerm */ + +RefOfSource + : SimpleName {} + | DebugTerm {} + | DerefOfTerm {} + | IndexTerm {} + | IndexExpTerm {} ; -/* Opcode types */ +/* For CondRefOf(), SuperName except for RefOf and MethodInvocationTerm */ + +CondRefOfSource + : SimpleName {} + | DebugTerm {} + | DerefOfTerm {} + | IndexTerm {} + | IndexExpTerm {} + ; +/* + * Opcode types, as defined in the ACPI specification + */ Type1Opcode : BreakTerm {} | BreakPointTerm {} diff --git a/src/acpica/source/compiler/aslstubs.c b/src/acpica/source/compiler/aslstubs.c index 995d355..9c84865 100644 --- a/src/acpica/source/compiler/aslstubs.c +++ b/src/acpica/source/compiler/aslstubs.c @@ -260,8 +260,7 @@ AcpiEvReleaseGlobalLock ( ACPI_STATUS AcpiEvInitializeRegion ( - ACPI_OPERAND_OBJECT *RegionObj, - BOOLEAN AcpiNsLocked) + ACPI_OPERAND_OBJECT *RegionObj) { return (AE_OK); } diff --git a/src/acpica/source/compiler/asltokens.y b/src/acpica/source/compiler/asltokens.y index 04e21ff..eaf5331 100644 --- a/src/acpica/source/compiler/asltokens.y +++ b/src/acpica/source/compiler/asltokens.y @@ -537,6 +537,9 @@ NoEcho(' %left <i> PARSEOP_EXP_INCREMENT PARSEOP_EXP_DECREMENT +%left <i> PARSEOP_OPEN_PAREN + PARSEOP_CLOSE_PAREN + /* Brackets for Index() support */ %left <i> PARSEOP_EXP_INDEX_LEFT diff --git a/src/acpica/source/compiler/asltypes.y b/src/acpica/source/compiler/asltypes.y index 811bed6..ec1a21c 100644 --- a/src/acpica/source/compiler/asltypes.y +++ b/src/acpica/source/compiler/asltypes.y @@ -140,7 +140,7 @@ NoEcho(' %type <n> ParameterTypesPackage %type <n> ParameterTypesPackageList %type <n> RequiredTarget -%type <n> SimpleTarget +%type <n> SimpleName %type <n> StringData %type <n> Target %type <n> Term @@ -324,7 +324,10 @@ NoEcho(' /* Types */ %type <n> SuperName -%type <n> ObjectTypeName +%type <n> ObjectTypeSource +%type <n> DerefOfSource +%type <n> RefOfSource +%type <n> CondRefOfSource %type <n> ArgTerm %type <n> LocalTerm %type <n> DebugTerm diff --git a/src/acpica/source/compiler/aslwalks.c b/src/acpica/source/compiler/aslwalks.c index bb743c6..c86b5e2 100644 --- a/src/acpica/source/compiler/aslwalks.c +++ b/src/acpica/source/compiler/aslwalks.c @@ -934,21 +934,10 @@ AnAnalyzeStoreOperator ( case PARSEOP_DEREFOF: case PARSEOP_REFOF: case PARSEOP_INDEX: + case PARSEOP_STORE: return; - case PARSEOP_METHODCALL: - /* - * A target is not allowed to be a method call. - * It is not supported by the ACPICA interpreter, nor is it - * supported by the MS ASL compiler or the MS interpreter. - * Although legal syntax up until ACPI 6.1, support for this - * will be removed for ACPI 6.2 (02/2016) - */ - AslError (ASL_ERROR, ASL_MSG_SYNTAX, - TargetOperandOp, "Illegal method invocation as a target operand"); - return; - default: break; } diff --git a/src/acpica/source/compiler/dttable.c b/src/acpica/source/compiler/dttable.c index ee3d26d..561c5ce 100644 --- a/src/acpica/source/compiler/dttable.c +++ b/src/acpica/source/compiler/dttable.c @@ -201,12 +201,9 @@ DtCompileFadt ( DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; ACPI_TABLE_HEADER *Table; - UINT8 FadtRevision; - UINT32 i; + UINT8 Revision; - /* Minimum table is the FADT version 1 (ACPI 1.0) */ - Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt1, &Subtable, TRUE); if (ACPI_FAILURE (Status)) @@ -218,41 +215,22 @@ DtCompileFadt ( DtInsertSubtable (ParentTable, Subtable); Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer); - FadtRevision = Table->Revision; - - /* Revision 0 and 2 are illegal */ - - if ((FadtRevision == 0) || - (FadtRevision == 2)) - { - DtError (ASL_ERROR, 0, NULL, - "Invalid value for FADT revision"); - - return (AE_BAD_VALUE); - } - - /* Revision out of supported range? */ + Revision = Table->Revision; - if (FadtRevision > ACPI_FADT_MAX_VERSION) + if (Revision == 2) { - DtError (ASL_ERROR, 0, NULL, - "Unknown or unsupported value for FADT revision"); - - return (AE_BAD_VALUE); - } - - /* Compile individual sub-parts of the FADT, per-revision */ - - for (i = 3; i <= ACPI_FADT_MAX_VERSION; i++) - { - if (i > FadtRevision) + Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt2, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) { - break; + return (Status); } - /* Compile the fields specific to this FADT revision */ - - Status = DtCompileTable (PFieldList, FadtRevisionInfo[i], + DtInsertSubtable (ParentTable, Subtable); + } + else if (Revision >= 2) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt3, &Subtable, TRUE); if (ACPI_FAILURE (Status)) { @@ -260,6 +238,30 @@ DtCompileFadt ( } DtInsertSubtable (ParentTable, Subtable); + + if (Revision >= 5) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt5, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + DtInsertSubtable (ParentTable, Subtable); + } + + if (Revision >= 6) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt6, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + DtInsertSubtable (ParentTable, Subtable); + } } return (AE_OK); diff --git a/src/acpica/source/components/disassembler/dmbuffer.c b/src/acpica/source/components/disassembler/dmbuffer.c index 7b2fcc4..d1c16e5 100644 --- a/src/acpica/source/components/disassembler/dmbuffer.c +++ b/src/acpica/source/components/disassembler/dmbuffer.c @@ -511,12 +511,16 @@ AcpiDmIsUnicodeBuffer ( return (FALSE); } - /* For each word, 1st byte must be ascii (1-0x7F), 2nd byte must be zero */ - + /* + * For each word, 1st byte must be printable ascii, and the + * 2nd byte must be zero. This does not allow for escape + * sequences, but it is the most secure way to detect a + * unicode string. + */ for (i = 0; i < (ByteCount - 2); i += 2) { if ((ByteData[i] == 0) || - (ByteData[i] > 0x7F) || + !(isprint (ByteData[i])) || (ByteData[(ACPI_SIZE) i + 1] != 0)) { return (FALSE); @@ -579,12 +583,27 @@ AcpiDmIsStringBuffer ( return (FALSE); } + /* + * Check for a possible standalone resource EndTag, ignore it + * here. However, this sequence is also the string "Y", but + * this seems rare enough to be acceptable. + */ + if ((ByteCount == 2) && (ByteData[0] == 0x79)) + { + return (FALSE); + } + + /* Check all bytes for ASCII */ + for (i = 0; i < (ByteCount - 1); i++) { - /* TBD: allow some escapes (non-ascii chars). + /* + * TBD: allow some escapes (non-ascii chars). * they will be handled in the string output routine */ + /* Not a string if not printable ascii */ + if (!isprint (ByteData[i])) { return (FALSE); diff --git a/src/acpica/source/components/disassembler/dmcstyle.c b/src/acpica/source/components/disassembler/dmcstyle.c index dcfc044..7bdc19f 100644 --- a/src/acpica/source/components/disassembler/dmcstyle.c +++ b/src/acpica/source/components/disassembler/dmcstyle.c @@ -145,6 +145,11 @@ AcpiDmIsTargetAnOperand ( ACPI_PARSE_OBJECT *Operand, BOOLEAN TopLevel); +static BOOLEAN +AcpiDmIsOptimizationIgnored ( + ACPI_PARSE_OBJECT *StoreOp, + ACPI_PARSE_OBJECT *StoreArgument); + /******************************************************************************* * @@ -167,12 +172,10 @@ AcpiDmCheckForSymbolicOpcode ( ACPI_OP_WALK_INFO *Info) { char *OperatorSymbol = NULL; - ACPI_PARSE_OBJECT *Child1; - ACPI_PARSE_OBJECT *Child2; + ACPI_PARSE_OBJECT *Argument1; + ACPI_PARSE_OBJECT *Argument2; ACPI_PARSE_OBJECT *Target; - ACPI_PARSE_OBJECT *GrandChild1; - ACPI_PARSE_OBJECT *GrandChild2; - ACPI_PARSE_OBJECT *GrandTarget = NULL; + ACPI_PARSE_OBJECT *Target2; /* Exit immediately if ASL+ not enabled */ @@ -182,25 +185,17 @@ AcpiDmCheckForSymbolicOpcode ( return (FALSE); } - /* Check for a non-ASL+ statement, propagate the flag */ - - if (Op->Common.Parent->Common.DisasmFlags & ACPI_PARSEOP_LEGACY_ASL_ONLY) - { - Op->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; - return (FALSE); - } - /* Get the first operand */ - Child1 = AcpiPsGetArg (Op, 0); - if (!Child1) + Argument1 = AcpiPsGetArg (Op, 0); + if (!Argument1) { return (FALSE); } /* Get the second operand */ - Child2 = Child1->Common.Next; + Argument2 = Argument1->Common.Next; /* Setup the operator string for this opcode */ @@ -274,7 +269,7 @@ AcpiDmCheckForSymbolicOpcode ( * LNotEqual, LLessEqual, and LGreaterEqual. There are * no actual AML opcodes for these operators. */ - switch (Child1->Common.AmlOpcode) + switch (Argument1->Common.AmlOpcode) { case AML_LEQUAL_OP: OperatorSymbol = " != "; @@ -296,19 +291,18 @@ AcpiDmCheckForSymbolicOpcode ( return (TRUE); } - Child1->Common.DisasmOpcode = ACPI_DASM_LNOT_SUFFIX; + Argument1->Common.DisasmOpcode = ACPI_DASM_LNOT_SUFFIX; Op->Common.DisasmOpcode = ACPI_DASM_LNOT_PREFIX; - Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND_ASSIGNMENT; /* Save symbol string in the next child (not peer) */ - Child2 = AcpiPsGetArg (Child1, 0); - if (!Child2) + Argument2 = AcpiPsGetArg (Argument1, 0); + if (!Argument2) { return (FALSE); } - Child2->Common.OperatorSymbol = OperatorSymbol; + Argument2->Common.OperatorSymbol = OperatorSymbol; return (TRUE); case AML_INDEX_OP: @@ -318,10 +312,10 @@ AcpiDmCheckForSymbolicOpcode ( * the symbolic operators for Index(). It doesn't make sense to * use Index() with a constant anyway. */ - if ((Child1->Common.AmlOpcode == AML_STRING_OP) || - (Child1->Common.AmlOpcode == AML_BUFFER_OP) || - (Child1->Common.AmlOpcode == AML_PACKAGE_OP) || - (Child1->Common.AmlOpcode == AML_VAR_PACKAGE_OP)) + if ((Argument1->Common.AmlOpcode == AML_STRING_OP) || + (Argument1->Common.AmlOpcode == AML_BUFFER_OP) || + (Argument1->Common.AmlOpcode == AML_PACKAGE_OP) || + (Argument1->Common.AmlOpcode == AML_VAR_PACKAGE_OP)) { Op->Common.DisasmFlags |= ACPI_PARSEOP_CLOSING_PAREN; return (FALSE); @@ -329,8 +323,8 @@ AcpiDmCheckForSymbolicOpcode ( /* Index operator is [] */ - Child1->Common.OperatorSymbol = " ["; - Child2->Common.OperatorSymbol = "]"; + Argument1->Common.OperatorSymbol = " ["; + Argument2->Common.OperatorSymbol = "]"; break; /* Unary operators */ @@ -352,7 +346,7 @@ AcpiDmCheckForSymbolicOpcode ( return (FALSE); } - if (Child1->Common.DisasmOpcode == ACPI_DASM_LNOT_SUFFIX) + if (Argument1->Common.DisasmOpcode == ACPI_DASM_LNOT_SUFFIX) { return (TRUE); } @@ -363,9 +357,9 @@ AcpiDmCheckForSymbolicOpcode ( * deferring symbol output until after the first operand has been * emitted. */ - if (!Child1->Common.OperatorSymbol) + if (!Argument1->Common.OperatorSymbol) { - Child1->Common.OperatorSymbol = OperatorSymbol; + Argument1->Common.OperatorSymbol = OperatorSymbol; } /* @@ -395,23 +389,58 @@ AcpiDmCheckForSymbolicOpcode ( /* Target is 3rd operand */ - Target = Child2->Common.Next; + Target = Argument2->Common.Next; if (Op->Common.AmlOpcode == AML_DIVIDE_OP) { + Target2 = Target->Common.Next; + /* * Divide has an extra target operand (Remainder). - * If this extra target is specified, it cannot be converted - * to a C-style operator + * Default behavior is to simply ignore ASL+ conversion + * if the remainder target (modulo) is specified. */ - if (AcpiDmIsValidTarget (Target)) + if (!AcpiGbl_DoDisassemblerOptimizations) { - Child1->Common.OperatorSymbol = NULL; - Op->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; - return (FALSE); + if (AcpiDmIsValidTarget (Target)) + { + Argument1->Common.OperatorSymbol = NULL; + Op->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; + return (FALSE); + } + + Target->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; + Target = Target2; } + else + { + /* + * Divide has an extra target operand (Remainder). + * If both targets are specified, it cannot be converted + * to a C-style operator. + */ + if (AcpiDmIsValidTarget (Target) && + AcpiDmIsValidTarget (Target2)) + { + Argument1->Common.OperatorSymbol = NULL; + Op->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; + return (FALSE); + } + + if (AcpiDmIsValidTarget (Target)) /* Only first Target is valid (remainder) */ + { + /* Convert the Divide to Modulo */ + + Op->Common.AmlOpcode = AML_MOD_OP; - Target->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; - Target = Target->Common.Next; + Argument1->Common.OperatorSymbol = " % "; + Target2->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; + } + else /* Only second Target (quotient) is valid */ + { + Target->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; + Target = Target2; + } + } } /* Parser should ensure there is at least a placeholder target */ @@ -423,13 +452,6 @@ AcpiDmCheckForSymbolicOpcode ( if (!AcpiDmIsValidTarget (Target)) { - if (Op->Common.Parent->Common.AmlOpcode == AML_STORE_OP) - { - Op->Common.DisasmFlags = 0; - Child1->Common.OperatorSymbol = NULL; - return (FALSE); - } - /* Not a valid target (placeholder only, from parser) */ break; } @@ -462,8 +484,8 @@ AcpiDmCheckForSymbolicOpcode ( * Add (B, A, A) --> A += B * Add (B, C, A) --> A = (B + C) */ - if ((AcpiDmIsTargetAnOperand (Target, Child1, TRUE)) || - (AcpiDmIsTargetAnOperand (Target, Child2, TRUE))) + if ((AcpiDmIsTargetAnOperand (Target, Argument1, TRUE)) || + (AcpiDmIsTargetAnOperand (Target, Argument2, TRUE))) { Target->Common.OperatorSymbol = AcpiDmGetCompoundSymbol (Op->Common.AmlOpcode); @@ -471,7 +493,7 @@ AcpiDmCheckForSymbolicOpcode ( /* Convert operator to compound assignment */ Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND_ASSIGNMENT; - Child1->Common.OperatorSymbol = NULL; + Argument1->Common.OperatorSymbol = NULL; return (TRUE); } break; @@ -491,7 +513,7 @@ AcpiDmCheckForSymbolicOpcode ( * Subtract (A, B, A) --> A -= B * Subtract (B, A, A) --> A = (B - A) */ - if ((AcpiDmIsTargetAnOperand (Target, Child1, TRUE))) + if ((AcpiDmIsTargetAnOperand (Target, Argument1, TRUE))) { Target->Common.OperatorSymbol = AcpiDmGetCompoundSymbol (Op->Common.AmlOpcode); @@ -499,7 +521,7 @@ AcpiDmCheckForSymbolicOpcode ( /* Convert operator to compound assignment */ Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND_ASSIGNMENT; - Child1->Common.OperatorSymbol = NULL; + Argument1->Common.OperatorSymbol = NULL; return (TRUE); } break; @@ -553,7 +575,7 @@ AcpiDmCheckForSymbolicOpcode ( /* Target is optional, 3rd operand */ - Target = Child2->Common.Next; + Target = Argument2->Common.Next; if (AcpiDmIsValidTarget (Target)) { AcpiDmPromoteTarget (Op, Target); @@ -567,75 +589,23 @@ AcpiDmCheckForSymbolicOpcode ( case AML_STORE_OP: /* - * Target is the 2nd operand. - * We know the target is valid, it is not optional. + * For Store, the Target is the 2nd operand. We know the target + * is valid, because it is not optional. * - * The following block implements "Ignore conversion if a store - * is followed by a math/bit operator that has no target". Used - * only for the ASL test suite. + * Ignore any optimizations/folding if flag is set. + * Used for iASL/disassembler test suite only. */ - if (!AcpiGbl_DoDisassemblerOptimizations) + if (AcpiDmIsOptimizationIgnored (Op, Argument1)) { - switch (Child1->Common.AmlOpcode) - { - /* This operator has two operands and two targets */ - - case AML_DIVIDE_OP: - - GrandChild1 = Child1->Common.Value.Arg; - GrandChild2 = GrandChild1->Common.Next; - GrandTarget = GrandChild2->Common.Next; - - if (GrandTarget && !AcpiDmIsValidTarget (GrandTarget)) - { - Op->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; - return (FALSE); - } - GrandTarget = GrandTarget->Common.Next; - break; - - case AML_ADD_OP: - case AML_SUBTRACT_OP: - case AML_MULTIPLY_OP: - case AML_MOD_OP: - case AML_SHIFT_LEFT_OP: - case AML_SHIFT_RIGHT_OP: - case AML_BIT_AND_OP: - case AML_BIT_OR_OP: - case AML_BIT_XOR_OP: - case AML_INDEX_OP: - - /* These operators have two operands and a target */ - - GrandChild1 = Child1->Common.Value.Arg; - GrandChild2 = GrandChild1->Common.Next; - GrandTarget = GrandChild2->Common.Next; - break; - - case AML_BIT_NOT_OP: - - /* This operator has one operand and a target */ - - GrandChild1 = Child1->Common.Value.Arg; - GrandTarget = GrandChild1->Common.Next; - break; - - default: - break; - } - - if (GrandTarget && !AcpiDmIsValidTarget (GrandTarget)) - { - Op->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; - return (FALSE); - } + return (FALSE); } /* + * Perform conversion. * In the parse tree, simply swap the target with the * source so that the target is processed first. */ - Target = Child1->Common.Next; + Target = Argument1->Common.Next; if (!Target) { return (FALSE); @@ -652,7 +622,7 @@ AcpiDmCheckForSymbolicOpcode ( /* Target is optional, 2nd operand */ - Target = Child1->Common.Next; + Target = Argument1->Common.Next; if (!Target) { return (FALSE); @@ -677,23 +647,129 @@ AcpiDmCheckForSymbolicOpcode ( break; } + /* All other operators, emit an open paren */ + + AcpiOsPrintf ("("); + return (TRUE); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmIsOptimizationIgnored + * + * PARAMETERS: StoreOp - Store operator parse object + * StoreArgument - Target associate with the Op + * + * RETURN: TRUE if this Store operator should not be converted/removed. + * + * DESCRIPTION: The following function implements "Do not optimize if a + * store is immediately followed by a math/bit operator that + * has no target". + * + * Function is ignored if DoDisassemblerOptimizations is TRUE. + * This is the default, ignore this function. + * + * Disables these types of optimizations, and simply emits + * legacy ASL code: + * Store (Add (INT1, 4), INT2) --> Add (INT1, 4, INT2) + * --> INT2 = INT1 + 4 + * + * Store (Not (INT1), INT2) --> Not (INT1, INT2) + * --> INT2 = ~INT1 + * + * Used only for the ASL test suite. For the test suite, we + * don't want to perform some optimizations to ensure binary + * compatibility with the generation of the legacy ASL->AML. + * In other words, for all test modules we want exactly: + * (ASL+ -> AML) == (ASL- -> AML) + * + ******************************************************************************/ + +static BOOLEAN +AcpiDmIsOptimizationIgnored ( + ACPI_PARSE_OBJECT *StoreOp, + ACPI_PARSE_OBJECT *StoreArgument) +{ + ACPI_PARSE_OBJECT *Argument1; + ACPI_PARSE_OBJECT *Argument2; + ACPI_PARSE_OBJECT *Target; + + + /* No optimizations/folding for the typical case */ + + if (AcpiGbl_DoDisassemblerOptimizations) + { + return (FALSE); + } + /* - * Nodes marked with ACPI_PARSEOP_PARAMLIST don't need a parens - * output here. We also need to check the parent to see if this op - * is part of a compound test (!=, >=, <=). + * Only a small subset of ASL/AML operators can be optimized. + * Can only optimize/fold if there is no target (or targets) + * specified for the operator. And of course, the operator + * is surrrounded by a Store() operator. */ - if ((Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) || - ((Op->Common.Parent->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) && - (Op->Common.DisasmOpcode == ACPI_DASM_LNOT_SUFFIX))) + switch (StoreArgument->Common.AmlOpcode) { - /* Do Nothing. Paren already generated */ - return (TRUE); - } + case AML_ADD_OP: + case AML_SUBTRACT_OP: + case AML_MULTIPLY_OP: + case AML_MOD_OP: + case AML_SHIFT_LEFT_OP: + case AML_SHIFT_RIGHT_OP: + case AML_BIT_AND_OP: + case AML_BIT_OR_OP: + case AML_BIT_XOR_OP: + case AML_INDEX_OP: - /* All other operators, emit an open paren */ + /* These operators have two arguments and one target */ - AcpiOsPrintf ("("); - return (TRUE); + Argument1 = StoreArgument->Common.Value.Arg; + Argument2 = Argument1->Common.Next; + Target = Argument2->Common.Next; + + if (!AcpiDmIsValidTarget (Target)) + { + StoreOp->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; + return (TRUE); + } + break; + + case AML_DIVIDE_OP: + + /* This operator has two arguments and two targets */ + + Argument1 = StoreArgument->Common.Value.Arg; + Argument2 = Argument1->Common.Next; + Target = Argument2->Common.Next; + + if (!AcpiDmIsValidTarget (Target) || + !AcpiDmIsValidTarget (Target->Common.Next)) + { + StoreOp->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; + return (TRUE); + } + break; + + case AML_BIT_NOT_OP: + + /* This operator has one operand and one target */ + + Argument1 = StoreArgument->Common.Value.Arg; + Target = Argument1->Common.Next; + + if (!AcpiDmIsValidTarget (Target)) + { + StoreOp->Common.DisasmFlags |= ACPI_PARSEOP_LEGACY_ASL_ONLY; + return (TRUE); + } + break; + + default: + break; + } + + return (FALSE); } @@ -715,8 +791,6 @@ void AcpiDmCloseOperator ( ACPI_PARSE_OBJECT *Op) { - BOOLEAN IsCStyleOp = FALSE; - /* Always emit paren if ASL+ disassembly disabled */ @@ -726,8 +800,6 @@ AcpiDmCloseOperator ( return; } - /* Check for a non-ASL+ statement */ - if (Op->Common.DisasmFlags & ACPI_PARSEOP_LEGACY_ASL_ONLY) { AcpiOsPrintf (")"); @@ -767,8 +839,6 @@ AcpiDmCloseOperator ( { AcpiOsPrintf (")"); } - - IsCStyleOp = TRUE; break; case AML_INDEX_OP: @@ -796,21 +866,7 @@ AcpiDmCloseOperator ( break; } - /* - * Nodes marked with ACPI_PARSEOP_PARAMLIST don't need a parens - * output here. We also need to check the parent to see if this op - * is part of a compound test (!=, >=, <=). - */ - if (IsCStyleOp && - ((Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) || - ((Op->Common.Parent->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) && - (Op->Common.DisasmOpcode == ACPI_DASM_LNOT_SUFFIX)))) - { - return; - } - AcpiOsPrintf (")"); - return; } diff --git a/src/acpica/source/components/disassembler/dmresrc.c b/src/acpica/source/components/disassembler/dmresrc.c index 7980256..e45cecc 100644 --- a/src/acpica/source/components/disassembler/dmresrc.c +++ b/src/acpica/source/components/disassembler/dmresrc.c @@ -464,7 +464,8 @@ AcpiDmIsResourceTemplate ( ACPI_PARSE_OBJECT *NextOp; UINT8 *Aml; UINT8 *EndAml; - ACPI_SIZE Length; + UINT32 BufferLength; + UINT32 DeclaredBufferLength; /* This op must be a buffer */ @@ -474,8 +475,10 @@ AcpiDmIsResourceTemplate ( return (AE_TYPE); } - /* Get the ByteData list and length */ - + /* + * Get the declared length of the buffer. + * This is the nn in "Buffer (nn)" + */ NextOp = Op->Common.Value.Arg; if (!NextOp) { @@ -483,6 +486,10 @@ AcpiDmIsResourceTemplate ( return (AE_TYPE); } + DeclaredBufferLength = NextOp->Common.Value.Size; + + /* Get the length of the raw initialization byte list */ + NextOp = NextOp->Common.Next; if (!NextOp) { @@ -490,11 +497,22 @@ AcpiDmIsResourceTemplate ( } Aml = NextOp->Named.Data; - Length = (ACPI_SIZE) NextOp->Common.Value.Integer; + BufferLength = NextOp->Common.Value.Size; + + /* + * Not a template if declared buffer length != actual length of the + * intialization byte list. Because the resource macros will create + * a buffer of the exact required length (buffer length will be equal + * to the actual length). + */ + if (DeclaredBufferLength != BufferLength) + { + return (AE_TYPE); + } /* Walk the byte list, abort on any invalid descriptor type or length */ - Status = AcpiUtWalkAmlResources (WalkState, Aml, Length, + Status = AcpiUtWalkAmlResources (WalkState, Aml, BufferLength, NULL, ACPI_CAST_INDIRECT_PTR (void, &EndAml)); if (ACPI_FAILURE (Status)) { @@ -507,7 +525,7 @@ AcpiDmIsResourceTemplate ( * of a ResourceTemplate, the buffer must not have any extra data after * the EndTag.) */ - if ((Aml + Length - sizeof (AML_RESOURCE_END_TAG)) != EndAml) + if ((Aml + BufferLength - sizeof (AML_RESOURCE_END_TAG)) != EndAml) { return (AE_AML_NO_RESOURCE_END_TAG); } diff --git a/src/acpica/source/components/dispatcher/dsinit.c b/src/acpica/source/components/dispatcher/dsinit.c index 390a63f..b9ad5c9 100644 --- a/src/acpica/source/components/dispatcher/dsinit.c +++ b/src/acpica/source/components/dispatcher/dsinit.c @@ -118,6 +118,7 @@ #include "acdispat.h" #include "acnamesp.h" #include "actables.h" +#include "acinterp.h" #define _COMPONENT ACPI_DISPATCHER ACPI_MODULE_NAME ("dsinit") @@ -303,23 +304,16 @@ AcpiDsInitializeObjects ( /* Walk entire namespace from the supplied root */ - Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - /* * We don't use AcpiWalkNamespace since we do not want to acquire * the namespace reader lock. */ Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, StartNode, ACPI_UINT32_MAX, - ACPI_NS_WALK_UNLOCK, AcpiDsInitOneObject, NULL, &Info, NULL); + ACPI_NS_WALK_NO_UNLOCK, AcpiDsInitOneObject, NULL, &Info, NULL); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace")); } - (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); Status = AcpiGetTableByIndex (TableIndex, &Table); if (ACPI_FAILURE (Status)) diff --git a/src/acpica/source/components/dispatcher/dsmethod.c b/src/acpica/source/components/dispatcher/dsmethod.c index b60b51f..e7edcf4 100644 --- a/src/acpica/source/components/dispatcher/dsmethod.c +++ b/src/acpica/source/components/dispatcher/dsmethod.c @@ -179,15 +179,12 @@ AcpiDsAutoSerializeMethod ( "Method auto-serialization parse [%4.4s] %p\n", AcpiUtGetNodeName (Node), Node)); - AcpiExEnterInterpreter (); - /* Create/Init a root op for the method parse tree */ Op = AcpiPsAllocOp (AML_METHOD_OP, ObjDesc->Method.AmlStart); if (!Op) { - Status = AE_NO_MEMORY; - goto Unlock; + return_ACPI_STATUS (AE_NO_MEMORY); } AcpiPsSetName (Op, Node->Name.Integer); @@ -199,8 +196,7 @@ AcpiDsAutoSerializeMethod ( if (!WalkState) { AcpiPsFreeOp (Op); - Status = AE_NO_MEMORY; - goto Unlock; + return_ACPI_STATUS (AE_NO_MEMORY); } Status = AcpiDsInitAmlWalk (WalkState, Op, Node, @@ -219,8 +215,6 @@ AcpiDsAutoSerializeMethod ( Status = AcpiPsParseAml (WalkState); AcpiPsDeleteParseTree (Op); -Unlock: - AcpiExExitInterpreter (); return_ACPI_STATUS (Status); } @@ -856,26 +850,6 @@ AcpiDsTerminateControlMethod ( AcpiDsMethodDataDeleteAll (WalkState); /* - * If method is serialized, release the mutex and restore the - * current sync level for this thread - */ - if (MethodDesc->Method.Mutex) - { - /* Acquisition Depth handles recursive calls */ - - MethodDesc->Method.Mutex->Mutex.AcquisitionDepth--; - if (!MethodDesc->Method.Mutex->Mutex.AcquisitionDepth) - { - WalkState->Thread->CurrentSyncLevel = - MethodDesc->Method.Mutex->Mutex.OriginalSyncLevel; - - AcpiOsReleaseMutex ( - MethodDesc->Method.Mutex->Mutex.OsMutex); - MethodDesc->Method.Mutex->Mutex.ThreadId = 0; - } - } - - /* * Delete any namespace objects created anywhere within the * namespace by the execution of this method. Unless: * 1) This method is a module-level executable code method, in which @@ -908,6 +882,26 @@ AcpiDsTerminateControlMethod ( ~ACPI_METHOD_MODIFIED_NAMESPACE; } } + + /* + * If method is serialized, release the mutex and restore the + * current sync level for this thread + */ + if (MethodDesc->Method.Mutex) + { + /* Acquisition Depth handles recursive calls */ + + MethodDesc->Method.Mutex->Mutex.AcquisitionDepth--; + if (!MethodDesc->Method.Mutex->Mutex.AcquisitionDepth) + { + WalkState->Thread->CurrentSyncLevel = + MethodDesc->Method.Mutex->Mutex.OriginalSyncLevel; + + AcpiOsReleaseMutex ( + MethodDesc->Method.Mutex->Mutex.OsMutex); + MethodDesc->Method.Mutex->Mutex.ThreadId = 0; + } + } } /* Decrement the thread count on the method */ diff --git a/src/acpica/source/components/dispatcher/dsopcode.c b/src/acpica/source/components/dispatcher/dsopcode.c index ea0f11e..42178ad 100644 --- a/src/acpica/source/components/dispatcher/dsopcode.c +++ b/src/acpica/source/components/dispatcher/dsopcode.c @@ -162,7 +162,7 @@ AcpiDsInitializeRegion ( /* Namespace is NOT locked */ - Status = AcpiEvInitializeRegion (ObjDesc, FALSE); + Status = AcpiEvInitializeRegion (ObjDesc); return (Status); } diff --git a/src/acpica/source/components/dispatcher/dswload2.c b/src/acpica/source/components/dispatcher/dswload2.c index 2497406..3ac19ed 100644 --- a/src/acpica/source/components/dispatcher/dswload2.c +++ b/src/acpica/source/components/dispatcher/dswload2.c @@ -698,23 +698,8 @@ AcpiDsLoad2EndOp ( } } - AcpiExExitInterpreter (); Status = AcpiEvInitializeRegion ( - AcpiNsGetAttachedObject (Node), FALSE); - AcpiExEnterInterpreter (); - - if (ACPI_FAILURE (Status)) - { - /* - * If AE_NOT_EXIST is returned, it is not fatal - * because many regions get created before a handler - * is installed for said region. - */ - if (AE_NOT_EXIST == Status) - { - Status = AE_OK; - } - } + AcpiNsGetAttachedObject (Node)); break; case AML_NAME_OP: diff --git a/src/acpica/source/components/events/evrgnini.c b/src/acpica/source/components/events/evrgnini.c index 2e6315c..72ba4f4 100644 --- a/src/acpica/source/components/events/evrgnini.c +++ b/src/acpica/source/components/events/evrgnini.c @@ -117,6 +117,7 @@ #include "accommon.h" #include "acevents.h" #include "acnamesp.h" +#include "acinterp.h" #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evrgnini") @@ -609,7 +610,6 @@ AcpiEvDefaultRegionSetup ( * FUNCTION: AcpiEvInitializeRegion * * PARAMETERS: RegionObj - Region we are initializing - * AcpiNsLocked - Is namespace locked? * * RETURN: Status * @@ -627,21 +627,33 @@ AcpiEvDefaultRegionSetup ( * MUTEX: Interpreter should be unlocked, because we may run the _REG * method for this region. * + * NOTE: Possible incompliance: + * There is a behavior conflict in automatic _REG execution: + * 1. When the interpreter is evaluating a method, we can only + * automatically run _REG for the following case: + * Method(_REG, 2) {} + * OperationRegion (OPR1, 0x80, 0x1000010, 0x4) + * 2. When the interpreter is loading a table, we can also + * automatically run _REG for the following case: + * OperationRegion (OPR1, 0x80, 0x1000010, 0x4) + * Method(_REG, 2) {} + * Though this may not be compliant to the de-facto standard, the + * logic is kept in order not to trigger regressions. And keeping + * this logic should be taken care by the caller of this function. + * ******************************************************************************/ ACPI_STATUS AcpiEvInitializeRegion ( - ACPI_OPERAND_OBJECT *RegionObj, - BOOLEAN AcpiNsLocked) + ACPI_OPERAND_OBJECT *RegionObj) { ACPI_OPERAND_OBJECT *HandlerObj; ACPI_OPERAND_OBJECT *ObjDesc; ACPI_ADR_SPACE_TYPE SpaceId; ACPI_NAMESPACE_NODE *Node; - ACPI_STATUS Status; - ACPI_FUNCTION_TRACE_U32 (EvInitializeRegion, AcpiNsLocked); + ACPI_FUNCTION_TRACE (EvInitializeRegion); if (!RegionObj) @@ -713,33 +725,15 @@ AcpiEvInitializeRegion ( "Found handler %p for region %p in obj %p\n", HandlerObj, RegionObj, ObjDesc)); - Status = AcpiEvAttachRegion (HandlerObj, RegionObj, - AcpiNsLocked); + (void) AcpiEvAttachRegion (HandlerObj, RegionObj, FALSE); /* * Tell all users that this region is usable by * running the _REG method */ - if (AcpiNsLocked) - { - Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - } - - Status = AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_CONNECT); - - if (AcpiNsLocked) - { - Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - } - + AcpiExExitInterpreter (); + (void) AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_CONNECT); + AcpiExEnterInterpreter (); return_ACPI_STATUS (AE_OK); } } @@ -749,11 +743,14 @@ AcpiEvInitializeRegion ( Node = Node->Parent; } - /* If we get here, there is no handler for this region */ - + /* + * If we get here, there is no handler for this region. This is not + * fatal because many regions get created before a handler is installed + * for said region. + */ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "No handler for RegionType %s(%X) (RegionObj %p)\n", AcpiUtGetRegionName (SpaceId), SpaceId, RegionObj)); - return_ACPI_STATUS (AE_NOT_EXIST); + return_ACPI_STATUS (AE_OK); } diff --git a/src/acpica/source/components/executer/exconfig.c b/src/acpica/source/components/executer/exconfig.c index fb55b67..93c8c5d 100644 --- a/src/acpica/source/components/executer/exconfig.c +++ b/src/acpica/source/components/executer/exconfig.c @@ -553,7 +553,7 @@ AcpiExLoadOp ( ACPI_INFO (("Dynamic OEM Table Load:")); AcpiExExitInterpreter (); - Status = AcpiTbInstallAndLoadTable (Table, ACPI_PTR_TO_PHYSADDR (Table), + Status = AcpiTbInstallAndLoadTable (ACPI_PTR_TO_PHYSADDR (Table), ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, TRUE, &TableIndex); AcpiExEnterInterpreter (); if (ACPI_FAILURE (Status)) @@ -618,7 +618,6 @@ AcpiExUnloadTable ( ACPI_STATUS Status = AE_OK; ACPI_OPERAND_OBJECT *TableDesc = DdbHandle; UINT32 TableIndex; - ACPI_TABLE_HEADER *Table; ACPI_FUNCTION_TRACE (ExUnloadTable); @@ -659,42 +658,7 @@ AcpiExUnloadTable ( * strict order requirement against it. */ AcpiExExitInterpreter (); - - /* Ensure the table is still loaded */ - - if (!AcpiTbIsTableLoaded (TableIndex)) - { - Status = AE_NOT_EXIST; - goto LockAndExit; - } - - /* Invoke table handler if present */ - - if (AcpiGbl_TableHandler) - { - Status = AcpiGetTableByIndex (TableIndex, &Table); - if (ACPI_SUCCESS (Status)) - { - (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_UNLOAD, Table, - AcpiGbl_TableHandlerContext); - } - } - - /* Delete the portion of the namespace owned by this table */ - - Status = AcpiTbDeleteNamespaceByOwner (TableIndex); - if (ACPI_FAILURE (Status)) - { - goto LockAndExit; - } - - (void) AcpiTbReleaseOwnerId (TableIndex); - AcpiTbSetTableLoadedFlag (TableIndex, FALSE); - -LockAndExit: - - /* Re-acquire the interpreter lock */ - + Status = AcpiTbUnloadTable (TableIndex); AcpiExEnterInterpreter (); /* diff --git a/src/acpica/source/components/executer/exconvrt.c b/src/acpica/source/components/executer/exconvrt.c index d01657a..b97ed2b 100644 --- a/src/acpica/source/components/executer/exconvrt.c +++ b/src/acpica/source/components/executer/exconvrt.c @@ -717,7 +717,6 @@ AcpiExConvertToTargetType ( switch (GET_CURRENT_ARG_TYPE (WalkState->OpInfo->RuntimeArgs)) { case ARGI_SIMPLE_TARGET: - case ARGI_FIXED_TARGET: case ARGI_INTEGER_REF: /* Handles Increment, Decrement cases */ switch (DestinationType) diff --git a/src/acpica/source/components/executer/exresop.c b/src/acpica/source/components/executer/exresop.c index eacd130..183e131 100644 --- a/src/acpica/source/components/executer/exresop.c +++ b/src/acpica/source/components/executer/exresop.c @@ -393,7 +393,6 @@ AcpiExResolveOperands ( case ARGI_OBJECT_REF: case ARGI_DEVICE_REF: case ARGI_TARGETREF: /* Allows implicit conversion rules before store */ - case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */ case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */ case ARGI_STORE_TARGET: diff --git a/src/acpica/source/components/namespace/nsload.c b/src/acpica/source/components/namespace/nsload.c index f34c48e..1e03215 100644 --- a/src/acpica/source/components/namespace/nsload.c +++ b/src/acpica/source/components/namespace/nsload.c @@ -226,7 +226,9 @@ Unlock: ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Begin Table Object Initialization\n")); + AcpiExEnterInterpreter (); Status = AcpiDsInitializeObjects (TableIndex, Node); + AcpiExExitInterpreter (); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Completed Table Object Initialization\n")); diff --git a/src/acpica/source/components/namespace/nsnames.c b/src/acpica/source/components/namespace/nsnames.c index 8e8fea7..a4e25e3 100644 --- a/src/acpica/source/components/namespace/nsnames.c +++ b/src/acpica/source/components/namespace/nsnames.c @@ -182,6 +182,58 @@ AcpiNsGetPathnameLength ( /******************************************************************************* * + * FUNCTION: AcpiNsHandleToName + * + * PARAMETERS: TargetHandle - Handle of named object whose name is + * to be found + * Buffer - Where the name is returned + * + * RETURN: Status, Buffer is filled with name if status is AE_OK + * + * DESCRIPTION: Build and return a full namespace name + * + ******************************************************************************/ + +ACPI_STATUS +AcpiNsHandleToName ( + ACPI_HANDLE TargetHandle, + ACPI_BUFFER *Buffer) +{ + ACPI_STATUS Status; + ACPI_NAMESPACE_NODE *Node; + const char *NodeName; + + + ACPI_FUNCTION_TRACE_PTR (NsHandleToName, TargetHandle); + + + Node = AcpiNsValidateHandle (TargetHandle); + if (!Node) + { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + + /* Validate/Allocate/Clear caller buffer */ + + Status = AcpiUtInitializeBuffer (Buffer, ACPI_PATH_SEGMENT_LENGTH); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Just copy the ACPI name from the Node and zero terminate it */ + + NodeName = AcpiUtGetNodeName (Node); + ACPI_MOVE_NAME (Buffer->Pointer, NodeName); + ((char *) Buffer->Pointer) [ACPI_NAME_SIZE] = 0; + + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%4.4s\n", (char *) Buffer->Pointer)); + return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + * * FUNCTION: AcpiNsHandleToPathname * * PARAMETERS: TargetHandle - Handle of named object whose name is diff --git a/src/acpica/source/components/namespace/nsxfname.c b/src/acpica/source/components/namespace/nsxfname.c index 9ccdc64..a40444f 100644 --- a/src/acpica/source/components/namespace/nsxfname.c +++ b/src/acpica/source/components/namespace/nsxfname.c @@ -248,8 +248,6 @@ AcpiGetName ( ACPI_BUFFER *Buffer) { ACPI_STATUS Status; - ACPI_NAMESPACE_NODE *Node; - const char *NodeName; /* Parameter validation */ @@ -265,16 +263,6 @@ AcpiGetName ( return (Status); } - if (NameType == ACPI_FULL_PATHNAME || - NameType == ACPI_FULL_PATHNAME_NO_TRAILING) - { - /* Get the full pathname (From the namespace root) */ - - Status = AcpiNsHandleToPathname (Handle, Buffer, - NameType == ACPI_FULL_PATHNAME ? FALSE : TRUE); - return (Status); - } - /* * Wants the single segment ACPI name. * Validate handle and convert to a namespace Node @@ -285,30 +273,20 @@ AcpiGetName ( return (Status); } - Node = AcpiNsValidateHandle (Handle); - if (!Node) + if (NameType == ACPI_FULL_PATHNAME || + NameType == ACPI_FULL_PATHNAME_NO_TRAILING) { - Status = AE_BAD_PARAMETER; - goto UnlockAndExit; - } - - /* Validate/Allocate/Clear caller buffer */ + /* Get the full pathname (From the namespace root) */ - Status = AcpiUtInitializeBuffer (Buffer, ACPI_PATH_SEGMENT_LENGTH); - if (ACPI_FAILURE (Status)) - { - goto UnlockAndExit; + Status = AcpiNsHandleToPathname (Handle, Buffer, + NameType == ACPI_FULL_PATHNAME ? FALSE : TRUE); } + else + { + /* Get the single name */ - /* Just copy the ACPI name from the Node and zero terminate it */ - - NodeName = AcpiUtGetNodeName (Node); - ACPI_MOVE_NAME (Buffer->Pointer, NodeName); - ((char *) Buffer->Pointer) [ACPI_NAME_SIZE] = 0; - Status = AE_OK; - - -UnlockAndExit: + Status = AcpiNsHandleToName (Handle, Buffer); + } (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); return (Status); diff --git a/src/acpica/source/components/parser/psargs.c b/src/acpica/source/components/parser/psargs.c index db2fdd8..9b3d6a8 100644 --- a/src/acpica/source/components/parser/psargs.c +++ b/src/acpica/source/components/parser/psargs.c @@ -370,23 +370,12 @@ AcpiPsGetNextNamepath ( PossibleMethodCall && (Node->Type == ACPI_TYPE_METHOD)) { - if (WalkState->Opcode == AML_UNLOAD_OP) - { - /* - * AcpiPsGetNextNamestring has increased the AML pointer, - * so we need to restore the saved AML pointer for method call. - */ - WalkState->ParserState.Aml = Start; - WalkState->ArgCount = 1; - AcpiPsInitOp (Arg, AML_INT_METHODCALL_OP); - return_ACPI_STATUS (AE_OK); - } - /* This name is actually a control method invocation */ MethodDesc = AcpiNsGetAttachedObject (Node); ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, - "Control Method - %p Desc %p Path=%p\n", Node, MethodDesc, Path)); + "Control Method invocation %4.4s - %p Desc %p Path=%p\n", + Node->Name.Ascii, Node, MethodDesc, Path)); NameOp = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, Start); if (!NameOp) @@ -843,6 +832,10 @@ AcpiPsGetNextArg ( ACPI_FUNCTION_TRACE_PTR (PsGetNextArg, ParserState); + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, + "Expected argument type ARGP: %s (%2.2X)\n", + AcpiUtGetArgumentTypeName (ArgType), ArgType)); + switch (ArgType) { case ARGP_BYTEDATA: @@ -926,11 +919,13 @@ AcpiPsGetNextArg ( } break; - case ARGP_TARGET: - case ARGP_SUPERNAME: case ARGP_SIMPLENAME: case ARGP_NAME_OR_REF: + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, + "**** SimpleName/NameOrRef: %s (%2.2X)\n", + AcpiUtGetArgumentTypeName (ArgType), ArgType)); + Subop = AcpiPsPeekOpcode (ParserState); if (Subop == 0 || AcpiPsIsLeadingChar (Subop) || @@ -945,28 +940,37 @@ AcpiPsGetNextArg ( return_ACPI_STATUS (AE_NO_MEMORY); } - /* To support SuperName arg of Unload */ + Status = AcpiPsGetNextNamepath (WalkState, ParserState, + Arg, ACPI_NOT_METHOD_CALL); + } + else + { + /* Single complex argument, nothing returned */ - if (WalkState->Opcode == AML_UNLOAD_OP) - { - Status = AcpiPsGetNextNamepath (WalkState, ParserState, - Arg, ACPI_POSSIBLE_METHOD_CALL); - - /* - * If the SuperName argument is a method call, we have - * already restored the AML pointer, just free this Arg - */ - if (Arg->Common.AmlOpcode == AML_INT_METHODCALL_OP) - { - AcpiPsFreeOp (Arg); - Arg = NULL; - } - } - else + WalkState->ArgCount = 1; + } + break; + + case ARGP_TARGET: + case ARGP_SUPERNAME: + + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, + "**** Target/Supername: %s (%2.2X)\n", + AcpiUtGetArgumentTypeName (ArgType), ArgType)); + + Subop = AcpiPsPeekOpcode (ParserState); + if (Subop == 0) + { + /* NULL target (zero). Convert to a NULL namepath */ + + Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, ParserState->Aml); + if (!Arg) { - Status = AcpiPsGetNextNamepath (WalkState, ParserState, - Arg, ACPI_NOT_METHOD_CALL); + return_ACPI_STATUS (AE_NO_MEMORY); } + + Status = AcpiPsGetNextNamepath (WalkState, ParserState, + Arg, ACPI_POSSIBLE_METHOD_CALL); } else { @@ -979,6 +983,11 @@ AcpiPsGetNextArg ( case ARGP_DATAOBJ: case ARGP_TERMARG: + + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, + "**** TermArg/DataObj: %s (%2.2X)\n", + AcpiUtGetArgumentTypeName (ArgType), ArgType)); + /* Single complex argument, nothing returned */ WalkState->ArgCount = 1; diff --git a/src/acpica/source/components/parser/psloop.c b/src/acpica/source/components/parser/psloop.c index 393becf..067424d 100644 --- a/src/acpica/source/components/parser/psloop.c +++ b/src/acpica/source/components/parser/psloop.c @@ -176,6 +176,9 @@ AcpiPsGetArguments ( ACPI_FUNCTION_TRACE_PTR (PsGetArguments, WalkState); + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, + "Get arguments for opcode [%s]\n", Op->Common.AmlOpName)); + switch (Op->Common.AmlOpcode) { case AML_BYTE_OP: /* AML_BYTEDATA_ARG */ diff --git a/src/acpica/source/components/parser/psobject.c b/src/acpica/source/components/parser/psobject.c index adce94c..efefc6e 100644 --- a/src/acpica/source/components/parser/psobject.c +++ b/src/acpica/source/components/parser/psobject.c @@ -445,7 +445,13 @@ AcpiPsCreateOp ( Op->Common.Flags |= ACPI_PARSEOP_TARGET; } } - else if (ParentScope->Common.AmlOpcode == AML_INCREMENT_OP) + + /* + * Special case for both Increment() and Decrement(), where + * the lone argument is both a source and a target. + */ + else if ((ParentScope->Common.AmlOpcode == AML_INCREMENT_OP) || + (ParentScope->Common.AmlOpcode == AML_DECREMENT_OP)) { Op->Common.Flags |= ACPI_PARSEOP_TARGET; } diff --git a/src/acpica/source/components/parser/pstree.c b/src/acpica/source/components/parser/pstree.c index c9737f2..ec059ec 100644 --- a/src/acpica/source/components/parser/pstree.c +++ b/src/acpica/source/components/parser/pstree.c @@ -214,12 +214,12 @@ AcpiPsAppendArg ( const ACPI_OPCODE_INFO *OpInfo; - ACPI_FUNCTION_ENTRY (); + ACPI_FUNCTION_TRACE ("PsAppendArg"); if (!Op) { - return; + return_VOID; } /* Get the info structure for this opcode */ @@ -231,7 +231,7 @@ AcpiPsAppendArg ( ACPI_ERROR ((AE_INFO, "Invalid AML Opcode: 0x%2.2X", Op->Common.AmlOpcode)); - return; + return_VOID; } /* Check if this opcode requires argument sub-objects */ @@ -240,7 +240,7 @@ AcpiPsAppendArg ( { /* Has no linked argument objects */ - return; + return_VOID; } /* Append the argument to the linked argument list */ @@ -272,6 +272,8 @@ AcpiPsAppendArg ( Op->Common.ArgListLength++; } + + return_VOID; } diff --git a/src/acpica/source/components/tables/tbdata.c b/src/acpica/source/components/tables/tbdata.c index 4136047..2a096f3 100644 --- a/src/acpica/source/components/tables/tbdata.c +++ b/src/acpica/source/components/tables/tbdata.c @@ -1009,9 +1009,9 @@ AcpiTbLoadTable ( * * FUNCTION: AcpiTbInstallAndLoadTable * - * PARAMETERS: Table - Pointer to the table - * Address - Physical address of the table + * PARAMETERS: Address - Physical address of the table * Flags - Allocation flags of the table + * Override - Whether override should be performed * TableIndex - Where table index is returned * * RETURN: Status @@ -1022,7 +1022,6 @@ AcpiTbLoadTable ( ACPI_STATUS AcpiTbInstallAndLoadTable ( - ACPI_TABLE_HEADER *Table, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, BOOLEAN Override, @@ -1030,10 +1029,9 @@ AcpiTbInstallAndLoadTable ( { ACPI_STATUS Status; UINT32 i; - ACPI_OWNER_ID OwnerId; - ACPI_FUNCTION_TRACE (AcpiLoadTable); + ACPI_FUNCTION_TRACE (TbInstallAndLoadTable); (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); @@ -1047,48 +1045,68 @@ AcpiTbInstallAndLoadTable ( goto UnlockAndExit; } - /* - * Note: Now table is "INSTALLED", it must be validated before - * using. - */ - Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[i]); - if (ACPI_FAILURE (Status)) - { - goto UnlockAndExit; - } + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + Status = AcpiTbLoadTable (i, AcpiGbl_RootNode); + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); +UnlockAndExit: + *TableIndex = i; (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - Status = AcpiNsLoadTable (i, AcpiGbl_RootNode); + return_ACPI_STATUS (Status); +} - /* Execute any module-level code that was found in the table */ - if (!AcpiGbl_ParseTableAsTermList && AcpiGbl_GroupModuleLevelCode) - { - AcpiNsExecModuleCodeList (); - } +/******************************************************************************* + * + * FUNCTION: AcpiTbUnloadTable + * + * PARAMETERS: TableIndex - Table index + * + * RETURN: Status + * + * DESCRIPTION: Unload an ACPI table + * + ******************************************************************************/ - /* - * Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is - * responsible for discovering any new wake GPEs by running _PRW methods - * that may have been loaded by this table. - */ - Status = AcpiTbGetOwnerId (i, &OwnerId); - if (ACPI_SUCCESS (Status)) +ACPI_STATUS +AcpiTbUnloadTable ( + UINT32 TableIndex) +{ + ACPI_STATUS Status = AE_OK; + ACPI_TABLE_HEADER *Table; + + + ACPI_FUNCTION_TRACE (TbUnloadTable); + + + /* Ensure the table is still loaded */ + + if (!AcpiTbIsTableLoaded (TableIndex)) { - AcpiEvUpdateGpes (OwnerId); + return_ACPI_STATUS (AE_NOT_EXIST); } /* Invoke table handler if present */ if (AcpiGbl_TableHandler) { - (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table, - AcpiGbl_TableHandlerContext); + Status = AcpiGetTableByIndex (TableIndex, &Table); + if (ACPI_SUCCESS (Status)) + { + (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_UNLOAD, Table, + AcpiGbl_TableHandlerContext); + } } - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); -UnlockAndExit: - *TableIndex = i; - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + /* Delete the portion of the namespace owned by this table */ + + Status = AcpiTbDeleteNamespaceByOwner (TableIndex); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + (void) AcpiTbReleaseOwnerId (TableIndex); + AcpiTbSetTableLoadedFlag (TableIndex, FALSE); return_ACPI_STATUS (Status); } diff --git a/src/acpica/source/components/tables/tbfadt.c b/src/acpica/source/components/tables/tbfadt.c index 89c6c0e..f3b6c1c 100644 --- a/src/acpica/source/components/tables/tbfadt.c +++ b/src/acpica/source/components/tables/tbfadt.c @@ -413,6 +413,8 @@ AcpiTbParseFadt ( { UINT32 Length; ACPI_TABLE_HEADER *Table; + ACPI_TABLE_DESC *FadtDesc; + ACPI_STATUS Status; /* @@ -422,14 +424,13 @@ AcpiTbParseFadt ( * Get a local copy of the FADT and convert it to a common format * Map entire FADT, assumed to be smaller than one page. */ - Length = AcpiGbl_RootTableList.Tables[AcpiGbl_FadtIndex].Length; - - Table = AcpiOsMapMemory ( - AcpiGbl_RootTableList.Tables[AcpiGbl_FadtIndex].Address, Length); - if (!Table) + FadtDesc = &AcpiGbl_RootTableList.Tables[AcpiGbl_FadtIndex]; + Status = AcpiTbGetTable (FadtDesc, &Table); + if (ACPI_FAILURE (Status)) { return; } + Length = FadtDesc->Length; /* * Validate the FADT checksum before we copy the table. Ignore @@ -443,7 +444,7 @@ AcpiTbParseFadt ( /* All done with the real FADT, unmap it */ - AcpiOsUnmapMemory (Table, Length); + AcpiTbPutTable (FadtDesc); /* Obtain the DSDT and FACS tables via their addresses within the FADT */ @@ -594,19 +595,17 @@ AcpiTbConvertFadt ( /* - * For ACPI 1.0 FADTs (revision 1), ensure that reserved fields which + * For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which * should be zero are indeed zero. This will workaround BIOSs that * inadvertently place values in these fields. * * The ACPI 1.0 reserved fields that will be zeroed are the bytes located * at offset 45, 55, 95, and the word located at offset 109, 110. * - * Note: The FADT revision value is unreliable because of BIOS errors. - * The table length is instead used as the final word on the version. - * - * Note: FADT revision 3 is the ACPI 2.0 version of the FADT. + * Note: The FADT revision value is unreliable. Only the length can be + * trusted. */ - if (AcpiGbl_FADT.Header.Length <= ACPI_FADT_V3_SIZE) + if (AcpiGbl_FADT.Header.Length <= ACPI_FADT_V2_SIZE) { AcpiGbl_FADT.PreferredProfile = 0; AcpiGbl_FADT.PstateControl = 0; diff --git a/src/acpica/source/components/tables/tbutils.c b/src/acpica/source/components/tables/tbutils.c index f270b94..6ca5e77 100644 --- a/src/acpica/source/components/tables/tbutils.c +++ b/src/acpica/source/components/tables/tbutils.c @@ -483,3 +483,99 @@ NextTable: AcpiOsUnmapMemory (Table, Length); return_ACPI_STATUS (AE_OK); } + + +/******************************************************************************* + * + * FUNCTION: AcpiTbGetTable + * + * PARAMETERS: TableDesc - Table descriptor + * OutTable - Where the pointer to the table is returned + * + * RETURN: Status and pointer to the requested table + * + * DESCRIPTION: Increase a reference to a table descriptor and return the + * validated table pointer. + * If the table descriptor is an entry of the root table list, + * this API must be invoked with ACPI_MTX_TABLES acquired. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiTbGetTable ( + ACPI_TABLE_DESC *TableDesc, + ACPI_TABLE_HEADER **OutTable) +{ + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (AcpiTbGetTable); + + + if (TableDesc->ValidationCount == 0) + { + /* Table need to be "VALIDATED" */ + + Status = AcpiTbValidateTable (TableDesc); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + + TableDesc->ValidationCount++; + if (TableDesc->ValidationCount == 0) + { + ACPI_ERROR ((AE_INFO, + "Table %p, Validation count is zero after increment\n", + TableDesc)); + TableDesc->ValidationCount--; + return_ACPI_STATUS (AE_LIMIT); + } + + *OutTable = TableDesc->Pointer; + return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbPutTable + * + * PARAMETERS: TableDesc - Table descriptor + * + * RETURN: None + * + * DESCRIPTION: Decrease a reference to a table descriptor and release the + * validated table pointer if no references. + * If the table descriptor is an entry of the root table list, + * this API must be invoked with ACPI_MTX_TABLES acquired. + * + ******************************************************************************/ + +void +AcpiTbPutTable ( + ACPI_TABLE_DESC *TableDesc) +{ + + ACPI_FUNCTION_TRACE (AcpiTbPutTable); + + + if (TableDesc->ValidationCount == 0) + { + ACPI_WARNING ((AE_INFO, + "Table %p, Validation count is zero before decrement\n", + TableDesc)); + return_VOID; + } + TableDesc->ValidationCount--; + + if (TableDesc->ValidationCount == 0) + { + /* Table need to be "INVALIDATED" */ + + AcpiTbInvalidateTable (TableDesc); + } + + return_VOID; +} diff --git a/src/acpica/source/components/tables/tbxface.c b/src/acpica/source/components/tables/tbxface.c index 9ac9dc1..b8026f7 100644 --- a/src/acpica/source/components/tables/tbxface.c +++ b/src/acpica/source/components/tables/tbxface.c @@ -256,6 +256,7 @@ AcpiReallocateRootTable ( void) { ACPI_STATUS Status; + UINT32 i; ACPI_FUNCTION_TRACE (AcpiReallocateRootTable); @@ -270,6 +271,22 @@ AcpiReallocateRootTable ( return_ACPI_STATUS (AE_SUPPORT); } + /* + * Ensure OS early boot logic, which is required by some hosts. If the + * table state is reported to be wrong, developers should fix the + * issue by invoking AcpiPutTable() for the reported table during the + * early stage. + */ + for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) + { + if (AcpiGbl_RootTableList.Tables[i].Pointer) + { + ACPI_ERROR ((AE_INFO, + "Table [%4.4s] is not invalidated during early boot stage", + AcpiGbl_RootTableList.Tables[i].Signature.Ascii)); + } + } + AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ALLOW_RESIZE; Status = AcpiTbResizeRootTableList (); @@ -379,6 +396,11 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader) * * DESCRIPTION: Finds and verifies an ACPI table. Table must be in the * RSDT/XSDT. + * Note that an early stage AcpiGetTable() call must be paired + * with an early stage AcpiPutTable() call. otherwise the table + * pointer mapped by the early stage mapping implementation may be + * erroneously unmapped by the late stage unmapping implementation + * in an AcpiPutTable() invoked during the late stage. * ******************************************************************************/ @@ -390,7 +412,8 @@ AcpiGetTable ( { UINT32 i; UINT32 j; - ACPI_STATUS Status; + ACPI_STATUS Status = AE_NOT_FOUND; + ACPI_TABLE_DESC *TableDesc; /* Parameter validation */ @@ -400,12 +423,22 @@ AcpiGetTable ( return (AE_BAD_PARAMETER); } + /* + * Note that the following line is required by some OSPMs, they only + * check if the returned table is NULL instead of the returned status + * to determined if this function is succeeded. + */ + *OutTable = NULL; + + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); + /* Walk the root table list */ for (i = 0, j = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++) { - if (!ACPI_COMPARE_NAME ( - &(AcpiGbl_RootTableList.Tables[i].Signature), Signature)) + TableDesc = &AcpiGbl_RootTableList.Tables[i]; + + if (!ACPI_COMPARE_NAME (&TableDesc->Signature, Signature)) { continue; } @@ -415,19 +448,66 @@ AcpiGetTable ( continue; } - Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[i]); - if (ACPI_SUCCESS (Status)) + Status = AcpiTbGetTable (TableDesc, OutTable); + break; + } + + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + return (Status); +} + +ACPI_EXPORT_SYMBOL (AcpiGetTable) + + +/******************************************************************************* + * + * FUNCTION: AcpiPutTable + * + * PARAMETERS: Table - The pointer to the table + * + * RETURN: None + * + * DESCRIPTION: Release a table returned by AcpiGetTable() and its clones. + * Note that it is not safe if this function was invoked after an + * uninstallation happened to the original table descriptor. + * Currently there is no OSPMs' requirement to handle such + * situations. + * + ******************************************************************************/ + +void +AcpiPutTable ( + ACPI_TABLE_HEADER *Table) +{ + UINT32 i; + ACPI_TABLE_DESC *TableDesc; + + + ACPI_FUNCTION_TRACE (AcpiPutTable); + + + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); + + /* Walk the root table list */ + + for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++) + { + TableDesc = &AcpiGbl_RootTableList.Tables[i]; + + if (TableDesc->Pointer != Table) { - *OutTable = AcpiGbl_RootTableList.Tables[i].Pointer; + continue; } - return (Status); + AcpiTbPutTable (TableDesc); + break; } - return (AE_NOT_FOUND); + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + return_VOID; } -ACPI_EXPORT_SYMBOL (AcpiGetTable) +ACPI_EXPORT_SYMBOL (AcpiPutTable) /******************************************************************************* @@ -435,7 +515,7 @@ ACPI_EXPORT_SYMBOL (AcpiGetTable) * FUNCTION: AcpiGetTableByIndex * * PARAMETERS: TableIndex - Table index - * Table - Where the pointer to the table is returned + * OutTable - Where the pointer to the table is returned * * RETURN: Status and pointer to the requested table * @@ -447,7 +527,7 @@ ACPI_EXPORT_SYMBOL (AcpiGetTable) ACPI_STATUS AcpiGetTableByIndex ( UINT32 TableIndex, - ACPI_TABLE_HEADER **Table) + ACPI_TABLE_HEADER **OutTable) { ACPI_STATUS Status; @@ -457,37 +537,34 @@ AcpiGetTableByIndex ( /* Parameter validation */ - if (!Table) + if (!OutTable) { return_ACPI_STATUS (AE_BAD_PARAMETER); } + /* + * Note that the following line is required by some OSPMs, they only + * check if the returned table is NULL instead of the returned status + * to determined if this function is succeeded. + */ + *OutTable = NULL; + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); /* Validate index */ if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount) { - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - return_ACPI_STATUS (AE_BAD_PARAMETER); + Status = AE_BAD_PARAMETER; + goto UnlockAndExit; } - if (!AcpiGbl_RootTableList.Tables[TableIndex].Pointer) - { - /* Table is not mapped, map it */ - - Status = AcpiTbValidateTable ( - &AcpiGbl_RootTableList.Tables[TableIndex]); - if (ACPI_FAILURE (Status)) - { - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - return_ACPI_STATUS (Status); - } - } + Status = AcpiTbGetTable ( + &AcpiGbl_RootTableList.Tables[TableIndex], OutTable); - *Table = AcpiGbl_RootTableList.Tables[TableIndex].Pointer; +UnlockAndExit: (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - return_ACPI_STATUS (AE_OK); + return_ACPI_STATUS (Status); } ACPI_EXPORT_SYMBOL (AcpiGetTableByIndex) diff --git a/src/acpica/source/components/tables/tbxfload.c b/src/acpica/source/components/tables/tbxfload.c index aa826fe..f43a400 100644 --- a/src/acpica/source/components/tables/tbxfload.c +++ b/src/acpica/source/components/tables/tbxfload.c @@ -444,7 +444,7 @@ AcpiLoadTable ( /* Install the table and load it into the namespace */ ACPI_INFO (("Host-directed Dynamic ACPI Table Load:")); - Status = AcpiTbInstallAndLoadTable (Table, ACPI_PTR_TO_PHYSADDR (Table), + Status = AcpiTbInstallAndLoadTable (ACPI_PTR_TO_PHYSADDR (Table), ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, FALSE, &TableIndex); return_ACPI_STATUS (Status); } @@ -531,39 +531,8 @@ AcpiUnloadParentTable ( break; } - /* Ensure the table is actually loaded */ - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - if (!AcpiTbIsTableLoaded (i)) - { - Status = AE_NOT_EXIST; - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - break; - } - - /* Invoke table handler if present */ - - if (AcpiGbl_TableHandler) - { - (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_UNLOAD, - AcpiGbl_RootTableList.Tables[i].Pointer, - AcpiGbl_TableHandlerContext); - } - - /* - * Delete all namespace objects owned by this table. Note that - * these objects can appear anywhere in the namespace by virtue - * of the AML "Scope" operator. Thus, we need to track ownership - * by an ID, not simply a position within the hierarchy. - */ - Status = AcpiTbDeleteNamespaceByOwner (i); - if (ACPI_FAILURE (Status)) - { - break; - } - - Status = AcpiTbReleaseOwnerId (i); - AcpiTbSetTableLoadedFlag (i, FALSE); + Status = AcpiTbUnloadTable (i); (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); break; } diff --git a/src/acpica/source/components/utilities/utdecode.c b/src/acpica/source/components/utilities/utdecode.c index dcfdfee..f27bf0f 100644 --- a/src/acpica/source/components/utilities/utdecode.c +++ b/src/acpica/source/components/utilities/utdecode.c @@ -116,6 +116,7 @@ #include "acpi.h" #include "accommon.h" #include "acnamesp.h" +#include "amlcode.h" #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("utdecode") @@ -676,6 +677,59 @@ AcpiUtGetNotifyName ( return ("Hardware-Specific"); } + + +/******************************************************************************* + * + * FUNCTION: AcpiUtGetArgumentTypeName + * + * PARAMETERS: ArgType - an ARGP_* parser argument type + * + * RETURN: Decoded ARGP_* type + * + * DESCRIPTION: Decode an ARGP_* parser type, as defined in the amlcode.h file, + * and used in the acopcode.h file. For example, ARGP_TERMARG. + * Used for debug only. + * + ******************************************************************************/ + +static const char *AcpiGbl_ArgumentType[20] = +{ + /* 00 */ "Unknown ARGP", + /* 01 */ "ByteData", + /* 02 */ "ByteList", + /* 03 */ "CharList", + /* 04 */ "DataObject", + /* 05 */ "DataObjectList", + /* 06 */ "DWordData", + /* 07 */ "FieldList", + /* 08 */ "Name", + /* 09 */ "NameString", + /* 0A */ "ObjectList", + /* 0B */ "PackageLength", + /* 0C */ "SuperName", + /* 0D */ "Target", + /* 0E */ "TermArg", + /* 0F */ "TermList", + /* 10 */ "WordData", + /* 11 */ "QWordData", + /* 12 */ "SimpleName", + /* 13 */ "NameOrRef" +}; + +const char * +AcpiUtGetArgumentTypeName ( + UINT32 ArgType) +{ + + if (ArgType > ARGP_MAX) + { + return ("Unknown ARGP"); + } + + return (AcpiGbl_ArgumentType[ArgType]); +} + #endif diff --git a/src/acpica/source/components/utilities/utresrc.c b/src/acpica/source/components/utilities/utresrc.c index de0ca6e..9c3823c 100644 --- a/src/acpica/source/components/utilities/utresrc.c +++ b/src/acpica/source/components/utilities/utresrc.c @@ -540,9 +540,11 @@ AcpiUtWalkAmlResources ( ACPI_FUNCTION_TRACE (UtWalkAmlResources); - /* The absolute minimum resource template is one EndTag descriptor */ - - if (AmlLength < sizeof (AML_RESOURCE_END_TAG)) + /* + * 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)) { return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG); } @@ -575,8 +577,8 @@ AcpiUtWalkAmlResources ( if (UserFunction) { - Status = UserFunction ( - Aml, Length, Offset, ResourceIndex, Context); + Status = UserFunction (Aml, Length, Offset, + ResourceIndex, Context); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -603,6 +605,13 @@ AcpiUtWalkAmlResources ( *Context = Aml; } + /* Check if buffer is defined to be longer than the resource length */ + + if (AmlLength > (Offset + Length)) + { + return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG); + } + /* Normal exit */ return_ACPI_STATUS (AE_OK); diff --git a/src/acpica/source/include/acdisasm.h b/src/acpica/source/include/acdisasm.h index 640ecf5..9c01d88 100644 --- a/src/acpica/source/include/acdisasm.h +++ b/src/acpica/source/include/acdisasm.h @@ -352,8 +352,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFacs[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[]; -extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt4[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt6[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt[]; @@ -497,9 +497,6 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoXenv[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2]; -extern ACPI_DMTABLE_INFO *FadtRevisionInfo [ACPI_FADT_MAX_VERSION + 1]; - - /* * dmtable and ahtable */ diff --git a/src/acpica/source/include/acevents.h b/src/acpica/source/include/acevents.h index 8a40d28..0f935ea 100644 --- a/src/acpica/source/include/acevents.h +++ b/src/acpica/source/include/acevents.h @@ -408,8 +408,7 @@ AcpiEvDefaultRegionSetup ( ACPI_STATUS AcpiEvInitializeRegion ( - ACPI_OPERAND_OBJECT *RegionObj, - BOOLEAN AcpiNsLocked); + ACPI_OPERAND_OBJECT *RegionObj); /* diff --git a/src/acpica/source/include/acnamesp.h b/src/acpica/source/include/acnamesp.h index 9fc9873..6fb0f27 100644 --- a/src/acpica/source/include/acnamesp.h +++ b/src/acpica/source/include/acnamesp.h @@ -457,6 +457,11 @@ AcpiNsNameOfCurrentScope ( ACPI_WALK_STATE *WalkState); ACPI_STATUS +AcpiNsHandleToName ( + ACPI_HANDLE TargetHandle, + ACPI_BUFFER *Buffer); + +ACPI_STATUS AcpiNsHandleToPathname ( ACPI_HANDLE TargetHandle, ACPI_BUFFER *Buffer, diff --git a/src/acpica/source/include/acopcode.h b/src/acpica/source/include/acopcode.h index 296b789..079e74a 100644 --- a/src/acpica/source/include/acopcode.h +++ b/src/acpica/source/include/acopcode.h @@ -165,7 +165,7 @@ #define ARGP_BYTELIST_OP ARGP_LIST1 (ARGP_NAMESTRING) #define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) #define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) -#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_NAME_OR_REF,ARGP_TARGET) +#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SIMPLENAME, ARGP_TARGET) #define ARGP_CONNECTFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING) #define ARGP_CONTINUE_OP ARG_NONE #define ARGP_COPY_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SIMPLENAME) @@ -178,7 +178,7 @@ #define ARGP_DATA_REGION_OP ARGP_LIST4 (ARGP_NAME, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG) #define ARGP_DEBUG_OP ARG_NONE #define ARGP_DECREMENT_OP ARGP_LIST1 (ARGP_SUPERNAME) -#define ARGP_DEREF_OF_OP ARGP_LIST1 (ARGP_TERMARG) +#define ARGP_DEREF_OF_OP ARGP_LIST1 (ARGP_SUPERNAME) #define ARGP_DEVICE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_OBJLIST) #define ARGP_DIVIDE_OP ARGP_LIST4 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET, ARGP_TARGET) #define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA) @@ -225,14 +225,14 @@ #define ARGP_NAMEPATH_OP ARGP_LIST1 (ARGP_NAMESTRING) #define ARGP_NOOP_OP ARG_NONE #define ARGP_NOTIFY_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_TERMARG) -#define ARGP_OBJECT_TYPE_OP ARGP_LIST1 (ARGP_NAME_OR_REF) +#define ARGP_OBJECT_TYPE_OP ARGP_LIST1 (ARGP_SIMPLENAME) #define ARGP_ONE_OP ARG_NONE #define ARGP_ONES_OP ARG_NONE #define ARGP_PACKAGE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_BYTEDATA, ARGP_DATAOBJLIST) #define ARGP_POWER_RES_OP ARGP_LIST5 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_WORDDATA, ARGP_OBJLIST) #define ARGP_PROCESSOR_OP ARGP_LIST6 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_BYTEDATA, ARGP_OBJLIST) #define ARGP_QWORD_OP ARGP_LIST1 (ARGP_QWORDDATA) -#define ARGP_REF_OF_OP ARGP_LIST1 (ARGP_NAME_OR_REF) +#define ARGP_REF_OF_OP ARGP_LIST1 (ARGP_SIMPLENAME) #define ARGP_REGION_OP ARGP_LIST4 (ARGP_NAME, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_TERMARG) #define ARGP_RELEASE_OP ARGP_LIST1 (ARGP_SUPERNAME) #define ARGP_RESERVEDFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING) @@ -323,7 +323,7 @@ #define ARGI_FIELD_OP ARGI_INVALID_OPCODE #define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) #define ARGI_FIND_SET_RIGHT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) -#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET) +#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) #define ARGI_IF_OP ARGI_INVALID_OPCODE #define ARGI_INCREMENT_OP ARGI_LIST1 (ARGI_TARGETREF) #define ARGI_INDEX_FIELD_OP ARGI_INVALID_OPCODE @@ -387,12 +387,12 @@ #define ARGI_SUBTRACT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) #define ARGI_THERMAL_ZONE_OP ARGI_INVALID_OPCODE #define ARGI_TIMER_OP ARG_NONE -#define ARGI_TO_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET) -#define ARGI_TO_BUFFER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET) -#define ARGI_TO_DEC_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET) -#define ARGI_TO_HEX_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET) -#define ARGI_TO_INTEGER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET) -#define ARGI_TO_STRING_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_FIXED_TARGET) +#define ARGI_TO_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) +#define ARGI_TO_BUFFER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF) +#define ARGI_TO_DEC_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF) +#define ARGI_TO_HEX_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF) +#define ARGI_TO_INTEGER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF) +#define ARGI_TO_STRING_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_TARGETREF) #define ARGI_UNLOAD_OP ARGI_LIST1 (ARGI_DDBHANDLE) #define ARGI_VAR_PACKAGE_OP ARGI_LIST1 (ARGI_INTEGER) #define ARGI_WAIT_OP ARGI_LIST2 (ARGI_EVENT, ARGI_INTEGER) diff --git a/src/acpica/source/include/acpixf.h b/src/acpica/source/include/acpixf.h index 8efd759..479404b 100644 --- a/src/acpica/source/include/acpixf.h +++ b/src/acpica/source/include/acpixf.h @@ -118,7 +118,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20160930 +#define ACPI_CA_VERSION 0x20161117 #include "acconfig.h" #include "actypes.h" @@ -654,6 +654,11 @@ AcpiGetTable ( UINT32 Instance, ACPI_TABLE_HEADER **OutTable)) +ACPI_EXTERNAL_RETURN_VOID ( +void +AcpiPutTable ( + ACPI_TABLE_HEADER *Table)) + ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetTableByIndex ( diff --git a/src/acpica/source/include/actables.h b/src/acpica/source/include/actables.h index e73430f..c5e9916 100644 --- a/src/acpica/source/include/actables.h +++ b/src/acpica/source/include/actables.h @@ -257,12 +257,15 @@ AcpiTbLoadTable ( ACPI_STATUS AcpiTbInstallAndLoadTable ( - ACPI_TABLE_HEADER *Table, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, BOOLEAN Override, UINT32 *TableIndex); +ACPI_STATUS +AcpiTbUnloadTable ( + UINT32 TableIndex); + void AcpiTbTerminate ( void); @@ -325,6 +328,15 @@ ACPI_STATUS AcpiTbParseRootTable ( ACPI_PHYSICAL_ADDRESS RsdpAddress); +ACPI_STATUS +AcpiTbGetTable ( + ACPI_TABLE_DESC *TableDesc, + ACPI_TABLE_HEADER **OutTable); + +void +AcpiTbPutTable ( + ACPI_TABLE_DESC *TableDesc); + /* * tbxfload diff --git a/src/acpica/source/include/actbl.h b/src/acpica/source/include/actbl.h index 3c73998..4d7fd8a 100644 --- a/src/acpica/source/include/actbl.h +++ b/src/acpica/source/include/actbl.h @@ -328,72 +328,62 @@ typedef struct acpi_table_facs typedef struct acpi_table_fadt { - ACPI_TABLE_HEADER Header; /* [V1] Common ACPI table header */ - UINT32 Facs; /* [V1] 32-bit physical address of FACS */ - UINT32 Dsdt; /* [V1] 32-bit physical address of DSDT */ - UINT8 Model; /* [V1] System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */ - UINT8 PreferredProfile; /* [V1] Conveys preferred power management profile to OSPM. */ - UINT16 SciInterrupt; /* [V1] System vector of SCI interrupt */ - UINT32 SmiCommand; /* [V1] 32-bit Port address of SMI command port */ - UINT8 AcpiEnable; /* [V1] Value to write to SMI_CMD to enable ACPI */ - UINT8 AcpiDisable; /* [V1] Value to write to SMI_CMD to disable ACPI */ - UINT8 S4BiosRequest; /* [V1] Value to write to SMI_CMD to enter S4BIOS state */ - UINT8 PstateControl; /* [V1] Processor performance state control*/ - UINT32 Pm1aEventBlock; /* [V1] 32-bit port address of Power Mgt 1a Event Reg Blk */ - UINT32 Pm1bEventBlock; /* [V1] 32-bit port address of Power Mgt 1b Event Reg Blk */ - UINT32 Pm1aControlBlock; /* [V1] 32-bit port address of Power Mgt 1a Control Reg Blk */ - UINT32 Pm1bControlBlock; /* [V1] 32-bit port address of Power Mgt 1b Control Reg Blk */ - UINT32 Pm2ControlBlock; /* [V1] 32-bit port address of Power Mgt 2 Control Reg Blk */ - UINT32 PmTimerBlock; /* [V1] 32-bit port address of Power Mgt Timer Ctrl Reg Blk */ - UINT32 Gpe0Block; /* [V1] 32-bit port address of General Purpose Event 0 Reg Blk */ - UINT32 Gpe1Block; /* [V1] 32-bit port address of General Purpose Event 1 Reg Blk */ - UINT8 Pm1EventLength; /* [V1] Byte Length of ports at Pm1xEventBlock */ - UINT8 Pm1ControlLength; /* [V1] Byte Length of ports at Pm1xControlBlock */ - UINT8 Pm2ControlLength; /* [V1] Byte Length of ports at Pm2ControlBlock */ - UINT8 PmTimerLength; /* [V1] Byte Length of ports at PmTimerBlock */ - UINT8 Gpe0BlockLength; /* [V1] Byte Length of ports at Gpe0Block */ - UINT8 Gpe1BlockLength; /* [V1] Byte Length of ports at Gpe1Block */ - UINT8 Gpe1Base; /* [V1] Offset in GPE number space where GPE1 events start */ - UINT8 CstControl; /* [V1] Support for the _CST object and C-States change notification */ - UINT16 C2Latency; /* [V1] Worst case HW latency to enter/exit C2 state */ - UINT16 C3Latency; /* [V1] Worst case HW latency to enter/exit C3 state */ - UINT16 FlushSize; /* [V1] Processor memory cache line width, in bytes */ - UINT16 FlushStride; /* [V1] Number of flush strides that need to be read */ - UINT8 DutyOffset; /* [V1] Processor duty cycle index in processor P_CNT reg */ - UINT8 DutyWidth; /* [V1] Processor duty cycle value bit width in P_CNT register */ - UINT8 DayAlarm; /* [V1] Index to day-of-month alarm in RTC CMOS RAM */ - UINT8 MonthAlarm; /* [V1] Index to month-of-year alarm in RTC CMOS RAM */ - UINT8 Century; /* [V1] Index to century in RTC CMOS RAM */ - UINT16 BootFlags; /* [V3] IA-PC Boot Architecture Flags (see below for individual flags) */ - UINT8 Reserved; /* [V1] Reserved, must be zero */ - UINT32 Flags; /* [V1] Miscellaneous flag bits (see below for individual flags) */ - /* End of Version 1 FADT fields (ACPI 1.0) */ - - ACPI_GENERIC_ADDRESS ResetRegister; /* [V3] 64-bit address of the Reset register */ - UINT8 ResetValue; /* [V3] Value to write to the ResetRegister port to reset the system */ - UINT16 ArmBootFlags; /* [V5] ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */ - UINT8 MinorRevision; /* [V5] FADT Minor Revision (ACPI 5.1) */ - UINT64 XFacs; /* [V3] 64-bit physical address of FACS */ - UINT64 XDsdt; /* [V3] 64-bit physical address of DSDT */ - ACPI_GENERIC_ADDRESS XPm1aEventBlock; /* [V3] 64-bit Extended Power Mgt 1a Event Reg Blk address */ - ACPI_GENERIC_ADDRESS XPm1bEventBlock; /* [V3] 64-bit Extended Power Mgt 1b Event Reg Blk address */ - ACPI_GENERIC_ADDRESS XPm1aControlBlock; /* [V3] 64-bit Extended Power Mgt 1a Control Reg Blk address */ - ACPI_GENERIC_ADDRESS XPm1bControlBlock; /* [V3] 64-bit Extended Power Mgt 1b Control Reg Blk address */ - ACPI_GENERIC_ADDRESS XPm2ControlBlock; /* [V3] 64-bit Extended Power Mgt 2 Control Reg Blk address */ - ACPI_GENERIC_ADDRESS XPmTimerBlock; /* [V3] 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */ - ACPI_GENERIC_ADDRESS XGpe0Block; /* [V3] 64-bit Extended General Purpose Event 0 Reg Blk address */ - ACPI_GENERIC_ADDRESS XGpe1Block; /* [V3] 64-bit Extended General Purpose Event 1 Reg Blk address */ - /* End of Version 3 FADT fields (ACPI 2.0) */ - - ACPI_GENERIC_ADDRESS SleepControl; /* [V4] 64-bit Sleep Control register (ACPI 5.0) */ - /* End of Version 4 FADT fields (ACPI 3.0 and ACPI 4.0) (Field was originally reserved in ACPI 3.0) */ - - ACPI_GENERIC_ADDRESS SleepStatus; /* [V5] 64-bit Sleep Status register (ACPI 5.0) */ - /* End of Version 5 FADT fields (ACPI 5.0) */ - - UINT64 HypervisorId; /* [V6] Hypervisor Vendor ID (ACPI 6.0) */ - /* End of Version 6 FADT fields (ACPI 6.0) */ - + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT32 Facs; /* 32-bit physical address of FACS */ + UINT32 Dsdt; /* 32-bit physical address of DSDT */ + UINT8 Model; /* System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */ + UINT8 PreferredProfile; /* Conveys preferred power management profile to OSPM. */ + UINT16 SciInterrupt; /* System vector of SCI interrupt */ + UINT32 SmiCommand; /* 32-bit Port address of SMI command port */ + UINT8 AcpiEnable; /* Value to write to SMI_CMD to enable ACPI */ + UINT8 AcpiDisable; /* Value to write to SMI_CMD to disable ACPI */ + UINT8 S4BiosRequest; /* Value to write to SMI_CMD to enter S4BIOS state */ + UINT8 PstateControl; /* Processor performance state control*/ + UINT32 Pm1aEventBlock; /* 32-bit port address of Power Mgt 1a Event Reg Blk */ + UINT32 Pm1bEventBlock; /* 32-bit port address of Power Mgt 1b Event Reg Blk */ + UINT32 Pm1aControlBlock; /* 32-bit port address of Power Mgt 1a Control Reg Blk */ + UINT32 Pm1bControlBlock; /* 32-bit port address of Power Mgt 1b Control Reg Blk */ + UINT32 Pm2ControlBlock; /* 32-bit port address of Power Mgt 2 Control Reg Blk */ + UINT32 PmTimerBlock; /* 32-bit port address of Power Mgt Timer Ctrl Reg Blk */ + UINT32 Gpe0Block; /* 32-bit port address of General Purpose Event 0 Reg Blk */ + UINT32 Gpe1Block; /* 32-bit port address of General Purpose Event 1 Reg Blk */ + UINT8 Pm1EventLength; /* Byte Length of ports at Pm1xEventBlock */ + UINT8 Pm1ControlLength; /* Byte Length of ports at Pm1xControlBlock */ + UINT8 Pm2ControlLength; /* Byte Length of ports at Pm2ControlBlock */ + UINT8 PmTimerLength; /* Byte Length of ports at PmTimerBlock */ + UINT8 Gpe0BlockLength; /* Byte Length of ports at Gpe0Block */ + UINT8 Gpe1BlockLength; /* Byte Length of ports at Gpe1Block */ + UINT8 Gpe1Base; /* Offset in GPE number space where GPE1 events start */ + UINT8 CstControl; /* Support for the _CST object and C-States change notification */ + UINT16 C2Latency; /* Worst case HW latency to enter/exit C2 state */ + UINT16 C3Latency; /* Worst case HW latency to enter/exit C3 state */ + UINT16 FlushSize; /* Processor memory cache line width, in bytes */ + UINT16 FlushStride; /* Number of flush strides that need to be read */ + UINT8 DutyOffset; /* Processor duty cycle index in processor P_CNT reg */ + UINT8 DutyWidth; /* Processor duty cycle value bit width in P_CNT register */ + UINT8 DayAlarm; /* Index to day-of-month alarm in RTC CMOS RAM */ + UINT8 MonthAlarm; /* Index to month-of-year alarm in RTC CMOS RAM */ + UINT8 Century; /* Index to century in RTC CMOS RAM */ + UINT16 BootFlags; /* IA-PC Boot Architecture Flags (see below for individual flags) */ + UINT8 Reserved; /* Reserved, must be zero */ + UINT32 Flags; /* Miscellaneous flag bits (see below for individual flags) */ + ACPI_GENERIC_ADDRESS ResetRegister; /* 64-bit address of the Reset register */ + UINT8 ResetValue; /* Value to write to the ResetRegister port to reset the system */ + UINT16 ArmBootFlags; /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */ + UINT8 MinorRevision; /* FADT Minor Revision (ACPI 5.1) */ + UINT64 XFacs; /* 64-bit physical address of FACS */ + UINT64 XDsdt; /* 64-bit physical address of DSDT */ + ACPI_GENERIC_ADDRESS XPm1aEventBlock; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */ + ACPI_GENERIC_ADDRESS XPm1bEventBlock; /* 64-bit Extended Power Mgt 1b Event Reg Blk address */ + ACPI_GENERIC_ADDRESS XPm1aControlBlock; /* 64-bit Extended Power Mgt 1a Control Reg Blk address */ + ACPI_GENERIC_ADDRESS XPm1bControlBlock; /* 64-bit Extended Power Mgt 1b Control Reg Blk address */ + ACPI_GENERIC_ADDRESS XPm2ControlBlock; /* 64-bit Extended Power Mgt 2 Control Reg Blk address */ + ACPI_GENERIC_ADDRESS XPmTimerBlock; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */ + ACPI_GENERIC_ADDRESS XGpe0Block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */ + ACPI_GENERIC_ADDRESS XGpe1Block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */ + ACPI_GENERIC_ADDRESS SleepControl; /* 64-bit Sleep Control register (ACPI 5.0) */ + ACPI_GENERIC_ADDRESS SleepStatus; /* 64-bit Sleep Status register (ACPI 5.0) */ + UINT64 HypervisorId; /* Hypervisor Vendor ID (ACPI 6.0) */ } ACPI_TABLE_FADT; @@ -409,8 +399,8 @@ typedef struct acpi_table_fadt /* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */ -#define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5] PSCI 0.2+ is implemented */ -#define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5] HVC must be used instead of SMC as the PSCI conduit */ +#define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5+] PSCI 0.2+ is implemented */ +#define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5+] HVC must be used instead of SMC as the PSCI conduit */ /* Masks for FADT flags */ @@ -487,6 +477,7 @@ typedef struct acpi_table_desc ACPI_NAME_UNION Signature; ACPI_OWNER_ID OwnerId; UINT8 Flags; + UINT16 ValidationCount; } ACPI_TABLE_DESC; @@ -517,34 +508,20 @@ typedef struct acpi_table_desc * match the expected length. In other words, the length of the * FADT is the bottom line as to what the version really is. * - * NOTE: There is no officialy released V2 of the FADT. This - * version was used only for prototyping and testing during the - * 32-bit to 64-bit transition. V3 was the first official 64-bit - * version of the FADT. - * - * Update this list of defines when a new version of the FADT is - * added to the ACPI specification. Note that the FADT version is - * only incremented when new fields are appended to the existing - * version. Therefore, the FADT version is competely independent - * from the version of the ACPI specification where it is - * defined. - * - * For reference, the various FADT lengths are as follows: - * FADT V1 size: 0x074 ACPI 1.0 - * FADT V3 size: 0x0F4 ACPI 2.0 - * FADT V4 size: 0x100 ACPI 3.0 and ACPI 4.0 - * FADT V5 size: 0x10C ACPI 5.0 - * FADT V6 size: 0x114 ACPI 6.0 + * For reference, the values below are as follows: + * FADT V1 size: 0x074 + * FADT V2 size: 0x084 + * FADT V3 size: 0x0F4 + * FADT V4 size: 0x0F4 + * FADT V5 size: 0x10C + * FADT V6 size: 0x114 */ -#define ACPI_FADT_V1_SIZE (UINT32) (ACPI_FADT_OFFSET (Flags) + 4) /* ACPI 1.0 */ -#define ACPI_FADT_V3_SIZE (UINT32) (ACPI_FADT_OFFSET (SleepControl)) /* ACPI 2.0 */ -#define ACPI_FADT_V4_SIZE (UINT32) (ACPI_FADT_OFFSET (SleepStatus)) /* ACPI 3.0 and ACPI 4.0 */ -#define ACPI_FADT_V5_SIZE (UINT32) (ACPI_FADT_OFFSET (HypervisorId)) /* ACPI 5.0 */ -#define ACPI_FADT_V6_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT)) /* ACPI 6.0 */ - -/* Update these when new FADT versions are added */ +#define ACPI_FADT_V1_SIZE (UINT32) (ACPI_FADT_OFFSET (Flags) + 4) +#define ACPI_FADT_V2_SIZE (UINT32) (ACPI_FADT_OFFSET (MinorRevision) + 1) +#define ACPI_FADT_V3_SIZE (UINT32) (ACPI_FADT_OFFSET (SleepControl)) +#define ACPI_FADT_V5_SIZE (UINT32) (ACPI_FADT_OFFSET (HypervisorId)) +#define ACPI_FADT_V6_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT)) -#define ACPI_FADT_MAX_VERSION 6 #define ACPI_FADT_CONFORMANCE "ACPI 6.1 (FADT version 6)" #endif /* __ACTBL_H__ */ diff --git a/src/acpica/source/include/acutils.h b/src/acpica/source/include/acutils.h index 9bc3960..eeedc95 100644 --- a/src/acpica/source/include/acutils.h +++ b/src/acpica/source/include/acutils.h @@ -355,6 +355,10 @@ const char * AcpiUtGetEventName ( UINT32 EventId); +const char * +AcpiUtGetArgumentTypeName ( + UINT32 ArgType); + char AcpiUtHexToAsciiChar ( UINT64 Integer, diff --git a/src/acpica/source/include/amlcode.h b/src/acpica/source/include/amlcode.h index 289d3ec..55354fe 100644 --- a/src/acpica/source/include/amlcode.h +++ b/src/acpica/source/include/amlcode.h @@ -315,6 +315,7 @@ #define ARGP_QWORDDATA 0x11 #define ARGP_SIMPLENAME 0x12 /* NameString | LocalTerm | ArgTerm */ #define ARGP_NAME_OR_REF 0x13 /* For ObjectType only */ +#define ARGP_MAX 0x13 /* * Resolved argument types for the AML Interpreter @@ -351,9 +352,24 @@ #define ARGI_DEVICE_REF 0x0D #define ARGI_REFERENCE 0x0E #define ARGI_TARGETREF 0x0F /* Target, subject to implicit conversion */ -#define ARGI_FIXED_TARGET 0x10 /* Target, no implicit conversion */ -#define ARGI_SIMPLE_TARGET 0x11 /* Name, Local, Arg -- no implicit conversion */ -#define ARGI_STORE_TARGET 0x12 /* Target for store is TARGETREF + package objects */ +#define ARGI_SIMPLE_TARGET 0x10 /* Name, Local, Arg -- no implicit conversion */ +#define ARGI_STORE_TARGET 0x11 /* Target for store is TARGETREF + package objects */ +/* + * #define ARGI_FIXED_TARGET 0x10 Target, no implicit conversion + * + * Removed 10/2016. ARGI_FIXED_TARGET was used for these operators: + * FromBCD + * ToBCD + * ToDecimalString + * ToHexString + * ToInteger + * ToBuffer + * The purpose of this type was to disable "implicit result conversion", + * but this was incorrect per the ACPI spec and other ACPI implementations. + * These operators now have the target operand defined as a normal + * ARGI_TARGETREF. + */ + /* Multiple/complex types */