Message ID | 1443776137-21353-1-git-send-email-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 10/02/2015 04:55 PM, 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/2015-September/000814.html > > Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Alex Hung <alex.hung@canonical.com>
On 2015年10月02日 16:55, 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/2015-September/000814.html > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/acpica/Makefile.am | 1 - > src/acpica/source/common/adfile.c | 2 +- > src/acpica/source/compiler/Makefile.am | 1 - > src/acpica/source/compiler/aslbtypes.c | 48 +- > src/acpica/source/compiler/aslcompile.c | 7 +- > src/acpica/source/compiler/aslcompiler.l | 3 + > src/acpica/source/compiler/aslcompiler.y | 2457 +++++++------- > src/acpica/source/compiler/aslcstyle.y | 281 ++ > src/acpica/source/compiler/asldefine.h | 20 - > src/acpica/source/compiler/aslglobal.h | 2 + > src/acpica/source/compiler/aslmain.c | 3 +- > src/acpica/source/compiler/aslmap.c | 5 +- > src/acpica/source/compiler/aslparser.y | 2 + > src/acpica/source/compiler/aslresources.y | 1251 +++++++ > src/acpica/source/compiler/aslrules.y | 3430 ++++++-------------- > src/acpica/source/compiler/asltokens.y | 6 + > src/acpica/source/compiler/asltree.c | 1 + > src/acpica/source/compiler/asltypes.h | 17 +- > src/acpica/source/compiler/asltypes.y | 5 +- > src/acpica/source/compiler/aslwalks.c | 448 ++- > src/acpica/source/components/debugger/dbexec.c | 12 + > src/acpica/source/components/debugger/dbinput.c | 18 +- > src/acpica/source/components/debugger/dbobject.c | 75 +- > src/acpica/source/components/debugger/dbxface.c | 46 +- > .../source/components/disassembler/dmcstyle.c | 33 +- > .../source/components/disassembler/dmobject.c | 648 ---- > src/acpica/source/components/executer/exconvrt.c | 1 + > src/acpica/source/components/executer/exresolv.c | 1 - > src/acpica/source/components/executer/exresop.c | 2 + > src/acpica/source/components/executer/exstore.c | 122 +- > src/acpica/source/components/executer/exstoren.c | 5 +- > src/acpica/source/components/namespace/nspredef.c | 2 +- > src/acpica/source/components/utilities/utdecode.c | 22 +- > src/acpica/source/components/utilities/utfileio.c | 7 + > src/acpica/source/components/utilities/utmutex.c | 24 + > src/acpica/source/include/acapps.h | 2 +- > src/acpica/source/include/acexcep.h | 6 +- > src/acpica/source/include/acglobal.h | 4 +- > src/acpica/source/include/aclocal.h | 14 +- > src/acpica/source/include/acopcode.h | 4 +- > src/acpica/source/include/acpixf.h | 2 +- > src/acpica/source/include/actbl1.h | 2 +- > src/acpica/source/include/amlcode.h | 11 +- > src/acpica/source/include/platform/acenv.h | 7 +- > src/acpica/source/tools/acpiexec/aehandlers.c | 2 +- > 45 files changed, 4587 insertions(+), 4475 deletions(-) > create mode 100644 src/acpica/source/compiler/aslcstyle.y > create mode 100644 src/acpica/source/compiler/aslresources.y > delete mode 100644 src/acpica/source/components/disassembler/dmobject.c > > diff --git a/src/acpica/Makefile.am b/src/acpica/Makefile.am > index 24e1f70..4fd897a 100644 > --- a/src/acpica/Makefile.am > +++ b/src/acpica/Makefile.am > @@ -85,7 +85,6 @@ libfwtsacpica_la_SOURCES = \ > source/components/disassembler/dmbuffer.c \ > source/components/disassembler/dmcstyle.c \ > source/components/disassembler/dmnames.c \ > - source/components/disassembler/dmobject.c \ > source/components/disassembler/dmopcode.c \ > source/components/disassembler/dmresrc.c \ > source/components/disassembler/dmresrcl.c \ > diff --git a/src/acpica/source/common/adfile.c b/src/acpica/source/common/adfile.c > index 96a2f25..3ba4a57 100644 > --- a/src/acpica/source/common/adfile.c > +++ b/src/acpica/source/common/adfile.c > @@ -171,7 +171,7 @@ AdGenerateFilename ( > } > > FilenameBuf[i] = 0; > - strcat (FilenameBuf, ACPI_TABLE_FILE_SUFFIX); > + strcat (FilenameBuf, FILE_SUFFIX_BINARY_TABLE); > return (FilenameBuf); > } > > diff --git a/src/acpica/source/compiler/Makefile.am b/src/acpica/source/compiler/Makefile.am > index 398d2a4..f0c48b1 100644 > --- a/src/acpica/source/compiler/Makefile.am > +++ b/src/acpica/source/compiler/Makefile.am > @@ -214,7 +214,6 @@ libfwtsiasl_la_SOURCES = \ > ../components/disassembler/dmcstyle.c \ > ../components/disassembler/dmnames.c \ > ../components/disassembler/dmopcode.c \ > - ../components/disassembler/dmobject.c \ > ../components/disassembler/dmresrc.c \ > ../components/disassembler/dmresrcl.c \ > ../components/disassembler/dmresrcs.c \ > diff --git a/src/acpica/source/compiler/aslbtypes.c b/src/acpica/source/compiler/aslbtypes.c > index 817ecb6..96f234a 100644 > --- a/src/acpica/source/compiler/aslbtypes.c > +++ b/src/acpica/source/compiler/aslbtypes.c > @@ -172,9 +172,10 @@ AnMapArgTypeToBtype ( > case ARGI_DDBHANDLE: > /* > * DDBHandleObject := SuperName > - * ACPI_BTYPE_REFERENCE: Index reference as parameter of Load/Unload > + * ACPI_BTYPE_REFERENCE_OBJECT: > + * Index reference as parameter of Load/Unload > */ > - return (ACPI_BTYPE_DDB_HANDLE | ACPI_BTYPE_REFERENCE); > + return (ACPI_BTYPE_DDB_HANDLE | ACPI_BTYPE_REFERENCE_OBJECT); > > /* Interchangeable types */ > /* > @@ -205,9 +206,24 @@ AnMapArgTypeToBtype ( > > case ARGI_REFERENCE: > > - return (ACPI_BTYPE_REFERENCE); > + return (ACPI_BTYPE_NAMED_REFERENCE); /* Name or Namestring */ > > case ARGI_TARGETREF: > + > + /* > + * Target operand for most math and logic operators. > + * Package objects not allowed as target. > + */ > + return (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_DEBUG_OBJECT | > + ACPI_BTYPE_REFERENCE_OBJECT); > + > + case ARGI_STORE_TARGET: > + > + /* Special target for Store(), includes packages */ > + > + return (ACPI_BTYPE_DATA | ACPI_BTYPE_DEBUG_OBJECT | > + ACPI_BTYPE_REFERENCE_OBJECT); > + > case ARGI_FIXED_TARGET: > case ARGI_SIMPLE_TARGET: > > @@ -221,28 +237,33 @@ AnMapArgTypeToBtype ( > * Used only by SizeOf operator > */ > return (ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER | > - ACPI_BTYPE_PACKAGE | ACPI_BTYPE_REFERENCE); > + ACPI_BTYPE_PACKAGE | ACPI_BTYPE_REFERENCE_OBJECT); > > case ARGI_COMPLEXOBJ: > > /* Buffer, String, or package */ > > - return (ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER | ACPI_BTYPE_PACKAGE); > + return (ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER | > + ACPI_BTYPE_PACKAGE); > > case ARGI_REF_OR_STRING: > > - return (ACPI_BTYPE_STRING | ACPI_BTYPE_REFERENCE); > + /* Used by DeRefOf operator only */ > + > + return (ACPI_BTYPE_STRING | ACPI_BTYPE_REFERENCE_OBJECT); > > case ARGI_REGION_OR_BUFFER: > > /* Used by Load() only. Allow buffers in addition to regions/fields */ > > - return (ACPI_BTYPE_REGION | ACPI_BTYPE_BUFFER | ACPI_BTYPE_FIELD_UNIT); > + return (ACPI_BTYPE_REGION | ACPI_BTYPE_BUFFER | > + ACPI_BTYPE_FIELD_UNIT); > > case ARGI_DATAREFOBJ: > > - return (ACPI_BTYPE_INTEGER |ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER | > - ACPI_BTYPE_PACKAGE | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE); > + /* Used by Store() only, as the source operand */ > + > + return (ACPI_BTYPE_DATA_REFERENCE | ACPI_BTYPE_REFERENCE_OBJECT); > > default: > > @@ -346,7 +367,7 @@ AnMapEtypeToBtype ( > case ACPI_TYPE_LOCAL_RESOURCE: > case ACPI_TYPE_LOCAL_RESOURCE_FIELD: > > - return (ACPI_BTYPE_REFERENCE); > + return (ACPI_BTYPE_REFERENCE_OBJECT); > > default: > > @@ -473,12 +494,6 @@ AnGetBtype ( > "could not map type"); > } > > - /* > - * Since it was a named reference, enable the > - * reference bit also > - */ > - ThisNodeBtype |= ACPI_BTYPE_REFERENCE; > - > if (Op->Asl.ParseOpcode == PARSEOP_METHODCALL) > { > ReferencedNode = Node->Op; > @@ -514,7 +529,6 @@ AnGetBtype ( > return (ThisNodeBtype); > } > > - > /******************************************************************************* > * > * FUNCTION: AnMapObjTypeToBtype > diff --git a/src/acpica/source/compiler/aslcompile.c b/src/acpica/source/compiler/aslcompile.c > index 5a0379d..c76178c 100644 > --- a/src/acpica/source/compiler/aslcompile.c > +++ b/src/acpica/source/compiler/aslcompile.c > @@ -374,8 +374,11 @@ CmDoCompile ( > > Event = UtBeginEvent ("Analyze AML operand types"); > DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Operand type checking\n\n"); > - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, > - NULL, AnOperandTypecheckWalkEnd, &AnalysisWalkInfo); > + if (Gbl_DoTypechecking) > + { > + TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, > + NULL, AnOperandTypecheckWalkEnd, &AnalysisWalkInfo); > + } > UtEndEvent (Event); > > /* Semantic error checking part four - other miscellaneous checks */ > diff --git a/src/acpica/source/compiler/aslcompiler.l b/src/acpica/source/compiler/aslcompiler.l > index 41ff855..0fc3535 100644 > --- a/src/acpica/source/compiler/aslcompiler.l > +++ b/src/acpica/source/compiler/aslcompiler.l > @@ -228,6 +228,9 @@ 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); } > + > > /* > * Begin standard ASL grammar > diff --git a/src/acpica/source/compiler/aslcompiler.y b/src/acpica/source/compiler/aslcompiler.y > index f1365ec..20b728a 100644 > --- a/src/acpica/source/compiler/aslcompiler.y > +++ b/src/acpica/source/compiler/aslcompiler.y > @@ -594,8 +594,14 @@ AslLocalAllocate ( > %left <i> PARSEOP_EXP_INCREMENT > PARSEOP_EXP_DECREMENT > > +/* Brackets for Index() support */ > + > +%left <i> PARSEOP_EXP_INDEX_LEFT > +%right <i> PARSEOP_EXP_INDEX_RIGHT > + > %token <i> PARSEOP_PRINTF > %token <i> PARSEOP_FPRINTF > + > /* Specific parentheses tokens are not used at this time */ > /* PARSEOP_EXP_PAREN_OPEN */ > /* PARSEOP_EXP_PAREN_CLOSE */ > @@ -706,7 +712,7 @@ AslLocalAllocate ( > %type <n> DefaultTerm > %type <n> ElseTerm > %type <n> FatalTerm > -%type <n> IfElseTerm > +%type <n> ElseIfTerm > %type <n> IfTerm > %type <n> LoadTerm > %type <n> NoOpTerm > @@ -758,6 +764,7 @@ AslLocalAllocate ( > %type <n> NotTerm > %type <n> ObjectTypeTerm > %type <n> OrTerm > +%type <n> RawDataBufferTerm > %type <n> RefOfTerm > %type <n> ShiftLeftTerm > %type <n> ShiftRightTerm > @@ -867,7 +874,6 @@ AslLocalAllocate ( > /* Resource Descriptors */ > > %type <n> ConnectionTerm > -%type <n> DataBufferTerm > %type <n> DMATerm > %type <n> DWordIOTerm > %type <n> DWordMemoryTerm > @@ -961,6 +967,7 @@ AslLocalAllocate ( > */ > %type <n> Expression > %type <n> EqualsTerm > +%type <n> IndexExpTerm > > %% > > @@ -970,14 +977,12 @@ AslLocalAllocate ( > > /******************************************************************************* > * > - * Production rules start here > + * ASL Root and Secondary Terms > * > ******************************************************************************/ > > /* > - * ASL Names > - * > - * Root rule. Allow multiple #line directives before the definition block > + * Root term. Allow multiple #line directives before the definition block > * to handle output from preprocessors > */ > ASLCode > @@ -986,10 +991,6 @@ ASLCode > ; > > /* > - * Blocks, Data, and Opcodes > - */ > - > -/* > * Note concerning support for "module-level code". > * > * ACPI 1.0 allowed Type1 and Type2 executable opcodes outside of control > @@ -1016,150 +1017,167 @@ DefinitionBlockTerm > '{' TermList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$6,$8,$10,$12,$14,$18);} > ; > > - /* > - * ASL Extensions: C-style math/logical operators and expressions. > - * The implementation transforms these operators into the standard > - * AML opcodes and syntax. > - * > - * Supported operators and precedence rules (high-to-low) > - * > - * NOTE: The operator precedence and associativity rules are > - * implemented by the tokens in asltokens.y > - * > - * (left-to-right): > - * 1) ( ) expr++ expr-- > - * > - * (right-to-left): > - * 2) ! ~ > - * > - * (left-to-right): > - * 3) * / % > - * 4) + - > - * 5) >> << > - * 6) < > <= >= > - * 7) == != > - * 8) & > - * 9) ^ > - * 10) | > - * 11) && > - * 12) || > - * > - * (right-to-left): > - * 13) = += -= *= /= %= <<= >>= &= ^= |= > - */ > -Expression > +SuperName > + : NameString {} > + | ArgTerm {} > + | LocalTerm {} > + | DebugTerm {} > + | Type6Opcode {} > > - /* Unary operators */ > +Target > + : {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ > + | ',' {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ > + | ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} > + ; > > - : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} > - TermArg {$$ = TrLinkChildren ($<n>2,1,$3);} > - | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} > - TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateNullTarget ());} > +TermArg > + : 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);} > + ; > > - | SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} > - {$$ = TrLinkChildren ($<n>3,1,$1);} > - | SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} > - {$$ = TrLinkChildren ($<n>3,1,$1);} > +/* > + NOTE: Removed from TermArg due to reduce/reduce conflicts: > + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > + | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > + | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > + | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > > - /* Binary operators: math and logical */ > +*/ > > - | TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > - | TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} > - TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), > - TrCreateNullTarget ());} > - | TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > - | TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > - | TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > - | TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > - | TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > +MethodInvocationTerm > + : NameString '(' {TrUpdateNode (PARSEOP_METHODCALL, $1);} > + ArgList ')' {$$ = TrLinkChildNode ($1,$4);} > + ; > > - | TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > - | TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > - | TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > +/* OptionalCount must appear before ByteList or an incorrect reduction will result */ > > - | TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} > - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > - | TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);} > - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > - | TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} > - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > - | TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);} > - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > +OptionalCount > + : {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ > + | ',' {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ > + | ',' TermArg {$$ = $2;} > + ; > > - | TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} > - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > - | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);} > - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > +VarPackageLengthTerm > + : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} > + | TermArg {$$ = $1;} > + ; > > - | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} > - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > - | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} > - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > > - /* Parentheses */ > +/******* List Terms **************************************************/ > > - | '(' TermArg ')' { $$ = $2;} > +ArgList > + : {$$ = NULL;} > + | TermArg > + | ArgList ',' /* Allows a trailing comma at list end */ > + | ArgList ',' > + TermArg {$$ = TrLinkPeerNode ($1,$3);} > ; > > -EqualsTerm > +ByteList > + : {$$ = NULL;} > + | ByteConstExpr > + | ByteList ',' /* Allows a trailing comma at list end */ > + | ByteList ',' > + ByteConstExpr {$$ = TrLinkPeerNode ($1,$3);} > + ; > > - /* All assignment-type operations */ > +DWordList > + : {$$ = NULL;} > + | DWordConstExpr > + | DWordList ',' /* Allows a trailing comma at list end */ > + | DWordList ',' > + DWordConstExpr {$$ = TrLinkPeerNode ($1,$3);} > + ; > > - : SuperName PARSEOP_EXP_EQUALS > - TermArg {$$ = TrCreateAssignmentNode ($1, $3);} > +FieldUnitList > + : {$$ = NULL;} > + | FieldUnit > + | FieldUnitList ',' /* Allows a trailing comma at list end */ > + | FieldUnitList ',' > + FieldUnit {$$ = TrLinkPeerNode ($1,$3);} > + ; > > - | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > +FieldUnit > + : FieldUnitEntry {} > + | OffsetTerm {} > + | AccessAsTerm {} > + | ConnectionTerm {} > + ; > > - | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} > - TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > +FieldUnitEntry > + : ',' AmlPackageLengthTerm {$$ = TrCreateNode (PARSEOP_RESERVED_BYTES,1,$2);} > + | NameSeg ',' > + AmlPackageLengthTerm {$$ = TrLinkChildNode ($1,$3);} > + ; > > - | TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > +ObjectList > + : {$$ = NULL;} > + | ObjectList Object {$$ = TrLinkPeerNode ($1,$2);} > + | error {$$ = AslDoError(); yyclearin;} > + ; > > - | TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > +Object > + : CompilerDirective {} > + | NamedObject {} > + | NameSpaceModifier {} > + ; > > - | TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > +PackageList > + : {$$ = NULL;} > + | PackageElement > + | PackageList ',' /* Allows a trailing comma at list end */ > + | PackageList ',' > + PackageElement {$$ = TrLinkPeerNode ($1,$3);} > + ; > > - | TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > +PackageElement > + : DataObject {} > + | NameString {} > + ; > > - | TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + /* Rules for specifying the type of one method argument or return value */ > > - | TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > +ParameterTypePackage > + : {$$ = NULL;} > + | ObjectTypeKeyword {$$ = $1;} > + | ParameterTypePackage ',' > + ObjectTypeKeyword {$$ = TrLinkPeerNodes (2,$1,$3);} > + ; > > - | TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > +ParameterTypePackageList > + : {$$ = NULL;} > + | ObjectTypeKeyword {$$ = $1;} > + | '{' ParameterTypePackage '}' {$$ = $2;} > + ; > > - | TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > +OptionalParameterTypePackage > + : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} > + | ',' ParameterTypePackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} > + ; > + > + /* Rules for specifying the types for method arguments */ > + > +ParameterTypesPackage > + : ParameterTypePackageList {$$ = $1;} > + | ParameterTypesPackage ',' > + ParameterTypePackageList {$$ = TrLinkPeerNodes (2,$1,$3);} > + ; > + > +ParameterTypesPackageList > + : {$$ = NULL;} > + | ObjectTypeKeyword {$$ = $1;} > + | '{' ParameterTypesPackage '}' {$$ = $2;} > ; > > +OptionalParameterTypesPackage > + : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} > + | ',' ParameterTypesPackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} > + ; > > -/* ACPI 3.0 -- allow semicolons between terms */ > + /* ACPI 3.0 -- allow semicolons between terms */ > > TermList > : {$$ = NULL;} > @@ -1180,22 +1198,44 @@ Term > | error {$$ = AslDoError(); yyclearin;} > ; > > -CompilerDirective > - : IncludeTerm {} > - | ExternalTerm {} > - ; > +/* > + * Case-Default list; allow only one Default term and unlimited Case terms > + */ > +CaseDefaultTermList > + : {$$ = NULL;} > + | CaseTerm {} > + | DefaultTerm {} > + | CaseDefaultTermList > + CaseTerm {$$ = TrLinkPeerNode ($1,$2);} > + | CaseDefaultTermList > + DefaultTerm {$$ = TrLinkPeerNode ($1,$2);} > > -ObjectList > +/* Original - attempts to force zero or one default term within the switch */ > + > +/* > +CaseDefaultTermList > : {$$ = NULL;} > - | ObjectList Object {$$ = TrLinkPeerNode ($1,$2);} > - | error {$$ = AslDoError(); yyclearin;} > + | CaseTermList > + DefaultTerm > + CaseTermList {$$ = TrLinkPeerNode ($1,TrLinkPeerNode ($2, $3));} > + | CaseTermList > + CaseTerm {$$ = TrLinkPeerNode ($1,$2);} > ; > > -Object > - : CompilerDirective {} > - | NamedObject {} > - | NameSpaceModifier {} > +CaseTermList > + : {$$ = NULL;} > + | CaseTerm {} > + | CaseTermList > + CaseTerm {$$ = TrLinkPeerNode ($1,$2);} > ; > +*/ > + > + > +/******************************************************************************* > + * > + * ASL Data and Constant Terms > + * > + ******************************************************************************/ > > DataObject > : BufferData {} > @@ -1227,6 +1267,93 @@ StringData > | String {} > ; > > +ByteConst > + : Integer {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} > + ; > + > +WordConst > + : Integer {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} > + ; > + > +DWordConst > + : Integer {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} > + ; > + > +QWordConst > + : Integer {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} > + ; > + > +/* > + * The NODE_COMPILE_TIME_CONST flag in the following constant expressions > + * enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes > + * to simple integers. It is an error if these types of expressions cannot be > + * reduced, since the AML grammar for ****ConstExpr requires a simple constant. > + * Note: The required byte length of the constant is passed through to the > + * constant folding code in the node AmlLength field. > + */ > +ByteConstExpr > + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} > + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} > + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} > + | ByteConst {} > + ; > + > +WordConstExpr > + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} > + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} > + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} > + | WordConst {} > + ; > + > +DWordConstExpr > + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} > + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} > + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} > + | DWordConst {} > + ; > + > +QWordConstExpr > + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} > + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} > + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} > + | QWordConst {} > + ; > + > +ConstTerm > + : ConstExprTerm {} > + | PARSEOP_REVISION {$$ = TrCreateLeafNode (PARSEOP_REVISION);} > + ; > + > +ConstExprTerm > + : PARSEOP_ZERO {$$ = TrCreateValuedLeafNode (PARSEOP_ZERO, 0);} > + | PARSEOP_ONE {$$ = TrCreateValuedLeafNode (PARSEOP_ONE, 1);} > + | PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_UINT64_MAX);} > + | PARSEOP___DATE__ {$$ = TrCreateConstantLeafNode (PARSEOP___DATE__);} > + | PARSEOP___FILE__ {$$ = TrCreateConstantLeafNode (PARSEOP___FILE__);} > + | PARSEOP___LINE__ {$$ = TrCreateConstantLeafNode (PARSEOP___LINE__);} > + | PARSEOP___PATH__ {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);} > + ; > + > +Integer > + : PARSEOP_INTEGER {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, AslCompilerlval.i);} > + ; > + > +String > + : PARSEOP_STRING_LITERAL {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, (ACPI_NATIVE_INT) AslCompilerlval.s);} > + ; > + > + > +/******************************************************************************* > + * > + * ASL Opcode Terms > + * > + ******************************************************************************/ > + > +CompilerDirective > + : IncludeTerm {} > + | ExternalTerm {} > + ; > + > NamedObject > : BankFieldTerm {} > | CreateBitFieldTerm {} > @@ -1255,40 +1382,18 @@ NameSpaceModifier > | ScopeTerm {} > ; > > -MethodInvocationTerm > - : NameString '(' {TrUpdateNode (PARSEOP_METHODCALL, $1);} > - ArgList ')' {$$ = TrLinkChildNode ($1,$4);} > - ; > - > -ArgList > - : {$$ = NULL;} > - | TermArg > - | ArgList ',' /* Allows a trailing comma at list end */ > - | ArgList ',' > - TermArg {$$ = TrLinkPeerNode ($1,$3);} > - ; > - > -/* > -Removed from TermArg due to reduce/reduce conflicts > - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > - | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > - | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > - | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > - > -*/ > +/* For ObjectType: SuperName except for MethodInvocationTerm */ > > -TermArg > - : 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);} > - ; > +ObjectTypeName > + : NameString {} > + | ArgTerm {} > + | LocalTerm {} > + | DebugTerm {} > + | RefOfTerm {} > + | DerefOfTerm {} > + | IndexTerm {} > > -Target > - : {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ > - | ',' {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ > - | ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} > +/* | MethodInvocationTerm {} */ /* Caused reduce/reduce with Type6Opcode->MethodInvocationTerm */ > ; > > RequiredTarget > @@ -1301,46 +1406,6 @@ SimpleTarget > | ArgTerm {} > ; > > -/* Rules for specifying the type of one method argument or return value */ > - > -ParameterTypePackage > - : {$$ = NULL;} > - | ObjectTypeKeyword {$$ = $1;} > - | ParameterTypePackage ',' > - ObjectTypeKeyword {$$ = TrLinkPeerNodes (2,$1,$3);} > - ; > - > -ParameterTypePackageList > - : {$$ = NULL;} > - | ObjectTypeKeyword {$$ = $1;} > - | '{' ParameterTypePackage '}' {$$ = $2;} > - ; > - > -OptionalParameterTypePackage > - : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} > - | ',' ParameterTypePackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} > - ; > - > -/* Rules for specifying the types for method arguments */ > - > -ParameterTypesPackage > - : ParameterTypePackageList {$$ = $1;} > - | ParameterTypesPackage ',' > - ParameterTypePackageList {$$ = TrLinkPeerNodes (2,$1,$3);} > - ; > - > -ParameterTypesPackageList > - : {$$ = NULL;} > - | ObjectTypeKeyword {$$ = $1;} > - | '{' ParameterTypesPackage '}' {$$ = $2;} > - ; > - > -OptionalParameterTypesPackage > - : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} > - | ',' ParameterTypesPackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} > - ; > - > - > /* Opcode types */ > > Type1Opcode > @@ -1348,7 +1413,7 @@ Type1Opcode > | BreakPointTerm {} > | ContinueTerm {} > | FatalTerm {} > - | IfElseTerm {} > + | ElseIfTerm {} > | LoadTerm {} > | NoOpTerm {} > | NotifyTerm {} > @@ -1381,7 +1446,6 @@ Type2Opcode > /* > * Type 3/4/5 opcodes > */ > - > Type2IntegerOpcode /* "Type3" opcodes */ > : Expression {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > | AddTerm {} > @@ -1439,7 +1503,6 @@ Type2BufferOrStringOpcode > /* > * A type 3 opcode evaluates to an Integer and cannot have a destination operand > */ > - > Type3Opcode > : EISAIDTerm {} > ; > @@ -1454,7 +1517,6 @@ Type4Opcode > ; > */ > > - > Type5Opcode > : ResourceTemplateTerm {} > | UnicodeTerm {} > @@ -1466,34 +1528,74 @@ Type6Opcode > : RefOfTerm {} > | DerefOfTerm {} > | IndexTerm {} > + | IndexExpTerm {} > | MethodInvocationTerm {} > ; > > -IncludeTerm > - : PARSEOP_INCLUDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCLUDE);} > - String ')' {TrLinkChildren ($<n>3,1,$4);FlOpenIncludeFile ($4);} > - TermList > - IncludeEndTerm {$$ = TrLinkPeerNodes (3,$<n>3,$7,$8);} > + > +/******************************************************************************* > + * > + * ASL Primary Terms > + * > + ******************************************************************************/ > + > +AccessAsTerm > + : PARSEOP_ACCESSAS '(' > + AccessTypeKeyword > + OptionalAccessAttribTerm > + ')' {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);} > + | PARSEOP_ACCESSAS '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -IncludeEndTerm > - : PARSEOP_INCLUDE_END {$$ = TrCreateLeafNode (PARSEOP_INCLUDE_END);} > +AcquireTerm > + : PARSEOP_ACQUIRE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} > + SuperName > + ',' WordConstExpr > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$6);} > + | PARSEOP_ACQUIRE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -ExternalTerm > - : PARSEOP_EXTERNAL '(' > - NameString > - OptionalObjectTypeKeyword > - OptionalParameterTypePackage > - OptionalParameterTypesPackage > - ')' {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);} > - | PARSEOP_EXTERNAL '(' > +AddTerm > + : PARSEOP_ADD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_ADD '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > +AliasTerm > + : PARSEOP_ALIAS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);} > + NameString > + NameStringItem > + ')' {$$ = TrLinkChildren ($<n>3,2,$4, > + TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} > + | PARSEOP_ALIAS '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > > -/******* Named Objects *******************************************************/ > +AndTerm > + : PARSEOP_AND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_AND '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > > +ArgTerm > + : PARSEOP_ARG0 {$$ = TrCreateLeafNode (PARSEOP_ARG0);} > + | PARSEOP_ARG1 {$$ = TrCreateLeafNode (PARSEOP_ARG1);} > + | PARSEOP_ARG2 {$$ = TrCreateLeafNode (PARSEOP_ARG2);} > + | PARSEOP_ARG3 {$$ = TrCreateLeafNode (PARSEOP_ARG3);} > + | PARSEOP_ARG4 {$$ = TrCreateLeafNode (PARSEOP_ARG4);} > + | PARSEOP_ARG5 {$$ = TrCreateLeafNode (PARSEOP_ARG5);} > + | PARSEOP_ARG6 {$$ = TrCreateLeafNode (PARSEOP_ARG6);} > + ; > > BankFieldTerm > : PARSEOP_BANKFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BANKFIELD);} > @@ -1509,41 +1611,54 @@ BankFieldTerm > error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} > ; > > -FieldUnitList > - : {$$ = NULL;} > - | FieldUnit > - | FieldUnitList ',' /* Allows a trailing comma at list end */ > - | FieldUnitList ',' > - FieldUnit {$$ = TrLinkPeerNode ($1,$3);} > +BreakTerm > + : PARSEOP_BREAK {$$ = TrCreateNode (PARSEOP_BREAK, 0);} > ; > > -FieldUnit > - : FieldUnitEntry {} > - | OffsetTerm {} > - | AccessAsTerm {} > - | ConnectionTerm {} > - ; > +BreakPointTerm > + : PARSEOP_BREAKPOINT {$$ = TrCreateNode (PARSEOP_BREAKPOINT, 0);} > + ; > > -FieldUnitEntry > - : ',' AmlPackageLengthTerm {$$ = TrCreateNode (PARSEOP_RESERVED_BYTES,1,$2);} > - | NameSeg ',' > - AmlPackageLengthTerm {$$ = TrLinkChildNode ($1,$3);} > +BufferTerm > + : PARSEOP_BUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER);} > + OptionalTermArg > + ')' '{' > + BufferTermData '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > + | PARSEOP_BUFFER '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OffsetTerm > - : PARSEOP_OFFSET '(' > - AmlPackageLengthTerm > - ')' {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);} > - | PARSEOP_OFFSET '(' > +BufferTermData > + : ByteList {} > + | StringData {} > + ; > + > +CaseTerm > + : PARSEOP_CASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);} > + DataObject > + ')' '{' > + TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > + | PARSEOP_CASE '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -AccessAsTerm > - : PARSEOP_ACCESSAS '(' > - AccessTypeKeyword > - OptionalAccessAttribTerm > - ')' {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);} > - | PARSEOP_ACCESSAS '(' > +ConcatTerm > + : PARSEOP_CONCATENATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_CONCATENATE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +ConcatResTerm > + : PARSEOP_CONCATENATERESTEMPLATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_CONCATENATERESTEMPLATE '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > @@ -1562,6 +1677,28 @@ ConnectionTerm > error ')' {$$ = AslDoError(); yyclearin;} > ; > > +CondRefOfTerm > + : PARSEOP_CONDREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} > + SuperName > + Target > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_CONDREFOF '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +ContinueTerm > + : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);} > + ; > + > +CopyObjectTerm > + : PARSEOP_COPYOBJECT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} > + TermArg > + ',' SimpleTarget > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} > + | PARSEOP_COPYOBJECT '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > CreateBitFieldTerm > : PARSEOP_CREATEBITFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} > TermArg > @@ -1634,6 +1771,33 @@ DataRegionTerm > error ')' {$$ = AslDoError(); yyclearin;} > ; > > +DebugTerm > + : PARSEOP_DEBUG {$$ = TrCreateLeafNode (PARSEOP_DEBUG);} > + ; > + > +DecTerm > + : PARSEOP_DECREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} > + SuperName > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_DECREMENT '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +DefaultTerm > + : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFAULT);} > + TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_DEFAULT '{' > + error '}' {$$ = AslDoError(); yyclearin;} > + ; > + > +DerefOfTerm > + : PARSEOP_DEREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);} > + TermArg > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_DEREFOF '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > DeviceTerm > : PARSEOP_DEVICE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);} > NameString > @@ -1643,6 +1807,53 @@ DeviceTerm > error ')' {$$ = AslDoError(); yyclearin;} > ; > > +DivideTerm > + : PARSEOP_DIVIDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} > + TermArg > + TermArgItem > + Target > + Target > + ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} > + | PARSEOP_DIVIDE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +EISAIDTerm > + : PARSEOP_EISAID '(' > + StringData ')' {$$ = TrUpdateNode (PARSEOP_EISAID, $3);} > + | PARSEOP_EISAID '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +ElseIfTerm > + : IfTerm ElseTerm {$$ = TrLinkPeerNode ($1,$2);} > + ; > + > +ElseTerm > + : {$$ = NULL;} > + | PARSEOP_ELSE '{' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} > + TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} > + > + | PARSEOP_ELSE '{' > + error '}' {$$ = AslDoError(); yyclearin;} > + > + | PARSEOP_ELSE > + error {$$ = AslDoError(); yyclearin;} > + > + | PARSEOP_ELSEIF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} > + TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} > + ')' '{' > + 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 > + error {$$ = AslDoError(); yyclearin;} > + ; > + > EventTerm > : PARSEOP_EVENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EVENT);} > NameString > @@ -1651,6 +1862,27 @@ EventTerm > error ')' {$$ = AslDoError(); yyclearin;} > ; > > +ExternalTerm > + : PARSEOP_EXTERNAL '(' > + NameString > + OptionalObjectTypeKeyword > + OptionalParameterTypePackage > + OptionalParameterTypesPackage > + ')' {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);} > + | PARSEOP_EXTERNAL '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +FatalTerm > + : PARSEOP_FATAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);} > + ByteConstExpr > + ',' DWordConstExpr > + TermArgItem > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} > + | PARSEOP_FATAL '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > FieldTerm > : PARSEOP_FIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIELD);} > NameString > @@ -1663,6 +1895,43 @@ FieldTerm > error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} > ; > > +FindSetLeftBitTerm > + : PARSEOP_FINDSETLEFTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} > + TermArg > + Target > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_FINDSETLEFTBIT '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +FindSetRightBitTerm > + : PARSEOP_FINDSETRIGHTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} > + TermArg > + Target > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_FINDSETRIGHTBIT '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +FprintfTerm > + : PARSEOP_FPRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);} > + TermArg ',' > + StringData > + PrintfArgList > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} > + | PARSEOP_FPRINTF '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +FromBCDTerm > + : PARSEOP_FROMBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);} > + TermArg > + Target > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_FROMBCD '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > FunctionTerm > : PARSEOP_FUNCTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} > NameString > @@ -1677,6 +1946,35 @@ FunctionTerm > error ')' {$$ = AslDoError(); yyclearin;} > ; > > +IfTerm > + : PARSEOP_IF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} > + TermArg > + ')' '{' > + TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > + > + | PARSEOP_IF '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +IncludeTerm > + : PARSEOP_INCLUDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCLUDE);} > + String ')' {TrLinkChildren ($<n>3,1,$4);FlOpenIncludeFile ($4);} > + TermList > + IncludeEndTerm {$$ = TrLinkPeerNodes (3,$<n>3,$7,$8);} > + ; > + > +IncludeEndTerm > + : PARSEOP_INCLUDE_END {$$ = TrCreateLeafNode (PARSEOP_INCLUDE_END);} > + ; > + > +IncTerm > + : PARSEOP_INCREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} > + SuperName > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_INCREMENT '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > IndexFieldTerm > : PARSEOP_INDEXFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} > NameString > @@ -1690,171 +1988,98 @@ IndexFieldTerm > error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} > ; > > -MethodTerm > - : PARSEOP_METHOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} > - NameString > - OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} > - OptionalSerializeRuleKeyword > - OptionalByteConstExpr > - OptionalParameterTypePackage > - OptionalParameterTypesPackage > - ')' '{' > - TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$7,$8,$9,$10,$13);} > - | PARSEOP_METHOD '(' > +IndexTerm > + : PARSEOP_INDEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_INDEX '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -MutexTerm > - : PARSEOP_MUTEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);} > - NameString > - ',' ByteConstExpr > - ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} > - | PARSEOP_MUTEX '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -OpRegionTerm > - : PARSEOP_OPERATIONREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} > - NameString > - ',' OpRegionSpaceIdTerm > - TermArgItem > +LAndTerm > + : PARSEOP_LAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} > + TermArg > TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8);} > - | PARSEOP_OPERATIONREGION '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -OpRegionSpaceIdTerm > - : RegionSpaceKeyword {} > - | ByteConst {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} > - ; > - > -PowerResTerm > - : PARSEOP_POWERRESOURCE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} > - NameString > - ',' ByteConstExpr > - ',' WordConstExpr > - ')' '{' > - ObjectList '}' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);} > - | PARSEOP_POWERRESOURCE '(' > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_LAND '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -ProcessorTerm > - : PARSEOP_PROCESSOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} > - NameString > - ',' ByteConstExpr > - OptionalDWordConstExpr > - OptionalByteConstExpr > - ')' '{' > - ObjectList '}' {$$ = TrLinkChildren ($<n>3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);} > - | PARSEOP_PROCESSOR '(' > +LEqualTerm > + : PARSEOP_LEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} > + TermArg > + TermArgItem > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_LEQUAL '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -ThermalZoneTerm > - : PARSEOP_THERMALZONE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} > - NameString > - ')' '{' > - ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} > - | PARSEOP_THERMALZONE '(' > +LGreaterEqualTerm > + : PARSEOP_LGREATEREQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} > + TermArg > + TermArgItem > + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} > + | PARSEOP_LGREATEREQUAL '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > - > -/******* Namespace modifiers *************************************************/ > - > - > -AliasTerm > - : PARSEOP_ALIAS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);} > - NameString > - NameStringItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} > - | PARSEOP_ALIAS '(' > +LGreaterTerm > + : PARSEOP_LGREATER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} > + TermArg > + TermArgItem > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_LGREATER '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -NameTerm > - : PARSEOP_NAME '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);} > - NameString > - ',' DataObject > - ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} > - | PARSEOP_NAME '(' > +LLessEqualTerm > + : PARSEOP_LLESSEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} > + TermArg > + TermArgItem > + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} > + | PARSEOP_LLESSEQUAL '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -ScopeTerm > - : PARSEOP_SCOPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);} > - NameString > - ')' '{' > - ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} > - | PARSEOP_SCOPE '(' > +LLessTerm > + : PARSEOP_LLESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} > + TermArg > + TermArgItem > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_LLESS '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > - > -/******* Type 1 opcodes *******************************************************/ > - > - > -BreakTerm > - : PARSEOP_BREAK {$$ = TrCreateNode (PARSEOP_BREAK, 0);} > - ; > - > -BreakPointTerm > - : PARSEOP_BREAKPOINT {$$ = TrCreateNode (PARSEOP_BREAKPOINT, 0);} > - ; > - > -ContinueTerm > - : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);} > - ; > - > -FatalTerm > - : PARSEOP_FATAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);} > - ByteConstExpr > - ',' DWordConstExpr > +LNotEqualTerm > + : PARSEOP_LNOTEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} > + TermArg > TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} > - | PARSEOP_FATAL '(' > + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} > + | PARSEOP_LNOTEQUAL '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -IfElseTerm > - : IfTerm ElseTerm {$$ = TrLinkPeerNode ($1,$2);} > - ; > - > -IfTerm > - : PARSEOP_IF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} > +LNotTerm > + : PARSEOP_LNOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} > TermArg > - ')' '{' > - TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - > - | PARSEOP_IF '(' > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_LNOT '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -ElseTerm > - : {$$ = NULL;} > - | PARSEOP_ELSE '{' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} > - TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} > - > - | PARSEOP_ELSE '{' > - error '}' {$$ = AslDoError(); yyclearin;} > - > - | PARSEOP_ELSE > - error {$$ = AslDoError(); yyclearin;} > - > - | PARSEOP_ELSEIF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} > - TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} > - ')' '{' > - TermList '}' {TrLinkChildren ($<n>5,2,$4,$8);} > - ElseTerm {TrLinkPeerNode ($<n>5,$11);} > - {$$ = TrLinkChildren ($<n>3,1,$<n>5);} > - > - | PARSEOP_ELSEIF '(' > +LoadTableTerm > + : PARSEOP_LOADTABLE '(' {$<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_ELSEIF > - error {$$ = AslDoError(); yyclearin;} > ; > > LoadTerm > @@ -1866,507 +2091,338 @@ LoadTerm > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -NoOpTerm > - : PARSEOP_NOOP {$$ = TrCreateNode (PARSEOP_NOOP, 0);} > +LocalTerm > + : PARSEOP_LOCAL0 {$$ = TrCreateLeafNode (PARSEOP_LOCAL0);} > + | PARSEOP_LOCAL1 {$$ = TrCreateLeafNode (PARSEOP_LOCAL1);} > + | PARSEOP_LOCAL2 {$$ = TrCreateLeafNode (PARSEOP_LOCAL2);} > + | PARSEOP_LOCAL3 {$$ = TrCreateLeafNode (PARSEOP_LOCAL3);} > + | PARSEOP_LOCAL4 {$$ = TrCreateLeafNode (PARSEOP_LOCAL4);} > + | PARSEOP_LOCAL5 {$$ = TrCreateLeafNode (PARSEOP_LOCAL5);} > + | PARSEOP_LOCAL6 {$$ = TrCreateLeafNode (PARSEOP_LOCAL6);} > + | PARSEOP_LOCAL7 {$$ = TrCreateLeafNode (PARSEOP_LOCAL7);} > ; > > -NotifyTerm > - : PARSEOP_NOTIFY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);} > - SuperName > +LOrTerm > + : PARSEOP_LOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} > + TermArg > TermArgItem > ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_NOTIFY '(' > + | PARSEOP_LOR '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -ReleaseTerm > - : PARSEOP_RELEASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);} > - SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_RELEASE '(' > +MatchTerm > + : PARSEOP_MATCH '(' {$<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;} > ; > > -ResetTerm > - : PARSEOP_RESET '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);} > - SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_RESET '(' > +MethodTerm > + : PARSEOP_METHOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} > + NameString > + OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} > + OptionalSerializeRuleKeyword > + OptionalByteConstExpr > + OptionalParameterTypePackage > + OptionalParameterTypesPackage > + ')' '{' > + TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$7,$8,$9,$10,$13);} > + | PARSEOP_METHOD '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -ReturnTerm > - : PARSEOP_RETURN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);} > - OptionalReturnArg > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_RETURN {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_RETURN),1,TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN));} > - | PARSEOP_RETURN '(' > +MidTerm > + : PARSEOP_MID '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MID);} > + TermArg > + TermArgItem > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} > + | PARSEOP_MID '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -SignalTerm > - : PARSEOP_SIGNAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);} > - SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_SIGNAL '(' > +ModTerm > + : PARSEOP_MOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_MOD '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -SleepTerm > - : PARSEOP_SLEEP '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);} > +MultiplyTerm > + : PARSEOP_MULTIPLY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} > TermArg > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_SLEEP '(' > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_MULTIPLY '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -StallTerm > - : PARSEOP_STALL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);} > - TermArg > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_STALL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -SwitchTerm > - : PARSEOP_SWITCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);} > - TermArg > - ')' '{' > - CaseDefaultTermList '}' > - {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_SWITCH '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -/* > - * Case-Default list; allow only one Default term and unlimited Case terms > - */ > - > -CaseDefaultTermList > - : {$$ = NULL;} > - | CaseTerm {} > - | DefaultTerm {} > - | CaseDefaultTermList > - CaseTerm {$$ = TrLinkPeerNode ($1,$2);} > - | CaseDefaultTermList > - DefaultTerm {$$ = TrLinkPeerNode ($1,$2);} > - > -/* Original - attempts to force zero or one default term within the switch */ > - > -/* > -CaseDefaultTermList > - : {$$ = NULL;} > - | CaseTermList > - DefaultTerm > - CaseTermList {$$ = TrLinkPeerNode ($1,TrLinkPeerNode ($2, $3));} > - | CaseTermList > - CaseTerm {$$ = TrLinkPeerNode ($1,$2);} > - ; > - > -CaseTermList > - : {$$ = NULL;} > - | CaseTerm {} > - | CaseTermList > - CaseTerm {$$ = TrLinkPeerNode ($1,$2);} > - ; > -*/ > - > -CaseTerm > - : PARSEOP_CASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);} > - DataObject > - ')' '{' > - TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_CASE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -DefaultTerm > - : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFAULT);} > - TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_DEFAULT '{' > - error '}' {$$ = AslDoError(); yyclearin;} > - ; > - > -UnloadTerm > - : PARSEOP_UNLOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);} > - SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_UNLOAD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -WhileTerm > - : PARSEOP_WHILE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} > - TermArg > - ')' '{' TermList '}' > - {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_WHILE '(' > +MutexTerm > + : PARSEOP_MUTEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);} > + NameString > + ',' ByteConstExpr > + ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} > + | PARSEOP_MUTEX '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > - > -/******* Type 2 opcodes *******************************************************/ > - > -AcquireTerm > - : PARSEOP_ACQUIRE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} > - SuperName > - ',' WordConstExpr > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$6);} > - | PARSEOP_ACQUIRE '(' > +NameTerm > + : PARSEOP_NAME '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);} > + NameString > + ',' DataObject > + ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} > + | PARSEOP_NAME '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -AddTerm > - : PARSEOP_ADD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} > +NAndTerm > + : PARSEOP_NAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);} > TermArg > TermArgItem > Target > ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_ADD '(' > + | PARSEOP_NAND '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -AndTerm > - : PARSEOP_AND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} > - TermArg > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_AND '(' > - error ')' {$$ = AslDoError(); yyclearin;} > +NoOpTerm > + : PARSEOP_NOOP {$$ = TrCreateNode (PARSEOP_NOOP, 0);} > ; > > -ConcatTerm > - : PARSEOP_CONCATENATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} > +NOrTerm > + : PARSEOP_NOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);} > TermArg > TermArgItem > Target > ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_CONCATENATE '(' > + | PARSEOP_NOR '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -ConcatResTerm > - : PARSEOP_CONCATENATERESTEMPLATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);} > - TermArg > +NotifyTerm > + : PARSEOP_NOTIFY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);} > + SuperName > TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_CONCATENATERESTEMPLATE '(' > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_NOTIFY '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -CondRefOfTerm > - : PARSEOP_CONDREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} > - SuperName > +NotTerm > + : PARSEOP_NOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} > + TermArg > Target > ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_CONDREFOF '(' > + | PARSEOP_NOT '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -CopyObjectTerm > - : PARSEOP_COPYOBJECT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} > - TermArg > - ',' SimpleTarget > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} > - | PARSEOP_COPYOBJECT '(' > +ObjectTypeTerm > + : PARSEOP_OBJECTTYPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} > + ObjectTypeName > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_OBJECTTYPE '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -DecTerm > - : PARSEOP_DECREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} > - SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_DECREMENT '(' > +OffsetTerm > + : PARSEOP_OFFSET '(' > + AmlPackageLengthTerm > + ')' {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);} > + | PARSEOP_OFFSET '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -DerefOfTerm > - : PARSEOP_DEREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);} > - TermArg > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_DEREFOF '(' > +OpRegionTerm > + : PARSEOP_OPERATIONREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} > + NameString > + ',' OpRegionSpaceIdTerm > + TermArgItem > + TermArgItem > + ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8);} > + | PARSEOP_OPERATIONREGION '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -DivideTerm > - : PARSEOP_DIVIDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} > +OpRegionSpaceIdTerm > + : RegionSpaceKeyword {} > + | ByteConst {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} > + ; > + > +OrTerm > + : PARSEOP_OR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} > TermArg > TermArgItem > Target > - Target > - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} > - | PARSEOP_DIVIDE '(' > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_OR '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -FindSetLeftBitTerm > - : PARSEOP_FINDSETLEFTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} > - TermArg > - Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_FINDSETLEFTBIT '(' > +PackageTerm > + : PARSEOP_PACKAGE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} > + VarPackageLengthTerm > + ')' '{' > + PackageList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > + | PARSEOP_PACKAGE '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -FindSetRightBitTerm > - : PARSEOP_FINDSETRIGHTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} > - TermArg > - Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_FINDSETRIGHTBIT '(' > +PowerResTerm > + : PARSEOP_POWERRESOURCE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} > + NameString > + ',' ByteConstExpr > + ',' WordConstExpr > + ')' '{' > + ObjectList '}' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);} > + | PARSEOP_POWERRESOURCE '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -FromBCDTerm > - : PARSEOP_FROMBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);} > - TermArg > - Target > +PrintfTerm > + : PARSEOP_PRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);} > + StringData > + PrintfArgList > ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_FROMBCD '(' > + | PARSEOP_PRINTF '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -IncTerm > - : PARSEOP_INCREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} > - SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_INCREMENT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > +PrintfArgList > + : {$$ = NULL;} > + | TermArg {$$ = $1;} > + | PrintfArgList ',' > + TermArg {$$ = TrLinkPeerNode ($1, $3);} > ; > > -IndexTerm > - : PARSEOP_INDEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);} > - TermArg > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_INDEX '(' > +ProcessorTerm > + : PARSEOP_PROCESSOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} > + NameString > + ',' ByteConstExpr > + OptionalDWordConstExpr > + OptionalByteConstExpr > + ')' '{' > + ObjectList '}' {$$ = TrLinkChildren ($<n>3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);} > + | PARSEOP_PROCESSOR '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -LAndTerm > - : PARSEOP_LAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} > - TermArg > - TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_LAND '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -LEqualTerm > - : PARSEOP_LEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} > - TermArg > - TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_LEQUAL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -LGreaterTerm > - : PARSEOP_LGREATER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} > - TermArg > - TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_LGREATER '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -LGreaterEqualTerm > - : PARSEOP_LGREATEREQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} > - TermArg > - TermArgItem > - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} > - | PARSEOP_LGREATEREQUAL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -LLessTerm > - : PARSEOP_LLESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} > - TermArg > - TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_LLESS '(' > +RawDataBufferTerm > + : PARSEOP_DATABUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} > + OptionalWordConst > + ')' '{' > + ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > + | PARSEOP_DATABUFFER '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -LLessEqualTerm > - : PARSEOP_LLESSEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} > - TermArg > - TermArgItem > - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} > - | PARSEOP_LLESSEQUAL '(' > +/* > + * In RefOf, the node isn't really a target, but we can't keep track of it after > + * 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,TrSetNodeFlags ($4, NODE_IS_TARGET));} > + | PARSEOP_REFOF '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -LNotTerm > - : PARSEOP_LNOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} > - TermArg > +ReleaseTerm > + : PARSEOP_RELEASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);} > + SuperName > ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_LNOT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -LNotEqualTerm > - : PARSEOP_LNOTEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} > - TermArg > - TermArgItem > - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} > - | PARSEOP_LNOTEQUAL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -LoadTableTerm > - : PARSEOP_LOADTABLE '(' {$<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;} > - ; > - > -LOrTerm > - : PARSEOP_LOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} > - TermArg > - TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_LOR '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -MatchTerm > - : PARSEOP_MATCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MATCH);} > - TermArg > - ',' MatchOpKeyword > - TermArgItem > - ',' MatchOpKeyword > - TermArgItem > - TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);} > - | PARSEOP_MATCH '(' > + | PARSEOP_RELEASE '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -MidTerm > - : PARSEOP_MID '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MID);} > - TermArg > - TermArgItem > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} > - | PARSEOP_MID '(' > +ResetTerm > + : PARSEOP_RESET '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);} > + SuperName > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_RESET '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -ModTerm > - : PARSEOP_MOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} > - TermArg > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_MOD '(' > +ReturnTerm > + : PARSEOP_RETURN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);} > + OptionalReturnArg > + ')' {$$ = 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;} > ; > > -MultiplyTerm > - : PARSEOP_MULTIPLY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} > - TermArg > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_MULTIPLY '(' > +ScopeTerm > + : PARSEOP_SCOPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);} > + NameString > + ')' '{' > + ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} > + | PARSEOP_SCOPE '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -NAndTerm > - : PARSEOP_NAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);} > +ShiftLeftTerm > + : PARSEOP_SHIFTLEFT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} > TermArg > TermArgItem > Target > ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_NAND '(' > + | PARSEOP_SHIFTLEFT '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -NOrTerm > - : PARSEOP_NOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);} > +ShiftRightTerm > + : PARSEOP_SHIFTRIGHT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} > TermArg > TermArgItem > Target > ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_NOR '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -NotTerm > - : PARSEOP_NOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} > - TermArg > - Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_NOT '(' > + | PARSEOP_SHIFTRIGHT '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -ObjectTypeTerm > - : PARSEOP_OBJECTTYPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} > - ObjectTypeName > +SignalTerm > + : PARSEOP_SIGNAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);} > + SuperName > ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_OBJECTTYPE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -OrTerm > - : PARSEOP_OR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} > - TermArg > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_OR '(' > + | PARSEOP_SIGNAL '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -/* > - * In RefOf, the node isn't really a target, but we can't keep track of it after > - * we've taken a pointer to it. (hard to tell if a local becomes initialized this way.) > - */ > -RefOfTerm > - : PARSEOP_REFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REFOF);} > +SizeOfTerm > + : PARSEOP_SIZEOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);} > SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,TrSetNodeFlags ($4, NODE_IS_TARGET));} > - | PARSEOP_REFOF '(' > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_SIZEOF '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -ShiftLeftTerm > - : PARSEOP_SHIFTLEFT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} > +SleepTerm > + : PARSEOP_SLEEP '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);} > TermArg > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_SHIFTLEFT '(' > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_SLEEP '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -ShiftRightTerm > - : PARSEOP_SHIFTRIGHT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} > +StallTerm > + : PARSEOP_STALL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);} > TermArg > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_SHIFTRIGHT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -SizeOfTerm > - : PARSEOP_SIZEOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);} > - SuperName > ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_SIZEOF '(' > + | PARSEOP_STALL '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > @@ -2388,6 +2444,24 @@ SubtractTerm > | PARSEOP_SUBTRACT '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > +SwitchTerm > + : PARSEOP_SWITCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);} > + TermArg > + ')' '{' > + CaseDefaultTermList '}' > + {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > + | PARSEOP_SWITCH '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +ThermalZoneTerm > + : PARSEOP_THERMALZONE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} > + NameString > + ')' '{' > + ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} > + | PARSEOP_THERMALZONE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > > TimerTerm > : PARSEOP_TIMER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);} > @@ -2442,35 +2516,12 @@ ToIntegerTerm > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -PldKeyword > - : PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);} > - | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);} > - | PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);} > - | PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);} > - | PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);} > - | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);} > - | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);} > - | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);} > - | PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);} > - | PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);} > - | PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);} > - | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);} > - | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);} > - | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);} > - | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);} > - | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);} > - | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);} > - | PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);} > - | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);} > - | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);} > - | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);} > - | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);} > - | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);} > - | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);} > - | PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);} > - | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);} > - | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);} > - | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);} > +ToPLDTerm > + : PARSEOP_TOPLD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);} > + PldKeywordList > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_TOPLD '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > PldKeywordList > @@ -2488,39 +2539,6 @@ PldKeywordList > PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} > ; > > -ToPLDTerm > - : PARSEOP_TOPLD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);} > - PldKeywordList > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_TOPLD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -PrintfArgList > - : {$$ = NULL;} > - | TermArg {$$ = $1;} > - | PrintfArgList ',' > - TermArg {$$ = TrLinkPeerNode ($1, $3);} > - ; > - > -PrintfTerm > - : PARSEOP_PRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);} > - StringData > - PrintfArgList > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_PRINTF '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -FprintfTerm > - : PARSEOP_FPRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);} > - TermArg ',' > - StringData > - PrintfArgList > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} > - | PARSEOP_FPRINTF '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > > ToStringTerm > : PARSEOP_TOSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);} > @@ -2539,6 +2557,22 @@ ToUUIDTerm > error ')' {$$ = AslDoError(); yyclearin;} > ; > > +UnicodeTerm > + : PARSEOP_UNICODE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);} > + StringData > + ')' {$$ = TrLinkChildren ($<n>3,2,0,$4);} > + | PARSEOP_UNICODE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +UnloadTerm > + : PARSEOP_UNLOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);} > + SuperName > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_UNLOAD '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > WaitTerm > : PARSEOP_WAIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);} > SuperName > @@ -2558,9 +2592,236 @@ XOrTerm > error ')' {$$ = AslDoError(); yyclearin;} > ; > > +WhileTerm > + : PARSEOP_WHILE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} > + TermArg > + ')' '{' TermList '}' > + {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > + | PARSEOP_WHILE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > + > +/******************************************************************************* > + * > + * ASL Helper Terms > + * > + ******************************************************************************/ > + > +AmlPackageLengthTerm > + : Integer {$$ = TrUpdateNode (PARSEOP_PACKAGE_LENGTH,(ACPI_PARSE_OBJECT *) $1);} > + ; > + > +NameStringItem > + : ',' NameString {$$ = $2;} > + | ',' error {$$ = AslDoError (); yyclearin;} > + ; > + > +TermArgItem > + : ',' TermArg {$$ = $2;} > + | ',' error {$$ = AslDoError (); yyclearin;} > + ; > + > +OptionalReference > + : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ > + | ',' {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ > + | ',' TermArg {$$ = $2;} > + ; > + > +OptionalReturnArg > + : {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN);} /* Placeholder is a ZeroOp object */ > + | TermArg {$$ = $1;} > + ; > + > +OptionalSerializeRuleKeyword > + : {$$ = NULL;} > + | ',' {$$ = NULL;} > + | ',' SerializeRuleKeyword {$$ = $2;} > + ; > + > +OptionalTermArg > + : {$$ = NULL;} > + | TermArg {$$ = $1;} > + ; > + > +OptionalWordConst > + : {$$ = NULL;} > + | WordConst {$$ = $1;} > + ; > + > > -/******* Keywords *************************************************************/ > > +/******************************************************************************* > + * > + * Production rules for the symbolic (c-style) operators > + * > + ******************************************************************************/ > + > +/* > + * ASL Extensions: C-style math/logical operators and expressions. > + * The implementation transforms these operators into the standard > + * AML opcodes and syntax. > + * > + * Supported operators and precedence rules (high-to-low) > + * > + * NOTE: The operator precedence and associativity rules are > + * implemented by the tokens in asltokens.y > + * > + * (left-to-right): > + * 1) ( ) expr++ expr-- > + * > + * (right-to-left): > + * 2) ! ~ > + * > + * (left-to-right): > + * 3) * / % > + * 4) + - > + * 5) >> << > + * 6) < > <= >= > + * 7) == != > + * 8) & > + * 9) ^ > + * 10) | > + * 11) && > + * 12) || > + * > + * (right-to-left): > + * 13) = += -= *= /= %= <<= >>= &= ^= |= > + */ > + > +Expression > + > + /* Unary operators */ > + > + : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} > + TermArg {$$ = TrLinkChildren ($<n>2,1,$3);} > + | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} > + TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateNullTarget ());} > + > + | SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} > + {$$ = TrLinkChildren ($<n>3,1,$1);} > + | SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} > + {$$ = TrLinkChildren ($<n>3,1,$1);} > + > + /* Binary operators: math and logical */ > + > + | TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + | TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} > + TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), > + TrCreateNullTarget ());} > + | TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + | TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + | TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + | TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + | TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + > + | TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + | TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + | TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + > + | TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} > + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > + | TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);} > + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > + | TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} > + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > + | TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);} > + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > + > + | TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} > + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > + | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);} > + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > + > + | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} > + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > + | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} > + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > + > + /* Parentheses */ > + > + | '(' TermArg ')' { $$ = $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 ());} > + ; > + > + /* Index term -- "BUF1[5] = " on left-hand side of an equals (target) */ > + > +IndexExpTerm > + > + : SuperName PARSEOP_EXP_INDEX_LEFT TermArg PARSEOP_EXP_INDEX_RIGHT > + {$$ = TrCreateLeafNode (PARSEOP_INDEX); > + TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());} > + ; > + > +EqualsTerm > + > + /* All assignment-type operations */ > + > + : SuperName PARSEOP_EXP_EQUALS > + TermArg {$$ = TrCreateAssignmentNode ($1, $3);} > + > + | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} > + TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + ; > + > + > + > +/******************************************************************************* > + * > + * ASL Parameter Keyword Terms > + * > + ******************************************************************************/ > > AccessAttribKeyword > : PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK);} > @@ -2677,383 +2938,198 @@ IoRestrictionKeyword > ; > > LockRuleKeyword > - : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);} > - | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_NOLOCK);} > - ; > - > -MatchOpKeyword > - : PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);} > - | PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);} > - | PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLE);} > - | PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLT);} > - | PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGE);} > - | PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGT);} > - ; > - > -MaxKeyword > - : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);} > - | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);} > - ; > - > -MemTypeKeyword > - : PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_CACHEABLE);} > - | PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_WRITECOMBINING);} > - | PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_PREFETCHABLE);} > - | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_NONCACHEABLE);} > - ; > - > -MinKeyword > - : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);} > - | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);} > - ; > - > -ObjectTypeKeyword > - : PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} > - | PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_INT);} > - | PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_STR);} > - | PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BUF);} > - | PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PKG);} > - | PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_FLD);} > - | PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DEV);} > - | PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_EVT);} > - | PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTH);} > - | PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTX);} > - | PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_OPR);} > - | PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_POW);} > - | PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PRO);} > - | PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_THZ);} > - | PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BFF);} > - | PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DDB);} > - ; > - > -ParityTypeKeyword > - : PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_SPACE);} > - | PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_MARK);} > - | PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_ODD);} > - | PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_EVEN);} > - | PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_NONE);} > - ; > - > -PinConfigByte > - : PinConfigKeyword {$$ = $1;} > - | ByteConstExpr {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} > - ; > - > -PinConfigKeyword > - : PARSEOP_PIN_NOPULL {$$ = TrCreateLeafNode (PARSEOP_PIN_NOPULL);} > - | PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDOWN);} > - | PARSEOP_PIN_PULLUP {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLUP);} > - | PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDEFAULT);} > - ; > - > -RangeTypeKeyword > - : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);} > - | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);} > - | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ENTIRE);} > - ; > - > -RegionSpaceKeyword > - : PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IO);} > - | PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_MEM);} > - | PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCI);} > - | PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_EC);} > - | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);} > - | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);} > - | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);} > - | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);} > - | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);} > - | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);} > - | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);} > - | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);} > - ; > - > -ResourceTypeKeyword > - : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} > - | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);} > - ; > - > -SerializeRuleKeyword > - : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);} > - | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL);} > - ; > - > -ShareTypeKeyword > - : PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHARED);} > - | PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVE);} > - | PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHAREDWAKE);} > - | PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);} > - ; > - > -SlaveModeKeyword > - : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_CONTROLLERINIT);} > - | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_DEVICEINIT);} > - ; > - > -StopBitsKeyword > - : PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_TWO);} > - | PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONEPLUSHALF);} > - | PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONE);} > - | PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ZERO);} > - ; > - > -TranslationKeyword > - : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);} > - | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);} > - ; > - > -TypeKeyword > - : PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafNode (PARSEOP_TYPE_TRANSLATION);} > - | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafNode (PARSEOP_TYPE_STATIC);} > - ; > - > -UpdateRuleKeyword > - : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);} > - | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);} > - | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);} > - ; > - > -WireModeKeyword > - : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_FOUR);} > - | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_THREE);} > - ; > - > -XferSizeKeyword > - : PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_8, 0);} > - | PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_16, 1);} > - | PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} > - | PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_64, 3);} > - | PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_128, 4);} > - | PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_256, 5);} > - ; > - > -XferTypeKeyword > - : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);} > - | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);} > - | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);} > - ; > - > - > -/******* Miscellaneous Types **************************************************/ > - > - > -SuperName > - : NameString {} > - | ArgTerm {} > - | LocalTerm {} > - | DebugTerm {} > - | Type6Opcode {} > - > -/* For ObjectType: SuperName except for MethodInvocationTerm */ > - > -ObjectTypeName > - : NameString {} > - | ArgTerm {} > - | LocalTerm {} > - | DebugTerm {} > - | RefOfTerm {} > - | DerefOfTerm {} > - | IndexTerm {} > - > -/* | MethodInvocationTerm {} */ /* Caused reduce/reduce with Type6Opcode->MethodInvocationTerm */ > - ; > - > -ArgTerm > - : PARSEOP_ARG0 {$$ = TrCreateLeafNode (PARSEOP_ARG0);} > - | PARSEOP_ARG1 {$$ = TrCreateLeafNode (PARSEOP_ARG1);} > - | PARSEOP_ARG2 {$$ = TrCreateLeafNode (PARSEOP_ARG2);} > - | PARSEOP_ARG3 {$$ = TrCreateLeafNode (PARSEOP_ARG3);} > - | PARSEOP_ARG4 {$$ = TrCreateLeafNode (PARSEOP_ARG4);} > - | PARSEOP_ARG5 {$$ = TrCreateLeafNode (PARSEOP_ARG5);} > - | PARSEOP_ARG6 {$$ = TrCreateLeafNode (PARSEOP_ARG6);} > - ; > - > -LocalTerm > - : PARSEOP_LOCAL0 {$$ = TrCreateLeafNode (PARSEOP_LOCAL0);} > - | PARSEOP_LOCAL1 {$$ = TrCreateLeafNode (PARSEOP_LOCAL1);} > - | PARSEOP_LOCAL2 {$$ = TrCreateLeafNode (PARSEOP_LOCAL2);} > - | PARSEOP_LOCAL3 {$$ = TrCreateLeafNode (PARSEOP_LOCAL3);} > - | PARSEOP_LOCAL4 {$$ = TrCreateLeafNode (PARSEOP_LOCAL4);} > - | PARSEOP_LOCAL5 {$$ = TrCreateLeafNode (PARSEOP_LOCAL5);} > - | PARSEOP_LOCAL6 {$$ = TrCreateLeafNode (PARSEOP_LOCAL6);} > - | PARSEOP_LOCAL7 {$$ = TrCreateLeafNode (PARSEOP_LOCAL7);} > - ; > - > -DebugTerm > - : PARSEOP_DEBUG {$$ = TrCreateLeafNode (PARSEOP_DEBUG);} > - ; > - > - > -ByteConst > - : Integer {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} > - ; > - > -WordConst > - : Integer {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} > - ; > - > -DWordConst > - : Integer {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} > - ; > - > -QWordConst > - : Integer {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} > - ; > - > -Integer > - : PARSEOP_INTEGER {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, AslCompilerlval.i);} > - ; > - > -String > - : PARSEOP_STRING_LITERAL {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, (ACPI_NATIVE_INT) AslCompilerlval.s);} > - ; > - > -ConstTerm > - : ConstExprTerm {} > - | PARSEOP_REVISION {$$ = TrCreateLeafNode (PARSEOP_REVISION);} > - ; > - > -ConstExprTerm > - : PARSEOP_ZERO {$$ = TrCreateValuedLeafNode (PARSEOP_ZERO, 0);} > - | PARSEOP_ONE {$$ = TrCreateValuedLeafNode (PARSEOP_ONE, 1);} > - | PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_UINT64_MAX);} > - | PARSEOP___DATE__ {$$ = TrCreateConstantLeafNode (PARSEOP___DATE__);} > - | PARSEOP___FILE__ {$$ = TrCreateConstantLeafNode (PARSEOP___FILE__);} > - | PARSEOP___LINE__ {$$ = TrCreateConstantLeafNode (PARSEOP___LINE__);} > - | PARSEOP___PATH__ {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);} > - ; > - > -/* > - * The NODE_COMPILE_TIME_CONST flag in the following constant expressions > - * enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes > - * to simple integers. It is an error if these types of expressions cannot be > - * reduced, since the AML grammar for ****ConstExpr requires a simple constant. > - * Note: The required byte length of the constant is passed through to the > - * constant folding code in the node AmlLength field. > - */ > -ByteConstExpr > - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} > - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} > - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} > - | ByteConst {} > + : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);} > + | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_NOLOCK);} > ; > > -WordConstExpr > - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} > - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} > - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} > - | WordConst {} > +MatchOpKeyword > + : PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);} > + | PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);} > + | PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLE);} > + | PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLT);} > + | PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGE);} > + | PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGT);} > ; > > -DWordConstExpr > - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} > - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} > - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} > - | DWordConst {} > +MaxKeyword > + : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);} > + | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);} > ; > > -QWordConstExpr > - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} > - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} > - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} > - | QWordConst {} > +MemTypeKeyword > + : PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_CACHEABLE);} > + | PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_WRITECOMBINING);} > + | PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_PREFETCHABLE);} > + | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_NONCACHEABLE);} > ; > > -/* OptionalCount must appear before ByteList or an incorrect reduction will result */ > +MinKeyword > + : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);} > + | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);} > + ; > > -OptionalCount > - : {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ > - | ',' {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ > - | ',' TermArg {$$ = $2;} > +ObjectTypeKeyword > + : PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} > + | PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_INT);} > + | PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_STR);} > + | PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BUF);} > + | PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PKG);} > + | PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_FLD);} > + | PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DEV);} > + | PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_EVT);} > + | PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTH);} > + | PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTX);} > + | PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_OPR);} > + | PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_POW);} > + | PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PRO);} > + | PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_THZ);} > + | PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BFF);} > + | PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DDB);} > ; > > -BufferTerm > - : PARSEOP_BUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER);} > - OptionalTermArg > - ')' '{' > - BufferTermData '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_BUFFER '(' > - error ')' {$$ = AslDoError(); yyclearin;} > +ParityTypeKeyword > + : PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_SPACE);} > + | PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_MARK);} > + | PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_ODD);} > + | PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_EVEN);} > + | PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_NONE);} > ; > > -BufferTermData > - : ByteList {} > - | StringData {} > +PinConfigByte > + : PinConfigKeyword {$$ = $1;} > + | ByteConstExpr {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} > ; > > -ByteList > - : {$$ = NULL;} > - | ByteConstExpr > - | ByteList ',' /* Allows a trailing comma at list end */ > - | ByteList ',' > - ByteConstExpr {$$ = TrLinkPeerNode ($1,$3);} > +PinConfigKeyword > + : PARSEOP_PIN_NOPULL {$$ = TrCreateLeafNode (PARSEOP_PIN_NOPULL);} > + | PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDOWN);} > + | PARSEOP_PIN_PULLUP {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLUP);} > + | PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDEFAULT);} > ; > > -DataBufferTerm > - : PARSEOP_DATABUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} > - OptionalWordConst > - ')' '{' > - ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_DATABUFFER '(' > - error ')' {$$ = AslDoError(); yyclearin;} > +PldKeyword > + : PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);} > + | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);} > + | PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);} > + | PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);} > + | PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);} > + | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);} > + | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);} > + | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);} > + | PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);} > + | PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);} > + | PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);} > + | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);} > + | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);} > + | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);} > + | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);} > + | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);} > + | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);} > + | PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);} > + | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);} > + | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);} > + | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);} > + | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);} > + | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);} > + | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);} > + | PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);} > + | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);} > + | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);} > + | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);} > ; > > -DWordList > - : {$$ = NULL;} > - | DWordConstExpr > - | DWordList ',' /* Allows a trailing comma at list end */ > - | DWordList ',' > - DWordConstExpr {$$ = TrLinkPeerNode ($1,$3);} > +RangeTypeKeyword > + : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);} > + | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);} > + | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ENTIRE);} > ; > > -PackageTerm > - : PARSEOP_PACKAGE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} > - VarPackageLengthTerm > - ')' '{' > - PackageList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_PACKAGE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > +RegionSpaceKeyword > + : PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IO);} > + | PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_MEM);} > + | PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCI);} > + | PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_EC);} > + | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);} > + | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);} > + | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);} > + | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);} > + | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);} > + | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);} > + | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);} > + | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);} > ; > > -PackageList > - : {$$ = NULL;} > - | PackageElement > - | PackageList ',' /* Allows a trailing comma at list end */ > - | PackageList ',' > - PackageElement {$$ = TrLinkPeerNode ($1,$3);} > +ResourceTypeKeyword > + : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} > + | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);} > ; > > -PackageElement > - : DataObject {} > - | NameString {} > +SerializeRuleKeyword > + : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);} > + | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL);} > ; > > -VarPackageLengthTerm > - : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} > - | TermArg {$$ = $1;} > +ShareTypeKeyword > + : PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHARED);} > + | PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVE);} > + | PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHAREDWAKE);} > + | PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);} > + ; > + > +SlaveModeKeyword > + : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_CONTROLLERINIT);} > + | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_DEVICEINIT);} > + ; > + > +StopBitsKeyword > + : PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_TWO);} > + | PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONEPLUSHALF);} > + | PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONE);} > + | PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ZERO);} > ; > > +TranslationKeyword > + : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);} > + | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);} > + ; > > -/******* Macros ***********************************************/ > +TypeKeyword > + : PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafNode (PARSEOP_TYPE_TRANSLATION);} > + | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafNode (PARSEOP_TYPE_STATIC);} > + ; > > +UpdateRuleKeyword > + : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);} > + | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);} > + | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);} > + ; > > -EISAIDTerm > - : PARSEOP_EISAID '(' > - StringData ')' {$$ = TrUpdateNode (PARSEOP_EISAID, $3);} > - | PARSEOP_EISAID '(' > - error ')' {$$ = AslDoError(); yyclearin;} > +WireModeKeyword > + : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_FOUR);} > + | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_THREE);} > ; > > -UnicodeTerm > - : PARSEOP_UNICODE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);} > - StringData > - ')' {$$ = TrLinkChildren ($<n>3,2,0,$4);} > - | PARSEOP_UNICODE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > +XferSizeKeyword > + : PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_8, 0);} > + | PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_16, 1);} > + | PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} > + | PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_64, 3);} > + | PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_128, 4);} > + | PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_256, 5);} > ; > > +XferTypeKeyword > + : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);} > + | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);} > + | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);} > + ; > > -/******* Resources and Memory ***********************************************/ > > +/******************************************************************************* > + * > + * ASL Resource Template Terms > + * > + ******************************************************************************/ > > /* > * Note: Create two default nodes to allow conversion to a Buffer AML opcode > @@ -3189,7 +3265,6 @@ DWordSpaceTerm > error ')' {$$ = AslDoError(); yyclearin;} > ; > > - > EndDependentFnTerm > : PARSEOP_ENDDEPENDENTFN '(' > ')' {$$ = TrCreateLeafNode (PARSEOP_ENDDEPENDENTFN);} > @@ -3655,22 +3730,11 @@ NameSeg > ; > > > -/******* Helper rules ****************************************************/ > - > - > -AmlPackageLengthTerm > - : Integer {$$ = TrUpdateNode (PARSEOP_PACKAGE_LENGTH,(ACPI_PARSE_OBJECT *) $1);} > - ; > - > -NameStringItem > - : ',' NameString {$$ = $2;} > - | ',' error {$$ = AslDoError (); yyclearin;} > - ; > - > -TermArgItem > - : ',' TermArg {$$ = $2;} > - | ',' error {$$ = AslDoError (); yyclearin;} > - ; > +/******************************************************************************* > + * > + * ASL Helper Terms > + * > + ******************************************************************************/ > > OptionalBusMasterKeyword > : ',' {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);} > @@ -3710,7 +3774,7 @@ OptionalBitsPerByte > OptionalBuffer_Last > : {$$ = NULL;} > | ',' {$$ = NULL;} > - | ',' DataBufferTerm {$$ = $2;} > + | ',' RawDataBufferTerm {$$ = $2;} > ; > > OptionalByteConstExpr > @@ -3815,12 +3879,6 @@ OptionalReadWriteKeyword > | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_READONLY);} > ; > > -OptionalReference > - : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ > - | ',' {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ > - | ',' TermArg {$$ = $2;} > - ; > - > OptionalResourceType_First > : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} > | ResourceTypeKeyword {$$ = $1;} > @@ -3832,17 +3890,6 @@ OptionalResourceType > | ',' ResourceTypeKeyword {$$ = $2;} > ; > > -OptionalReturnArg > - : {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN);} /* Placeholder is a ZeroOp object */ > - | TermArg {$$ = $1;} > - ; > - > -OptionalSerializeRuleKeyword > - : {$$ = NULL;} > - | ',' {$$ = NULL;} > - | ',' SerializeRuleKeyword {$$ = $2;} > - ; > - > OptionalSlaveMode > : ',' {$$ = NULL;} > | ',' SlaveModeKeyword {$$ = $2;} > @@ -3870,9 +3917,10 @@ OptionalStringData > | ',' StringData {$$ = $2;} > ; > > -OptionalTermArg > +OptionalTranslationType_Last > : {$$ = NULL;} > - | TermArg {$$ = $1;} > + | ',' {$$ = NULL;} > + | ',' TranslationKeyword {$$ = $2;} > ; > > OptionalType > @@ -3887,22 +3935,11 @@ OptionalType_Last > | ',' TypeKeyword {$$ = $2;} > ; > > -OptionalTranslationType_Last > - : {$$ = NULL;} > - | ',' {$$ = NULL;} > - | ',' TranslationKeyword {$$ = $2;} > - ; > - > OptionalWireMode > : ',' {$$ = NULL;} > | ',' WireModeKeyword {$$ = $2;} > ; > > -OptionalWordConst > - : {$$ = NULL;} > - | WordConst {$$ = $1;} > - ; > - > OptionalWordConstExpr > : ',' {$$ = NULL;} > | ',' WordConstExpr {$$ = $2;} > diff --git a/src/acpica/source/compiler/aslcstyle.y b/src/acpica/source/compiler/aslcstyle.y > new file mode 100644 > index 0000000..074278a > --- /dev/null > +++ b/src/acpica/source/compiler/aslcstyle.y > @@ -0,0 +1,281 @@ > +NoEcho(' > +/****************************************************************************** > + * > + * Module Name: aslcstyle.y - Production rules for symbolic operators > + * > + *****************************************************************************/ > + > +/****************************************************************************** > + * > + * 1. Copyright Notice > + * > + * Some or all of this work - Copyright (c) 1999 - 2015, Intel Corp. > + * All rights reserved. > + * > + * 2. License > + * > + * 2.1. This is your license from Intel Corp. under its intellectual property > + * rights. You may have additional license terms from the party that provided > + * you this software, covering your right to use that party's intellectual > + * property rights. > + * > + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a > + * copy of the source code appearing in this file ("Covered Code") an > + * irrevocable, perpetual, worldwide license under Intel's copyrights in the > + * base code distributed originally by Intel ("Original Intel Code") to copy, > + * make derivatives, distribute, use and display any portion of the Covered > + * Code in any form, with the right to sublicense such rights; and > + * > + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent > + * license (with the right to sublicense), under only those claims of Intel > + * patents that are infringed by the Original Intel Code, to make, use, sell, > + * offer to sell, and import the Covered Code and derivative works thereof > + * solely to the minimum extent necessary to exercise the above copyright > + * license, and in no event shall the patent license extend to any additions > + * to or modifications of the Original Intel Code. No other license or right > + * is granted directly or by implication, estoppel or otherwise; > + * > + * The above copyright and patent license is granted only if the following > + * conditions are met: > + * > + * 3. Conditions > + * > + * 3.1. Redistribution of Source with Rights to Further Distribute Source. > + * Redistribution of source code of any substantial portion of the Covered > + * Code or modification with rights to further distribute source must include > + * the above Copyright Notice, the above License, this list of Conditions, > + * and the following Disclaimer and Export Compliance provision. In addition, > + * Licensee must cause all Covered Code to which Licensee contributes to > + * contain a file documenting the changes Licensee made to create that Covered > + * Code and the date of any change. Licensee must include in that file the > + * documentation of any changes made by any predecessor Licensee. Licensee > + * must include a prominent statement that the modification is derived, > + * directly or indirectly, from Original Intel Code. > + * > + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. > + * Redistribution of source code of any substantial portion of the Covered > + * Code or modification without rights to further distribute source must > + * include the following Disclaimer and Export Compliance provision in the > + * documentation and/or other materials provided with distribution. In > + * addition, Licensee may not authorize further sublicense of source of any > + * portion of the Covered Code, and must include terms to the effect that the > + * license from Licensee to its licensee is limited to the intellectual > + * property embodied in the software Licensee provides to its licensee, and > + * not to intellectual property embodied in modifications its licensee may > + * make. > + * > + * 3.3. Redistribution of Executable. Redistribution in executable form of any > + * substantial portion of the Covered Code or modification must reproduce the > + * above Copyright Notice, and the following Disclaimer and Export Compliance > + * provision in the documentation and/or other materials provided with the > + * distribution. > + * > + * 3.4. Intel retains all right, title, and interest in and to the Original > + * Intel Code. > + * > + * 3.5. Neither the name Intel nor any other trademark owned or controlled by > + * Intel shall be used in advertising or otherwise to promote the sale, use or > + * other dealings in products derived from or relating to the Covered Code > + * without prior written authorization from Intel. > + * > + * 4. Disclaimer and Export Compliance > + * > + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED > + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE > + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, > + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY > + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY > + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A > + * PARTICULAR PURPOSE. > + * > + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES > + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR > + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, > + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY > + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL > + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS > + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY > + * LIMITED REMEDY. > + * > + * 4.3. Licensee shall not export, either directly or indirectly, any of this > + * software or system incorporating such software without first obtaining any > + * required license or other approval from the U. S. Department of Commerce or > + * any other agency or department of the United States Government. In the > + * event Licensee exports any such software from the United States or > + * re-exports any such software from a foreign destination, Licensee shall > + * ensure that the distribution and export/re-export of the software is in > + * compliance with all laws, regulations, orders, or other restrictions of the > + * U.S. Export Administration Regulations. Licensee agrees that neither it nor > + * any of its subsidiaries will export/re-export any technical data, process, > + * software, or service, directly or indirectly, to any country for which the > + * United States government or any agency thereof requires an export license, > + * other governmental approval, or letter of assurance, without first obtaining > + * such license, approval or letter. > + * > + *****************************************************************************/ > + > +') > + > +/******************************************************************************* > + * > + * Production rules for the symbolic (c-style) operators > + * > + ******************************************************************************/ > + > +/* > + * ASL Extensions: C-style math/logical operators and expressions. > + * The implementation transforms these operators into the standard > + * AML opcodes and syntax. > + * > + * Supported operators and precedence rules (high-to-low) > + * > + * NOTE: The operator precedence and associativity rules are > + * implemented by the tokens in asltokens.y > + * > + * (left-to-right): > + * 1) ( ) expr++ expr-- > + * > + * (right-to-left): > + * 2) ! ~ > + * > + * (left-to-right): > + * 3) * / % > + * 4) + - > + * 5) >> << > + * 6) < > <= >= > + * 7) == != > + * 8) & > + * 9) ^ > + * 10) | > + * 11) && > + * 12) || > + * > + * (right-to-left): > + * 13) = += -= *= /= %= <<= >>= &= ^= |= > + */ > + > +Expression > + > + /* Unary operators */ > + > + : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} > + TermArg {$$ = TrLinkChildren ($<n>2,1,$3);} > + | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} > + TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateNullTarget ());} > + > + | SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} > + {$$ = TrLinkChildren ($<n>3,1,$1);} > + | SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} > + {$$ = TrLinkChildren ($<n>3,1,$1);} > + > + /* Binary operators: math and logical */ > + > + | TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + | TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} > + TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), > + TrCreateNullTarget ());} > + | TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + | TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + | TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + | TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + | TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + > + | TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + | TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + | TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > + > + | TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} > + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > + | TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);} > + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > + | TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} > + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > + | TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);} > + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > + > + | TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} > + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > + | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);} > + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > + > + | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} > + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > + | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} > + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > + > + /* Parentheses */ > + > + | '(' TermArg ')' { $$ = $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 ());} > + ; > + > + /* Index term -- "BUF1[5] = " on left-hand side of an equals (target) */ > + > +IndexExpTerm > + > + : SuperName PARSEOP_EXP_INDEX_LEFT TermArg PARSEOP_EXP_INDEX_RIGHT > + {$$ = TrCreateLeafNode (PARSEOP_INDEX); > + TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());} > + ; > + > +EqualsTerm > + > + /* All assignment-type operations */ > + > + : SuperName PARSEOP_EXP_EQUALS > + TermArg {$$ = TrCreateAssignmentNode ($1, $3);} > + > + | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} > + TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + > + | TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} > + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > + ; > diff --git a/src/acpica/source/compiler/asldefine.h b/src/acpica/source/compiler/asldefine.h > index 168a129..87e4d35 100644 > --- a/src/acpica/source/compiler/asldefine.h > +++ b/src/acpica/source/compiler/asldefine.h > @@ -176,26 +176,6 @@ > #define AML_DEFAULT_ARG_OP (UINT16) 0xDDDD > > > -/* filename suffixes for output files */ > - > -#define FILE_SUFFIX_PREPROC_USER "i " > -#define FILE_SUFFIX_PREPROCESSOR "pre" > -#define FILE_SUFFIX_AML_CODE "aml" > -#define FILE_SUFFIX_MAP "map" > -#define FILE_SUFFIX_LISTING "lst" > -#define FILE_SUFFIX_HEX_DUMP "hex" > -#define FILE_SUFFIX_DEBUG "txt" > -#define FILE_SUFFIX_SOURCE "src" > -#define FILE_SUFFIX_NAMESPACE "nsp" > -#define FILE_SUFFIX_ASM_SOURCE "asm" > -#define FILE_SUFFIX_C_SOURCE "c" > -#define FILE_SUFFIX_DISASSEMBLY "dsl" > -#define FILE_SUFFIX_ASM_INCLUDE "inc" > -#define FILE_SUFFIX_C_INCLUDE "h" > -#define FILE_SUFFIX_ASL_CODE "asl" > -#define FILE_SUFFIX_C_OFFSET "offset.h" > - > - > /* Types for input files */ > > #define ASL_INPUT_TYPE_BINARY 0 > diff --git a/src/acpica/source/compiler/aslglobal.h b/src/acpica/source/compiler/aslglobal.h > index 15d6485..9a9aba4 100644 > --- a/src/acpica/source/compiler/aslglobal.h > +++ b/src/acpica/source/compiler/aslglobal.h > @@ -249,6 +249,8 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTemplates, FALSE); > ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileGeneric, FALSE); > ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AllExceptionsDisabled, FALSE); > ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PruneParseTree, FALSE); > +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTypechecking, TRUE); > +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_EnableReferenceTypechecking, FALSE); > > > #define HEX_OUTPUT_NONE 0 > diff --git a/src/acpica/source/compiler/aslmain.c b/src/acpica/source/compiler/aslmain.c > index ca1ffc6..0f90b1f 100644 > --- a/src/acpica/source/compiler/aslmain.c > +++ b/src/acpica/source/compiler/aslmain.c > @@ -232,6 +232,7 @@ Usage ( > ACPI_OPTION ("-of", "Disable constant folding"); > ACPI_OPTION ("-oi", "Disable integer optimization to Zero/One/Ones"); > ACPI_OPTION ("-on", "Disable named reference string optimization"); > + ACPI_OPTION ("-ot", "Disable typechecking"); > ACPI_OPTION ("-cr", "Disable Resource Descriptor error checking"); > ACPI_OPTION ("-in", "Ignore NoOp operators"); > ACPI_OPTION ("-r <revision>", "Override table header Revision (1-255)"); > @@ -275,7 +276,7 @@ Usage ( > ACPI_OPTION ("-f", "Ignore errors, force creation of AML output file(s)"); > ACPI_OPTION ("-m <size>", "Set internal line buffer size (in Kbytes)"); > ACPI_OPTION ("-n", "Parse only, no output generation"); > - ACPI_OPTION ("-ot", "Display compile times and statistics"); > + ACPI_OPTION ("-oc", "Display compile times and statistics"); > ACPI_OPTION ("-x <level>", "Set debug level for trace output"); > ACPI_OPTION ("-z", "Do not insert new compiler ID for DataTables"); > } > diff --git a/src/acpica/source/compiler/aslmap.c b/src/acpica/source/compiler/aslmap.c > index cb6a941..a06c246 100644 > --- a/src/acpica/source/compiler/aslmap.c > +++ b/src/acpica/source/compiler/aslmap.c > @@ -195,6 +195,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = > { > /*! [Begin] no source code translation (keep the table structure) */ > > + /* AML Opcode Value Flags Btype */ > > /* ACCESSAS */ OP_TABLE_ENTRY (AML_INT_ACCESSFIELD_OP, 0, 0, 0), > /* ACCESSATTRIB_BLOCK */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_BLOCK, 0, 0), > @@ -313,7 +314,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = > /* INCLUDE */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), > /* INCLUDE_END */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), > /* INCREMENT */ OP_TABLE_ENTRY (AML_INCREMENT_OP, 0, 0, ACPI_BTYPE_INTEGER), > -/* INDEX */ OP_TABLE_ENTRY (AML_INDEX_OP, 0, 0, ACPI_BTYPE_REFERENCE), > +/* INDEX */ OP_TABLE_ENTRY (AML_INDEX_OP, 0, 0, ACPI_BTYPE_REFERENCE_OBJECT), > /* INDEXFIELD */ OP_TABLE_ENTRY (AML_INDEX_FIELD_OP, 0, NODE_AML_PACKAGE, 0), > /* INTEGER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, ACPI_BTYPE_INTEGER), > /* INTERRUPT */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), > @@ -429,7 +430,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = > /* RAW_DATA */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), > /* READWRITETYPE_BOTH */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), > /* READWRITETYPE_READONLY */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), > -/* REFOF */ OP_TABLE_ENTRY (AML_REF_OF_OP, 0, 0, ACPI_BTYPE_REFERENCE), > +/* REFOF */ OP_TABLE_ENTRY (AML_REF_OF_OP, 0, 0, ACPI_BTYPE_REFERENCE_OBJECT), > /* REGIONSPACE_CMOS */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_CMOS, 0, 0), > /* REGIONSPACE_EC */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_EC, 0, 0), > /* REGIONSPACE_FFIXEDHW */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_FIXED_HARDWARE, 0, 0), > diff --git a/src/acpica/source/compiler/aslparser.y b/src/acpica/source/compiler/aslparser.y > index 588e239..94fc401 100644 > --- a/src/acpica/source/compiler/aslparser.y > +++ b/src/acpica/source/compiler/aslparser.y > @@ -194,6 +194,8 @@ m4_include(asltypes.y) > /* Production rules */ > > m4_include(aslrules.y) > +m4_include(aslcstyle.y) > +m4_include(aslresources.y) > %% > > /*! [End] no source code translation !*/ > diff --git a/src/acpica/source/compiler/aslresources.y b/src/acpica/source/compiler/aslresources.y > new file mode 100644 > index 0000000..46d4f31 > --- /dev/null > +++ b/src/acpica/source/compiler/aslresources.y > @@ -0,0 +1,1251 @@ > +NoEcho(' > +/****************************************************************************** > + * > + * Module Name: aslresources.y - Bison/Yacc production rules for resources > + * > + *****************************************************************************/ > + > +/****************************************************************************** > + * > + * 1. Copyright Notice > + * > + * Some or all of this work - Copyright (c) 1999 - 2015, Intel Corp. > + * All rights reserved. > + * > + * 2. License > + * > + * 2.1. This is your license from Intel Corp. under its intellectual property > + * rights. You may have additional license terms from the party that provided > + * you this software, covering your right to use that party's intellectual > + * property rights. > + * > + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a > + * copy of the source code appearing in this file ("Covered Code") an > + * irrevocable, perpetual, worldwide license under Intel's copyrights in the > + * base code distributed originally by Intel ("Original Intel Code") to copy, > + * make derivatives, distribute, use and display any portion of the Covered > + * Code in any form, with the right to sublicense such rights; and > + * > + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent > + * license (with the right to sublicense), under only those claims of Intel > + * patents that are infringed by the Original Intel Code, to make, use, sell, > + * offer to sell, and import the Covered Code and derivative works thereof > + * solely to the minimum extent necessary to exercise the above copyright > + * license, and in no event shall the patent license extend to any additions > + * to or modifications of the Original Intel Code. No other license or right > + * is granted directly or by implication, estoppel or otherwise; > + * > + * The above copyright and patent license is granted only if the following > + * conditions are met: > + * > + * 3. Conditions > + * > + * 3.1. Redistribution of Source with Rights to Further Distribute Source. > + * Redistribution of source code of any substantial portion of the Covered > + * Code or modification with rights to further distribute source must include > + * the above Copyright Notice, the above License, this list of Conditions, > + * and the following Disclaimer and Export Compliance provision. In addition, > + * Licensee must cause all Covered Code to which Licensee contributes to > + * contain a file documenting the changes Licensee made to create that Covered > + * Code and the date of any change. Licensee must include in that file the > + * documentation of any changes made by any predecessor Licensee. Licensee > + * must include a prominent statement that the modification is derived, > + * directly or indirectly, from Original Intel Code. > + * > + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. > + * Redistribution of source code of any substantial portion of the Covered > + * Code or modification without rights to further distribute source must > + * include the following Disclaimer and Export Compliance provision in the > + * documentation and/or other materials provided with distribution. In > + * addition, Licensee may not authorize further sublicense of source of any > + * portion of the Covered Code, and must include terms to the effect that the > + * license from Licensee to its licensee is limited to the intellectual > + * property embodied in the software Licensee provides to its licensee, and > + * not to intellectual property embodied in modifications its licensee may > + * make. > + * > + * 3.3. Redistribution of Executable. Redistribution in executable form of any > + * substantial portion of the Covered Code or modification must reproduce the > + * above Copyright Notice, and the following Disclaimer and Export Compliance > + * provision in the documentation and/or other materials provided with the > + * distribution. > + * > + * 3.4. Intel retains all right, title, and interest in and to the Original > + * Intel Code. > + * > + * 3.5. Neither the name Intel nor any other trademark owned or controlled by > + * Intel shall be used in advertising or otherwise to promote the sale, use or > + * other dealings in products derived from or relating to the Covered Code > + * without prior written authorization from Intel. > + * > + * 4. Disclaimer and Export Compliance > + * > + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED > + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE > + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, > + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY > + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY > + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A > + * PARTICULAR PURPOSE. > + * > + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES > + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR > + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, > + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY > + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL > + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS > + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY > + * LIMITED REMEDY. > + * > + * 4.3. Licensee shall not export, either directly or indirectly, any of this > + * software or system incorporating such software without first obtaining any > + * required license or other approval from the U. S. Department of Commerce or > + * any other agency or department of the United States Government. In the > + * event Licensee exports any such software from the United States or > + * re-exports any such software from a foreign destination, Licensee shall > + * ensure that the distribution and export/re-export of the software is in > + * compliance with all laws, regulations, orders, or other restrictions of the > + * U.S. Export Administration Regulations. Licensee agrees that neither it nor > + * any of its subsidiaries will export/re-export any technical data, process, > + * software, or service, directly or indirectly, to any country for which the > + * United States government or any agency thereof requires an export license, > + * other governmental approval, or letter of assurance, without first obtaining > + * such license, approval or letter. > + * > + *****************************************************************************/ > + > +') > + > +/******************************************************************************* > + * > + * ASL Parameter Keyword Terms > + * > + ******************************************************************************/ > + > +AccessAttribKeyword > + : PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK);} > + | PARSEOP_ACCESSATTRIB_BLOCK_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK_CALL);} > + | PARSEOP_ACCESSATTRIB_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BYTE);} > + | PARSEOP_ACCESSATTRIB_QUICK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_QUICK );} > + | PARSEOP_ACCESSATTRIB_SND_RCV {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_SND_RCV);} > + | PARSEOP_ACCESSATTRIB_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD);} > + | PARSEOP_ACCESSATTRIB_WORD_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD_CALL);} > + | PARSEOP_ACCESSATTRIB_MULTIBYTE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);} > + ByteConst > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_ACCESSATTRIB_RAW_BYTES '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);} > + ByteConst > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_ACCESSATTRIB_RAW_PROCESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);} > + ByteConst > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + ; > + > +AccessTypeKeyword > + : PARSEOP_ACCESSTYPE_ANY {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_ANY);} > + | PARSEOP_ACCESSTYPE_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BYTE);} > + | PARSEOP_ACCESSTYPE_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_WORD);} > + | PARSEOP_ACCESSTYPE_DWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_DWORD);} > + | PARSEOP_ACCESSTYPE_QWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_QWORD);} > + | PARSEOP_ACCESSTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BUF);} > + ; > + > +AddressingModeKeyword > + : PARSEOP_ADDRESSINGMODE_7BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_7BIT);} > + | PARSEOP_ADDRESSINGMODE_10BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_10BIT);} > + ; > + > +AddressKeyword > + : PARSEOP_ADDRESSTYPE_MEMORY {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_MEMORY);} > + | PARSEOP_ADDRESSTYPE_RESERVED {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_RESERVED);} > + | PARSEOP_ADDRESSTYPE_NVS {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_NVS);} > + | PARSEOP_ADDRESSTYPE_ACPI {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_ACPI);} > + ; > + > +AddressSpaceKeyword > + : ByteConst {$$ = UtCheckIntegerRange ($1, 0x0A, 0xFF);} > + | RegionSpaceKeyword {} > + ; > + > +BitsPerByteKeyword > + : PARSEOP_BITSPERBYTE_FIVE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_FIVE);} > + | PARSEOP_BITSPERBYTE_SIX {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SIX);} > + | PARSEOP_BITSPERBYTE_SEVEN {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SEVEN);} > + | PARSEOP_BITSPERBYTE_EIGHT {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_EIGHT);} > + | PARSEOP_BITSPERBYTE_NINE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_NINE);} > + ; > + > +ClockPhaseKeyword > + : PARSEOP_CLOCKPHASE_FIRST {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_FIRST);} > + | PARSEOP_CLOCKPHASE_SECOND {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_SECOND);} > + ; > + > +ClockPolarityKeyword > + : PARSEOP_CLOCKPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_LOW);} > + | PARSEOP_CLOCKPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_HIGH);} > + ; > + > +DecodeKeyword > + : PARSEOP_DECODETYPE_POS {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_POS);} > + | PARSEOP_DECODETYPE_SUB {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_SUB);} > + ; > + > +DevicePolarityKeyword > + : PARSEOP_DEVICEPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_LOW);} > + | PARSEOP_DEVICEPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_HIGH);} > + ; > + > +DMATypeKeyword > + : PARSEOP_DMATYPE_A {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_A);} > + | PARSEOP_DMATYPE_COMPATIBILITY {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_COMPATIBILITY);} > + | PARSEOP_DMATYPE_B {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_B);} > + | PARSEOP_DMATYPE_F {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_F);} > + ; > + > +EndianKeyword > + : PARSEOP_ENDIAN_LITTLE {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_LITTLE);} > + | PARSEOP_ENDIAN_BIG {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_BIG);} > + ; > + > +FlowControlKeyword > + : PARSEOP_FLOWCONTROL_HW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_HW);} > + | PARSEOP_FLOWCONTROL_NONE {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_NONE);} > + | PARSEOP_FLOWCONTROL_SW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_SW);} > + ; > + > +InterruptLevel > + : PARSEOP_INTLEVEL_ACTIVEBOTH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEBOTH);} > + | PARSEOP_INTLEVEL_ACTIVEHIGH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEHIGH);} > + | PARSEOP_INTLEVEL_ACTIVELOW {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVELOW);} > + ; > + > +InterruptTypeKeyword > + : PARSEOP_INTTYPE_EDGE {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_EDGE);} > + | PARSEOP_INTTYPE_LEVEL {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_LEVEL);} > + ; > + > +IODecodeKeyword > + : PARSEOP_IODECODETYPE_16 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_16);} > + | PARSEOP_IODECODETYPE_10 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_10);} > + ; > + > +IoRestrictionKeyword > + : PARSEOP_IORESTRICT_IN {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_IN);} > + | PARSEOP_IORESTRICT_OUT {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_OUT);} > + | PARSEOP_IORESTRICT_NONE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_NONE);} > + | PARSEOP_IORESTRICT_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_PRESERVE);} > + ; > + > +LockRuleKeyword > + : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);} > + | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_NOLOCK);} > + ; > + > +MatchOpKeyword > + : PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);} > + | PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);} > + | PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLE);} > + | PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLT);} > + | PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGE);} > + | PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGT);} > + ; > + > +MaxKeyword > + : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);} > + | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);} > + ; > + > +MemTypeKeyword > + : PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_CACHEABLE);} > + | PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_WRITECOMBINING);} > + | PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_PREFETCHABLE);} > + | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_NONCACHEABLE);} > + ; > + > +MinKeyword > + : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);} > + | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);} > + ; > + > +ObjectTypeKeyword > + : PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} > + | PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_INT);} > + | PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_STR);} > + | PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BUF);} > + | PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PKG);} > + | PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_FLD);} > + | PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DEV);} > + | PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_EVT);} > + | PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTH);} > + | PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTX);} > + | PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_OPR);} > + | PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_POW);} > + | PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PRO);} > + | PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_THZ);} > + | PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BFF);} > + | PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DDB);} > + ; > + > +ParityTypeKeyword > + : PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_SPACE);} > + | PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_MARK);} > + | PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_ODD);} > + | PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_EVEN);} > + | PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_NONE);} > + ; > + > +PinConfigByte > + : PinConfigKeyword {$$ = $1;} > + | ByteConstExpr {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} > + ; > + > +PinConfigKeyword > + : PARSEOP_PIN_NOPULL {$$ = TrCreateLeafNode (PARSEOP_PIN_NOPULL);} > + | PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDOWN);} > + | PARSEOP_PIN_PULLUP {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLUP);} > + | PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDEFAULT);} > + ; > + > +PldKeyword > + : PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);} > + | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);} > + | PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);} > + | PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);} > + | PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);} > + | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);} > + | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);} > + | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);} > + | PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);} > + | PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);} > + | PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);} > + | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);} > + | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);} > + | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);} > + | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);} > + | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);} > + | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);} > + | PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);} > + | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);} > + | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);} > + | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);} > + | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);} > + | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);} > + | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);} > + | PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);} > + | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);} > + | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);} > + | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);} > + ; > + > +RangeTypeKeyword > + : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);} > + | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);} > + | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ENTIRE);} > + ; > + > +RegionSpaceKeyword > + : PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IO);} > + | PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_MEM);} > + | PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCI);} > + | PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_EC);} > + | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);} > + | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);} > + | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);} > + | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);} > + | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);} > + | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);} > + | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);} > + | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);} > + ; > + > +ResourceTypeKeyword > + : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} > + | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);} > + ; > + > +SerializeRuleKeyword > + : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);} > + | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL);} > + ; > + > +ShareTypeKeyword > + : PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHARED);} > + | PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVE);} > + | PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHAREDWAKE);} > + | PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);} > + ; > + > +SlaveModeKeyword > + : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_CONTROLLERINIT);} > + | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_DEVICEINIT);} > + ; > + > +StopBitsKeyword > + : PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_TWO);} > + | PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONEPLUSHALF);} > + | PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONE);} > + | PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ZERO);} > + ; > + > +TranslationKeyword > + : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);} > + | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);} > + ; > + > +TypeKeyword > + : PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafNode (PARSEOP_TYPE_TRANSLATION);} > + | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafNode (PARSEOP_TYPE_STATIC);} > + ; > + > +UpdateRuleKeyword > + : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);} > + | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);} > + | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);} > + ; > + > +WireModeKeyword > + : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_FOUR);} > + | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_THREE);} > + ; > + > +XferSizeKeyword > + : PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_8, 0);} > + | PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_16, 1);} > + | PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} > + | PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_64, 3);} > + | PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_128, 4);} > + | PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_256, 5);} > + ; > + > +XferTypeKeyword > + : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);} > + | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);} > + | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);} > + ; > + > + > +/******************************************************************************* > + * > + * ASL Resource Template Terms > + * > + ******************************************************************************/ > + > +/* > + * Note: Create two default nodes to allow conversion to a Buffer AML opcode > + * Also, insert the EndTag at the end of the template. > + */ > +ResourceTemplateTerm > + : PARSEOP_RESOURCETEMPLATE '(' ')' > + '{' > + ResourceMacroList '}' {$$ = TrCreateNode (PARSEOP_RESOURCETEMPLATE,4, > + TrCreateLeafNode (PARSEOP_DEFAULT_ARG), > + TrCreateLeafNode (PARSEOP_DEFAULT_ARG), > + $5, > + TrCreateLeafNode (PARSEOP_ENDTAG));} > + ; > + > +ResourceMacroList > + : {$$ = NULL;} > + | ResourceMacroList > + ResourceMacroTerm {$$ = TrLinkPeerNode ($1,$2);} > + ; > + > +ResourceMacroTerm > + : DMATerm {} > + | DWordIOTerm {} > + | DWordMemoryTerm {} > + | DWordSpaceTerm {} > + | EndDependentFnTerm {} > + | ExtendedIOTerm {} > + | ExtendedMemoryTerm {} > + | ExtendedSpaceTerm {} > + | FixedDmaTerm {} > + | FixedIOTerm {} > + | GpioIntTerm {} > + | GpioIoTerm {} > + | I2cSerialBusTerm {} > + | InterruptTerm {} > + | IOTerm {} > + | IRQNoFlagsTerm {} > + | IRQTerm {} > + | Memory24Term {} > + | Memory32FixedTerm {} > + | Memory32Term {} > + | QWordIOTerm {} > + | QWordMemoryTerm {} > + | QWordSpaceTerm {} > + | RegisterTerm {} > + | SpiSerialBusTerm {} > + | StartDependentFnNoPriTerm {} > + | StartDependentFnTerm {} > + | UartSerialBusTerm {} > + | VendorLongTerm {} > + | VendorShortTerm {} > + | WordBusNumberTerm {} > + | WordIOTerm {} > + | WordSpaceTerm {} > + ; > + > +DMATerm > + : PARSEOP_DMA '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DMA);} > + DMATypeKeyword > + OptionalBusMasterKeyword > + ',' XferTypeKeyword > + OptionalNameString_Last > + ')' '{' > + ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$5,$7,$8,$11);} > + | PARSEOP_DMA '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +DWordIOTerm > + : PARSEOP_DWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDIO);} > + OptionalResourceType_First > + OptionalMinType > + OptionalMaxType > + OptionalDecodeType > + OptionalRangeType > + ',' DWordConstExpr > + ',' DWordConstExpr > + ',' DWordConstExpr > + ',' DWordConstExpr > + ',' DWordConstExpr > + OptionalByteConstExpr > + OptionalStringData > + OptionalNameString > + OptionalType > + OptionalTranslationType_Last > + ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} > + | PARSEOP_DWORDIO '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +DWordMemoryTerm > + : PARSEOP_DWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);} > + OptionalResourceType_First > + OptionalDecodeType > + OptionalMinType > + OptionalMaxType > + OptionalMemType > + ',' OptionalReadWriteKeyword > + ',' DWordConstExpr > + ',' DWordConstExpr > + ',' DWordConstExpr > + ',' DWordConstExpr > + ',' DWordConstExpr > + OptionalByteConstExpr > + OptionalStringData > + OptionalNameString > + OptionalAddressRange > + OptionalType_Last > + ')' {$$ = 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;} > + ; > + > +DWordSpaceTerm > + : PARSEOP_DWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);} > + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} > + OptionalResourceType > + OptionalDecodeType > + OptionalMinType > + OptionalMaxType > + ',' ByteConstExpr > + ',' DWordConstExpr > + ',' DWordConstExpr > + ',' DWordConstExpr > + ',' DWordConstExpr > + ',' DWordConstExpr > + OptionalByteConstExpr > + OptionalStringData > + OptionalNameString_Last > + ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} > + | PARSEOP_DWORDSPACE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +EndDependentFnTerm > + : PARSEOP_ENDDEPENDENTFN '(' > + ')' {$$ = TrCreateLeafNode (PARSEOP_ENDDEPENDENTFN);} > + | PARSEOP_ENDDEPENDENTFN '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +ExtendedIOTerm > + : PARSEOP_EXTENDEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);} > + OptionalResourceType_First > + OptionalMinType > + OptionalMaxType > + OptionalDecodeType > + OptionalRangeType > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + OptionalQWordConstExpr > + OptionalNameString > + OptionalType > + OptionalTranslationType_Last > + ')' {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22);} > + | PARSEOP_EXTENDEDIO '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +ExtendedMemoryTerm > + : PARSEOP_EXTENDEDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);} > + OptionalResourceType_First > + OptionalDecodeType > + OptionalMinType > + OptionalMaxType > + OptionalMemType > + ',' OptionalReadWriteKeyword > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + OptionalQWordConstExpr > + OptionalNameString > + OptionalAddressRange > + OptionalType_Last > + ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24);} > + | PARSEOP_EXTENDEDMEMORY '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +ExtendedSpaceTerm > + : PARSEOP_EXTENDEDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);} > + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} > + OptionalResourceType > + OptionalDecodeType > + OptionalMinType > + OptionalMaxType > + ',' ByteConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + OptionalQWordConstExpr > + OptionalNameString_Last > + ')' {$$ = TrLinkChildren ($<n>3,13,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23);} > + | PARSEOP_EXTENDEDSPACE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +FixedDmaTerm > + : PARSEOP_FIXEDDMA '(' {$<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;} > + ; > + > +FixedIOTerm > + : PARSEOP_FIXEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDIO);} > + WordConstExpr > + ',' ByteConstExpr > + OptionalNameString_Last > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} > + | PARSEOP_FIXEDIO '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +GpioIntTerm > + : PARSEOP_GPIO_INT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);} > + InterruptTypeKeyword /* 04: InterruptType */ > + ',' InterruptLevel /* 06: InterruptLevel */ > + OptionalShareType /* 07: SharedType */ > + ',' PinConfigByte /* 09: PinConfig */ > + OptionalWordConstExpr /* 10: DebounceTimeout */ > + ',' StringData /* 12: ResourceSource */ > + OptionalByteConstExpr /* 13: ResourceSourceIndex */ > + OptionalResourceType /* 14: ResourceType */ > + OptionalNameString /* 15: DescriptorName */ > + OptionalBuffer_Last /* 16: VendorData */ > + ')' '{' > + DWordConstExpr '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);} > + | PARSEOP_GPIO_INT '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +GpioIoTerm > + : PARSEOP_GPIO_IO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);} > + OptionalShareType_First /* 04: SharedType */ > + ',' PinConfigByte /* 06: PinConfig */ > + OptionalWordConstExpr /* 07: DebounceTimeout */ > + OptionalWordConstExpr /* 08: DriveStrength */ > + OptionalIoRestriction /* 09: IoRestriction */ > + ',' StringData /* 11: ResourceSource */ > + OptionalByteConstExpr /* 12: ResourceSourceIndex */ > + OptionalResourceType /* 13: ResourceType */ > + OptionalNameString /* 14: DescriptorName */ > + OptionalBuffer_Last /* 15: VendorData */ > + ')' '{' > + DWordList '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);} > + | PARSEOP_GPIO_IO '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +I2cSerialBusTerm > + : PARSEOP_I2C_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);} > + WordConstExpr /* 04: SlaveAddress */ > + OptionalSlaveMode /* 05: SlaveMode */ > + ',' DWordConstExpr /* 07: ConnectionSpeed */ > + OptionalAddressingMode /* 08: AddressingMode */ > + ',' StringData /* 10: ResourceSource */ > + OptionalByteConstExpr /* 11: ResourceSourceIndex */ > + OptionalResourceType /* 12: ResourceType */ > + OptionalNameString /* 13: DescriptorName */ > + OptionalBuffer_Last /* 14: VendorData */ > + ')' {$$ = TrLinkChildren ($<n>3,9,$4,$5,$7,$8,$10,$11,$12,$13,$14);} > + | PARSEOP_I2C_SERIALBUS '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +InterruptTerm > + : PARSEOP_INTERRUPT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} > + OptionalResourceType_First > + ',' InterruptTypeKeyword > + ',' InterruptLevel > + OptionalShareType > + OptionalByteConstExpr > + OptionalStringData > + OptionalNameString_Last > + ')' '{' > + DWordList '}' {$$ = TrLinkChildren ($<n>3,8,$4,$6,$8,$9,$10,$11,$12,$15);} > + | PARSEOP_INTERRUPT '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +IOTerm > + : PARSEOP_IO '(' {$<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;} > + ; > + > +IRQNoFlagsTerm > + : PARSEOP_IRQNOFLAGS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);} > + OptionalNameString_First > + ')' '{' > + ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > + | PARSEOP_IRQNOFLAGS '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +IRQTerm > + : PARSEOP_IRQ '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQ);} > + InterruptTypeKeyword > + ',' InterruptLevel > + OptionalShareType > + OptionalNameString_Last > + ')' '{' > + ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$7,$8,$11);} > + | PARSEOP_IRQ '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +Memory24Term > + : PARSEOP_MEMORY24 '(' {$<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;} > + ; > + > +Memory32FixedTerm > + : PARSEOP_MEMORY32FIXED '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);} > + OptionalReadWriteKeyword > + ',' DWordConstExpr > + ',' DWordConstExpr > + OptionalNameString_Last > + ')' {$$ = TrLinkChildren ($<n>3,4,$4,$6,$8,$9);} > + | PARSEOP_MEMORY32FIXED '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +Memory32Term > + : PARSEOP_MEMORY32 '(' {$<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;} > + ; > + > +QWordIOTerm > + : PARSEOP_QWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDIO);} > + OptionalResourceType_First > + OptionalMinType > + OptionalMaxType > + OptionalDecodeType > + OptionalRangeType > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + OptionalByteConstExpr > + OptionalStringData > + OptionalNameString > + OptionalType > + OptionalTranslationType_Last > + ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} > + | PARSEOP_QWORDIO '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +QWordMemoryTerm > + : PARSEOP_QWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);} > + OptionalResourceType_First > + OptionalDecodeType > + OptionalMinType > + OptionalMaxType > + OptionalMemType > + ',' OptionalReadWriteKeyword > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + OptionalByteConstExpr > + OptionalStringData > + OptionalNameString > + OptionalAddressRange > + OptionalType_Last > + ')' {$$ = 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;} > + ; > + > +QWordSpaceTerm > + : PARSEOP_QWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);} > + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} > + OptionalResourceType > + OptionalDecodeType > + OptionalMinType > + OptionalMaxType > + ',' ByteConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + ',' QWordConstExpr > + OptionalByteConstExpr > + OptionalStringData > + OptionalNameString_Last > + ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} > + | PARSEOP_QWORDSPACE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +RegisterTerm > + : PARSEOP_REGISTER '(' {$<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;} > + ; > + > +SpiSerialBusTerm > + : PARSEOP_SPI_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);} > + WordConstExpr /* 04: DeviceSelection */ > + OptionalDevicePolarity /* 05: DevicePolarity */ > + OptionalWireMode /* 06: WireMode */ > + ',' ByteConstExpr /* 08: DataBitLength */ > + OptionalSlaveMode /* 09: SlaveMode */ > + ',' DWordConstExpr /* 11: ConnectionSpeed */ > + ',' ClockPolarityKeyword /* 13: ClockPolarity */ > + ',' ClockPhaseKeyword /* 15: ClockPhase */ > + ',' StringData /* 17: ResourceSource */ > + OptionalByteConstExpr /* 18: ResourceSourceIndex */ > + OptionalResourceType /* 19: ResourceType */ > + OptionalNameString /* 20: DescriptorName */ > + OptionalBuffer_Last /* 21: VendorData */ > + ')' {$$ = TrLinkChildren ($<n>3,13,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21);} > + | PARSEOP_SPI_SERIALBUS '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +StartDependentFnNoPriTerm > + : PARSEOP_STARTDEPENDENTFN_NOPRI '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} > + ')' '{' > + ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,1,$6);} > + | PARSEOP_STARTDEPENDENTFN_NOPRI '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +StartDependentFnTerm > + : PARSEOP_STARTDEPENDENTFN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);} > + ByteConstExpr > + ',' ByteConstExpr > + ')' '{' > + ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$9);} > + | PARSEOP_STARTDEPENDENTFN '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +UartSerialBusTerm > + : PARSEOP_UART_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);} > + DWordConstExpr /* 04: ConnectionSpeed */ > + OptionalBitsPerByte /* 05: BitsPerByte */ > + OptionalStopBits /* 06: StopBits */ > + ',' ByteConstExpr /* 08: LinesInUse */ > + OptionalEndian /* 09: Endianess */ > + OptionalParityType /* 10: Parity */ > + OptionalFlowControl /* 11: FlowControl */ > + ',' WordConstExpr /* 13: Rx BufferSize */ > + ',' WordConstExpr /* 15: Tx BufferSize */ > + ',' StringData /* 17: ResourceSource */ > + OptionalByteConstExpr /* 18: ResourceSourceIndex */ > + OptionalResourceType /* 19: ResourceType */ > + OptionalNameString /* 20: DescriptorName */ > + OptionalBuffer_Last /* 21: VendorData */ > + ')' {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21);} > + | PARSEOP_UART_SERIALBUS '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +VendorLongTerm > + : PARSEOP_VENDORLONG '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORLONG);} > + OptionalNameString_First > + ')' '{' > + ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > + | PARSEOP_VENDORLONG '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +VendorShortTerm > + : PARSEOP_VENDORSHORT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);} > + OptionalNameString_First > + ')' '{' > + ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > + | PARSEOP_VENDORSHORT '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +WordBusNumberTerm > + : PARSEOP_WORDBUSNUMBER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);} > + OptionalResourceType_First > + OptionalMinType > + OptionalMaxType > + OptionalDecodeType > + ',' WordConstExpr > + ',' WordConstExpr > + ',' WordConstExpr > + ',' WordConstExpr > + ',' WordConstExpr > + OptionalByteConstExpr > + OptionalStringData > + OptionalNameString_Last > + ')' {$$ = TrLinkChildren ($<n>3,12,$4,$5,$6,$7,$9,$11,$13,$15,$17,$18,$19,$20);} > + | PARSEOP_WORDBUSNUMBER '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +WordIOTerm > + : PARSEOP_WORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDIO);} > + OptionalResourceType_First > + OptionalMinType > + OptionalMaxType > + OptionalDecodeType > + OptionalRangeType > + ',' WordConstExpr > + ',' WordConstExpr > + ',' WordConstExpr > + ',' WordConstExpr > + ',' WordConstExpr > + OptionalByteConstExpr > + OptionalStringData > + OptionalNameString > + OptionalType > + OptionalTranslationType_Last > + ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} > + | PARSEOP_WORDIO '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +WordSpaceTerm > + : PARSEOP_WORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDSPACE);} > + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} > + OptionalResourceType > + OptionalDecodeType > + OptionalMinType > + OptionalMaxType > + ',' ByteConstExpr > + ',' WordConstExpr > + ',' WordConstExpr > + ',' WordConstExpr > + ',' WordConstExpr > + ',' WordConstExpr > + OptionalByteConstExpr > + OptionalStringData > + OptionalNameString_Last > + ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} > + | PARSEOP_WORDSPACE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > + > +/******* Object References ***********************************************/ > + > +/* Allow IO, DMA, IRQ Resource macro names to also be used as identifiers */ > + > +NameString > + : NameSeg {} > + | PARSEOP_NAMESTRING {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) AslCompilerlval.s);} > + | PARSEOP_IO {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IO");} > + | PARSEOP_DMA {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "DMA");} > + | PARSEOP_IRQ {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IRQ");} > + ; > + > +NameSeg > + : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, (ACPI_NATIVE_INT) AslCompilerlval.s);} > + ; > + > + > +/******************************************************************************* > + * > + * ASL Helper Terms > + * > + ******************************************************************************/ > + > +OptionalBusMasterKeyword > + : ',' {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);} > + | ',' PARSEOP_BUSMASTERTYPE_MASTER {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);} > + | ',' PARSEOP_BUSMASTERTYPE_NOTMASTER {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_NOTMASTER);} > + ; > + > +OptionalAccessAttribTerm > + : {$$ = NULL;} > + | ',' {$$ = NULL;} > + | ',' ByteConstExpr {$$ = $2;} > + | ',' AccessAttribKeyword {$$ = $2;} > + ; > + > +OptionalAccessSize > + : {$$ = TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0);} > + | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0);} > + | ',' ByteConstExpr {$$ = $2;} > + ; > + > +OptionalAddressingMode > + : ',' {$$ = NULL;} > + | ',' AddressingModeKeyword {$$ = $2;} > + ; > + > +OptionalAddressRange > + : {$$ = NULL;} > + | ',' {$$ = NULL;} > + | ',' AddressKeyword {$$ = $2;} > + ; > + > +OptionalBitsPerByte > + : ',' {$$ = NULL;} > + | ',' BitsPerByteKeyword {$$ = $2;} > + ; > + > +OptionalBuffer_Last > + : {$$ = NULL;} > + | ',' {$$ = NULL;} > + | ',' RawDataBufferTerm {$$ = $2;} > + ; > + > +OptionalByteConstExpr > + : {$$ = NULL;} > + | ',' {$$ = NULL;} > + | ',' ByteConstExpr {$$ = $2;} > + ; > + > +OptionalDecodeType > + : ',' {$$ = NULL;} > + | ',' DecodeKeyword {$$ = $2;} > + ; > + > +OptionalDevicePolarity > + : ',' {$$ = NULL;} > + | ',' DevicePolarityKeyword {$$ = $2;} > + ; > + > +OptionalDWordConstExpr > + : {$$ = NULL;} > + | ',' {$$ = NULL;} > + | ',' DWordConstExpr {$$ = $2;} > + ; > + > +OptionalEndian > + : ',' {$$ = NULL;} > + | ',' EndianKeyword {$$ = $2;} > + ; > + > +OptionalFlowControl > + : ',' {$$ = NULL;} > + | ',' FlowControlKeyword {$$ = $2;} > + ; > + > +OptionalIoRestriction > + : ',' {$$ = NULL;} > + | ',' IoRestrictionKeyword {$$ = $2;} > + ; > + > +OptionalListString > + : {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ > + | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ > + | ',' TermArg {$$ = $2;} > + ; > + > +OptionalMaxType > + : ',' {$$ = NULL;} > + | ',' MaxKeyword {$$ = $2;} > + ; > + > +OptionalMemType > + : ',' {$$ = NULL;} > + | ',' MemTypeKeyword {$$ = $2;} > + ; > + > +OptionalMinType > + : ',' {$$ = NULL;} > + | ',' MinKeyword {$$ = $2;} > + ; > + > +OptionalNameString > + : {$$ = NULL;} > + | ',' {$$ = NULL;} > + | ',' NameString {$$ = $2;} > + ; > + > +OptionalNameString_Last > + : {$$ = NULL;} > + | ',' {$$ = NULL;} > + | ',' NameString {$$ = $2;} > + ; > + > +OptionalNameString_First > + : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} > + | NameString {$$ = $1;} > + ; > + > +OptionalObjectTypeKeyword > + : {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} > + | ',' ObjectTypeKeyword {$$ = $2;} > + ; > + > +OptionalParityType > + : ',' {$$ = NULL;} > + | ',' ParityTypeKeyword {$$ = $2;} > + ; > + > +OptionalQWordConstExpr > + : {$$ = NULL;} > + | ',' {$$ = NULL;} > + | ',' QWordConstExpr {$$ = $2;} > + ; > + > +OptionalRangeType > + : ',' {$$ = NULL;} > + | ',' RangeTypeKeyword {$$ = $2;} > + ; > + > +OptionalReadWriteKeyword > + : {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);} > + | PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);} > + | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_READONLY);} > + ; > + > +OptionalResourceType_First > + : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} > + | ResourceTypeKeyword {$$ = $1;} > + ; > + > +OptionalResourceType > + : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} > + | ',' {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} > + | ',' ResourceTypeKeyword {$$ = $2;} > + ; > + > +OptionalSlaveMode > + : ',' {$$ = NULL;} > + | ',' SlaveModeKeyword {$$ = $2;} > + ; > + > +OptionalShareType > + : {$$ = NULL;} > + | ',' {$$ = NULL;} > + | ',' ShareTypeKeyword {$$ = $2;} > + ; > + > +OptionalShareType_First > + : {$$ = NULL;} > + | ShareTypeKeyword {$$ = $1;} > + ; > + > +OptionalStopBits > + : ',' {$$ = NULL;} > + | ',' StopBitsKeyword {$$ = $2;} > + ; > + > +OptionalStringData > + : {$$ = NULL;} > + | ',' {$$ = NULL;} > + | ',' StringData {$$ = $2;} > + ; > + > +OptionalTranslationType_Last > + : {$$ = NULL;} > + | ',' {$$ = NULL;} > + | ',' TranslationKeyword {$$ = $2;} > + ; > + > +OptionalType > + : {$$ = NULL;} > + | ',' {$$ = NULL;} > + | ',' TypeKeyword {$$ = $2;} > + ; > + > +OptionalType_Last > + : {$$ = NULL;} > + | ',' {$$ = NULL;} > + | ',' TypeKeyword {$$ = $2;} > + ; > + > +OptionalWireMode > + : ',' {$$ = NULL;} > + | ',' WireModeKeyword {$$ = $2;} > + ; > + > +OptionalWordConstExpr > + : ',' {$$ = NULL;} > + | ',' WordConstExpr {$$ = $2;} > + ; > + > +OptionalXferSize > + : {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} > + | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} > + | ',' XferSizeKeyword {$$ = $2;} > + ; > diff --git a/src/acpica/source/compiler/aslrules.y b/src/acpica/source/compiler/aslrules.y > index 63a0375..789df32 100644 > --- a/src/acpica/source/compiler/aslrules.y > +++ b/src/acpica/source/compiler/aslrules.y > @@ -1,7 +1,7 @@ > NoEcho(' > /****************************************************************************** > * > - * Module Name: aslrules.y - Bison/Yacc production rules > + * Module Name: aslrules.y - Main Bison/Yacc production rules > * > *****************************************************************************/ > > @@ -118,14 +118,12 @@ NoEcho(' > > /******************************************************************************* > * > - * Production rules start here > + * ASL Root and Secondary Terms > * > ******************************************************************************/ > > /* > - * ASL Names > - * > - * Root rule. Allow multiple #line directives before the definition block > + * Root term. Allow multiple #line directives before the definition block > * to handle output from preprocessors > */ > ASLCode > @@ -134,10 +132,6 @@ ASLCode > ; > > /* > - * Blocks, Data, and Opcodes > - */ > - > -/* > * Note concerning support for "module-level code". > * > * ACPI 1.0 allowed Type1 and Type2 executable opcodes outside of control > @@ -164,292 +158,128 @@ DefinitionBlockTerm > '{' TermList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$6,$8,$10,$12,$14,$18);} > ; > > - /* > - * ASL Extensions: C-style math/logical operators and expressions. > - * The implementation transforms these operators into the standard > - * AML opcodes and syntax. > - * > - * Supported operators and precedence rules (high-to-low) > - * > - * NOTE: The operator precedence and associativity rules are > - * implemented by the tokens in asltokens.y > - * > - * (left-to-right): > - * 1) ( ) expr++ expr-- > - * > - * (right-to-left): > - * 2) ! ~ > - * > - * (left-to-right): > - * 3) * / % > - * 4) + - > - * 5) >> << > - * 6) < > <= >= > - * 7) == != > - * 8) & > - * 9) ^ > - * 10) | > - * 11) && > - * 12) || > - * > - * (right-to-left): > - * 13) = += -= *= /= %= <<= >>= &= ^= |= > - */ > -Expression > - > - /* Unary operators */ > - > - : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} > - TermArg {$$ = TrLinkChildren ($<n>2,1,$3);} > - | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} > - TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateNullTarget ());} > - > - | SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} > - {$$ = TrLinkChildren ($<n>3,1,$1);} > - | SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} > - {$$ = TrLinkChildren ($<n>3,1,$1);} > - > - /* Binary operators: math and logical */ > - > - | TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > - | TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} > - TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), > - TrCreateNullTarget ());} > - | TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > - | TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > - | TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > - | TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > - | TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > - > - | TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > - | TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > - | TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} > - > - | TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} > - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > - | TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);} > - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > - | TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} > - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > - | TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);} > - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > - > - | TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} > - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > - | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);} > - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > - > - | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} > - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > - | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} > - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} > - > - /* Parentheses */ > - > - | '(' TermArg ')' { $$ = $2;} > - ; > - > -EqualsTerm > - > - /* All assignment-type operations */ > - > - : SuperName PARSEOP_EXP_EQUALS > - TermArg {$$ = TrCreateAssignmentNode ($1, $3);} > - > - | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > - > - | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} > - TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > - > - | TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > - > - | TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > - > - | TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > - > - | TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > - > - | TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > - > - | TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > - > - | TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > +SuperName > + : NameString {} > + | ArgTerm {} > + | LocalTerm {} > + | DebugTerm {} > + | Type6Opcode {} > > - | TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} > - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, > - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} > +Target > + : {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ > + | ',' {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ > + | ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} > ; > > +TermArg > + : 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);} > + ; > > -/* ACPI 3.0 -- allow semicolons between terms */ > +/* > + NOTE: Removed from TermArg due to reduce/reduce conflicts: > + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > + | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > + | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > + | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > > -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;} > +MethodInvocationTerm > + : NameString '(' {TrUpdateNode (PARSEOP_METHODCALL, $1);} > + ArgList ')' {$$ = TrLinkChildNode ($1,$4);} > ; > > -CompilerDirective > - : IncludeTerm {} > - | ExternalTerm {} > - ; > +/* OptionalCount must appear before ByteList or an incorrect reduction will result */ > > -ObjectList > - : {$$ = NULL;} > - | ObjectList Object {$$ = TrLinkPeerNode ($1,$2);} > - | error {$$ = AslDoError(); yyclearin;} > +OptionalCount > + : {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ > + | ',' {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ > + | ',' TermArg {$$ = $2;} > ; > > -Object > - : CompilerDirective {} > - | NamedObject {} > - | NameSpaceModifier {} > +VarPackageLengthTerm > + : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} > + | TermArg {$$ = $1;} > ; > > -DataObject > - : BufferData {} > - | PackageData {} > - | IntegerData {} > - | StringData {} > - ; > > -BufferData > - : Type5Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > - | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > - | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > - | BufferTerm {} > - ; > +/******* List Terms **************************************************/ > > -PackageData > - : PackageTerm {} > +ArgList > + : {$$ = NULL;} > + | TermArg > + | ArgList ',' /* Allows a trailing comma at list end */ > + | ArgList ',' > + TermArg {$$ = TrLinkPeerNode ($1,$3);} > ; > > -IntegerData > - : Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > - | Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > - | Integer {} > - | ConstTerm {} > +ByteList > + : {$$ = NULL;} > + | ByteConstExpr > + | ByteList ',' /* Allows a trailing comma at list end */ > + | ByteList ',' > + ByteConstExpr {$$ = TrLinkPeerNode ($1,$3);} > ; > > -StringData > - : Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > - | String {} > +DWordList > + : {$$ = NULL;} > + | DWordConstExpr > + | DWordList ',' /* Allows a trailing comma at list end */ > + | DWordList ',' > + DWordConstExpr {$$ = TrLinkPeerNode ($1,$3);} > ; > > -NamedObject > - : BankFieldTerm {} > - | CreateBitFieldTerm {} > - | CreateByteFieldTerm {} > - | CreateDWordFieldTerm {} > - | CreateFieldTerm {} > - | CreateQWordFieldTerm {} > - | CreateWordFieldTerm {} > - | DataRegionTerm {} > - | DeviceTerm {} > - | EventTerm {} > - | FieldTerm {} > - | FunctionTerm {} > - | IndexFieldTerm {} > - | MethodTerm {} > - | MutexTerm {} > - | OpRegionTerm {} > - | PowerResTerm {} > - | ProcessorTerm {} > - | ThermalZoneTerm {} > +FieldUnitList > + : {$$ = NULL;} > + | FieldUnit > + | FieldUnitList ',' /* Allows a trailing comma at list end */ > + | FieldUnitList ',' > + FieldUnit {$$ = TrLinkPeerNode ($1,$3);} > ; > > -NameSpaceModifier > - : AliasTerm {} > - | NameTerm {} > - | ScopeTerm {} > +FieldUnit > + : FieldUnitEntry {} > + | OffsetTerm {} > + | AccessAsTerm {} > + | ConnectionTerm {} > ; > > -MethodInvocationTerm > - : NameString '(' {TrUpdateNode (PARSEOP_METHODCALL, $1);} > - ArgList ')' {$$ = TrLinkChildNode ($1,$4);} > +FieldUnitEntry > + : ',' AmlPackageLengthTerm {$$ = TrCreateNode (PARSEOP_RESERVED_BYTES,1,$2);} > + | NameSeg ',' > + AmlPackageLengthTerm {$$ = TrLinkChildNode ($1,$3);} > ; > > -ArgList > +ObjectList > : {$$ = NULL;} > - | TermArg > - | ArgList ',' /* Allows a trailing comma at list end */ > - | ArgList ',' > - TermArg {$$ = TrLinkPeerNode ($1,$3);} > - ; > - > -/* > -Removed from TermArg due to reduce/reduce conflicts > - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > - | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > - | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > - | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} > - > -*/ > - > -TermArg > - : 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);} > + | ObjectList Object {$$ = TrLinkPeerNode ($1,$2);} > + | error {$$ = AslDoError(); yyclearin;} > ; > > -Target > - : {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ > - | ',' {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ > - | ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} > +Object > + : CompilerDirective {} > + | NamedObject {} > + | NameSpaceModifier {} > ; > > -RequiredTarget > - : ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} > +PackageList > + : {$$ = NULL;} > + | PackageElement > + | PackageList ',' /* Allows a trailing comma at list end */ > + | PackageList ',' > + PackageElement {$$ = TrLinkPeerNode ($1,$3);} > ; > > -SimpleTarget > - : NameString {} > - | LocalTerm {} > - | ArgTerm {} > +PackageElement > + : DataObject {} > + | NameString {} > ; > > -/* Rules for specifying the type of one method argument or return value */ > + /* Rules for specifying the type of one method argument or return value */ > > ParameterTypePackage > : {$$ = NULL;} > @@ -469,7 +299,7 @@ OptionalParameterTypePackage > | ',' ParameterTypePackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} > ; > > -/* Rules for specifying the types for method arguments */ > + /* Rules for specifying the types for method arguments */ > > ParameterTypesPackage > : ParameterTypePackageList {$$ = $1;} > @@ -488,50 +318,277 @@ OptionalParameterTypesPackage > | ',' ParameterTypesPackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} > ; > > + /* ACPI 3.0 -- allow semicolons between terms */ > > -/* Opcode types */ > - > -Type1Opcode > - : BreakTerm {} > - | BreakPointTerm {} > - | ContinueTerm {} > - | FatalTerm {} > - | IfElseTerm {} > - | LoadTerm {} > - | NoOpTerm {} > - | NotifyTerm {} > - | ReleaseTerm {} > - | ResetTerm {} > - | ReturnTerm {} > - | SignalTerm {} > - | SleepTerm {} > - | StallTerm {} > - | SwitchTerm {} > - | UnloadTerm {} > - | WhileTerm {} > +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);} > ; > > -Type2Opcode > - : AcquireTerm {} > - | CondRefOfTerm {} > - | CopyObjectTerm {} > - | DerefOfTerm {} > - | ObjectTypeTerm {} > - | RefOfTerm {} > - | SizeOfTerm {} > - | StoreTerm {} > - | EqualsTerm {} > - | TimerTerm {} > - | WaitTerm {} > - | MethodInvocationTerm {} > +Term > + : Object {} > + | Type1Opcode {} > + | Type2Opcode {} > + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > + | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > + | Type2BufferOpcode {} > + | Type2BufferOrStringOpcode {} > + | error {$$ = AslDoError(); yyclearin;} > ; > > /* > - * Type 3/4/5 opcodes > + * Case-Default list; allow only one Default term and unlimited Case terms > */ > +CaseDefaultTermList > + : {$$ = NULL;} > + | CaseTerm {} > + | DefaultTerm {} > + | CaseDefaultTermList > + CaseTerm {$$ = TrLinkPeerNode ($1,$2);} > + | CaseDefaultTermList > + DefaultTerm {$$ = TrLinkPeerNode ($1,$2);} > > -Type2IntegerOpcode /* "Type3" opcodes */ > - : Expression {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > +/* Original - attempts to force zero or one default term within the switch */ > + > +/* > +CaseDefaultTermList > + : {$$ = NULL;} > + | CaseTermList > + DefaultTerm > + CaseTermList {$$ = TrLinkPeerNode ($1,TrLinkPeerNode ($2, $3));} > + | CaseTermList > + CaseTerm {$$ = TrLinkPeerNode ($1,$2);} > + ; > + > +CaseTermList > + : {$$ = NULL;} > + | CaseTerm {} > + | CaseTermList > + CaseTerm {$$ = TrLinkPeerNode ($1,$2);} > + ; > +*/ > + > + > +/******************************************************************************* > + * > + * ASL Data and Constant Terms > + * > + ******************************************************************************/ > + > +DataObject > + : BufferData {} > + | PackageData {} > + | IntegerData {} > + | StringData {} > + ; > + > +BufferData > + : Type5Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > + | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > + | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > + | BufferTerm {} > + ; > + > +PackageData > + : PackageTerm {} > + ; > + > +IntegerData > + : Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > + | Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > + | Integer {} > + | ConstTerm {} > + ; > + > +StringData > + : Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > + | String {} > + ; > + > +ByteConst > + : Integer {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} > + ; > + > +WordConst > + : Integer {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} > + ; > + > +DWordConst > + : Integer {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} > + ; > + > +QWordConst > + : Integer {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} > + ; > + > +/* > + * The NODE_COMPILE_TIME_CONST flag in the following constant expressions > + * enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes > + * to simple integers. It is an error if these types of expressions cannot be > + * reduced, since the AML grammar for ****ConstExpr requires a simple constant. > + * Note: The required byte length of the constant is passed through to the > + * constant folding code in the node AmlLength field. > + */ > +ByteConstExpr > + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} > + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} > + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} > + | ByteConst {} > + ; > + > +WordConstExpr > + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} > + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} > + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} > + | WordConst {} > + ; > + > +DWordConstExpr > + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} > + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} > + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} > + | DWordConst {} > + ; > + > +QWordConstExpr > + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} > + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} > + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} > + | QWordConst {} > + ; > + > +ConstTerm > + : ConstExprTerm {} > + | PARSEOP_REVISION {$$ = TrCreateLeafNode (PARSEOP_REVISION);} > + ; > + > +ConstExprTerm > + : PARSEOP_ZERO {$$ = TrCreateValuedLeafNode (PARSEOP_ZERO, 0);} > + | PARSEOP_ONE {$$ = TrCreateValuedLeafNode (PARSEOP_ONE, 1);} > + | PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_UINT64_MAX);} > + | PARSEOP___DATE__ {$$ = TrCreateConstantLeafNode (PARSEOP___DATE__);} > + | PARSEOP___FILE__ {$$ = TrCreateConstantLeafNode (PARSEOP___FILE__);} > + | PARSEOP___LINE__ {$$ = TrCreateConstantLeafNode (PARSEOP___LINE__);} > + | PARSEOP___PATH__ {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);} > + ; > + > +Integer > + : PARSEOP_INTEGER {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, AslCompilerlval.i);} > + ; > + > +String > + : PARSEOP_STRING_LITERAL {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, (ACPI_NATIVE_INT) AslCompilerlval.s);} > + ; > + > + > +/******************************************************************************* > + * > + * ASL Opcode Terms > + * > + ******************************************************************************/ > + > +CompilerDirective > + : IncludeTerm {} > + | ExternalTerm {} > + ; > + > +NamedObject > + : BankFieldTerm {} > + | CreateBitFieldTerm {} > + | CreateByteFieldTerm {} > + | CreateDWordFieldTerm {} > + | CreateFieldTerm {} > + | CreateQWordFieldTerm {} > + | CreateWordFieldTerm {} > + | DataRegionTerm {} > + | DeviceTerm {} > + | EventTerm {} > + | FieldTerm {} > + | FunctionTerm {} > + | IndexFieldTerm {} > + | MethodTerm {} > + | MutexTerm {} > + | OpRegionTerm {} > + | PowerResTerm {} > + | ProcessorTerm {} > + | ThermalZoneTerm {} > + ; > + > +NameSpaceModifier > + : AliasTerm {} > + | NameTerm {} > + | ScopeTerm {} > + ; > + > +/* For ObjectType: SuperName except for MethodInvocationTerm */ > + > +ObjectTypeName > + : NameString {} > + | ArgTerm {} > + | LocalTerm {} > + | DebugTerm {} > + | RefOfTerm {} > + | DerefOfTerm {} > + | IndexTerm {} > + > +/* | MethodInvocationTerm {} */ /* Caused reduce/reduce with Type6Opcode->MethodInvocationTerm */ > + ; > + > +RequiredTarget > + : ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} > + ; > + > +SimpleTarget > + : NameString {} > + | LocalTerm {} > + | ArgTerm {} > + ; > + > +/* Opcode types */ > + > +Type1Opcode > + : BreakTerm {} > + | BreakPointTerm {} > + | ContinueTerm {} > + | FatalTerm {} > + | ElseIfTerm {} > + | LoadTerm {} > + | NoOpTerm {} > + | NotifyTerm {} > + | ReleaseTerm {} > + | ResetTerm {} > + | ReturnTerm {} > + | SignalTerm {} > + | SleepTerm {} > + | StallTerm {} > + | SwitchTerm {} > + | UnloadTerm {} > + | WhileTerm {} > + ; > + > +Type2Opcode > + : AcquireTerm {} > + | CondRefOfTerm {} > + | CopyObjectTerm {} > + | DerefOfTerm {} > + | ObjectTypeTerm {} > + | RefOfTerm {} > + | SizeOfTerm {} > + | StoreTerm {} > + | EqualsTerm {} > + | TimerTerm {} > + | WaitTerm {} > + | MethodInvocationTerm {} > + ; > + > +/* > + * Type 3/4/5 opcodes > + */ > +Type2IntegerOpcode /* "Type3" opcodes */ > + : Expression {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} > | AddTerm {} > | AndTerm {} > | DecTerm {} > @@ -587,7 +644,6 @@ Type2BufferOrStringOpcode > /* > * A type 3 opcode evaluates to an Integer and cannot have a destination operand > */ > - > Type3Opcode > : EISAIDTerm {} > ; > @@ -602,7 +658,6 @@ Type4Opcode > ; > */ > > - > Type5Opcode > : ResourceTemplateTerm {} > | UnicodeTerm {} > @@ -614,34 +669,74 @@ Type6Opcode > : RefOfTerm {} > | DerefOfTerm {} > | IndexTerm {} > + | IndexExpTerm {} > | MethodInvocationTerm {} > ; > > -IncludeTerm > - : PARSEOP_INCLUDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCLUDE);} > - String ')' {TrLinkChildren ($<n>3,1,$4);FlOpenIncludeFile ($4);} > - TermList > - IncludeEndTerm {$$ = TrLinkPeerNodes (3,$<n>3,$7,$8);} > - ; > > -IncludeEndTerm > - : PARSEOP_INCLUDE_END {$$ = TrCreateLeafNode (PARSEOP_INCLUDE_END);} > - ; > +/******************************************************************************* > + * > + * ASL Primary Terms > + * > + ******************************************************************************/ > > -ExternalTerm > - : PARSEOP_EXTERNAL '(' > - NameString > - OptionalObjectTypeKeyword > - OptionalParameterTypePackage > - OptionalParameterTypesPackage > - ')' {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);} > - | PARSEOP_EXTERNAL '(' > +AccessAsTerm > + : PARSEOP_ACCESSAS '(' > + AccessTypeKeyword > + OptionalAccessAttribTerm > + ')' {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);} > + | PARSEOP_ACCESSAS '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +AcquireTerm > + : PARSEOP_ACQUIRE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} > + SuperName > + ',' WordConstExpr > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$6);} > + | PARSEOP_ACQUIRE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +AddTerm > + : PARSEOP_ADD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_ADD '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > +AliasTerm > + : PARSEOP_ALIAS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);} > + NameString > + NameStringItem > + ')' {$$ = TrLinkChildren ($<n>3,2,$4, > + TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} > + | PARSEOP_ALIAS '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > > -/******* Named Objects *******************************************************/ > +AndTerm > + : PARSEOP_AND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_AND '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > > +ArgTerm > + : PARSEOP_ARG0 {$$ = TrCreateLeafNode (PARSEOP_ARG0);} > + | PARSEOP_ARG1 {$$ = TrCreateLeafNode (PARSEOP_ARG1);} > + | PARSEOP_ARG2 {$$ = TrCreateLeafNode (PARSEOP_ARG2);} > + | PARSEOP_ARG3 {$$ = TrCreateLeafNode (PARSEOP_ARG3);} > + | PARSEOP_ARG4 {$$ = TrCreateLeafNode (PARSEOP_ARG4);} > + | PARSEOP_ARG5 {$$ = TrCreateLeafNode (PARSEOP_ARG5);} > + | PARSEOP_ARG6 {$$ = TrCreateLeafNode (PARSEOP_ARG6);} > + ; > > BankFieldTerm > : PARSEOP_BANKFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BANKFIELD);} > @@ -657,41 +752,54 @@ BankFieldTerm > error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} > ; > > -FieldUnitList > - : {$$ = NULL;} > - | FieldUnit > - | FieldUnitList ',' /* Allows a trailing comma at list end */ > - | FieldUnitList ',' > - FieldUnit {$$ = TrLinkPeerNode ($1,$3);} > +BreakTerm > + : PARSEOP_BREAK {$$ = TrCreateNode (PARSEOP_BREAK, 0);} > ; > > -FieldUnit > - : FieldUnitEntry {} > - | OffsetTerm {} > - | AccessAsTerm {} > - | ConnectionTerm {} > +BreakPointTerm > + : PARSEOP_BREAKPOINT {$$ = TrCreateNode (PARSEOP_BREAKPOINT, 0);} > ; > > -FieldUnitEntry > - : ',' AmlPackageLengthTerm {$$ = TrCreateNode (PARSEOP_RESERVED_BYTES,1,$2);} > - | NameSeg ',' > - AmlPackageLengthTerm {$$ = TrLinkChildNode ($1,$3);} > +BufferTerm > + : PARSEOP_BUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER);} > + OptionalTermArg > + ')' '{' > + BufferTermData '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > + | PARSEOP_BUFFER '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OffsetTerm > - : PARSEOP_OFFSET '(' > - AmlPackageLengthTerm > - ')' {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);} > - | PARSEOP_OFFSET '(' > +BufferTermData > + : ByteList {} > + | StringData {} > + ; > + > +CaseTerm > + : PARSEOP_CASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);} > + DataObject > + ')' '{' > + TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > + | PARSEOP_CASE '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -AccessAsTerm > - : PARSEOP_ACCESSAS '(' > - AccessTypeKeyword > - OptionalAccessAttribTerm > - ')' {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);} > - | PARSEOP_ACCESSAS '(' > +ConcatTerm > + : PARSEOP_CONCATENATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_CONCATENATE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +ConcatResTerm > + : PARSEOP_CONCATENATERESTEMPLATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_CONCATENATERESTEMPLATE '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > @@ -710,6 +818,28 @@ ConnectionTerm > error ')' {$$ = AslDoError(); yyclearin;} > ; > > +CondRefOfTerm > + : PARSEOP_CONDREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} > + SuperName > + Target > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_CONDREFOF '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +ContinueTerm > + : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);} > + ; > + > +CopyObjectTerm > + : PARSEOP_COPYOBJECT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} > + TermArg > + ',' SimpleTarget > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} > + | PARSEOP_COPYOBJECT '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > CreateBitFieldTerm > : PARSEOP_CREATEBITFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} > TermArg > @@ -782,6 +912,33 @@ DataRegionTerm > error ')' {$$ = AslDoError(); yyclearin;} > ; > > +DebugTerm > + : PARSEOP_DEBUG {$$ = TrCreateLeafNode (PARSEOP_DEBUG);} > + ; > + > +DecTerm > + : PARSEOP_DECREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} > + SuperName > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_DECREMENT '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +DefaultTerm > + : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFAULT);} > + TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_DEFAULT '{' > + error '}' {$$ = AslDoError(); yyclearin;} > + ; > + > +DerefOfTerm > + : PARSEOP_DEREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);} > + TermArg > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_DEREFOF '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > DeviceTerm > : PARSEOP_DEVICE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);} > NameString > @@ -791,6 +948,53 @@ DeviceTerm > error ')' {$$ = AslDoError(); yyclearin;} > ; > > +DivideTerm > + : PARSEOP_DIVIDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} > + TermArg > + TermArgItem > + Target > + Target > + ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} > + | PARSEOP_DIVIDE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +EISAIDTerm > + : PARSEOP_EISAID '(' > + StringData ')' {$$ = TrUpdateNode (PARSEOP_EISAID, $3);} > + | PARSEOP_EISAID '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +ElseIfTerm > + : IfTerm ElseTerm {$$ = TrLinkPeerNode ($1,$2);} > + ; > + > +ElseTerm > + : {$$ = NULL;} > + | PARSEOP_ELSE '{' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} > + TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} > + > + | PARSEOP_ELSE '{' > + error '}' {$$ = AslDoError(); yyclearin;} > + > + | PARSEOP_ELSE > + error {$$ = AslDoError(); yyclearin;} > + > + | PARSEOP_ELSEIF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} > + TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} > + ')' '{' > + 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 > + error {$$ = AslDoError(); yyclearin;} > + ; > + > EventTerm > : PARSEOP_EVENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EVENT);} > NameString > @@ -799,6 +1003,27 @@ EventTerm > error ')' {$$ = AslDoError(); yyclearin;} > ; > > +ExternalTerm > + : PARSEOP_EXTERNAL '(' > + NameString > + OptionalObjectTypeKeyword > + OptionalParameterTypePackage > + OptionalParameterTypesPackage > + ')' {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);} > + | PARSEOP_EXTERNAL '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +FatalTerm > + : PARSEOP_FATAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);} > + ByteConstExpr > + ',' DWordConstExpr > + TermArgItem > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} > + | PARSEOP_FATAL '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > FieldTerm > : PARSEOP_FIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIELD);} > NameString > @@ -811,198 +1036,191 @@ FieldTerm > error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} > ; > > -FunctionTerm > - : PARSEOP_FUNCTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} > - NameString > - OptionalParameterTypePackage > - OptionalParameterTypesPackage > - ')' '{' > - 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 '(' > +FindSetLeftBitTerm > + : PARSEOP_FINDSETLEFTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} > + TermArg > + Target > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_FINDSETLEFTBIT '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -IndexFieldTerm > - : PARSEOP_INDEXFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} > - NameString > - NameStringItem > - ',' AccessTypeKeyword > - ',' LockRuleKeyword > - ',' UpdateRuleKeyword > - ')' '{' > - FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$7,$9,$11,$14);} > - | PARSEOP_INDEXFIELD '(' > - error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} > - ; > - > -MethodTerm > - : PARSEOP_METHOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} > - NameString > - OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} > - OptionalSerializeRuleKeyword > - OptionalByteConstExpr > - OptionalParameterTypePackage > - OptionalParameterTypesPackage > - ')' '{' > - TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$7,$8,$9,$10,$13);} > - | PARSEOP_METHOD '(' > +FindSetRightBitTerm > + : PARSEOP_FINDSETRIGHTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} > + TermArg > + Target > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_FINDSETRIGHTBIT '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -MutexTerm > - : PARSEOP_MUTEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);} > - NameString > - ',' ByteConstExpr > - ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} > - | PARSEOP_MUTEX '(' > +FprintfTerm > + : PARSEOP_FPRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);} > + TermArg ',' > + StringData > + PrintfArgList > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} > + | PARSEOP_FPRINTF '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OpRegionTerm > - : PARSEOP_OPERATIONREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} > - NameString > - ',' OpRegionSpaceIdTerm > - TermArgItem > - TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8);} > - | PARSEOP_OPERATIONREGION '(' > +FromBCDTerm > + : PARSEOP_FROMBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);} > + TermArg > + Target > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_FROMBCD '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OpRegionSpaceIdTerm > - : RegionSpaceKeyword {} > - | ByteConst {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} > - ; > - > -PowerResTerm > - : PARSEOP_POWERRESOURCE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} > +FunctionTerm > + : PARSEOP_FUNCTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} > NameString > - ',' ByteConstExpr > - ',' WordConstExpr > + OptionalParameterTypePackage > + OptionalParameterTypesPackage > ')' '{' > - ObjectList '}' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);} > - | PARSEOP_POWERRESOURCE '(' > + 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;} > ; > > -ProcessorTerm > - : PARSEOP_PROCESSOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} > - NameString > - ',' ByteConstExpr > - OptionalDWordConstExpr > - OptionalByteConstExpr > +IfTerm > + : PARSEOP_IF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} > + TermArg > ')' '{' > - ObjectList '}' {$$ = TrLinkChildren ($<n>3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);} > - | PARSEOP_PROCESSOR '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > + TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > > -ThermalZoneTerm > - : PARSEOP_THERMALZONE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} > - NameString > - ')' '{' > - ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} > - | PARSEOP_THERMALZONE '(' > + | PARSEOP_IF '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > +IncludeTerm > + : PARSEOP_INCLUDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCLUDE);} > + String ')' {TrLinkChildren ($<n>3,1,$4);FlOpenIncludeFile ($4);} > + TermList > + IncludeEndTerm {$$ = TrLinkPeerNodes (3,$<n>3,$7,$8);} > + ; > > -/******* Namespace modifiers *************************************************/ > +IncludeEndTerm > + : PARSEOP_INCLUDE_END {$$ = TrCreateLeafNode (PARSEOP_INCLUDE_END);} > + ; > > +IncTerm > + : PARSEOP_INCREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} > + SuperName > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_INCREMENT '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > > -AliasTerm > - : PARSEOP_ALIAS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);} > +IndexFieldTerm > + : PARSEOP_INDEXFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} > NameString > NameStringItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} > - | PARSEOP_ALIAS '(' > - error ')' {$$ = AslDoError(); yyclearin;} > + ',' AccessTypeKeyword > + ',' LockRuleKeyword > + ',' UpdateRuleKeyword > + ')' '{' > + FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$7,$9,$11,$14);} > + | PARSEOP_INDEXFIELD '(' > + error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} > ; > > -NameTerm > - : PARSEOP_NAME '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);} > - NameString > - ',' DataObject > - ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} > - | PARSEOP_NAME '(' > +IndexTerm > + : PARSEOP_INDEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_INDEX '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -ScopeTerm > - : PARSEOP_SCOPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);} > - NameString > - ')' '{' > - ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} > - | PARSEOP_SCOPE '(' > +LAndTerm > + : PARSEOP_LAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} > + TermArg > + TermArgItem > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_LAND '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > - > -/******* Type 1 opcodes *******************************************************/ > - > - > -BreakTerm > - : PARSEOP_BREAK {$$ = TrCreateNode (PARSEOP_BREAK, 0);} > +LEqualTerm > + : PARSEOP_LEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} > + TermArg > + TermArgItem > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_LEQUAL '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -BreakPointTerm > - : PARSEOP_BREAKPOINT {$$ = TrCreateNode (PARSEOP_BREAKPOINT, 0);} > +LGreaterEqualTerm > + : PARSEOP_LGREATEREQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} > + TermArg > + TermArgItem > + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} > + | PARSEOP_LGREATEREQUAL '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -ContinueTerm > - : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);} > +LGreaterTerm > + : PARSEOP_LGREATER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} > + TermArg > + TermArgItem > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_LGREATER '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -FatalTerm > - : PARSEOP_FATAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);} > - ByteConstExpr > - ',' DWordConstExpr > +LLessEqualTerm > + : PARSEOP_LLESSEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} > + TermArg > TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} > - | PARSEOP_FATAL '(' > + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} > + | PARSEOP_LLESSEQUAL '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -IfElseTerm > - : IfTerm ElseTerm {$$ = TrLinkPeerNode ($1,$2);} > +LLessTerm > + : PARSEOP_LLESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} > + TermArg > + TermArgItem > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_LLESS '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -IfTerm > - : PARSEOP_IF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} > +LNotEqualTerm > + : PARSEOP_LNOTEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} > TermArg > - ')' '{' > - TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - > - | PARSEOP_IF '(' > + TermArgItem > + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} > + | PARSEOP_LNOTEQUAL '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -ElseTerm > - : {$$ = NULL;} > - | PARSEOP_ELSE '{' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} > - TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} > - > - | PARSEOP_ELSE '{' > - error '}' {$$ = AslDoError(); yyclearin;} > - > - | PARSEOP_ELSE > - error {$$ = AslDoError(); yyclearin;} > - > - | PARSEOP_ELSEIF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} > - TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} > - ')' '{' > - TermList '}' {TrLinkChildren ($<n>5,2,$4,$8);} > - ElseTerm {TrLinkPeerNode ($<n>5,$11);} > - {$$ = TrLinkChildren ($<n>3,1,$<n>5);} > - > - | PARSEOP_ELSEIF '(' > +LNotTerm > + : PARSEOP_LNOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} > + TermArg > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_LNOT '(' > error ')' {$$ = AslDoError(); yyclearin;} > + ; > > - | PARSEOP_ELSEIF > - error {$$ = AslDoError(); yyclearin;} > +LoadTableTerm > + : PARSEOP_LOADTABLE '(' {$<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;} > ; > > LoadTerm > @@ -1014,1953 +1232,535 @@ LoadTerm > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -NoOpTerm > - : PARSEOP_NOOP {$$ = TrCreateNode (PARSEOP_NOOP, 0);} > +LocalTerm > + : PARSEOP_LOCAL0 {$$ = TrCreateLeafNode (PARSEOP_LOCAL0);} > + | PARSEOP_LOCAL1 {$$ = TrCreateLeafNode (PARSEOP_LOCAL1);} > + | PARSEOP_LOCAL2 {$$ = TrCreateLeafNode (PARSEOP_LOCAL2);} > + | PARSEOP_LOCAL3 {$$ = TrCreateLeafNode (PARSEOP_LOCAL3);} > + | PARSEOP_LOCAL4 {$$ = TrCreateLeafNode (PARSEOP_LOCAL4);} > + | PARSEOP_LOCAL5 {$$ = TrCreateLeafNode (PARSEOP_LOCAL5);} > + | PARSEOP_LOCAL6 {$$ = TrCreateLeafNode (PARSEOP_LOCAL6);} > + | PARSEOP_LOCAL7 {$$ = TrCreateLeafNode (PARSEOP_LOCAL7);} > ; > > -NotifyTerm > - : PARSEOP_NOTIFY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);} > - SuperName > - TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_NOTIFY '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ReleaseTerm > - : PARSEOP_RELEASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);} > - SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_RELEASE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ResetTerm > - : PARSEOP_RESET '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);} > - SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_RESET '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ReturnTerm > - : PARSEOP_RETURN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);} > - OptionalReturnArg > - ')' {$$ = 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;} > - ; > - > -SignalTerm > - : PARSEOP_SIGNAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);} > - SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_SIGNAL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -SleepTerm > - : PARSEOP_SLEEP '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);} > - TermArg > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_SLEEP '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -StallTerm > - : PARSEOP_STALL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);} > - TermArg > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_STALL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -SwitchTerm > - : PARSEOP_SWITCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);} > - TermArg > - ')' '{' > - CaseDefaultTermList '}' > - {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_SWITCH '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -/* > - * Case-Default list; allow only one Default term and unlimited Case terms > - */ > - > -CaseDefaultTermList > - : {$$ = NULL;} > - | CaseTerm {} > - | DefaultTerm {} > - | CaseDefaultTermList > - CaseTerm {$$ = TrLinkPeerNode ($1,$2);} > - | CaseDefaultTermList > - DefaultTerm {$$ = TrLinkPeerNode ($1,$2);} > - > -/* Original - attempts to force zero or one default term within the switch */ > - > -/* > -CaseDefaultTermList > - : {$$ = NULL;} > - | CaseTermList > - DefaultTerm > - CaseTermList {$$ = TrLinkPeerNode ($1,TrLinkPeerNode ($2, $3));} > - | CaseTermList > - CaseTerm {$$ = TrLinkPeerNode ($1,$2);} > - ; > - > -CaseTermList > - : {$$ = NULL;} > - | CaseTerm {} > - | CaseTermList > - CaseTerm {$$ = TrLinkPeerNode ($1,$2);} > - ; > -*/ > - > -CaseTerm > - : PARSEOP_CASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);} > - DataObject > - ')' '{' > - TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_CASE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -DefaultTerm > - : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFAULT);} > - TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_DEFAULT '{' > - error '}' {$$ = AslDoError(); yyclearin;} > - ; > - > -UnloadTerm > - : PARSEOP_UNLOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);} > - SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_UNLOAD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -WhileTerm > - : PARSEOP_WHILE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} > - TermArg > - ')' '{' TermList '}' > - {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_WHILE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > - > -/******* Type 2 opcodes *******************************************************/ > - > -AcquireTerm > - : PARSEOP_ACQUIRE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} > - SuperName > - ',' WordConstExpr > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$6);} > - | PARSEOP_ACQUIRE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -AddTerm > - : PARSEOP_ADD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} > +LOrTerm > + : PARSEOP_LOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} > TermArg > TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_ADD '(' > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_LOR '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -AndTerm > - : PARSEOP_AND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} > +MatchTerm > + : PARSEOP_MATCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MATCH);} > TermArg > + ',' MatchOpKeyword > TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_AND '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ConcatTerm > - : PARSEOP_CONCATENATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} > - TermArg > + ',' MatchOpKeyword > TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_CONCATENATE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ConcatResTerm > - : PARSEOP_CONCATENATERESTEMPLATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);} > - TermArg > TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_CONCATENATERESTEMPLATE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -CondRefOfTerm > - : PARSEOP_CONDREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} > - SuperName > - Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_CONDREFOF '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -CopyObjectTerm > - : PARSEOP_COPYOBJECT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} > - TermArg > - ',' SimpleTarget > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} > - | PARSEOP_COPYOBJECT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -DecTerm > - : PARSEOP_DECREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} > - SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_DECREMENT '(' > + ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);} > + | PARSEOP_MATCH '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -DerefOfTerm > - : PARSEOP_DEREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);} > - TermArg > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_DEREFOF '(' > +MethodTerm > + : PARSEOP_METHOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} > + NameString > + OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} > + OptionalSerializeRuleKeyword > + OptionalByteConstExpr > + OptionalParameterTypePackage > + OptionalParameterTypesPackage > + ')' '{' > + TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$7,$8,$9,$10,$13);} > + | PARSEOP_METHOD '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -DivideTerm > - : PARSEOP_DIVIDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} > +MidTerm > + : PARSEOP_MID '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MID);} > TermArg > TermArgItem > - Target > + TermArgItem > Target > ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} > - | PARSEOP_DIVIDE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -FindSetLeftBitTerm > - : PARSEOP_FINDSETLEFTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} > - TermArg > - Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_FINDSETLEFTBIT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -FindSetRightBitTerm > - : PARSEOP_FINDSETRIGHTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} > - TermArg > - Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_FINDSETRIGHTBIT '(' > + | PARSEOP_MID '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -FromBCDTerm > - : PARSEOP_FROMBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);} > +ModTerm > + : PARSEOP_MOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} > TermArg > + TermArgItem > Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_FROMBCD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -IncTerm > - : PARSEOP_INCREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} > - SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_INCREMENT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -IndexTerm > - : PARSEOP_INDEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);} > - TermArg > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_INDEX '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -LAndTerm > - : PARSEOP_LAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} > - TermArg > - TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_LAND '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -LEqualTerm > - : PARSEOP_LEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} > - TermArg > - TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_LEQUAL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -LGreaterTerm > - : PARSEOP_LGREATER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} > - TermArg > - TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_LGREATER '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -LGreaterEqualTerm > - : PARSEOP_LGREATEREQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} > - TermArg > - TermArgItem > - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} > - | PARSEOP_LGREATEREQUAL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -LLessTerm > - : PARSEOP_LLESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} > - TermArg > - TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_LLESS '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -LLessEqualTerm > - : PARSEOP_LLESSEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} > - TermArg > - TermArgItem > - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} > - | PARSEOP_LLESSEQUAL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -LNotTerm > - : PARSEOP_LNOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} > - TermArg > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_LNOT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -LNotEqualTerm > - : PARSEOP_LNOTEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} > - TermArg > - TermArgItem > - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} > - | PARSEOP_LNOTEQUAL '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -LoadTableTerm > - : PARSEOP_LOADTABLE '(' {$<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;} > - ; > - > -LOrTerm > - : PARSEOP_LOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} > - TermArg > - TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_LOR '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -MatchTerm > - : PARSEOP_MATCH '(' {$<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;} > - ; > - > -MidTerm > - : PARSEOP_MID '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MID);} > - TermArg > - TermArgItem > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} > - | PARSEOP_MID '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ModTerm > - : PARSEOP_MOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} > - TermArg > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_MOD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -MultiplyTerm > - : PARSEOP_MULTIPLY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} > - TermArg > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_MULTIPLY '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -NAndTerm > - : PARSEOP_NAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);} > - TermArg > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_NAND '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -NOrTerm > - : PARSEOP_NOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);} > - TermArg > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_NOR '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -NotTerm > - : PARSEOP_NOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} > - TermArg > - Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_NOT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ObjectTypeTerm > - : PARSEOP_OBJECTTYPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} > - ObjectTypeName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_OBJECTTYPE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -OrTerm > - : PARSEOP_OR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} > - TermArg > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_OR '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -/* > - * In RefOf, the node isn't really a target, but we can't keep track of it after > - * 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,TrSetNodeFlags ($4, NODE_IS_TARGET));} > - | PARSEOP_REFOF '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ShiftLeftTerm > - : PARSEOP_SHIFTLEFT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} > - TermArg > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_SHIFTLEFT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ShiftRightTerm > - : PARSEOP_SHIFTRIGHT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} > - TermArg > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_SHIFTRIGHT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -SizeOfTerm > - : PARSEOP_SIZEOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);} > - SuperName > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_SIZEOF '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -StoreTerm > - : PARSEOP_STORE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STORE);} > - TermArg > - ',' SuperName > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} > - | PARSEOP_STORE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -SubtractTerm > - : PARSEOP_SUBTRACT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} > - TermArg > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_SUBTRACT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -TimerTerm > - : PARSEOP_TIMER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);} > - ')' {$$ = TrLinkChildren ($<n>3,0);} > - | PARSEOP_TIMER {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_TIMER),0);} > - | PARSEOP_TIMER '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ToBCDTerm > - : PARSEOP_TOBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBCD);} > - TermArg > - Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_TOBCD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ToBufferTerm > - : PARSEOP_TOBUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} > - TermArg > - Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_TOBUFFER '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ToDecimalStringTerm > - : PARSEOP_TODECIMALSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} > - TermArg > - Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_TODECIMALSTRING '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ToHexStringTerm > - : PARSEOP_TOHEXSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} > - TermArg > - Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_TOHEXSTRING '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ToIntegerTerm > - : PARSEOP_TOINTEGER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} > - TermArg > - Target > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_TOINTEGER '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -PldKeyword > - : PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);} > - | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);} > - | PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);} > - | PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);} > - | PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);} > - | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);} > - | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);} > - | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);} > - | PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);} > - | PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);} > - | PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);} > - | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);} > - | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);} > - | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);} > - | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);} > - | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);} > - | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);} > - | PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);} > - | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);} > - | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);} > - | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);} > - | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);} > - | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);} > - | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);} > - | PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);} > - | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);} > - | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);} > - | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);} > - ; > - > -PldKeywordList > - : {$$ = NULL;} > - | PldKeyword > - PARSEOP_EXP_EQUALS Integer {$$ = TrLinkChildren ($1,1,$3);} > - | PldKeyword > - PARSEOP_EXP_EQUALS String {$$ = TrLinkChildren ($1,1,$3);} > - | PldKeywordList ',' /* Allows a trailing comma at list end */ > - | PldKeywordList ',' > - PldKeyword > - PARSEOP_EXP_EQUALS Integer {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} > - | PldKeywordList ',' > - PldKeyword > - PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} > - ; > - > -ToPLDTerm > - : PARSEOP_TOPLD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);} > - PldKeywordList > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_TOPLD '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -PrintfArgList > - : {$$ = NULL;} > - | TermArg {$$ = $1;} > - | PrintfArgList ',' > - TermArg {$$ = TrLinkPeerNode ($1, $3);} > - ; > - > -PrintfTerm > - : PARSEOP_PRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);} > - StringData > - PrintfArgList > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_PRINTF '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -FprintfTerm > - : PARSEOP_FPRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);} > - TermArg ',' > - StringData > - PrintfArgList > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} > - | PARSEOP_FPRINTF '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ToStringTerm > - : PARSEOP_TOSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);} > - TermArg > - OptionalCount > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_TOSTRING '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ToUUIDTerm > - : PARSEOP_TOUUID '(' > - StringData ')' {$$ = TrUpdateNode (PARSEOP_TOUUID, $3);} > - | PARSEOP_TOUUID '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -WaitTerm > - : PARSEOP_WAIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);} > - SuperName > - TermArgItem > - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > - | PARSEOP_WAIT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -XOrTerm > - : PARSEOP_XOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} > - TermArg > - TermArgItem > - Target > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > - | PARSEOP_XOR '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > - > -/******* Keywords *************************************************************/ > - > - > -AccessAttribKeyword > - : PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK);} > - | PARSEOP_ACCESSATTRIB_BLOCK_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK_CALL);} > - | PARSEOP_ACCESSATTRIB_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BYTE);} > - | PARSEOP_ACCESSATTRIB_QUICK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_QUICK );} > - | PARSEOP_ACCESSATTRIB_SND_RCV {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_SND_RCV);} > - | PARSEOP_ACCESSATTRIB_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD);} > - | PARSEOP_ACCESSATTRIB_WORD_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD_CALL);} > - | PARSEOP_ACCESSATTRIB_MULTIBYTE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);} > - ByteConst > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_ACCESSATTRIB_RAW_BYTES '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);} > - ByteConst > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - | PARSEOP_ACCESSATTRIB_RAW_PROCESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);} > - ByteConst > - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > - ; > - > -AccessTypeKeyword > - : PARSEOP_ACCESSTYPE_ANY {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_ANY);} > - | PARSEOP_ACCESSTYPE_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BYTE);} > - | PARSEOP_ACCESSTYPE_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_WORD);} > - | PARSEOP_ACCESSTYPE_DWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_DWORD);} > - | PARSEOP_ACCESSTYPE_QWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_QWORD);} > - | PARSEOP_ACCESSTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BUF);} > - ; > - > -AddressingModeKeyword > - : PARSEOP_ADDRESSINGMODE_7BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_7BIT);} > - | PARSEOP_ADDRESSINGMODE_10BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_10BIT);} > - ; > - > -AddressKeyword > - : PARSEOP_ADDRESSTYPE_MEMORY {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_MEMORY);} > - | PARSEOP_ADDRESSTYPE_RESERVED {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_RESERVED);} > - | PARSEOP_ADDRESSTYPE_NVS {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_NVS);} > - | PARSEOP_ADDRESSTYPE_ACPI {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_ACPI);} > - ; > - > -AddressSpaceKeyword > - : ByteConst {$$ = UtCheckIntegerRange ($1, 0x0A, 0xFF);} > - | RegionSpaceKeyword {} > - ; > - > -BitsPerByteKeyword > - : PARSEOP_BITSPERBYTE_FIVE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_FIVE);} > - | PARSEOP_BITSPERBYTE_SIX {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SIX);} > - | PARSEOP_BITSPERBYTE_SEVEN {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SEVEN);} > - | PARSEOP_BITSPERBYTE_EIGHT {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_EIGHT);} > - | PARSEOP_BITSPERBYTE_NINE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_NINE);} > - ; > - > -ClockPhaseKeyword > - : PARSEOP_CLOCKPHASE_FIRST {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_FIRST);} > - | PARSEOP_CLOCKPHASE_SECOND {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_SECOND);} > - ; > - > -ClockPolarityKeyword > - : PARSEOP_CLOCKPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_LOW);} > - | PARSEOP_CLOCKPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_HIGH);} > - ; > - > -DecodeKeyword > - : PARSEOP_DECODETYPE_POS {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_POS);} > - | PARSEOP_DECODETYPE_SUB {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_SUB);} > - ; > - > -DevicePolarityKeyword > - : PARSEOP_DEVICEPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_LOW);} > - | PARSEOP_DEVICEPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_HIGH);} > - ; > - > -DMATypeKeyword > - : PARSEOP_DMATYPE_A {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_A);} > - | PARSEOP_DMATYPE_COMPATIBILITY {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_COMPATIBILITY);} > - | PARSEOP_DMATYPE_B {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_B);} > - | PARSEOP_DMATYPE_F {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_F);} > - ; > - > -EndianKeyword > - : PARSEOP_ENDIAN_LITTLE {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_LITTLE);} > - | PARSEOP_ENDIAN_BIG {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_BIG);} > - ; > - > -FlowControlKeyword > - : PARSEOP_FLOWCONTROL_HW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_HW);} > - | PARSEOP_FLOWCONTROL_NONE {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_NONE);} > - | PARSEOP_FLOWCONTROL_SW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_SW);} > - ; > - > -InterruptLevel > - : PARSEOP_INTLEVEL_ACTIVEBOTH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEBOTH);} > - | PARSEOP_INTLEVEL_ACTIVEHIGH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEHIGH);} > - | PARSEOP_INTLEVEL_ACTIVELOW {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVELOW);} > - ; > - > -InterruptTypeKeyword > - : PARSEOP_INTTYPE_EDGE {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_EDGE);} > - | PARSEOP_INTTYPE_LEVEL {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_LEVEL);} > - ; > - > -IODecodeKeyword > - : PARSEOP_IODECODETYPE_16 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_16);} > - | PARSEOP_IODECODETYPE_10 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_10);} > - ; > - > -IoRestrictionKeyword > - : PARSEOP_IORESTRICT_IN {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_IN);} > - | PARSEOP_IORESTRICT_OUT {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_OUT);} > - | PARSEOP_IORESTRICT_NONE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_NONE);} > - | PARSEOP_IORESTRICT_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_PRESERVE);} > - ; > - > -LockRuleKeyword > - : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);} > - | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_NOLOCK);} > - ; > - > -MatchOpKeyword > - : PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);} > - | PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);} > - | PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLE);} > - | PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLT);} > - | PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGE);} > - | PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGT);} > - ; > - > -MaxKeyword > - : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);} > - | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);} > - ; > - > -MemTypeKeyword > - : PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_CACHEABLE);} > - | PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_WRITECOMBINING);} > - | PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_PREFETCHABLE);} > - | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_NONCACHEABLE);} > - ; > - > -MinKeyword > - : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);} > - | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);} > - ; > - > -ObjectTypeKeyword > - : PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} > - | PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_INT);} > - | PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_STR);} > - | PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BUF);} > - | PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PKG);} > - | PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_FLD);} > - | PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DEV);} > - | PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_EVT);} > - | PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTH);} > - | PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTX);} > - | PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_OPR);} > - | PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_POW);} > - | PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PRO);} > - | PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_THZ);} > - | PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BFF);} > - | PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DDB);} > - ; > - > -ParityTypeKeyword > - : PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_SPACE);} > - | PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_MARK);} > - | PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_ODD);} > - | PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_EVEN);} > - | PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_NONE);} > - ; > - > -PinConfigByte > - : PinConfigKeyword {$$ = $1;} > - | ByteConstExpr {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} > - ; > - > -PinConfigKeyword > - : PARSEOP_PIN_NOPULL {$$ = TrCreateLeafNode (PARSEOP_PIN_NOPULL);} > - | PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDOWN);} > - | PARSEOP_PIN_PULLUP {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLUP);} > - | PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDEFAULT);} > - ; > - > -RangeTypeKeyword > - : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);} > - | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);} > - | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ENTIRE);} > - ; > - > -RegionSpaceKeyword > - : PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IO);} > - | PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_MEM);} > - | PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCI);} > - | PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_EC);} > - | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);} > - | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);} > - | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);} > - | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);} > - | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);} > - | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);} > - | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);} > - | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);} > - ; > - > -ResourceTypeKeyword > - : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} > - | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);} > - ; > - > -SerializeRuleKeyword > - : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);} > - | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL);} > - ; > - > -ShareTypeKeyword > - : PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHARED);} > - | PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVE);} > - | PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHAREDWAKE);} > - | PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);} > - ; > - > -SlaveModeKeyword > - : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_CONTROLLERINIT);} > - | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_DEVICEINIT);} > - ; > - > -StopBitsKeyword > - : PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_TWO);} > - | PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONEPLUSHALF);} > - | PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONE);} > - | PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ZERO);} > - ; > - > -TranslationKeyword > - : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);} > - | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);} > - ; > - > -TypeKeyword > - : PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafNode (PARSEOP_TYPE_TRANSLATION);} > - | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafNode (PARSEOP_TYPE_STATIC);} > - ; > - > -UpdateRuleKeyword > - : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);} > - | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);} > - | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);} > - ; > - > -WireModeKeyword > - : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_FOUR);} > - | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_THREE);} > - ; > - > -XferSizeKeyword > - : PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_8, 0);} > - | PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_16, 1);} > - | PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} > - | PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_64, 3);} > - | PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_128, 4);} > - | PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_256, 5);} > - ; > - > -XferTypeKeyword > - : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);} > - | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);} > - | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);} > - ; > - > - > -/******* Miscellaneous Types **************************************************/ > - > - > -SuperName > - : NameString {} > - | ArgTerm {} > - | LocalTerm {} > - | DebugTerm {} > - | Type6Opcode {} > - > -/* For ObjectType: SuperName except for MethodInvocationTerm */ > - > -ObjectTypeName > - : NameString {} > - | ArgTerm {} > - | LocalTerm {} > - | DebugTerm {} > - | RefOfTerm {} > - | DerefOfTerm {} > - | IndexTerm {} > - > -/* | MethodInvocationTerm {} */ /* Caused reduce/reduce with Type6Opcode->MethodInvocationTerm */ > - ; > - > -ArgTerm > - : PARSEOP_ARG0 {$$ = TrCreateLeafNode (PARSEOP_ARG0);} > - | PARSEOP_ARG1 {$$ = TrCreateLeafNode (PARSEOP_ARG1);} > - | PARSEOP_ARG2 {$$ = TrCreateLeafNode (PARSEOP_ARG2);} > - | PARSEOP_ARG3 {$$ = TrCreateLeafNode (PARSEOP_ARG3);} > - | PARSEOP_ARG4 {$$ = TrCreateLeafNode (PARSEOP_ARG4);} > - | PARSEOP_ARG5 {$$ = TrCreateLeafNode (PARSEOP_ARG5);} > - | PARSEOP_ARG6 {$$ = TrCreateLeafNode (PARSEOP_ARG6);} > - ; > - > -LocalTerm > - : PARSEOP_LOCAL0 {$$ = TrCreateLeafNode (PARSEOP_LOCAL0);} > - | PARSEOP_LOCAL1 {$$ = TrCreateLeafNode (PARSEOP_LOCAL1);} > - | PARSEOP_LOCAL2 {$$ = TrCreateLeafNode (PARSEOP_LOCAL2);} > - | PARSEOP_LOCAL3 {$$ = TrCreateLeafNode (PARSEOP_LOCAL3);} > - | PARSEOP_LOCAL4 {$$ = TrCreateLeafNode (PARSEOP_LOCAL4);} > - | PARSEOP_LOCAL5 {$$ = TrCreateLeafNode (PARSEOP_LOCAL5);} > - | PARSEOP_LOCAL6 {$$ = TrCreateLeafNode (PARSEOP_LOCAL6);} > - | PARSEOP_LOCAL7 {$$ = TrCreateLeafNode (PARSEOP_LOCAL7);} > - ; > - > -DebugTerm > - : PARSEOP_DEBUG {$$ = TrCreateLeafNode (PARSEOP_DEBUG);} > - ; > - > - > -ByteConst > - : Integer {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} > - ; > - > -WordConst > - : Integer {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} > - ; > - > -DWordConst > - : Integer {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} > - ; > - > -QWordConst > - : Integer {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} > - ; > - > -Integer > - : PARSEOP_INTEGER {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, AslCompilerlval.i);} > - ; > - > -String > - : PARSEOP_STRING_LITERAL {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, (ACPI_NATIVE_INT) AslCompilerlval.s);} > - ; > - > -ConstTerm > - : ConstExprTerm {} > - | PARSEOP_REVISION {$$ = TrCreateLeafNode (PARSEOP_REVISION);} > - ; > - > -ConstExprTerm > - : PARSEOP_ZERO {$$ = TrCreateValuedLeafNode (PARSEOP_ZERO, 0);} > - | PARSEOP_ONE {$$ = TrCreateValuedLeafNode (PARSEOP_ONE, 1);} > - | PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_UINT64_MAX);} > - | PARSEOP___DATE__ {$$ = TrCreateConstantLeafNode (PARSEOP___DATE__);} > - | PARSEOP___FILE__ {$$ = TrCreateConstantLeafNode (PARSEOP___FILE__);} > - | PARSEOP___LINE__ {$$ = TrCreateConstantLeafNode (PARSEOP___LINE__);} > - | PARSEOP___PATH__ {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);} > - ; > - > -/* > - * The NODE_COMPILE_TIME_CONST flag in the following constant expressions > - * enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes > - * to simple integers. It is an error if these types of expressions cannot be > - * reduced, since the AML grammar for ****ConstExpr requires a simple constant. > - * Note: The required byte length of the constant is passed through to the > - * constant folding code in the node AmlLength field. > - */ > -ByteConstExpr > - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} > - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} > - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} > - | ByteConst {} > - ; > - > -WordConstExpr > - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} > - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} > - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} > - | WordConst {} > - ; > - > -DWordConstExpr > - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} > - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} > - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} > - | DWordConst {} > - ; > - > -QWordConstExpr > - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} > - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} > - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} > - | QWordConst {} > - ; > - > -/* OptionalCount must appear before ByteList or an incorrect reduction will result */ > - > -OptionalCount > - : {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ > - | ',' {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ > - | ',' TermArg {$$ = $2;} > - ; > - > -BufferTerm > - : PARSEOP_BUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER);} > - OptionalTermArg > - ')' '{' > - BufferTermData '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_BUFFER '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -BufferTermData > - : ByteList {} > - | StringData {} > - ; > - > -ByteList > - : {$$ = NULL;} > - | ByteConstExpr > - | ByteList ',' /* Allows a trailing comma at list end */ > - | ByteList ',' > - ByteConstExpr {$$ = TrLinkPeerNode ($1,$3);} > - ; > - > -DataBufferTerm > - : PARSEOP_DATABUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} > - OptionalWordConst > - ')' '{' > - ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_DATABUFFER '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -DWordList > - : {$$ = NULL;} > - | DWordConstExpr > - | DWordList ',' /* Allows a trailing comma at list end */ > - | DWordList ',' > - DWordConstExpr {$$ = TrLinkPeerNode ($1,$3);} > - ; > - > -PackageTerm > - : PARSEOP_PACKAGE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} > - VarPackageLengthTerm > - ')' '{' > - PackageList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_PACKAGE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -PackageList > - : {$$ = NULL;} > - | PackageElement > - | PackageList ',' /* Allows a trailing comma at list end */ > - | PackageList ',' > - PackageElement {$$ = TrLinkPeerNode ($1,$3);} > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_MOD '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -PackageElement > - : DataObject {} > - | NameString {} > +MultiplyTerm > + : PARSEOP_MULTIPLY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_MULTIPLY '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -VarPackageLengthTerm > - : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} > - | TermArg {$$ = $1;} > +MutexTerm > + : PARSEOP_MUTEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);} > + NameString > + ',' ByteConstExpr > + ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} > + | PARSEOP_MUTEX '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > - > -/******* Macros ***********************************************/ > - > - > -EISAIDTerm > - : PARSEOP_EISAID '(' > - StringData ')' {$$ = TrUpdateNode (PARSEOP_EISAID, $3);} > - | PARSEOP_EISAID '(' > +NameTerm > + : PARSEOP_NAME '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);} > + NameString > + ',' DataObject > + ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} > + | PARSEOP_NAME '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -UnicodeTerm > - : PARSEOP_UNICODE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);} > - StringData > - ')' {$$ = TrLinkChildren ($<n>3,2,0,$4);} > - | PARSEOP_UNICODE '(' > +NAndTerm > + : PARSEOP_NAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_NAND '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > - > -/******* Resources and Memory ***********************************************/ > - > - > -/* > - * Note: Create two default nodes to allow conversion to a Buffer AML opcode > - * Also, insert the EndTag at the end of the template. > - */ > -ResourceTemplateTerm > - : PARSEOP_RESOURCETEMPLATE '(' ')' > - '{' > - ResourceMacroList '}' {$$ = TrCreateNode (PARSEOP_RESOURCETEMPLATE,4, > - TrCreateLeafNode (PARSEOP_DEFAULT_ARG), > - TrCreateLeafNode (PARSEOP_DEFAULT_ARG), > - $5, > - TrCreateLeafNode (PARSEOP_ENDTAG));} > +NoOpTerm > + : PARSEOP_NOOP {$$ = TrCreateNode (PARSEOP_NOOP, 0);} > ; > > -ResourceMacroList > - : {$$ = NULL;} > - | ResourceMacroList > - ResourceMacroTerm {$$ = TrLinkPeerNode ($1,$2);} > - ; > - > -ResourceMacroTerm > - : DMATerm {} > - | DWordIOTerm {} > - | DWordMemoryTerm {} > - | DWordSpaceTerm {} > - | EndDependentFnTerm {} > - | ExtendedIOTerm {} > - | ExtendedMemoryTerm {} > - | ExtendedSpaceTerm {} > - | FixedDmaTerm {} > - | FixedIOTerm {} > - | GpioIntTerm {} > - | GpioIoTerm {} > - | I2cSerialBusTerm {} > - | InterruptTerm {} > - | IOTerm {} > - | IRQNoFlagsTerm {} > - | IRQTerm {} > - | Memory24Term {} > - | Memory32FixedTerm {} > - | Memory32Term {} > - | QWordIOTerm {} > - | QWordMemoryTerm {} > - | QWordSpaceTerm {} > - | RegisterTerm {} > - | SpiSerialBusTerm {} > - | StartDependentFnNoPriTerm {} > - | StartDependentFnTerm {} > - | UartSerialBusTerm {} > - | VendorLongTerm {} > - | VendorShortTerm {} > - | WordBusNumberTerm {} > - | WordIOTerm {} > - | WordSpaceTerm {} > - ; > - > -DMATerm > - : PARSEOP_DMA '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DMA);} > - DMATypeKeyword > - OptionalBusMasterKeyword > - ',' XferTypeKeyword > - OptionalNameString_Last > - ')' '{' > - ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$5,$7,$8,$11);} > - | PARSEOP_DMA '(' > +NOrTerm > + : PARSEOP_NOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_NOR '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -DWordIOTerm > - : PARSEOP_DWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDIO);} > - OptionalResourceType_First > - OptionalMinType > - OptionalMaxType > - OptionalDecodeType > - OptionalRangeType > - ',' DWordConstExpr > - ',' DWordConstExpr > - ',' DWordConstExpr > - ',' DWordConstExpr > - ',' DWordConstExpr > - OptionalByteConstExpr > - OptionalStringData > - OptionalNameString > - OptionalType > - OptionalTranslationType_Last > - ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} > - | PARSEOP_DWORDIO '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -DWordMemoryTerm > - : PARSEOP_DWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);} > - OptionalResourceType_First > - OptionalDecodeType > - OptionalMinType > - OptionalMaxType > - OptionalMemType > - ',' OptionalReadWriteKeyword > - ',' DWordConstExpr > - ',' DWordConstExpr > - ',' DWordConstExpr > - ',' DWordConstExpr > - ',' DWordConstExpr > - OptionalByteConstExpr > - OptionalStringData > - OptionalNameString > - OptionalAddressRange > - OptionalType_Last > - ')' {$$ = 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;} > - ; > - > -DWordSpaceTerm > - : PARSEOP_DWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);} > - ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} > - OptionalResourceType > - OptionalDecodeType > - OptionalMinType > - OptionalMaxType > - ',' ByteConstExpr > - ',' DWordConstExpr > - ',' DWordConstExpr > - ',' DWordConstExpr > - ',' DWordConstExpr > - ',' DWordConstExpr > - OptionalByteConstExpr > - OptionalStringData > - OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} > - | PARSEOP_DWORDSPACE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > - > -EndDependentFnTerm > - : PARSEOP_ENDDEPENDENTFN '(' > - ')' {$$ = TrCreateLeafNode (PARSEOP_ENDDEPENDENTFN);} > - | PARSEOP_ENDDEPENDENTFN '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ExtendedIOTerm > - : PARSEOP_EXTENDEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);} > - OptionalResourceType_First > - OptionalMinType > - OptionalMaxType > - OptionalDecodeType > - OptionalRangeType > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - OptionalQWordConstExpr > - OptionalNameString > - OptionalType > - OptionalTranslationType_Last > - ')' {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22);} > - | PARSEOP_EXTENDEDIO '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ExtendedMemoryTerm > - : PARSEOP_EXTENDEDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);} > - OptionalResourceType_First > - OptionalDecodeType > - OptionalMinType > - OptionalMaxType > - OptionalMemType > - ',' OptionalReadWriteKeyword > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - OptionalQWordConstExpr > - OptionalNameString > - OptionalAddressRange > - OptionalType_Last > - ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24);} > - | PARSEOP_EXTENDEDMEMORY '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -ExtendedSpaceTerm > - : PARSEOP_EXTENDEDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);} > - ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} > - OptionalResourceType > - OptionalDecodeType > - OptionalMinType > - OptionalMaxType > - ',' ByteConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - OptionalQWordConstExpr > - OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,13,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23);} > - | PARSEOP_EXTENDEDSPACE '(' > +NotifyTerm > + : PARSEOP_NOTIFY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);} > + SuperName > + TermArgItem > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_NOTIFY '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -FixedDmaTerm > - : PARSEOP_FIXEDDMA '(' {$<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 '(' > +NotTerm > + : PARSEOP_NOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} > + TermArg > + Target > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_NOT '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -FixedIOTerm > - : PARSEOP_FIXEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDIO);} > - WordConstExpr > - ',' ByteConstExpr > - OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} > - | PARSEOP_FIXEDIO '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -GpioIntTerm > - : PARSEOP_GPIO_INT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);} > - InterruptTypeKeyword /* 04: InterruptType */ > - ',' InterruptLevel /* 06: InterruptLevel */ > - OptionalShareType /* 07: SharedType */ > - ',' PinConfigByte /* 09: PinConfig */ > - OptionalWordConstExpr /* 10: DebounceTimeout */ > - ',' StringData /* 12: ResourceSource */ > - OptionalByteConstExpr /* 13: ResourceSourceIndex */ > - OptionalResourceType /* 14: ResourceType */ > - OptionalNameString /* 15: DescriptorName */ > - OptionalBuffer_Last /* 16: VendorData */ > - ')' '{' > - DWordConstExpr '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);} > - | PARSEOP_GPIO_INT '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -GpioIoTerm > - : PARSEOP_GPIO_IO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);} > - OptionalShareType_First /* 04: SharedType */ > - ',' PinConfigByte /* 06: PinConfig */ > - OptionalWordConstExpr /* 07: DebounceTimeout */ > - OptionalWordConstExpr /* 08: DriveStrength */ > - OptionalIoRestriction /* 09: IoRestriction */ > - ',' StringData /* 11: ResourceSource */ > - OptionalByteConstExpr /* 12: ResourceSourceIndex */ > - OptionalResourceType /* 13: ResourceType */ > - OptionalNameString /* 14: DescriptorName */ > - OptionalBuffer_Last /* 15: VendorData */ > - ')' '{' > - DWordList '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);} > - | PARSEOP_GPIO_IO '(' > +ObjectTypeTerm > + : PARSEOP_OBJECTTYPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} > + ObjectTypeName > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_OBJECTTYPE '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -I2cSerialBusTerm > - : PARSEOP_I2C_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);} > - WordConstExpr /* 04: SlaveAddress */ > - OptionalSlaveMode /* 05: SlaveMode */ > - ',' DWordConstExpr /* 07: ConnectionSpeed */ > - OptionalAddressingMode /* 08: AddressingMode */ > - ',' StringData /* 10: ResourceSource */ > - OptionalByteConstExpr /* 11: ResourceSourceIndex */ > - OptionalResourceType /* 12: ResourceType */ > - OptionalNameString /* 13: DescriptorName */ > - OptionalBuffer_Last /* 14: VendorData */ > - ')' {$$ = TrLinkChildren ($<n>3,9,$4,$5,$7,$8,$10,$11,$12,$13,$14);} > - | PARSEOP_I2C_SERIALBUS '(' > +OffsetTerm > + : PARSEOP_OFFSET '(' > + AmlPackageLengthTerm > + ')' {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);} > + | PARSEOP_OFFSET '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -InterruptTerm > - : PARSEOP_INTERRUPT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} > - OptionalResourceType_First > - ',' InterruptTypeKeyword > - ',' InterruptLevel > - OptionalShareType > - OptionalByteConstExpr > - OptionalStringData > - OptionalNameString_Last > - ')' '{' > - DWordList '}' {$$ = TrLinkChildren ($<n>3,8,$4,$6,$8,$9,$10,$11,$12,$15);} > - | PARSEOP_INTERRUPT '(' > +OpRegionTerm > + : PARSEOP_OPERATIONREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} > + NameString > + ',' OpRegionSpaceIdTerm > + TermArgItem > + TermArgItem > + ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8);} > + | PARSEOP_OPERATIONREGION '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -IOTerm > - : PARSEOP_IO '(' {$<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;} > +OpRegionSpaceIdTerm > + : RegionSpaceKeyword {} > + | ByteConst {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} > ; > > -IRQNoFlagsTerm > - : PARSEOP_IRQNOFLAGS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);} > - OptionalNameString_First > - ')' '{' > - ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_IRQNOFLAGS '(' > +OrTerm > + : PARSEOP_OR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_OR '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -IRQTerm > - : PARSEOP_IRQ '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQ);} > - InterruptTypeKeyword > - ',' InterruptLevel > - OptionalShareType > - OptionalNameString_Last > +PackageTerm > + : PARSEOP_PACKAGE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} > + VarPackageLengthTerm > ')' '{' > - ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$7,$8,$11);} > - | PARSEOP_IRQ '(' > + PackageList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > + | PARSEOP_PACKAGE '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -Memory24Term > - : PARSEOP_MEMORY24 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY24);} > - OptionalReadWriteKeyword > - ',' WordConstExpr > - ',' WordConstExpr > - ',' WordConstExpr > +PowerResTerm > + : PARSEOP_POWERRESOURCE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} > + NameString > + ',' ByteConstExpr > ',' WordConstExpr > - OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} > - | PARSEOP_MEMORY24 '(' > + ')' '{' > + ObjectList '}' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);} > + | PARSEOP_POWERRESOURCE '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -Memory32FixedTerm > - : PARSEOP_MEMORY32FIXED '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);} > - OptionalReadWriteKeyword > - ',' DWordConstExpr > - ',' DWordConstExpr > - OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$6,$8,$9);} > - | PARSEOP_MEMORY32FIXED '(' > +PrintfTerm > + : PARSEOP_PRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);} > + StringData > + PrintfArgList > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_PRINTF '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -Memory32Term > - : PARSEOP_MEMORY32 '(' {$<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;} > - ; > - > -QWordIOTerm > - : PARSEOP_QWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDIO);} > - OptionalResourceType_First > - OptionalMinType > - OptionalMaxType > - OptionalDecodeType > - OptionalRangeType > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - OptionalByteConstExpr > - OptionalStringData > - OptionalNameString > - OptionalType > - OptionalTranslationType_Last > - ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} > - | PARSEOP_QWORDIO '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -QWordMemoryTerm > - : PARSEOP_QWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);} > - OptionalResourceType_First > - OptionalDecodeType > - OptionalMinType > - OptionalMaxType > - OptionalMemType > - ',' OptionalReadWriteKeyword > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - OptionalByteConstExpr > - OptionalStringData > - OptionalNameString > - OptionalAddressRange > - OptionalType_Last > - ')' {$$ = 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;} > - ; > - > -QWordSpaceTerm > - : PARSEOP_QWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);} > - ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} > - OptionalResourceType > - OptionalDecodeType > - OptionalMinType > - OptionalMaxType > - ',' ByteConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - ',' QWordConstExpr > - OptionalByteConstExpr > - OptionalStringData > - OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} > - | PARSEOP_QWORDSPACE '(' > - error ')' {$$ = AslDoError(); yyclearin;} > +PrintfArgList > + : {$$ = NULL;} > + | TermArg {$$ = $1;} > + | PrintfArgList ',' > + TermArg {$$ = TrLinkPeerNode ($1, $3);} > ; > > -RegisterTerm > - : PARSEOP_REGISTER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REGISTER);} > - AddressSpaceKeyword > - ',' ByteConstExpr > +ProcessorTerm > + : PARSEOP_PROCESSOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} > + NameString > ',' ByteConstExpr > - ',' QWordConstExpr > - OptionalAccessSize > - OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$11,$12);} > - | PARSEOP_REGISTER '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -SpiSerialBusTerm > - : PARSEOP_SPI_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);} > - WordConstExpr /* 04: DeviceSelection */ > - OptionalDevicePolarity /* 05: DevicePolarity */ > - OptionalWireMode /* 06: WireMode */ > - ',' ByteConstExpr /* 08: DataBitLength */ > - OptionalSlaveMode /* 09: SlaveMode */ > - ',' DWordConstExpr /* 11: ConnectionSpeed */ > - ',' ClockPolarityKeyword /* 13: ClockPolarity */ > - ',' ClockPhaseKeyword /* 15: ClockPhase */ > - ',' StringData /* 17: ResourceSource */ > - OptionalByteConstExpr /* 18: ResourceSourceIndex */ > - OptionalResourceType /* 19: ResourceType */ > - OptionalNameString /* 20: DescriptorName */ > - OptionalBuffer_Last /* 21: VendorData */ > - ')' {$$ = TrLinkChildren ($<n>3,13,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21);} > - | PARSEOP_SPI_SERIALBUS '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -StartDependentFnNoPriTerm > - : PARSEOP_STARTDEPENDENTFN_NOPRI '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} > + OptionalDWordConstExpr > + OptionalByteConstExpr > ')' '{' > - ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,1,$6);} > - | PARSEOP_STARTDEPENDENTFN_NOPRI '(' > + ObjectList '}' {$$ = TrLinkChildren ($<n>3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);} > + | PARSEOP_PROCESSOR '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -StartDependentFnTerm > - : PARSEOP_STARTDEPENDENTFN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);} > - ByteConstExpr > - ',' ByteConstExpr > - ')' '{' > - ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$9);} > - | PARSEOP_STARTDEPENDENTFN '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -UartSerialBusTerm > - : PARSEOP_UART_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);} > - DWordConstExpr /* 04: ConnectionSpeed */ > - OptionalBitsPerByte /* 05: BitsPerByte */ > - OptionalStopBits /* 06: StopBits */ > - ',' ByteConstExpr /* 08: LinesInUse */ > - OptionalEndian /* 09: Endianess */ > - OptionalParityType /* 10: Parity */ > - OptionalFlowControl /* 11: FlowControl */ > - ',' WordConstExpr /* 13: Rx BufferSize */ > - ',' WordConstExpr /* 15: Tx BufferSize */ > - ',' StringData /* 17: ResourceSource */ > - OptionalByteConstExpr /* 18: ResourceSourceIndex */ > - OptionalResourceType /* 19: ResourceType */ > - OptionalNameString /* 20: DescriptorName */ > - OptionalBuffer_Last /* 21: VendorData */ > - ')' {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21);} > - | PARSEOP_UART_SERIALBUS '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -VendorLongTerm > - : PARSEOP_VENDORLONG '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORLONG);} > - OptionalNameString_First > +RawDataBufferTerm > + : PARSEOP_DATABUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} > + OptionalWordConst > ')' '{' > ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_VENDORLONG '(' > + | PARSEOP_DATABUFFER '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -VendorShortTerm > - : PARSEOP_VENDORSHORT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);} > - OptionalNameString_First > - ')' '{' > - ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > - | PARSEOP_VENDORSHORT '(' > +/* > + * In RefOf, the node isn't really a target, but we can't keep track of it after > + * 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,TrSetNodeFlags ($4, NODE_IS_TARGET));} > + | PARSEOP_REFOF '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -WordBusNumberTerm > - : PARSEOP_WORDBUSNUMBER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);} > - OptionalResourceType_First > - OptionalMinType > - OptionalMaxType > - OptionalDecodeType > - ',' WordConstExpr > - ',' WordConstExpr > - ',' WordConstExpr > - ',' WordConstExpr > - ',' WordConstExpr > - OptionalByteConstExpr > - OptionalStringData > - OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,12,$4,$5,$6,$7,$9,$11,$13,$15,$17,$18,$19,$20);} > - | PARSEOP_WORDBUSNUMBER '(' > +ReleaseTerm > + : PARSEOP_RELEASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);} > + SuperName > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_RELEASE '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > -WordIOTerm > - : PARSEOP_WORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDIO);} > - OptionalResourceType_First > - OptionalMinType > - OptionalMaxType > - OptionalDecodeType > - OptionalRangeType > - ',' WordConstExpr > - ',' WordConstExpr > - ',' WordConstExpr > - ',' WordConstExpr > - ',' WordConstExpr > - OptionalByteConstExpr > - OptionalStringData > - OptionalNameString > - OptionalType > - OptionalTranslationType_Last > - ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} > - | PARSEOP_WORDIO '(' > - error ')' {$$ = AslDoError(); yyclearin;} > - ; > - > -WordSpaceTerm > - : PARSEOP_WORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDSPACE);} > - ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} > - OptionalResourceType > - OptionalDecodeType > - OptionalMinType > - OptionalMaxType > - ',' ByteConstExpr > - ',' WordConstExpr > - ',' WordConstExpr > - ',' WordConstExpr > - ',' WordConstExpr > - ',' WordConstExpr > - OptionalByteConstExpr > - OptionalStringData > - OptionalNameString_Last > - ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} > - | PARSEOP_WORDSPACE '(' > +ResetTerm > + : PARSEOP_RESET '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);} > + SuperName > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_RESET '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +ReturnTerm > + : PARSEOP_RETURN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);} > + OptionalReturnArg > + ')' {$$ = 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;} > + ; > + > +ScopeTerm > + : PARSEOP_SCOPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);} > + NameString > + ')' '{' > + ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} > + | PARSEOP_SCOPE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > + ; > + > +ShiftLeftTerm > + : PARSEOP_SHIFTLEFT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_SHIFTLEFT '(' > error ')' {$$ = AslDoError(); yyclearin;} > ; > > - > -/******* Object References ***********************************************/ > - > -/* Allow IO, DMA, IRQ Resource macro names to also be used as identifiers */ > - > -NameString > - : NameSeg {} > - | PARSEOP_NAMESTRING {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) AslCompilerlval.s);} > - | PARSEOP_IO {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IO");} > - | PARSEOP_DMA {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "DMA");} > - | PARSEOP_IRQ {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IRQ");} > - ; > - > -NameSeg > - : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, (ACPI_NATIVE_INT) AslCompilerlval.s);} > +ShiftRightTerm > + : PARSEOP_SHIFTRIGHT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_SHIFTRIGHT '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > - > -/******* Helper rules ****************************************************/ > - > - > -AmlPackageLengthTerm > - : Integer {$$ = TrUpdateNode (PARSEOP_PACKAGE_LENGTH,(ACPI_PARSE_OBJECT *) $1);} > +SignalTerm > + : PARSEOP_SIGNAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);} > + SuperName > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_SIGNAL '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -NameStringItem > - : ',' NameString {$$ = $2;} > - | ',' error {$$ = AslDoError (); yyclearin;} > +SizeOfTerm > + : PARSEOP_SIZEOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);} > + SuperName > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_SIZEOF '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -TermArgItem > - : ',' TermArg {$$ = $2;} > - | ',' error {$$ = AslDoError (); yyclearin;} > +SleepTerm > + : PARSEOP_SLEEP '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);} > + TermArg > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_SLEEP '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalBusMasterKeyword > - : ',' {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);} > - | ',' PARSEOP_BUSMASTERTYPE_MASTER {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);} > - | ',' PARSEOP_BUSMASTERTYPE_NOTMASTER {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_NOTMASTER);} > +StallTerm > + : PARSEOP_STALL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);} > + TermArg > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_STALL '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalAccessAttribTerm > - : {$$ = NULL;} > - | ',' {$$ = NULL;} > - | ',' ByteConstExpr {$$ = $2;} > - | ',' AccessAttribKeyword {$$ = $2;} > +StoreTerm > + : PARSEOP_STORE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STORE);} > + TermArg > + ',' SuperName > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} > + | PARSEOP_STORE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalAccessSize > - : {$$ = TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0);} > - | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0);} > - | ',' ByteConstExpr {$$ = $2;} > +SubtractTerm > + : PARSEOP_SUBTRACT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_SUBTRACT '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > - > -OptionalAddressingMode > - : ',' {$$ = NULL;} > - | ',' AddressingModeKeyword {$$ = $2;} > +SwitchTerm > + : PARSEOP_SWITCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);} > + TermArg > + ')' '{' > + CaseDefaultTermList '}' > + {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > + | PARSEOP_SWITCH '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalAddressRange > - : {$$ = NULL;} > - | ',' {$$ = NULL;} > - | ',' AddressKeyword {$$ = $2;} > +ThermalZoneTerm > + : PARSEOP_THERMALZONE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} > + NameString > + ')' '{' > + ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} > + | PARSEOP_THERMALZONE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalBitsPerByte > - : ',' {$$ = NULL;} > - | ',' BitsPerByteKeyword {$$ = $2;} > +TimerTerm > + : PARSEOP_TIMER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);} > + ')' {$$ = TrLinkChildren ($<n>3,0);} > + | PARSEOP_TIMER {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_TIMER),0);} > + | PARSEOP_TIMER '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalBuffer_Last > - : {$$ = NULL;} > - | ',' {$$ = NULL;} > - | ',' DataBufferTerm {$$ = $2;} > +ToBCDTerm > + : PARSEOP_TOBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBCD);} > + TermArg > + Target > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_TOBCD '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalByteConstExpr > - : {$$ = NULL;} > - | ',' {$$ = NULL;} > - | ',' ByteConstExpr {$$ = $2;} > +ToBufferTerm > + : PARSEOP_TOBUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} > + TermArg > + Target > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_TOBUFFER '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalDecodeType > - : ',' {$$ = NULL;} > - | ',' DecodeKeyword {$$ = $2;} > +ToDecimalStringTerm > + : PARSEOP_TODECIMALSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} > + TermArg > + Target > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_TODECIMALSTRING '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalDevicePolarity > - : ',' {$$ = NULL;} > - | ',' DevicePolarityKeyword {$$ = $2;} > +ToHexStringTerm > + : PARSEOP_TOHEXSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} > + TermArg > + Target > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_TOHEXSTRING '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalDWordConstExpr > - : {$$ = NULL;} > - | ',' {$$ = NULL;} > - | ',' DWordConstExpr {$$ = $2;} > +ToIntegerTerm > + : PARSEOP_TOINTEGER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} > + TermArg > + Target > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_TOINTEGER '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalEndian > - : ',' {$$ = NULL;} > - | ',' EndianKeyword {$$ = $2;} > +ToPLDTerm > + : PARSEOP_TOPLD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);} > + PldKeywordList > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_TOPLD '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalFlowControl > - : ',' {$$ = NULL;} > - | ',' FlowControlKeyword {$$ = $2;} > +PldKeywordList > + : {$$ = NULL;} > + | PldKeyword > + PARSEOP_EXP_EQUALS Integer {$$ = TrLinkChildren ($1,1,$3);} > + | PldKeyword > + PARSEOP_EXP_EQUALS String {$$ = TrLinkChildren ($1,1,$3);} > + | PldKeywordList ',' /* Allows a trailing comma at list end */ > + | PldKeywordList ',' > + PldKeyword > + PARSEOP_EXP_EQUALS Integer {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} > + | PldKeywordList ',' > + PldKeyword > + PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} > ; > > -OptionalIoRestriction > - : ',' {$$ = NULL;} > - | ',' IoRestrictionKeyword {$$ = $2;} > - ; > > -OptionalListString > - : {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ > - | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ > - | ',' TermArg {$$ = $2;} > +ToStringTerm > + : PARSEOP_TOSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);} > + TermArg > + OptionalCount > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_TOSTRING '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalMaxType > - : ',' {$$ = NULL;} > - | ',' MaxKeyword {$$ = $2;} > +ToUUIDTerm > + : PARSEOP_TOUUID '(' > + StringData ')' {$$ = TrUpdateNode (PARSEOP_TOUUID, $3);} > + | PARSEOP_TOUUID '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalMemType > - : ',' {$$ = NULL;} > - | ',' MemTypeKeyword {$$ = $2;} > +UnicodeTerm > + : PARSEOP_UNICODE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);} > + StringData > + ')' {$$ = TrLinkChildren ($<n>3,2,0,$4);} > + | PARSEOP_UNICODE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalMinType > - : ',' {$$ = NULL;} > - | ',' MinKeyword {$$ = $2;} > +UnloadTerm > + : PARSEOP_UNLOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);} > + SuperName > + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} > + | PARSEOP_UNLOAD '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalNameString > - : {$$ = NULL;} > - | ',' {$$ = NULL;} > - | ',' NameString {$$ = $2;} > +WaitTerm > + : PARSEOP_WAIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);} > + SuperName > + TermArgItem > + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} > + | PARSEOP_WAIT '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalNameString_Last > - : {$$ = NULL;} > - | ',' {$$ = NULL;} > - | ',' NameString {$$ = $2;} > +XOrTerm > + : PARSEOP_XOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} > + TermArg > + TermArgItem > + Target > + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} > + | PARSEOP_XOR '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalNameString_First > - : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} > - | NameString {$$ = $1;} > +WhileTerm > + : PARSEOP_WHILE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} > + TermArg > + ')' '{' TermList '}' > + {$$ = TrLinkChildren ($<n>3,2,$4,$7);} > + | PARSEOP_WHILE '(' > + error ')' {$$ = AslDoError(); yyclearin;} > ; > > -OptionalObjectTypeKeyword > - : {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} > - | ',' ObjectTypeKeyword {$$ = $2;} > - ; > > -OptionalParityType > - : ',' {$$ = NULL;} > - | ',' ParityTypeKeyword {$$ = $2;} > - ; > +/******************************************************************************* > + * > + * ASL Helper Terms > + * > + ******************************************************************************/ > > -OptionalQWordConstExpr > - : {$$ = NULL;} > - | ',' {$$ = NULL;} > - | ',' QWordConstExpr {$$ = $2;} > +AmlPackageLengthTerm > + : Integer {$$ = TrUpdateNode (PARSEOP_PACKAGE_LENGTH,(ACPI_PARSE_OBJECT *) $1);} > ; > > -OptionalRangeType > - : ',' {$$ = NULL;} > - | ',' RangeTypeKeyword {$$ = $2;} > +NameStringItem > + : ',' NameString {$$ = $2;} > + | ',' error {$$ = AslDoError (); yyclearin;} > ; > > -OptionalReadWriteKeyword > - : {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);} > - | PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);} > - | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_READONLY);} > +TermArgItem > + : ',' TermArg {$$ = $2;} > + | ',' error {$$ = AslDoError (); yyclearin;} > ; > > OptionalReference > @@ -2969,17 +1769,6 @@ OptionalReference > | ',' TermArg {$$ = $2;} > ; > > -OptionalResourceType_First > - : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} > - | ResourceTypeKeyword {$$ = $1;} > - ; > - > -OptionalResourceType > - : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} > - | ',' {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} > - | ',' ResourceTypeKeyword {$$ = $2;} > - ; > - > OptionalReturnArg > : {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN);} /* Placeholder is a ZeroOp object */ > | TermArg {$$ = $1;} > @@ -2991,73 +1780,12 @@ OptionalSerializeRuleKeyword > | ',' SerializeRuleKeyword {$$ = $2;} > ; > > -OptionalSlaveMode > - : ',' {$$ = NULL;} > - | ',' SlaveModeKeyword {$$ = $2;} > - ; > - > -OptionalShareType > - : {$$ = NULL;} > - | ',' {$$ = NULL;} > - | ',' ShareTypeKeyword {$$ = $2;} > - ; > - > -OptionalShareType_First > - : {$$ = NULL;} > - | ShareTypeKeyword {$$ = $1;} > - ; > - > -OptionalStopBits > - : ',' {$$ = NULL;} > - | ',' StopBitsKeyword {$$ = $2;} > - ; > - > -OptionalStringData > - : {$$ = NULL;} > - | ',' {$$ = NULL;} > - | ',' StringData {$$ = $2;} > - ; > - > OptionalTermArg > : {$$ = NULL;} > | TermArg {$$ = $1;} > ; > > -OptionalType > - : {$$ = NULL;} > - | ',' {$$ = NULL;} > - | ',' TypeKeyword {$$ = $2;} > - ; > - > -OptionalType_Last > - : {$$ = NULL;} > - | ',' {$$ = NULL;} > - | ',' TypeKeyword {$$ = $2;} > - ; > - > -OptionalTranslationType_Last > - : {$$ = NULL;} > - | ',' {$$ = NULL;} > - | ',' TranslationKeyword {$$ = $2;} > - ; > - > -OptionalWireMode > - : ',' {$$ = NULL;} > - | ',' WireModeKeyword {$$ = $2;} > - ; > - > OptionalWordConst > : {$$ = NULL;} > | WordConst {$$ = $1;} > ; > - > -OptionalWordConstExpr > - : ',' {$$ = NULL;} > - | ',' WordConstExpr {$$ = $2;} > - ; > - > -OptionalXferSize > - : {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} > - | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} > - | ',' XferSizeKeyword {$$ = $2;} > - ; > diff --git a/src/acpica/source/compiler/asltokens.y b/src/acpica/source/compiler/asltokens.y > index 0e99c24..89ce095 100644 > --- a/src/acpica/source/compiler/asltokens.y > +++ b/src/acpica/source/compiler/asltokens.y > @@ -524,8 +524,14 @@ NoEcho(' > %left <i> PARSEOP_EXP_INCREMENT > PARSEOP_EXP_DECREMENT > > +/* Brackets for Index() support */ > + > +%left <i> PARSEOP_EXP_INDEX_LEFT > +%right <i> PARSEOP_EXP_INDEX_RIGHT > + > %token <i> PARSEOP_PRINTF > %token <i> PARSEOP_FPRINTF > + > /* Specific parentheses tokens are not used at this time */ > /* PARSEOP_EXP_PAREN_OPEN */ > /* PARSEOP_EXP_PAREN_CLOSE */ > diff --git a/src/acpica/source/compiler/asltree.c b/src/acpica/source/compiler/asltree.c > index 33194af..e54a690 100644 > --- a/src/acpica/source/compiler/asltree.c > +++ b/src/acpica/source/compiler/asltree.c > @@ -610,6 +610,7 @@ TrCreateAssignmentNode ( > case PARSEOP_ADD: > case PARSEOP_AND: > case PARSEOP_DIVIDE: > + case PARSEOP_INDEX: > case PARSEOP_MOD: > case PARSEOP_MULTIPLY: > case PARSEOP_NOT: > diff --git a/src/acpica/source/compiler/asltypes.h b/src/acpica/source/compiler/asltypes.h > index a536e02..b08c5df 100644 > --- a/src/acpica/source/compiler/asltypes.h > +++ b/src/acpica/source/compiler/asltypes.h > @@ -242,7 +242,7 @@ typedef enum > ASL_FILE_C_SOURCE_OUTPUT, /* .c */ > ASL_FILE_ASM_INCLUDE_OUTPUT,/* .inc */ > ASL_FILE_C_INCLUDE_OUTPUT, /* .h */ > - ASL_FILE_C_OFFSET_OUTPUT, /* offset.h */ > + ASL_FILE_C_OFFSET_OUTPUT, /* .offset.h */ > ASL_FILE_MAP_OUTPUT /* .map */ > > } ASL_FILE_TYPES; > @@ -251,24 +251,23 @@ typedef enum > #define ASL_MAX_FILE_TYPE 16 > #define ASL_NUM_FILES (ASL_MAX_FILE_TYPE + 1) > > -/* filename suffixes for output files */ > +/* Name suffixes used to create filenames for output files */ > > -#define FILE_SUFFIX_PREPROC_USER "i " > -#define FILE_SUFFIX_PREPROCESSOR "pre" > +#define FILE_SUFFIX_ASL_CODE "asl" > #define FILE_SUFFIX_AML_CODE "aml" > -#define FILE_SUFFIX_MAP "map" > +#define FILE_SUFFIX_SOURCE "src" > +#define FILE_SUFFIX_PREPROCESSOR "pre" > +#define FILE_SUFFIX_PREPROC_USER "i" > #define FILE_SUFFIX_LISTING "lst" > #define FILE_SUFFIX_HEX_DUMP "hex" > -#define FILE_SUFFIX_DEBUG "txt" > -#define FILE_SUFFIX_SOURCE "src" > #define FILE_SUFFIX_NAMESPACE "nsp" > +#define FILE_SUFFIX_DEBUG "txt" > #define FILE_SUFFIX_ASM_SOURCE "asm" > #define FILE_SUFFIX_C_SOURCE "c" > -#define FILE_SUFFIX_DISASSEMBLY "dsl" > #define FILE_SUFFIX_ASM_INCLUDE "inc" > #define FILE_SUFFIX_C_INCLUDE "h" > -#define FILE_SUFFIX_ASL_CODE "asl" > #define FILE_SUFFIX_C_OFFSET "offset.h" > +#define FILE_SUFFIX_MAP "map" > > > /* Cache block structure for ParseOps and Strings */ > diff --git a/src/acpica/source/compiler/asltypes.y b/src/acpica/source/compiler/asltypes.y > index 7051966..832d67c 100644 > --- a/src/acpica/source/compiler/asltypes.y > +++ b/src/acpica/source/compiler/asltypes.y > @@ -208,7 +208,7 @@ NoEcho(' > %type <n> DefaultTerm > %type <n> ElseTerm > %type <n> FatalTerm > -%type <n> IfElseTerm > +%type <n> ElseIfTerm > %type <n> IfTerm > %type <n> LoadTerm > %type <n> NoOpTerm > @@ -260,6 +260,7 @@ NoEcho(' > %type <n> NotTerm > %type <n> ObjectTypeTerm > %type <n> OrTerm > +%type <n> RawDataBufferTerm > %type <n> RefOfTerm > %type <n> ShiftLeftTerm > %type <n> ShiftRightTerm > @@ -369,7 +370,6 @@ NoEcho(' > /* Resource Descriptors */ > > %type <n> ConnectionTerm > -%type <n> DataBufferTerm > %type <n> DMATerm > %type <n> DWordIOTerm > %type <n> DWordMemoryTerm > @@ -463,3 +463,4 @@ NoEcho(' > */ > %type <n> Expression > %type <n> EqualsTerm > +%type <n> IndexExpTerm > diff --git a/src/acpica/source/compiler/aslwalks.c b/src/acpica/source/compiler/aslwalks.c > index e1f2743..1675cad 100644 > --- a/src/acpica/source/compiler/aslwalks.c > +++ b/src/acpica/source/compiler/aslwalks.c > @@ -123,6 +123,13 @@ > ACPI_MODULE_NAME ("aslwalks") > > > +/* Local prototypes */ > + > +static void > +AnAnalyzeStoreOperator ( > + ACPI_PARSE_OBJECT *Op); > + > + > /******************************************************************************* > * > * FUNCTION: AnMethodTypingWalkEnd > @@ -145,7 +152,7 @@ AnMethodTypingWalkEnd ( > UINT32 Level, > void *Context) > { > - UINT32 ThisNodeBtype; > + UINT32 ThisOpBtype; > > > switch (Op->Asl.ParseOpcode) > @@ -160,10 +167,10 @@ AnMethodTypingWalkEnd ( > if ((Op->Asl.Child) && > (Op->Asl.Child->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)) > { > - ThisNodeBtype = AnGetBtype (Op->Asl.Child); > + ThisOpBtype = AnGetBtype (Op->Asl.Child); > > if ((Op->Asl.Child->Asl.ParseOpcode == PARSEOP_METHODCALL) && > - (ThisNodeBtype == (ACPI_UINT32_MAX -1))) > + (ThisOpBtype == (ACPI_UINT32_MAX -1))) > { > /* > * The called method is untyped at this time (typically a > @@ -179,7 +186,7 @@ AnMethodTypingWalkEnd ( > ASL_WALK_VISIT_UPWARD, NULL, > AnMethodTypingWalkEnd, NULL); > > - ThisNodeBtype = AnGetBtype (Op->Asl.Child); > + ThisOpBtype = AnGetBtype (Op->Asl.Child); > } > } > > @@ -187,7 +194,7 @@ AnMethodTypingWalkEnd ( > > if (Op->Asl.ParentMethod) > { > - Op->Asl.ParentMethod->Asl.AcpiBtype |= ThisNodeBtype; > + Op->Asl.ParentMethod->Asl.AcpiBtype |= ThisOpBtype; > } > } > break; > @@ -258,9 +265,9 @@ AnOperandTypecheckWalkEnd ( > return (AE_OK); > } > > - ArgOp = Op->Asl.Child; > + ArgOp = Op->Asl.Child; > + OpcodeClass = OpInfo->Class; > RuntimeArgTypes = OpInfo->RuntimeArgs; > - OpcodeClass = OpInfo->Class; > > #ifdef ASL_ERROR_NAMED_OBJECT_IN_WHILE > /* > @@ -319,6 +326,7 @@ AnOperandTypecheckWalkEnd ( > { > return (AE_OK); > } > + > AnCheckMethodReturnValue (Op, OpInfo, ArgOp, > RequiredBtypes, ThisNodeBtype); > } > @@ -343,6 +351,70 @@ AnOperandTypecheckWalkEnd ( > return (AE_OK); > } > > + /* > + * Special handling for certain opcodes. > + */ > + switch (Op->Asl.AmlOpcode) > + { > + /* BankField has one TermArg */ > + > + case AML_BANK_FIELD_OP: > + > + OpcodeClass = AML_CLASS_EXECUTE; > + ArgOp = ArgOp->Asl.Next; > + ArgOp = ArgOp->Asl.Next; > + break; > + > + /* Operation Region has 2 TermArgs */ > + > + case AML_REGION_OP: > + > + OpcodeClass = AML_CLASS_EXECUTE; > + ArgOp = ArgOp->Asl.Next; > + ArgOp = ArgOp->Asl.Next; > + break; > + > + /* DataTableRegion has 3 TermArgs */ > + > + case AML_DATA_REGION_OP: > + > + OpcodeClass = AML_CLASS_EXECUTE; > + ArgOp = ArgOp->Asl.Next; > + break; > + > + /* Buffers/Packages have a length that is a TermArg */ > + > + case AML_BUFFER_OP: > + case AML_PACKAGE_OP: > + case AML_VAR_PACKAGE_OP: > + > + /* If length is a constant, we are done */ > + > + if ((ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER) || > + (ArgOp->Asl.ParseOpcode == PARSEOP_RAW_DATA)) > + { > + return (AE_OK); > + } > + break; > + > + /* Store can write any object to the Debug object */ > + > + case AML_STORE_OP: > + /* > + * If this is a Store() to the Debug object, we don't need > + * to perform any further validation -- because a Store of > + * any object to Debug is permitted and supported. > + */ > + if (ArgOp->Asl.Next->Asl.AmlOpcode == AML_DEBUG_OP) > + { > + return (AE_OK); > + } > + break; > + > + default: > + break; > + } > + > switch (OpcodeClass) > { > case AML_CLASS_EXECUTE: > @@ -350,15 +422,6 @@ AnOperandTypecheckWalkEnd ( > case AML_CLASS_CONTROL: > case AML_CLASS_RETURN_VALUE: > > - /* TBD: Change class or fix typechecking for these */ > - > - if ((Op->Asl.AmlOpcode == AML_BUFFER_OP) || > - (Op->Asl.AmlOpcode == AML_PACKAGE_OP) || > - (Op->Asl.AmlOpcode == AML_VAR_PACKAGE_OP)) > - { > - break; > - } > - > /* Reverse the runtime argument list */ > > RuntimeArgTypes2 = 0; > @@ -369,8 +432,12 @@ AnOperandTypecheckWalkEnd ( > INCREMENT_ARG_LIST (RuntimeArgTypes); > } > > + /* Typecheck each argument */ > + > while ((ArgType = GET_CURRENT_ARG_TYPE (RuntimeArgTypes2))) > { > + /* Get the required type(s) for the argument */ > + > RequiredBtypes = AnMapArgTypeToBtype (ArgType); > > if (!ArgOp) > @@ -380,6 +447,8 @@ AnOperandTypecheckWalkEnd ( > AslAbort (); > } > > + /* Get the actual type of the argument */ > + > ThisNodeBtype = AnGetBtype (ArgOp); > if (ThisNodeBtype == ACPI_UINT32_MAX) > { > @@ -400,6 +469,10 @@ AnOperandTypecheckWalkEnd ( > break; > } > > + /* Fallthrough */ > + > + case ARGI_STORE_TARGET: > + > if (ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER) > { > /* > @@ -411,25 +484,22 @@ AnOperandTypecheckWalkEnd ( > if ((ArgOp->Asl.Node->Type == ACPI_TYPE_LOCAL_RESOURCE_FIELD) || > (ArgOp->Asl.Node->Type == ACPI_TYPE_LOCAL_RESOURCE)) > { > - AslError (ASL_ERROR, ASL_MSG_RESOURCE_FIELD, ArgOp, NULL); > + AslError (ASL_ERROR, ASL_MSG_RESOURCE_FIELD, > + ArgOp, NULL); > } > else > { > - AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, NULL); > + AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, > + ArgOp, NULL); > } > - break; > } > - > - if ((ArgOp->Asl.ParseOpcode == PARSEOP_METHODCALL) || > - (ArgOp->Asl.ParseOpcode == PARSEOP_DEREFOF)) > - { > - break; > - } > - > - ThisNodeBtype = RequiredBtypes; > break; > > > +#ifdef __FUTURE_IMPLEMENTATION > +/* > + * Possible future typechecking support > + */ > case ARGI_REFERENCE: /* References */ > case ARGI_INTEGER_REF: > case ARGI_OBJECT_REF: > @@ -460,8 +530,8 @@ AnOperandTypecheckWalkEnd ( > case PARSEOP_ARG5: > case PARSEOP_ARG6: > > - /* Hard to analyze argument types, sow we won't */ > - /* For now, just treat any arg as a typematch */ > + /* Hard to analyze argument types, so we won't */ > + /* for now. Just treat any arg as a typematch */ > > /* ThisNodeBtype = RequiredBtypes; */ > break; > @@ -472,10 +542,9 @@ AnOperandTypecheckWalkEnd ( > default: > > break; > - > } > break; > - > +#endif > case ARGI_INTEGER: > default: > > @@ -483,6 +552,8 @@ AnOperandTypecheckWalkEnd ( > } > > > + /* Check for a type mismatch (required versus actual) */ > + > CommonBtypes = ThisNodeBtype & RequiredBtypes; > > if (ArgOp->Asl.ParseOpcode == PARSEOP_METHODCALL) > @@ -510,9 +581,10 @@ AnOperandTypecheckWalkEnd ( > AnFormatBtype (StringBuffer2, RequiredBtypes); > > sprintf (MsgBuffer, "[%s] found, %s operator requires [%s]", > - StringBuffer, OpInfo->Name, StringBuffer2); > + StringBuffer, OpInfo->Name, StringBuffer2); > > - AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, MsgBuffer); > + AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, > + ArgOp, MsgBuffer); > } > > NextArgument: > @@ -549,14 +621,15 @@ AnOtherSemanticAnalysisWalkBegin ( > UINT32 Level, > void *Context) > { > - ACPI_PARSE_OBJECT *ArgNode; > - ACPI_PARSE_OBJECT *PrevArgNode = NULL; > + ACPI_PARSE_OBJECT *ArgOp; > + ACPI_PARSE_OBJECT *PrevArgOp = NULL; > const ACPI_OPCODE_INFO *OpInfo; > ACPI_NAMESPACE_NODE *Node; > > > OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode); > > + > /* > * Determine if an execution class operator actually does something by > * checking if it has a target and/or the function return value is used. > @@ -569,30 +642,31 @@ AnOtherSemanticAnalysisWalkBegin ( > if (OpInfo->Flags & AML_HAS_TARGET) > { > /* > - * Find the target node, it is always the last child. If the traget > + * Find the target node, it is always the last child. If the target > * is not specified in the ASL, a default node of type Zero was > * created by the parser. > */ > - ArgNode = Op->Asl.Child; > - while (ArgNode->Asl.Next) > + ArgOp = Op->Asl.Child; > + while (ArgOp->Asl.Next) > { > - PrevArgNode = ArgNode; > - ArgNode = ArgNode->Asl.Next; > + PrevArgOp = ArgOp; > + ArgOp = ArgOp->Asl.Next; > } > > /* Divide() is the only weird case, it has two targets */ > > if (Op->Asl.AmlOpcode == AML_DIVIDE_OP) > { > - if ((ArgNode->Asl.ParseOpcode == PARSEOP_ZERO) && > - (PrevArgNode) && > - (PrevArgNode->Asl.ParseOpcode == PARSEOP_ZERO)) > + if ((ArgOp->Asl.ParseOpcode == PARSEOP_ZERO) && > + (PrevArgOp) && > + (PrevArgOp->Asl.ParseOpcode == PARSEOP_ZERO)) > { > AslError (ASL_ERROR, ASL_MSG_RESULT_NOT_USED, > Op, Op->Asl.ExternalName); > } > } > - else if (ArgNode->Asl.ParseOpcode == PARSEOP_ZERO) > + > + else if (ArgOp->Asl.ParseOpcode == PARSEOP_ZERO) > { > AslError (ASL_ERROR, ASL_MSG_RESULT_NOT_USED, > Op, Op->Asl.ExternalName); > @@ -627,6 +701,15 @@ AnOtherSemanticAnalysisWalkBegin ( > */ > switch (Op->Asl.ParseOpcode) > { > + case PARSEOP_STORE: > + > + if (Gbl_DoTypechecking) > + { > + AnAnalyzeStoreOperator (Op); > + } > + break; > + > + > case PARSEOP_ACQUIRE: > case PARSEOP_WAIT: > /* > @@ -638,16 +721,16 @@ AnOtherSemanticAnalysisWalkBegin ( > > /* First child is the namepath, 2nd child is timeout */ > > - ArgNode = Op->Asl.Child; > - ArgNode = ArgNode->Asl.Next; > + ArgOp = Op->Asl.Child; > + ArgOp = ArgOp->Asl.Next; > > /* > * Check for the WAIT_FOREVER case - defined by the ACPI spec to be > * 0xFFFF or greater > */ > - if (((ArgNode->Asl.ParseOpcode == PARSEOP_WORDCONST) || > - (ArgNode->Asl.ParseOpcode == PARSEOP_INTEGER)) && > - (ArgNode->Asl.Value.Integer >= (UINT64) ACPI_WAIT_FOREVER)) > + if (((ArgOp->Asl.ParseOpcode == PARSEOP_WORDCONST) || > + (ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER)) && > + (ArgOp->Asl.Value.Integer >= (UINT64) ACPI_WAIT_FOREVER)) > { > break; > } > @@ -658,7 +741,7 @@ AnOtherSemanticAnalysisWalkBegin ( > */ > if (!AnIsResultUsed (Op)) > { > - AslError (ASL_WARNING, ASL_MSG_TIMEOUT, ArgNode, > + AslError (ASL_WARNING, ASL_MSG_TIMEOUT, ArgOp, > Op->Asl.ExternalName); > } > break; > @@ -667,15 +750,15 @@ AnOtherSemanticAnalysisWalkBegin ( > /* > * Check for a zero Length (NumBits) operand. NumBits is the 3rd operand > */ > - ArgNode = Op->Asl.Child; > - ArgNode = ArgNode->Asl.Next; > - ArgNode = ArgNode->Asl.Next; > + ArgOp = Op->Asl.Child; > + ArgOp = ArgOp->Asl.Next; > + ArgOp = ArgOp->Asl.Next; > > - if ((ArgNode->Asl.ParseOpcode == PARSEOP_ZERO) || > - ((ArgNode->Asl.ParseOpcode == PARSEOP_INTEGER) && > - (ArgNode->Asl.Value.Integer == 0))) > + if ((ArgOp->Asl.ParseOpcode == PARSEOP_ZERO) || > + ((ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER) && > + (ArgOp->Asl.Value.Integer == 0))) > { > - AslError (ASL_ERROR, ASL_MSG_NON_ZERO, ArgNode, NULL); > + AslError (ASL_ERROR, ASL_MSG_NON_ZERO, ArgOp, NULL); > } > break; > > @@ -684,24 +767,24 @@ AnOtherSemanticAnalysisWalkBegin ( > * Ensure that the referenced operation region has the correct SPACE_ID. > * From the grammar/parser, we know the parent is a FIELD definition. > */ > - ArgNode = Op->Asl.Parent; /* Field definition */ > - ArgNode = ArgNode->Asl.Child; /* First child is the OpRegion Name */ > - Node = ArgNode->Asl.Node; /* OpRegion namespace node */ > + ArgOp = Op->Asl.Parent; /* Field definition */ > + ArgOp = ArgOp->Asl.Child; /* First child is the OpRegion Name */ > + Node = ArgOp->Asl.Node; /* OpRegion namespace node */ > if (!Node) > { > break; > } > > - ArgNode = Node->Op; /* OpRegion definition */ > - ArgNode = ArgNode->Asl.Child; /* First child is the OpRegion Name */ > - ArgNode = ArgNode->Asl.Next; /* Next peer is the SPACE_ID (what we want) */ > + ArgOp = Node->Op; /* OpRegion definition */ > + ArgOp = ArgOp->Asl.Child; /* First child is the OpRegion Name */ > + ArgOp = ArgOp->Asl.Next; /* Next peer is the SPACE_ID (what we want) */ > > /* > * The Connection() operator is only valid for the following operation > * region SpaceIds: GeneralPurposeIo and GenericSerialBus. > */ > - if ((ArgNode->Asl.Value.Integer != ACPI_ADR_SPACE_GPIO) && > - (ArgNode->Asl.Value.Integer != ACPI_ADR_SPACE_GSBUS)) > + if ((ArgOp->Asl.Value.Integer != ACPI_ADR_SPACE_GPIO) && > + (ArgOp->Asl.Value.Integer != ACPI_ADR_SPACE_GSBUS)) > { > AslError (ASL_ERROR, ASL_MSG_CONNECTION_INVALID, Op, NULL); > } > @@ -712,46 +795,46 @@ AnOtherSemanticAnalysisWalkBegin ( > * Ensure that fields for GeneralPurposeIo and GenericSerialBus > * contain at least one Connection() operator > */ > - ArgNode = Op->Asl.Child; /* 1st child is the OpRegion Name */ > - Node = ArgNode->Asl.Node; /* OpRegion namespace node */ > + ArgOp = Op->Asl.Child; /* 1st child is the OpRegion Name */ > + Node = ArgOp->Asl.Node; /* OpRegion namespace node */ > if (!Node) > { > break; > } > > - ArgNode = Node->Op; /* OpRegion definition */ > - ArgNode = ArgNode->Asl.Child; /* First child is the OpRegion Name */ > - ArgNode = ArgNode->Asl.Next; /* Next peer is the SPACE_ID (what we want) */ > + ArgOp = Node->Op; /* OpRegion definition */ > + ArgOp = ArgOp->Asl.Child; /* First child is the OpRegion Name */ > + ArgOp = ArgOp->Asl.Next; /* Next peer is the SPACE_ID (what we want) */ > > /* We are only interested in GeneralPurposeIo and GenericSerialBus */ > > - if ((ArgNode->Asl.Value.Integer != ACPI_ADR_SPACE_GPIO) && > - (ArgNode->Asl.Value.Integer != ACPI_ADR_SPACE_GSBUS)) > + if ((ArgOp->Asl.Value.Integer != ACPI_ADR_SPACE_GPIO) && > + (ArgOp->Asl.Value.Integer != ACPI_ADR_SPACE_GSBUS)) > { > break; > } > > - ArgNode = Op->Asl.Child; /* 1st child is the OpRegion Name */ > - ArgNode = ArgNode->Asl.Next; /* AccessType */ > - ArgNode = ArgNode->Asl.Next; /* LockRule */ > - ArgNode = ArgNode->Asl.Next; /* UpdateRule */ > - ArgNode = ArgNode->Asl.Next; /* Start of FieldUnitList */ > + ArgOp = Op->Asl.Child; /* 1st child is the OpRegion Name */ > + ArgOp = ArgOp->Asl.Next; /* AccessType */ > + ArgOp = ArgOp->Asl.Next; /* LockRule */ > + ArgOp = ArgOp->Asl.Next; /* UpdateRule */ > + ArgOp = ArgOp->Asl.Next; /* Start of FieldUnitList */ > > /* Walk the FieldUnitList */ > > - while (ArgNode) > + while (ArgOp) > { > - if (ArgNode->Asl.ParseOpcode == PARSEOP_CONNECTION) > + if (ArgOp->Asl.ParseOpcode == PARSEOP_CONNECTION) > { > break; > } > - else if (ArgNode->Asl.ParseOpcode == PARSEOP_NAMESEG) > + else if (ArgOp->Asl.ParseOpcode == PARSEOP_NAMESEG) > { > - AslError (ASL_ERROR, ASL_MSG_CONNECTION_MISSING, ArgNode, NULL); > + AslError (ASL_ERROR, ASL_MSG_CONNECTION_MISSING, ArgOp, NULL); > break; > } > > - ArgNode = ArgNode->Asl.Next; > + ArgOp = ArgOp->Asl.Next; > } > break; > > @@ -762,3 +845,204 @@ AnOtherSemanticAnalysisWalkBegin ( > > return (AE_OK); > } > + > + > +/******************************************************************************* > + * > + * FUNCTION: AnAnalyzeStoreOperator > + * > + * PARAMETERS: Op - Store() operator > + * > + * RETURN: None > + * > + * DESCRIPTION: Analyze a store operator. Mostly for stores to/from package > + * objects where there are more restrictions than other data > + * types. > + * > + ******************************************************************************/ > + > +static void > +AnAnalyzeStoreOperator ( > + ACPI_PARSE_OBJECT *Op) > +{ > + ACPI_NAMESPACE_NODE *SourceNode; > + ACPI_NAMESPACE_NODE *TargetNode; > + ACPI_PARSE_OBJECT *SourceOperandOp; > + ACPI_PARSE_OBJECT *TargetOperandOp; > + UINT32 SourceOperandBtype; > + UINT32 TargetOperandBtype; > + > + > + /* Extract the two operands for STORE */ > + > + SourceOperandOp = Op->Asl.Child; > + TargetOperandOp = SourceOperandOp->Asl.Next; > + > + /* > + * Ignore these Source operand opcodes, they cannot be typechecked, > + * the actual result is unknown here. > + */ > + switch (SourceOperandOp->Asl.ParseOpcode) > + { > + /* For these, type of the returned value is unknown at compile time */ > + > + case PARSEOP_DEREFOF: > + case PARSEOP_METHODCALL: > + case PARSEOP_STORE: > + case PARSEOP_COPYOBJECT: > + > + return; > + > + case PARSEOP_INDEX: > + case PARSEOP_REFOF: > + > + if (!Gbl_EnableReferenceTypechecking) > + { > + return; > + } > + > + /* > + * These opcodes always return an object reference, and thus > + * the result can only be stored to a Local, Arg, or Debug. > + */ > + if (TargetOperandOp->Asl.AmlOpcode == AML_DEBUG_OP) > + { > + return; > + } > + > + if ((TargetOperandOp->Asl.AmlOpcode < AML_LOCAL0) || > + (TargetOperandOp->Asl.AmlOpcode > AML_ARG6)) > + { > + AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, TargetOperandOp, > + "Source [Reference], Target must be [Local/Arg/Debug]"); > + } > + return; > + > + default: > + break; > + } > + > + /* > + * Ignore these Target operand opcodes, they cannot be typechecked > + */ > + switch (TargetOperandOp->Asl.ParseOpcode) > + { > + case PARSEOP_DEBUG: > + case PARSEOP_DEREFOF: > + case PARSEOP_REFOF: > + case PARSEOP_INDEX: > + > + return; > + > + case PARSEOP_METHODCALL: > + /* > + * A target is not allowed to be a method call. > + * It is technically allowed to be a method call, but this only > + * makes sense in one case: if the method returns a reference object, > + * which will then allow the Store to complete successfully. > + * However, this is not supported by the ACPICA interpreter, > + * and not supported by the MS ASL compiler > + * at this time. (09/2015) > + */ > + AslError (ASL_ERROR, ASL_MSG_UNSUPPORTED, > + TargetOperandOp, "Method invocation cannot be a target"); > + return; > + > + default: > + break; > + } > + > + /* > + * Ignore typecheck for External() operands of type "UnknownObj", > + * we don't know the actual type (source or target). > + */ > + SourceNode = SourceOperandOp->Asl.Node; > + if (SourceNode && > + (SourceNode->Flags & ANOBJ_IS_EXTERNAL) && > + (SourceNode->Type == ACPI_TYPE_ANY)) > + { > + return; > + } > + > + TargetNode = TargetOperandOp->Asl.Node; > + if (TargetNode && > + (TargetNode->Flags & ANOBJ_IS_EXTERNAL) && > + (TargetNode->Type == ACPI_TYPE_ANY)) > + { > + return; > + } > + > + /* > + * A NULL node with a namepath AML opcode indicates non-existent > + * name. Just return, the error message is generated elsewhere. > + */ > + if ((!SourceNode && (SourceOperandOp->Asl.AmlOpcode == AML_INT_NAMEPATH_OP)) || > + (!TargetNode && (TargetOperandOp->Asl.AmlOpcode == AML_INT_NAMEPATH_OP))) > + { > + return; > + } > + > + /* > + * Simple check for source same as target via NS node. > + * -- Could be expanded to locals and args. > + */ > + if (SourceNode && TargetNode) > + { > + if (SourceNode == TargetNode) > + { > + AslError (ASL_WARNING, ASL_MSG_DUPLICATE_ITEM, > + TargetOperandOp, "Source is the same as Target"); > + return; > + } > + } > + > + /* Ignore typecheck if either source or target is a local or arg */ > + > + if ((SourceOperandOp->Asl.AmlOpcode >= AML_LOCAL0) && > + (SourceOperandOp->Asl.AmlOpcode <= AML_ARG6)) > + { > + return; /* Cannot type a local/arg at compile time */ > + } > + > + if ((TargetOperandOp->Asl.AmlOpcode >= AML_LOCAL0) && > + (TargetOperandOp->Asl.AmlOpcode <= AML_ARG6)) > + { > + return; /* Cannot type a local/arg at compile time */ > + } > + > + /* > + * Package objects are a special case because they cannot by implicitly > + * converted to/from anything. Check for these two illegal cases: > + * > + * Store (non-package, package) > + * Store (package, non-package) > + */ > + SourceOperandBtype = AnGetBtype (SourceOperandOp); > + TargetOperandBtype = AnGetBtype (TargetOperandOp); > + > + /* Check source first for (package, non-package) case */ > + > + if (SourceOperandBtype & ACPI_BTYPE_PACKAGE) > + { > + /* If Source is PACKAGE-->Target must be PACKAGE */ > + > + if (!(TargetOperandBtype & ACPI_BTYPE_PACKAGE)) > + { > + AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, TargetOperandOp, > + "Source is [Package], Target must be a package also"); > + } > + } > + > + /* Else check target for (non-package, package) case */ > + > + else if (TargetOperandBtype & ACPI_BTYPE_PACKAGE) > + { > + /* If Target is PACKAGE, Source must be PACKAGE */ > + > + if (!(SourceOperandBtype & ACPI_BTYPE_PACKAGE)) > + { > + AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, SourceOperandOp, > + "Target is [Package], Source must be a package also"); > + } > + } > +} > diff --git a/src/acpica/source/components/debugger/dbexec.c b/src/acpica/source/components/debugger/dbexec.c > index 2f3c1b3..c2b02d2 100644 > --- a/src/acpica/source/components/debugger/dbexec.c > +++ b/src/acpica/source/components/debugger/dbexec.c > @@ -491,8 +491,20 @@ AcpiDbExecute ( > #ifdef ACPI_DEBUG_OUTPUT > UINT32 PreviousAllocations; > UINT32 Allocations; > +#endif > + > > + /* > + * Allow one execution to be performed by debugger or single step > + * execution will be dead locked by the interpreter mutexes. > + */ > + if (AcpiGbl_MethodExecuting) > + { > + AcpiOsPrintf ("Only one debugger execution is allowed.\n"); > + return; > + } > > +#ifdef ACPI_DEBUG_OUTPUT > /* Memory allocation tracking */ > > PreviousAllocations = AcpiDbGetOutstandingAllocations (); > diff --git a/src/acpica/source/components/debugger/dbinput.c b/src/acpica/source/components/debugger/dbinput.c > index d40a504..b3ee71f 100644 > --- a/src/acpica/source/components/debugger/dbinput.c > +++ b/src/acpica/source/components/debugger/dbinput.c > @@ -195,6 +195,7 @@ enum AcpiExDebuggerCommands > CMD_OSI, > CMD_OWNER, > CMD_PATHS, > + CMD_PREDEFINED, > CMD_PREFIX, > CMD_QUIT, > CMD_REFERENCES, > @@ -224,7 +225,6 @@ enum AcpiExDebuggerCommands > CMD_TERMINATE, > CMD_THREADS, > > - CMD_PREDEFINED, > CMD_TEST, > #endif > }; > @@ -273,6 +273,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] = > {"OSI", 0}, > {"OWNER", 1}, > {"PATHS", 0}, > + {"PREDEFINED", 0}, > {"PREFIX", 0}, > {"QUIT", 0}, > {"REFERENCES", 1}, > @@ -302,7 +303,6 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] = > {"TERMINATE", 0}, > {"THREADS", 3}, > > - {"PREDEFINED", 0}, > {"TEST", 1}, > #endif > {NULL, 0} > @@ -1301,7 +1301,8 @@ AcpiDbExecuteThread ( > AcpiGbl_MethodExecuting = FALSE; > AcpiGbl_StepToNextCall = FALSE; > > - MStatus = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY); > + MStatus = AcpiOsAcquireMutex (AcpiGbl_DbCommandReady, > + ACPI_WAIT_FOREVER); > if (ACPI_FAILURE (MStatus)) > { > return; > @@ -1309,11 +1310,7 @@ AcpiDbExecuteThread ( > > Status = AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL); > > - MStatus = AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_COMPLETE); > - if (ACPI_FAILURE (MStatus)) > - { > - return; > - } > + AcpiOsReleaseMutex (AcpiGbl_DbCommandComplete); > } > } > > @@ -1404,13 +1401,14 @@ AcpiDbUserCommands ( > * Signal the debug thread that we have a command to execute, > * and wait for the command to complete. > */ > - Status = AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_READY); > + AcpiOsReleaseMutex (AcpiGbl_DbCommandReady); > if (ACPI_FAILURE (Status)) > { > return (Status); > } > > - Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_COMPLETE); > + Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandComplete, > + ACPI_WAIT_FOREVER); > if (ACPI_FAILURE (Status)) > { > return (Status); > diff --git a/src/acpica/source/components/debugger/dbobject.c b/src/acpica/source/components/debugger/dbobject.c > index 35cea65..e52d1ca 100644 > --- a/src/acpica/source/components/debugger/dbobject.c > +++ b/src/acpica/source/components/debugger/dbobject.c > @@ -517,6 +517,7 @@ AcpiDbDecodeLocals ( > UINT32 i; > ACPI_OPERAND_OBJECT *ObjDesc; > ACPI_NAMESPACE_NODE *Node; > + BOOLEAN DisplayLocals = FALSE; > > > ObjDesc = WalkState->MethodDesc; > @@ -535,14 +536,39 @@ AcpiDbDecodeLocals ( > return; > } > > - AcpiOsPrintf ("Local Variables for method [%4.4s]:\n", > - AcpiUtGetNodeName (Node)); > + /* Are any locals actually set? */ > > for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) > { > ObjDesc = WalkState->LocalVariables[i].Object; > - AcpiOsPrintf (" Local%X: ", i); > - AcpiDbDisplayInternalObject (ObjDesc, WalkState); > + if (ObjDesc) > + { > + DisplayLocals = TRUE; > + break; > + } > + } > + > + /* If any are set, only display the ones that are set */ > + > + if (DisplayLocals) > + { > + AcpiOsPrintf ("\nInitialized Local Variables for method [%4.4s]:\n", > + AcpiUtGetNodeName (Node)); > + > + for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) > + { > + ObjDesc = WalkState->LocalVariables[i].Object; > + if (ObjDesc) > + { > + AcpiOsPrintf (" Local%X: ", i); > + AcpiDbDisplayInternalObject (ObjDesc, WalkState); > + } > + } > + } > + else > + { > + AcpiOsPrintf ("No Local Variables are initialized for method [%4.4s]\n", > + AcpiUtGetNodeName (Node)); > } > } > > @@ -566,10 +592,11 @@ AcpiDbDecodeArguments ( > UINT32 i; > ACPI_OPERAND_OBJECT *ObjDesc; > ACPI_NAMESPACE_NODE *Node; > + BOOLEAN DisplayArgs = FALSE; > > > + Node = WalkState->MethodNode; > ObjDesc = WalkState->MethodDesc; > - Node = WalkState->MethodNode; > > if (!Node) > { > @@ -584,16 +611,40 @@ AcpiDbDecodeArguments ( > return; > } > > - AcpiOsPrintf ( > - "Arguments for Method [%4.4s]: " > - "(%X arguments defined, max concurrency = %X)\n", > - AcpiUtGetNodeName (Node), ObjDesc->Method.ParamCount, > - ObjDesc->Method.SyncLevel); > + /* Are any arguments actually set? */ > > for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) > { > ObjDesc = WalkState->Arguments[i].Object; > - AcpiOsPrintf (" Arg%u: ", i); > - AcpiDbDisplayInternalObject (ObjDesc, WalkState); > + if (ObjDesc) > + { > + DisplayArgs = TRUE; > + break; > + } > + } > + > + /* If any are set, only display the ones that are set */ > + > + if (DisplayArgs) > + { > + AcpiOsPrintf ( > + "Initialized Arguments for Method [%4.4s]: " > + "(%X arguments defined for method invocation)\n", > + AcpiUtGetNodeName (Node), ObjDesc->Method.ParamCount); > + > + for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) > + { > + ObjDesc = WalkState->Arguments[i].Object; > + if (ObjDesc) > + { > + AcpiOsPrintf (" Arg%u: ", i); > + AcpiDbDisplayInternalObject (ObjDesc, WalkState); > + } > + } > + } > + else > + { > + AcpiOsPrintf ("No Arguments are initialized for method [%4.4s]\n", > + AcpiUtGetNodeName (Node)); > } > } > diff --git a/src/acpica/source/components/debugger/dbxface.c b/src/acpica/source/components/debugger/dbxface.c > index eadcc16..0004665 100644 > --- a/src/acpica/source/components/debugger/dbxface.c > +++ b/src/acpica/source/components/debugger/dbxface.c > @@ -173,12 +173,10 @@ AcpiDbStartCommand ( > { > /* Handshake with the front-end that gets user command lines */ > > - Status = AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_COMPLETE); > - if (ACPI_FAILURE (Status)) > - { > - return (Status); > - } > - Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY); > + AcpiOsReleaseMutex (AcpiGbl_DbCommandComplete); > + > + Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandReady, > + ACPI_WAIT_FOREVER); > if (ACPI_FAILURE (Status)) > { > return (Status); > @@ -522,14 +520,16 @@ AcpiInitializeDebugger ( > { > /* These were created with one unit, grab it */ > > - Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_COMPLETE); > + Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandComplete, > + ACPI_WAIT_FOREVER); > if (ACPI_FAILURE (Status)) > { > AcpiOsPrintf ("Could not get debugger mutex\n"); > return_ACPI_STATUS (Status); > } > > - Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY); > + Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandReady, > + ACPI_WAIT_FOREVER); > if (ACPI_FAILURE (Status)) > { > AcpiOsPrintf ("Could not get debugger mutex\n"); > @@ -583,33 +583,3 @@ AcpiTerminateDebugger ( > } > > ACPI_EXPORT_SYMBOL (AcpiTerminateDebugger) > - > - > -#ifdef ACPI_OBSOLETE_FUNCTIONS > -/******************************************************************************* > - * > - * FUNCTION: AcpiDbMethodEnd > - * > - * PARAMETERS: WalkState - Current walk > - * > - * RETURN: Status > - * > - * DESCRIPTION: Called at method termination > - * > - ******************************************************************************/ > - > -void > -AcpiDbMethodEnd ( > - ACPI_WALK_STATE *WalkState) > -{ > - > - if (!AcpiGbl_CmSingleStep) > - { > - return; > - } > - > - AcpiOsPrintf ("<Method Terminating>\n"); > - > - AcpiDbStartCommand (WalkState, NULL); > -} > -#endif > diff --git a/src/acpica/source/components/disassembler/dmcstyle.c b/src/acpica/source/components/disassembler/dmcstyle.c > index 37f31e8..0dbbb60 100644 > --- a/src/acpica/source/components/disassembler/dmcstyle.c > +++ b/src/acpica/source/components/disassembler/dmcstyle.c > @@ -299,12 +299,27 @@ AcpiDmCheckForSymbolicOpcode ( > Child2->Common.OperatorSymbol = OperatorSymbol; > return (TRUE); > > -#ifdef INDEX_SUPPORT > case AML_INDEX_OP: > + /* > + * Check for constant source operand. Note: although technically > + * legal syntax, the iASL compiler does not support this with > + * 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)) > + { > + Op->Common.DisasmFlags |= ACPI_PARSEOP_CLOSING_PAREN; > + return (FALSE); > + } > + > + /* Index operator is [] */ > + > Child1->Common.OperatorSymbol = " ["; > Child2->Common.OperatorSymbol = "]"; > break; > -#endif > > /* Unary operators */ > > @@ -514,7 +529,6 @@ AcpiDmCheckForSymbolicOpcode ( > case AML_INCREMENT_OP: > return (TRUE); > > -#ifdef INDEX_SUPPORT > case AML_INDEX_OP: > > /* Target is optional, 3rd operand */ > @@ -530,7 +544,6 @@ AcpiDmCheckForSymbolicOpcode ( > } > } > return (TRUE); > -#endif > > case AML_STORE_OP: > /* > @@ -650,12 +663,18 @@ AcpiDmCloseOperator ( > } > break; > > + case AML_INDEX_OP: > + > + /* This is case for unsupported Index() source constants */ > + > + if (Op->Common.DisasmFlags & ACPI_PARSEOP_CLOSING_PAREN) > + { > + AcpiOsPrintf (")"); > + } > + return; > > /* No need for parens for these */ > > -#ifdef INDEX_SUPPORT > - case AML_INDEX_OP: > -#endif > case AML_DECREMENT_OP: > case AML_INCREMENT_OP: > case AML_LNOT_OP: > diff --git a/src/acpica/source/components/disassembler/dmobject.c b/src/acpica/source/components/disassembler/dmobject.c > deleted file mode 100644 > index c4680ef..0000000 > --- a/src/acpica/source/components/disassembler/dmobject.c > +++ /dev/null > @@ -1,648 +0,0 @@ > -/******************************************************************************* > - * > - * Module Name: dmobject - ACPI object decode and display > - * > - ******************************************************************************/ > - > -/****************************************************************************** > - * > - * 1. Copyright Notice > - * > - * Some or all of this work - Copyright (c) 1999 - 2015, Intel Corp. > - * All rights reserved. > - * > - * 2. License > - * > - * 2.1. This is your license from Intel Corp. under its intellectual property > - * rights. You may have additional license terms from the party that provided > - * you this software, covering your right to use that party's intellectual > - * property rights. > - * > - * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a > - * copy of the source code appearing in this file ("Covered Code") an > - * irrevocable, perpetual, worldwide license under Intel's copyrights in the > - * base code distributed originally by Intel ("Original Intel Code") to copy, > - * make derivatives, distribute, use and display any portion of the Covered > - * Code in any form, with the right to sublicense such rights; and > - * > - * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent > - * license (with the right to sublicense), under only those claims of Intel > - * patents that are infringed by the Original Intel Code, to make, use, sell, > - * offer to sell, and import the Covered Code and derivative works thereof > - * solely to the minimum extent necessary to exercise the above copyright > - * license, and in no event shall the patent license extend to any additions > - * to or modifications of the Original Intel Code. No other license or right > - * is granted directly or by implication, estoppel or otherwise; > - * > - * The above copyright and patent license is granted only if the following > - * conditions are met: > - * > - * 3. Conditions > - * > - * 3.1. Redistribution of Source with Rights to Further Distribute Source. > - * Redistribution of source code of any substantial portion of the Covered > - * Code or modification with rights to further distribute source must include > - * the above Copyright Notice, the above License, this list of Conditions, > - * and the following Disclaimer and Export Compliance provision. In addition, > - * Licensee must cause all Covered Code to which Licensee contributes to > - * contain a file documenting the changes Licensee made to create that Covered > - * Code and the date of any change. Licensee must include in that file the > - * documentation of any changes made by any predecessor Licensee. Licensee > - * must include a prominent statement that the modification is derived, > - * directly or indirectly, from Original Intel Code. > - * > - * 3.2. Redistribution of Source with no Rights to Further Distribute Source. > - * Redistribution of source code of any substantial portion of the Covered > - * Code or modification without rights to further distribute source must > - * include the following Disclaimer and Export Compliance provision in the > - * documentation and/or other materials provided with distribution. In > - * addition, Licensee may not authorize further sublicense of source of any > - * portion of the Covered Code, and must include terms to the effect that the > - * license from Licensee to its licensee is limited to the intellectual > - * property embodied in the software Licensee provides to its licensee, and > - * not to intellectual property embodied in modifications its licensee may > - * make. > - * > - * 3.3. Redistribution of Executable. Redistribution in executable form of any > - * substantial portion of the Covered Code or modification must reproduce the > - * above Copyright Notice, and the following Disclaimer and Export Compliance > - * provision in the documentation and/or other materials provided with the > - * distribution. > - * > - * 3.4. Intel retains all right, title, and interest in and to the Original > - * Intel Code. > - * > - * 3.5. Neither the name Intel nor any other trademark owned or controlled by > - * Intel shall be used in advertising or otherwise to promote the sale, use or > - * other dealings in products derived from or relating to the Covered Code > - * without prior written authorization from Intel. > - * > - * 4. Disclaimer and Export Compliance > - * > - * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED > - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE > - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, > - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY > - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY > - * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A > - * PARTICULAR PURPOSE. > - * > - * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES > - * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR > - * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, > - * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY > - * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL > - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS > - * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY > - * LIMITED REMEDY. > - * > - * 4.3. Licensee shall not export, either directly or indirectly, any of this > - * software or system incorporating such software without first obtaining any > - * required license or other approval from the U. S. Department of Commerce or > - * any other agency or department of the United States Government. In the > - * event Licensee exports any such software from the United States or > - * re-exports any such software from a foreign destination, Licensee shall > - * ensure that the distribution and export/re-export of the software is in > - * compliance with all laws, regulations, orders, or other restrictions of the > - * U.S. Export Administration Regulations. Licensee agrees that neither it nor > - * any of its subsidiaries will export/re-export any technical data, process, > - * software, or service, directly or indirectly, to any country for which the > - * United States government or any agency thereof requires an export license, > - * other governmental approval, or letter of assurance, without first obtaining > - * such license, approval or letter. > - * > - *****************************************************************************/ > - > -#include "acpi.h" > -#include "accommon.h" > -#include "acnamesp.h" > -#include "acdisasm.h" > - > - > -#ifdef ACPI_DISASSEMBLER > - > -#define _COMPONENT ACPI_CA_DEBUGGER > - ACPI_MODULE_NAME ("dmnames") > - > -/* Local prototypes */ > - > -static void > -AcpiDmDecodeNode ( > - ACPI_NAMESPACE_NODE *Node); > - > - > -/******************************************************************************* > - * > - * FUNCTION: AcpiDmDumpMethodInfo > - * > - * PARAMETERS: Status - Method execution status > - * WalkState - Current state of the parse tree walk > - * Op - Executing parse op > - * > - * RETURN: None > - * > - * DESCRIPTION: Called when a method has been aborted because of an error. > - * Dumps the method execution stack, and the method locals/args, > - * and disassembles the AML opcode that failed. > - * > - ******************************************************************************/ > - > -void > -AcpiDmDumpMethodInfo ( > - ACPI_STATUS Status, > - ACPI_WALK_STATE *WalkState, > - ACPI_PARSE_OBJECT *Op) > -{ > - ACPI_PARSE_OBJECT *Next; > - ACPI_THREAD_STATE *Thread; > - ACPI_WALK_STATE *NextWalkState; > - ACPI_NAMESPACE_NODE *PreviousMethod = NULL; > - > - > - /* Ignore control codes, they are not errors */ > - > - if ((Status & AE_CODE_MASK) == AE_CODE_CONTROL) > - { > - return; > - } > - > - /* We may be executing a deferred opcode */ > - > - if (WalkState->DeferredNode) > - { > - AcpiOsPrintf ("Executing subtree for Buffer/Package/Region\n"); > - return; > - } > - > - /* > - * If there is no Thread, we are not actually executing a method. > - * This can happen when the iASL compiler calls the interpreter > - * to perform constant folding. > - */ > - Thread = WalkState->Thread; > - if (!Thread) > - { > - return; > - } > - > - /* Display exception and method name */ > - > - AcpiOsPrintf ("\n**** Exception %s during execution of method ", > - AcpiFormatException (Status)); > - AcpiNsPrintNodePathname (WalkState->MethodNode, NULL); > - > - /* Display stack of executing methods */ > - > - AcpiOsPrintf ("\n\nMethod Execution Stack:\n"); > - NextWalkState = Thread->WalkStateList; > - > - /* Walk list of linked walk states */ > - > - while (NextWalkState) > - { > - AcpiOsPrintf (" Method [%4.4s] executing: ", > - AcpiUtGetNodeName (NextWalkState->MethodNode)); > - > - /* First method is the currently executing method */ > - > - if (NextWalkState == WalkState) > - { > - if (Op) > - { > - /* Display currently executing ASL statement */ > - > - Next = Op->Common.Next; > - Op->Common.Next = NULL; > - > - AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX); > - Op->Common.Next = Next; > - } > - } > - else > - { > - /* > - * This method has called another method > - * NOTE: the method call parse subtree is already deleted at this > - * point, so we cannot disassemble the method invocation. > - */ > - AcpiOsPrintf ("Call to method "); > - AcpiNsPrintNodePathname (PreviousMethod, NULL); > - } > - > - PreviousMethod = NextWalkState->MethodNode; > - NextWalkState = NextWalkState->Next; > - AcpiOsPrintf ("\n"); > - } > - > - /* Display the method locals and arguments */ > - > - AcpiOsPrintf ("\n"); > - AcpiDmDisplayLocals (WalkState); > - AcpiOsPrintf ("\n"); > - AcpiDmDisplayArguments (WalkState); > - AcpiOsPrintf ("\n"); > -} > - > - > -/******************************************************************************* > - * > - * FUNCTION: AcpiDmDecodeInternalObject > - * > - * PARAMETERS: ObjDesc - Object to be displayed > - * > - * RETURN: None > - * > - * DESCRIPTION: Short display of an internal object. Numbers/Strings/Buffers. > - * > - ******************************************************************************/ > - > -void > -AcpiDmDecodeInternalObject ( > - ACPI_OPERAND_OBJECT *ObjDesc) > -{ > - UINT32 i; > - > - > - if (!ObjDesc) > - { > - AcpiOsPrintf (" Uninitialized"); > - return; > - } > - > - if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) > - { > - AcpiOsPrintf (" %p [%s]", ObjDesc, AcpiUtGetDescriptorName (ObjDesc)); > - return; > - } > - > - AcpiOsPrintf (" %s", AcpiUtGetObjectTypeName (ObjDesc)); > - > - switch (ObjDesc->Common.Type) > - { > - case ACPI_TYPE_INTEGER: > - > - AcpiOsPrintf (" %8.8X%8.8X", > - ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); > - break; > - > - case ACPI_TYPE_STRING: > - > - AcpiOsPrintf ("(%u) \"%.24s", > - ObjDesc->String.Length, ObjDesc->String.Pointer); > - > - if (ObjDesc->String.Length > 24) > - { > - AcpiOsPrintf ("..."); > - } > - else > - { > - AcpiOsPrintf ("\""); > - } > - break; > - > - case ACPI_TYPE_BUFFER: > - > - AcpiOsPrintf ("(%u)", ObjDesc->Buffer.Length); > - for (i = 0; (i < 8) && (i < ObjDesc->Buffer.Length); i++) > - { > - AcpiOsPrintf (" %2.2X", ObjDesc->Buffer.Pointer[i]); > - } > - break; > - > - default: > - > - AcpiOsPrintf (" %p", ObjDesc); > - break; > - } > -} > - > - > -/******************************************************************************* > - * > - * FUNCTION: AcpiDmDecodeNode > - * > - * PARAMETERS: Node - Object to be displayed > - * > - * RETURN: None > - * > - * DESCRIPTION: Short display of a namespace node > - * > - ******************************************************************************/ > - > -static void > -AcpiDmDecodeNode ( > - ACPI_NAMESPACE_NODE *Node) > -{ > - > - AcpiOsPrintf ("<Node> Name %4.4s", > - AcpiUtGetNodeName (Node)); > - > - if (Node->Flags & ANOBJ_METHOD_ARG) > - { > - AcpiOsPrintf (" [Method Arg]"); > - } > - if (Node->Flags & ANOBJ_METHOD_LOCAL) > - { > - AcpiOsPrintf (" [Method Local]"); > - } > - > - switch (Node->Type) > - { > - /* These types have no attached object */ > - > - case ACPI_TYPE_DEVICE: > - > - AcpiOsPrintf (" Device"); > - break; > - > - case ACPI_TYPE_THERMAL: > - > - AcpiOsPrintf (" Thermal Zone"); > - break; > - > - default: > - > - AcpiDmDecodeInternalObject (AcpiNsGetAttachedObject (Node)); > - break; > - } > -} > - > - > -/******************************************************************************* > - * > - * FUNCTION: AcpiDmDisplayInternalObject > - * > - * PARAMETERS: ObjDesc - Object to be displayed > - * WalkState - Current walk state > - * > - * RETURN: None > - * > - * DESCRIPTION: Short display of an internal object > - * > - ******************************************************************************/ > - > -void > -AcpiDmDisplayInternalObject ( > - ACPI_OPERAND_OBJECT *ObjDesc, > - ACPI_WALK_STATE *WalkState) > -{ > - UINT8 Type; > - > - > - AcpiOsPrintf ("%p ", ObjDesc); > - > - if (!ObjDesc) > - { > - AcpiOsPrintf ("<Null Object>\n"); > - return; > - } > - > - /* Decode the object type */ > - > - switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc)) > - { > - case ACPI_DESC_TYPE_PARSER: > - > - AcpiOsPrintf ("<Parser> "); > - break; > - > - case ACPI_DESC_TYPE_NAMED: > - > - AcpiDmDecodeNode ((ACPI_NAMESPACE_NODE *) ObjDesc); > - break; > - > - case ACPI_DESC_TYPE_OPERAND: > - > - Type = ObjDesc->Common.Type; > - if (Type > ACPI_TYPE_LOCAL_MAX) > - { > - AcpiOsPrintf (" Type %X [Invalid Type]", (UINT32) Type); > - return; > - } > - > - /* Decode the ACPI object type */ > - > - switch (ObjDesc->Common.Type) > - { > - case ACPI_TYPE_LOCAL_REFERENCE: > - > - AcpiOsPrintf ("[%s] ", AcpiUtGetReferenceName (ObjDesc)); > - > - /* Decode the refererence */ > - > - switch (ObjDesc->Reference.Class) > - { > - case ACPI_REFCLASS_LOCAL: > - > - AcpiOsPrintf ("%X ", ObjDesc->Reference.Value); > - if (WalkState) > - { > - ObjDesc = WalkState->LocalVariables > - [ObjDesc->Reference.Value].Object; > - AcpiOsPrintf ("%p", ObjDesc); > - AcpiDmDecodeInternalObject (ObjDesc); > - } > - break; > - > - case ACPI_REFCLASS_ARG: > - > - AcpiOsPrintf ("%X ", ObjDesc->Reference.Value); > - if (WalkState) > - { > - ObjDesc = WalkState->Arguments > - [ObjDesc->Reference.Value].Object; > - AcpiOsPrintf ("%p", ObjDesc); > - AcpiDmDecodeInternalObject (ObjDesc); > - } > - break; > - > - case ACPI_REFCLASS_INDEX: > - > - switch (ObjDesc->Reference.TargetType) > - { > - case ACPI_TYPE_BUFFER_FIELD: > - > - AcpiOsPrintf ("%p", ObjDesc->Reference.Object); > - AcpiDmDecodeInternalObject (ObjDesc->Reference.Object); > - break; > - > - case ACPI_TYPE_PACKAGE: > - > - AcpiOsPrintf ("%p", ObjDesc->Reference.Where); > - if (!ObjDesc->Reference.Where) > - { > - AcpiOsPrintf (" Uninitialized WHERE pointer"); > - } > - else > - { > - AcpiDmDecodeInternalObject ( > - *(ObjDesc->Reference.Where)); > - } > - break; > - > - default: > - > - AcpiOsPrintf ("Unknown index target type"); > - break; > - } > - break; > - > - case ACPI_REFCLASS_REFOF: > - > - if (!ObjDesc->Reference.Object) > - { > - AcpiOsPrintf ("Uninitialized reference subobject pointer"); > - break; > - } > - > - /* Reference can be to a Node or an Operand object */ > - > - switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc->Reference.Object)) > - { > - case ACPI_DESC_TYPE_NAMED: > - AcpiDmDecodeNode (ObjDesc->Reference.Object); > - break; > - > - case ACPI_DESC_TYPE_OPERAND: > - AcpiDmDecodeInternalObject (ObjDesc->Reference.Object); > - break; > - > - default: > - break; > - } > - break; > - > - case ACPI_REFCLASS_NAME: > - > - AcpiDmDecodeNode (ObjDesc->Reference.Node); > - break; > - > - case ACPI_REFCLASS_DEBUG: > - case ACPI_REFCLASS_TABLE: > - > - AcpiOsPrintf ("\n"); > - break; > - > - default: /* Unknown reference class */ > - > - AcpiOsPrintf ("%2.2X\n", ObjDesc->Reference.Class); > - break; > - } > - break; > - > - default: > - > - AcpiOsPrintf ("<Obj> "); > - AcpiDmDecodeInternalObject (ObjDesc); > - break; > - } > - break; > - > - default: > - > - AcpiOsPrintf ("<Not a valid ACPI Object Descriptor> [%s]", > - AcpiUtGetDescriptorName (ObjDesc)); > - break; > - } > - > - AcpiOsPrintf ("\n"); > -} > - > - > -/******************************************************************************* > - * > - * FUNCTION: AcpiDmDisplayLocals > - * > - * PARAMETERS: WalkState - State for current method > - * > - * RETURN: None > - * > - * DESCRIPTION: Display all locals for the currently running control method > - * > - ******************************************************************************/ > - > -void > -AcpiDmDisplayLocals ( > - ACPI_WALK_STATE *WalkState) > -{ > - UINT32 i; > - ACPI_OPERAND_OBJECT *ObjDesc; > - ACPI_NAMESPACE_NODE *Node; > - > - > - ObjDesc = WalkState->MethodDesc; > - Node = WalkState->MethodNode; > - if (!Node) > - { > - AcpiOsPrintf ( > - "No method node (Executing subtree for buffer or opregion)\n"); > - return; > - } > - > - if (Node->Type != ACPI_TYPE_METHOD) > - { > - AcpiOsPrintf ("Executing subtree for Buffer/Package/Region\n"); > - return; > - } > - > - AcpiOsPrintf ("Local Variables for method [%4.4s]:\n", > - AcpiUtGetNodeName (Node)); > - > - for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) > - { > - ObjDesc = WalkState->LocalVariables[i].Object; > - AcpiOsPrintf (" Local%X: ", i); > - AcpiDmDisplayInternalObject (ObjDesc, WalkState); > - } > -} > - > - > -/******************************************************************************* > - * > - * FUNCTION: AcpiDmDisplayArguments > - * > - * PARAMETERS: WalkState - State for current method > - * > - * RETURN: None > - * > - * DESCRIPTION: Display all arguments for the currently running control method > - * > - ******************************************************************************/ > - > -void > -AcpiDmDisplayArguments ( > - ACPI_WALK_STATE *WalkState) > -{ > - UINT32 i; > - ACPI_OPERAND_OBJECT *ObjDesc; > - ACPI_NAMESPACE_NODE *Node; > - > - > - ObjDesc = WalkState->MethodDesc; > - Node = WalkState->MethodNode; > - if (!Node) > - { > - AcpiOsPrintf ( > - "No method node (Executing subtree for buffer or opregion)\n"); > - return; > - } > - > - if (Node->Type != ACPI_TYPE_METHOD) > - { > - AcpiOsPrintf ("Executing subtree for Buffer/Package/Region\n"); > - return; > - } > - > - AcpiOsPrintf ( > - "Arguments for Method [%4.4s]: (%X arguments defined, max concurrency = %X)\n", > - AcpiUtGetNodeName (Node), ObjDesc->Method.ParamCount, ObjDesc->Method.SyncLevel); > - > - for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) > - { > - ObjDesc = WalkState->Arguments[i].Object; > - AcpiOsPrintf (" Arg%u: ", i); > - AcpiDmDisplayInternalObject (ObjDesc, WalkState); > - } > -} > - > -#endif > diff --git a/src/acpica/source/components/executer/exconvrt.c b/src/acpica/source/components/executer/exconvrt.c > index 0023668..019a490 100644 > --- a/src/acpica/source/components/executer/exconvrt.c > +++ b/src/acpica/source/components/executer/exconvrt.c > @@ -745,6 +745,7 @@ AcpiExConvertToTargetType ( > break; > > case ARGI_TARGETREF: > + case ARGI_STORE_TARGET: > > switch (DestinationType) > { > diff --git a/src/acpica/source/components/executer/exresolv.c b/src/acpica/source/components/executer/exresolv.c > index d32e842..a273a71 100644 > --- a/src/acpica/source/components/executer/exresolv.c > +++ b/src/acpica/source/components/executer/exresolv.c > @@ -297,7 +297,6 @@ AcpiExResolveObjectToValue ( > * (i.e., dereference the package index) > * Delete the ref object, increment the returned object > */ > - AcpiUtRemoveReference (StackDesc); > AcpiUtAddReference (ObjDesc); > *StackPtr = ObjDesc; > } > diff --git a/src/acpica/source/components/executer/exresop.c b/src/acpica/source/components/executer/exresop.c > index fab4993..3cfe472 100644 > --- a/src/acpica/source/components/executer/exresop.c > +++ b/src/acpica/source/components/executer/exresop.c > @@ -392,6 +392,8 @@ AcpiExResolveOperands ( > 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: > + > /* > * Need an operand of type ACPI_TYPE_LOCAL_REFERENCE > * A Namespace Node is OK as-is > diff --git a/src/acpica/source/components/executer/exstore.c b/src/acpica/source/components/executer/exstore.c > index 47c212d..cb6ebc0 100644 > --- a/src/acpica/source/components/executer/exstore.c > +++ b/src/acpica/source/components/executer/exstore.c > @@ -219,7 +219,7 @@ AcpiExStore ( > /* Destination is not a Reference object */ > > ACPI_ERROR ((AE_INFO, > - "Target is not a Reference or Constant object - %s [%p]", > + "Target is not a Reference or Constant object - [%s] %p", > AcpiUtGetObjectTypeName (DestDesc), DestDesc)); > > return_ACPI_STATUS (AE_AML_OPERAND_TYPE); > @@ -266,7 +266,7 @@ AcpiExStore ( > * displayed and otherwise has no effect -- see ACPI Specification > */ > ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, > - "**** Write to Debug Object: Object %p %s ****:\n\n", > + "**** Write to Debug Object: Object %p [%s] ****:\n\n", > SourceDesc, AcpiUtGetObjectTypeName (SourceDesc))); > > ACPI_DEBUG_OBJECT (SourceDesc, 0, 0); > @@ -428,7 +428,7 @@ AcpiExStoreObjectToIndex ( > /* All other types are invalid */ > > ACPI_ERROR ((AE_INFO, > - "Source must be Integer/Buffer/String type, not %s", > + "Source must be type [Integer/Buffer/String], found [%s]", > AcpiUtGetObjectTypeName (SourceDesc))); > return_ACPI_STATUS (AE_AML_OPERAND_TYPE); > } > @@ -440,8 +440,8 @@ AcpiExStoreObjectToIndex ( > > default: > ACPI_ERROR ((AE_INFO, > - "Target is not a Package or BufferField")); > - Status = AE_AML_OPERAND_TYPE; > + "Target is not of type [Package/BufferField]")); > + Status = AE_AML_TARGET_TYPE; > break; > } > > @@ -462,20 +462,20 @@ AcpiExStoreObjectToIndex ( > * > * DESCRIPTION: Store the object to the named object. > * > - * The Assignment of an object to a named object is handled here > - * The value passed in will replace the current value (if any) > - * with the input value. > + * The assignment of an object to a named object is handled here. > + * The value passed in will replace the current value (if any) > + * with the input value. > * > - * When storing into an object the data is converted to the > - * target object type then stored in the object. This means > - * that the target object type (for an initialized target) will > - * not be changed by a store operation. A CopyObject can change > - * the target type, however. > + * When storing into an object the data is converted to the > + * target object type then stored in the object. This means > + * that the target object type (for an initialized target) will > + * not be changed by a store operation. A CopyObject can change > + * the target type, however. > * > - * The ImplicitConversion flag is set to NO/FALSE only when > - * storing to an ArgX -- as per the rules of the ACPI spec. > + * The ImplicitConversion flag is set to NO/FALSE only when > + * storing to an ArgX -- as per the rules of the ACPI spec. > * > - * Assumes parameters are already validated. > + * Assumes parameters are already validated. > * > ******************************************************************************/ > > @@ -500,9 +500,74 @@ AcpiExStoreObjectToNode ( > TargetType = AcpiNsGetType (Node); > TargetDesc = AcpiNsGetAttachedObject (Node); > > - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p (%s) to node %p (%s)\n", > + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p [%s] to node %p [%s]\n", > SourceDesc, AcpiUtGetObjectTypeName (SourceDesc), > - Node, AcpiUtGetTypeName (TargetType))); > + Node, AcpiUtGetTypeName (TargetType))); > + > + /* Only limited target types possible for everything except CopyObject */ > + > + if (WalkState->Opcode != AML_COPY_OP) > + { > + /* > + * Only CopyObject allows all object types to be overwritten. For > + * TargetRef(s), there are restrictions on the object types that > + * are allowed. > + * > + * Allowable operations/typing for Store: > + * > + * 1) Simple Store > + * Integer --> Integer (Named/Local/Arg) > + * String --> String (Named/Local/Arg) > + * Buffer --> Buffer (Named/Local/Arg) > + * Package --> Package (Named/Local/Arg) > + * > + * 2) Store with implicit conversion > + * Integer --> String or Buffer (Named) > + * String --> Integer or Buffer (Named) > + * Buffer --> Integer or String (Named) > + */ > + switch (TargetType) > + { > + case ACPI_TYPE_PACKAGE: > + /* > + * Here, can only store a package to an existing package. > + * Storing a package to a Local/Arg is OK, and handled > + * elsewhere. > + */ > + if (WalkState->Opcode == AML_STORE_OP) > + { > + if (SourceDesc->Common.Type != ACPI_TYPE_PACKAGE) > + { > + ACPI_ERROR ((AE_INFO, > + "Cannot assign type [%s] to [Package] " > + "(source must be type Pkg)", > + AcpiUtGetObjectTypeName (SourceDesc))); > + > + return_ACPI_STATUS (AE_AML_TARGET_TYPE); > + } > + break; > + } > + > + /* Fallthrough */ > + > + case ACPI_TYPE_DEVICE: > + case ACPI_TYPE_EVENT: > + case ACPI_TYPE_MUTEX: > + case ACPI_TYPE_REGION: > + case ACPI_TYPE_POWER: > + case ACPI_TYPE_PROCESSOR: > + case ACPI_TYPE_THERMAL: > + > + ACPI_ERROR ((AE_INFO, > + "Target must be [Buffer/Integer/String/Reference], found [%s] (%4.4s)", > + AcpiUtGetTypeName (Node->Type), Node->Name.Ascii)); > + > + return_ACPI_STATUS (AE_AML_TARGET_TYPE); > + > + default: > + break; > + } > + } > > /* > * Resolve the source object to an actual value > @@ -518,13 +583,13 @@ AcpiExStoreObjectToNode ( > > switch (TargetType) > { > - case ACPI_TYPE_INTEGER: > - case ACPI_TYPE_STRING: > - case ACPI_TYPE_BUFFER: > /* > * The simple data types all support implicit source operand > * conversion before the store. > */ > + case ACPI_TYPE_INTEGER: > + case ACPI_TYPE_STRING: > + case ACPI_TYPE_BUFFER: > > if ((WalkState->Opcode == AML_COPY_OP) || > !ImplicitConversion) > @@ -563,7 +628,7 @@ AcpiExStoreObjectToNode ( > NewDesc->Common.Type); > > ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, > - "Store %s into %s via Convert/Attach\n", > + "Store type [%s] into [%s] via Convert/Attach\n", > AcpiUtGetObjectTypeName (SourceDesc), > AcpiUtGetObjectTypeName (NewDesc))); > } > @@ -585,15 +650,12 @@ AcpiExStoreObjectToNode ( > > default: > /* > - * No conversions for all other types. Directly store a copy of > - * the source object. This is the ACPI spec-defined behavior for > - * the CopyObject operator. > + * CopyObject operator: No conversions for all other types. > + * Instead, directly store a copy of the source object. > * > - * NOTE: For the Store operator, this is a departure from the > - * ACPI spec, which states "If conversion is impossible, abort > - * the running control method". Instead, this code implements > - * "If conversion is impossible, treat the Store operation as > - * a CopyObject". > + * This is the ACPI spec-defined behavior for the CopyObject > + * operator. (Note, for this default case, all normal > + * Store/Target operations exited above with an error). > */ > Status = AcpiExStoreDirectToNode (SourceDesc, Node, > WalkState); > diff --git a/src/acpica/source/components/executer/exstoren.c b/src/acpica/source/components/executer/exstoren.c > index c1879b4..6a1be4c 100644 > --- a/src/acpica/source/components/executer/exstoren.c > +++ b/src/acpica/source/components/executer/exstoren.c > @@ -201,9 +201,10 @@ AcpiExResolveObject ( > /* Conversion successful but still not a valid type */ > > ACPI_ERROR ((AE_INFO, > - "Cannot assign type %s to %s (must be type Int/Str/Buf)", > + "Cannot assign type [%s] to [%s] (must be type Int/Str/Buf)", > AcpiUtGetObjectTypeName (SourceDesc), > AcpiUtGetTypeName (TargetType))); > + > Status = AE_AML_OPERAND_TYPE; > } > break; > @@ -356,7 +357,7 @@ AcpiExStoreObjectToObject ( > /* > * All other types come here. > */ > - ACPI_WARNING ((AE_INFO, "Store into type %s not implemented", > + ACPI_WARNING ((AE_INFO, "Store into type [%s] not implemented", > AcpiUtGetObjectTypeName (DestDesc))); > > Status = AE_NOT_IMPLEMENTED; > diff --git a/src/acpica/source/components/namespace/nspredef.c b/src/acpica/source/components/namespace/nspredef.c > index 8a522d2..85793f9 100644 > --- a/src/acpica/source/components/namespace/nspredef.c > +++ b/src/acpica/source/components/namespace/nspredef.c > @@ -321,7 +321,7 @@ AcpiNsCheckObjectType ( > { > ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; > ACPI_STATUS Status = AE_OK; > - char TypeBuffer[48]; /* Room for 5 types */ > + char TypeBuffer[96]; /* Room for 10 types */ > > > /* A Namespace node should not get here, but make sure */ > diff --git a/src/acpica/source/components/utilities/utdecode.c b/src/acpica/source/components/utilities/utdecode.c > index eb0dc9f..99468d5 100644 > --- a/src/acpica/source/components/utilities/utdecode.c > +++ b/src/acpica/source/components/utilities/utdecode.c > @@ -333,13 +333,29 @@ char * > AcpiUtGetObjectTypeName ( > ACPI_OPERAND_OBJECT *ObjDesc) > { > + ACPI_FUNCTION_TRACE (UtGetObjectTypeName); > + > > if (!ObjDesc) > { > - return ("[NULL Object Descriptor]"); > + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Null Object Descriptor\n")); > + return_PTR ("[NULL Object Descriptor]"); > + } > + > + /* These descriptor types share a common area */ > + > + if ((ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) && > + (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_NAMED)) > + { > + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, > + "Invalid object descriptor type: 0x%2.2X [%s] (%p)\n", > + ACPI_GET_DESCRIPTOR_TYPE (ObjDesc), > + AcpiUtGetDescriptorName (ObjDesc), ObjDesc)); > + > + return_PTR ("Invalid object"); > } > > - return (AcpiUtGetTypeName (ObjDesc->Common.Type)); > + return_PTR (AcpiUtGetTypeName (ObjDesc->Common.Type)); > } > > > @@ -533,8 +549,6 @@ static char *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] = > "ACPI_MTX_Events", > "ACPI_MTX_Caches", > "ACPI_MTX_Memory", > - "ACPI_MTX_CommandComplete", > - "ACPI_MTX_CommandReady" > }; > > char * > diff --git a/src/acpica/source/components/utilities/utfileio.c b/src/acpica/source/components/utilities/utfileio.c > index 7d6c225..756c14b 100644 > --- a/src/acpica/source/components/utilities/utfileio.c > +++ b/src/acpica/source/components/utilities/utfileio.c > @@ -117,6 +117,7 @@ > #include "accommon.h" > #include "actables.h" > #include "acapps.h" > +#include "errno.h" > > #ifdef ACPI_ASL_COMPILER > #include "aslcompiler.h" > @@ -402,6 +403,12 @@ AcpiUtReadTableFromFile ( > if (!File) > { > perror ("Could not open input file"); > + > + if (errno == ENOENT) > + { > + return (AE_NOT_EXIST); > + } > + > return (Status); > } > > diff --git a/src/acpica/source/components/utilities/utmutex.c b/src/acpica/source/components/utilities/utmutex.c > index f5b864f..0fa4c36 100644 > --- a/src/acpica/source/components/utilities/utmutex.c > +++ b/src/acpica/source/components/utilities/utmutex.c > @@ -196,6 +196,24 @@ AcpiUtMutexInitialize ( > /* Create the reader/writer lock for namespace access */ > > Status = AcpiUtCreateRwLock (&AcpiGbl_NamespaceRwLock); > + if (ACPI_FAILURE (Status)) > + { > + return_ACPI_STATUS (Status); > + } > + > +#ifdef ACPI_DEBUGGER > + > + /* Debugger Support */ > + > + Status = AcpiOsCreateMutex (&AcpiGbl_DbCommandReady); > + if (ACPI_FAILURE (Status)) > + { > + return_ACPI_STATUS (Status); > + } > + > + Status = AcpiOsCreateMutex (&AcpiGbl_DbCommandComplete); > +#endif > + > return_ACPI_STATUS (Status); > } > > @@ -241,6 +259,12 @@ AcpiUtMutexTerminate ( > /* Delete the reader/writer lock */ > > AcpiUtDeleteRwLock (&AcpiGbl_NamespaceRwLock); > + > +#ifdef ACPI_DEBUGGER > + AcpiOsDeleteMutex (AcpiGbl_DbCommandReady); > + AcpiOsDeleteMutex (AcpiGbl_DbCommandComplete); > +#endif > + > return_VOID; > } > > diff --git a/src/acpica/source/include/acapps.h b/src/acpica/source/include/acapps.h > index 1153642..1c2004d 100644 > --- a/src/acpica/source/include/acapps.h > +++ b/src/acpica/source/include/acapps.h > @@ -166,7 +166,7 @@ > > > #define FILE_SUFFIX_DISASSEMBLY "dsl" > -#define ACPI_TABLE_FILE_SUFFIX ".dat" > +#define FILE_SUFFIX_BINARY_TABLE ".dat" /* Needs the dot */ > > > /* > diff --git a/src/acpica/source/include/acexcep.h b/src/acpica/source/include/acexcep.h > index cf89df2..ca09e6b 100644 > --- a/src/acpica/source/include/acexcep.h > +++ b/src/acpica/source/include/acexcep.h > @@ -270,8 +270,9 @@ typedef struct acpi_exception_info > #define AE_AML_ILLEGAL_ADDRESS EXCEP_AML (0x0020) > #define AE_AML_INFINITE_LOOP EXCEP_AML (0x0021) > #define AE_AML_UNINITIALIZED_NODE EXCEP_AML (0x0022) > +#define AE_AML_TARGET_TYPE EXCEP_AML (0x0023) > > -#define AE_CODE_AML_MAX 0x0022 > +#define AE_CODE_AML_MAX 0x0023 > > > /* > @@ -396,7 +397,8 @@ static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Aml[] = > EXCEP_TXT ("AE_AML_BAD_RESOURCE_LENGTH", "The length of a Resource Descriptor in the AML is incorrect"), > EXCEP_TXT ("AE_AML_ILLEGAL_ADDRESS", "A memory, I/O, or PCI configuration address is invalid"), > EXCEP_TXT ("AE_AML_INFINITE_LOOP", "An apparent infinite AML While loop, method was aborted"), > - EXCEP_TXT ("AE_AML_UNINITIALIZED_NODE", "A namespace node is uninitialized or unresolved") > + EXCEP_TXT ("AE_AML_UNINITIALIZED_NODE", "A namespace node is uninitialized or unresolved"), > + EXCEP_TXT ("AE_AML_TARGET_TYPE", "A target operand of an incorrect type was encountered") > }; > > static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Ctrl[] = > diff --git a/src/acpica/source/include/acglobal.h b/src/acpica/source/include/acglobal.h > index d9ef98c..2733f39 100644 > --- a/src/acpica/source/include/acglobal.h > +++ b/src/acpica/source/include/acglobal.h > @@ -389,7 +389,6 @@ ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnoreNoopOperator, FALSE); > ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CstyleDisassembly, TRUE); > ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ForceAmlDisassembly, FALSE); > ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Verbose, TRUE); > -//ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Verbose, FALSE); OK > > ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Disasm); > ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Listing); > @@ -434,6 +433,9 @@ ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCountMisc); > ACPI_GLOBAL (UINT32, AcpiGbl_NumNodes); > ACPI_GLOBAL (UINT32, AcpiGbl_NumObjects); > > +ACPI_GLOBAL (ACPI_MUTEX, AcpiGbl_DbCommandReady); > +ACPI_GLOBAL (ACPI_MUTEX, AcpiGbl_DbCommandComplete); > + > #endif /* ACPI_DEBUGGER */ > > > diff --git a/src/acpica/source/include/aclocal.h b/src/acpica/source/include/aclocal.h > index 58f2320..fdeafff 100644 > --- a/src/acpica/source/include/aclocal.h > +++ b/src/acpica/source/include/aclocal.h > @@ -159,10 +159,8 @@ union acpi_parse_object; > #define ACPI_MTX_EVENTS 3 /* Data for ACPI events */ > #define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */ > #define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */ > -#define ACPI_MTX_DEBUG_CMD_COMPLETE 6 /* AML debugger */ > -#define ACPI_MTX_DEBUG_CMD_READY 7 /* AML debugger */ > > -#define ACPI_MAX_MUTEX 7 > +#define ACPI_MAX_MUTEX 5 > #define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1 > > > @@ -400,13 +398,17 @@ ACPI_STATUS (*ACPI_INTERNAL_METHOD) ( > #define ACPI_BTYPE_BUFFER_FIELD 0x00002000 > #define ACPI_BTYPE_DDB_HANDLE 0x00004000 > #define ACPI_BTYPE_DEBUG_OBJECT 0x00008000 > -#define ACPI_BTYPE_REFERENCE 0x00010000 > +#define ACPI_BTYPE_REFERENCE_OBJECT 0x00010000 /* From Index(), RefOf(), etc (Type6Opcodes) */ > #define ACPI_BTYPE_RESOURCE 0x00020000 > +#define ACPI_BTYPE_NAMED_REFERENCE 0x00040000 /* Generic unresolved Name or Namepath */ > > #define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER) > > #define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE) > -#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE) > + > + /* Used by Copy, DeRefOf, Store, Printf, Fprintf */ > + > +#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE_OBJECT | ACPI_BTYPE_DDB_HANDLE) > #define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR) > #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ > #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF > @@ -1089,7 +1091,7 @@ typedef struct acpi_parse_state > #define ACPI_PARSEOP_PARAMLIST 0x02 > #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 > #define ACPI_PARSEOP_PREDEF_CHECKED 0x08 > -#define ACPI_PARSEOP_SPECIAL 0x10 > +#define ACPI_PARSEOP_CLOSING_PAREN 0x10 > #define ACPI_PARSEOP_COMPOUND 0x20 > #define ACPI_PARSEOP_ASSIGNMENT 0x40 > > diff --git a/src/acpica/source/include/acopcode.h b/src/acpica/source/include/acopcode.h > index 133e134..50bac80 100644 > --- a/src/acpica/source/include/acopcode.h > +++ b/src/acpica/source/include/acopcode.h > @@ -285,7 +285,7 @@ > #define ARGI_ARG4 ARG_NONE > #define ARGI_ARG5 ARG_NONE > #define ARGI_ARG6 ARG_NONE > -#define ARGI_BANK_FIELD_OP ARGI_INVALID_OPCODE > +#define ARGI_BANK_FIELD_OP ARGI_LIST1 (ARGI_INTEGER) > #define ARGI_BIT_AND_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) > #define ARGI_BIT_NAND_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) > #define ARGI_BIT_NOR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) > @@ -381,7 +381,7 @@ > #define ARGI_SLEEP_OP ARGI_LIST1 (ARGI_INTEGER) > #define ARGI_STALL_OP ARGI_LIST1 (ARGI_INTEGER) > #define ARGI_STATICSTRING_OP ARGI_INVALID_OPCODE > -#define ARGI_STORE_OP ARGI_LIST2 (ARGI_DATAREFOBJ, ARGI_TARGETREF) > +#define ARGI_STORE_OP ARGI_LIST2 (ARGI_DATAREFOBJ, ARGI_STORE_TARGET) > #define ARGI_STRING_OP ARGI_INVALID_OPCODE > #define ARGI_SUBTRACT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) > #define ARGI_THERMAL_ZONE_OP ARGI_INVALID_OPCODE > diff --git a/src/acpica/source/include/acpixf.h b/src/acpica/source/include/acpixf.h > index e0cd0d0..55412c8 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 0x20150818 > +#define ACPI_CA_VERSION 0x20150930 > > #include "acconfig.h" > #include "actypes.h" > diff --git a/src/acpica/source/include/actbl1.h b/src/acpica/source/include/actbl1.h > index f7eaa4c..dd00f20 100644 > --- a/src/acpica/source/include/actbl1.h > +++ b/src/acpica/source/include/actbl1.h > @@ -1256,7 +1256,7 @@ typedef struct acpi_nfit_memory_map > #define ACPI_NFIT_MEM_SAVE_FAILED (1) /* 00: Last SAVE to Memory Device failed */ > #define ACPI_NFIT_MEM_RESTORE_FAILED (1<<1) /* 01: Last RESTORE from Memory Device failed */ > #define ACPI_NFIT_MEM_FLUSH_FAILED (1<<2) /* 02: Platform flush failed */ > -#define ACPI_NFIT_MEM_ARMED (1<<3) /* 03: Memory Device observed to be not armed */ > +#define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed */ > #define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */ > #define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */ > > diff --git a/src/acpica/source/include/amlcode.h b/src/acpica/source/include/amlcode.h > index 34ac987..6940b7a 100644 > --- a/src/acpica/source/include/amlcode.h > +++ b/src/acpica/source/include/amlcode.h > @@ -352,14 +352,15 @@ > #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 */ > > /* Multiple/complex types */ > > -#define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by SizeOf operator*/ > -#define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */ > -#define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */ > -#define ARGI_REGION_OR_BUFFER 0x15 /* Used by LOAD op only */ > -#define ARGI_DATAREFOBJ 0x16 > +#define ARGI_DATAOBJECT 0x13 /* Buffer, String, package or reference to a Node - Used only by SizeOf operator*/ > +#define ARGI_COMPLEXOBJ 0x14 /* Buffer, String, or package (Used by INDEX op only) */ > +#define ARGI_REF_OR_STRING 0x15 /* Reference or String (Used by DEREFOF op only) */ > +#define ARGI_REGION_OR_BUFFER 0x16 /* Used by LOAD op only */ > +#define ARGI_DATAREFOBJ 0x17 > > /* Note: types above can expand to 0x1F maximum */ > > diff --git a/src/acpica/source/include/platform/acenv.h b/src/acpica/source/include/platform/acenv.h > index 614a538..d393af2 100644 > --- a/src/acpica/source/include/platform/acenv.h > +++ b/src/acpica/source/include/platform/acenv.h > @@ -369,6 +369,7 @@ > #define ACPI_INTERNAL_VAR_XFACE > #endif > > + > /* > * Debugger threading model > * Use single threaded if the entire subsystem is contained in an application > @@ -378,11 +379,11 @@ > * multi-threaded if ACPI_APPLICATION is not set. > */ > #ifndef DEBUGGER_THREADING > -#ifdef ACPI_APPLICATION > -#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED > +#if !defined (ACPI_APPLICATION) || defined (ACPI_EXEC_APP) > +#define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED > > #else > -#define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED > +#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED > #endif > #endif /* !DEBUGGER_THREADING */ > > diff --git a/src/acpica/source/tools/acpiexec/aehandlers.c b/src/acpica/source/tools/acpiexec/aehandlers.c > index c4eb02a..97ea103 100644 > --- a/src/acpica/source/tools/acpiexec/aehandlers.c > +++ b/src/acpica/source/tools/acpiexec/aehandlers.c > @@ -490,7 +490,7 @@ AeExceptionHandler ( > > if (NewAmlStatus != AmlStatus) > { > - AcpiOsPrintf ("[AcpiExec] Exception override, new status %s\n", > + AcpiOsPrintf ("[AcpiExec] Exception override, new status %s\n\n", > AcpiFormatException (NewAmlStatus)); > } > > Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff --git a/src/acpica/Makefile.am b/src/acpica/Makefile.am index 24e1f70..4fd897a 100644 --- a/src/acpica/Makefile.am +++ b/src/acpica/Makefile.am @@ -85,7 +85,6 @@ libfwtsacpica_la_SOURCES = \ source/components/disassembler/dmbuffer.c \ source/components/disassembler/dmcstyle.c \ source/components/disassembler/dmnames.c \ - source/components/disassembler/dmobject.c \ source/components/disassembler/dmopcode.c \ source/components/disassembler/dmresrc.c \ source/components/disassembler/dmresrcl.c \ diff --git a/src/acpica/source/common/adfile.c b/src/acpica/source/common/adfile.c index 96a2f25..3ba4a57 100644 --- a/src/acpica/source/common/adfile.c +++ b/src/acpica/source/common/adfile.c @@ -171,7 +171,7 @@ AdGenerateFilename ( } FilenameBuf[i] = 0; - strcat (FilenameBuf, ACPI_TABLE_FILE_SUFFIX); + strcat (FilenameBuf, FILE_SUFFIX_BINARY_TABLE); return (FilenameBuf); } diff --git a/src/acpica/source/compiler/Makefile.am b/src/acpica/source/compiler/Makefile.am index 398d2a4..f0c48b1 100644 --- a/src/acpica/source/compiler/Makefile.am +++ b/src/acpica/source/compiler/Makefile.am @@ -214,7 +214,6 @@ libfwtsiasl_la_SOURCES = \ ../components/disassembler/dmcstyle.c \ ../components/disassembler/dmnames.c \ ../components/disassembler/dmopcode.c \ - ../components/disassembler/dmobject.c \ ../components/disassembler/dmresrc.c \ ../components/disassembler/dmresrcl.c \ ../components/disassembler/dmresrcs.c \ diff --git a/src/acpica/source/compiler/aslbtypes.c b/src/acpica/source/compiler/aslbtypes.c index 817ecb6..96f234a 100644 --- a/src/acpica/source/compiler/aslbtypes.c +++ b/src/acpica/source/compiler/aslbtypes.c @@ -172,9 +172,10 @@ AnMapArgTypeToBtype ( case ARGI_DDBHANDLE: /* * DDBHandleObject := SuperName - * ACPI_BTYPE_REFERENCE: Index reference as parameter of Load/Unload + * ACPI_BTYPE_REFERENCE_OBJECT: + * Index reference as parameter of Load/Unload */ - return (ACPI_BTYPE_DDB_HANDLE | ACPI_BTYPE_REFERENCE); + return (ACPI_BTYPE_DDB_HANDLE | ACPI_BTYPE_REFERENCE_OBJECT); /* Interchangeable types */ /* @@ -205,9 +206,24 @@ AnMapArgTypeToBtype ( case ARGI_REFERENCE: - return (ACPI_BTYPE_REFERENCE); + return (ACPI_BTYPE_NAMED_REFERENCE); /* Name or Namestring */ case ARGI_TARGETREF: + + /* + * Target operand for most math and logic operators. + * Package objects not allowed as target. + */ + return (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_DEBUG_OBJECT | + ACPI_BTYPE_REFERENCE_OBJECT); + + case ARGI_STORE_TARGET: + + /* Special target for Store(), includes packages */ + + return (ACPI_BTYPE_DATA | ACPI_BTYPE_DEBUG_OBJECT | + ACPI_BTYPE_REFERENCE_OBJECT); + case ARGI_FIXED_TARGET: case ARGI_SIMPLE_TARGET: @@ -221,28 +237,33 @@ AnMapArgTypeToBtype ( * Used only by SizeOf operator */ return (ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER | - ACPI_BTYPE_PACKAGE | ACPI_BTYPE_REFERENCE); + ACPI_BTYPE_PACKAGE | ACPI_BTYPE_REFERENCE_OBJECT); case ARGI_COMPLEXOBJ: /* Buffer, String, or package */ - return (ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER | ACPI_BTYPE_PACKAGE); + return (ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER | + ACPI_BTYPE_PACKAGE); case ARGI_REF_OR_STRING: - return (ACPI_BTYPE_STRING | ACPI_BTYPE_REFERENCE); + /* Used by DeRefOf operator only */ + + return (ACPI_BTYPE_STRING | ACPI_BTYPE_REFERENCE_OBJECT); case ARGI_REGION_OR_BUFFER: /* Used by Load() only. Allow buffers in addition to regions/fields */ - return (ACPI_BTYPE_REGION | ACPI_BTYPE_BUFFER | ACPI_BTYPE_FIELD_UNIT); + return (ACPI_BTYPE_REGION | ACPI_BTYPE_BUFFER | + ACPI_BTYPE_FIELD_UNIT); case ARGI_DATAREFOBJ: - return (ACPI_BTYPE_INTEGER |ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER | - ACPI_BTYPE_PACKAGE | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE); + /* Used by Store() only, as the source operand */ + + return (ACPI_BTYPE_DATA_REFERENCE | ACPI_BTYPE_REFERENCE_OBJECT); default: @@ -346,7 +367,7 @@ AnMapEtypeToBtype ( case ACPI_TYPE_LOCAL_RESOURCE: case ACPI_TYPE_LOCAL_RESOURCE_FIELD: - return (ACPI_BTYPE_REFERENCE); + return (ACPI_BTYPE_REFERENCE_OBJECT); default: @@ -473,12 +494,6 @@ AnGetBtype ( "could not map type"); } - /* - * Since it was a named reference, enable the - * reference bit also - */ - ThisNodeBtype |= ACPI_BTYPE_REFERENCE; - if (Op->Asl.ParseOpcode == PARSEOP_METHODCALL) { ReferencedNode = Node->Op; @@ -514,7 +529,6 @@ AnGetBtype ( return (ThisNodeBtype); } - /******************************************************************************* * * FUNCTION: AnMapObjTypeToBtype diff --git a/src/acpica/source/compiler/aslcompile.c b/src/acpica/source/compiler/aslcompile.c index 5a0379d..c76178c 100644 --- a/src/acpica/source/compiler/aslcompile.c +++ b/src/acpica/source/compiler/aslcompile.c @@ -374,8 +374,11 @@ CmDoCompile ( Event = UtBeginEvent ("Analyze AML operand types"); DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Operand type checking\n\n"); - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, - NULL, AnOperandTypecheckWalkEnd, &AnalysisWalkInfo); + if (Gbl_DoTypechecking) + { + TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, + NULL, AnOperandTypecheckWalkEnd, &AnalysisWalkInfo); + } UtEndEvent (Event); /* Semantic error checking part four - other miscellaneous checks */ diff --git a/src/acpica/source/compiler/aslcompiler.l b/src/acpica/source/compiler/aslcompiler.l index 41ff855..0fc3535 100644 --- a/src/acpica/source/compiler/aslcompiler.l +++ b/src/acpica/source/compiler/aslcompiler.l @@ -228,6 +228,9 @@ 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); } + /* * Begin standard ASL grammar diff --git a/src/acpica/source/compiler/aslcompiler.y b/src/acpica/source/compiler/aslcompiler.y index f1365ec..20b728a 100644 --- a/src/acpica/source/compiler/aslcompiler.y +++ b/src/acpica/source/compiler/aslcompiler.y @@ -594,8 +594,14 @@ AslLocalAllocate ( %left <i> PARSEOP_EXP_INCREMENT PARSEOP_EXP_DECREMENT +/* Brackets for Index() support */ + +%left <i> PARSEOP_EXP_INDEX_LEFT +%right <i> PARSEOP_EXP_INDEX_RIGHT + %token <i> PARSEOP_PRINTF %token <i> PARSEOP_FPRINTF + /* Specific parentheses tokens are not used at this time */ /* PARSEOP_EXP_PAREN_OPEN */ /* PARSEOP_EXP_PAREN_CLOSE */ @@ -706,7 +712,7 @@ AslLocalAllocate ( %type <n> DefaultTerm %type <n> ElseTerm %type <n> FatalTerm -%type <n> IfElseTerm +%type <n> ElseIfTerm %type <n> IfTerm %type <n> LoadTerm %type <n> NoOpTerm @@ -758,6 +764,7 @@ AslLocalAllocate ( %type <n> NotTerm %type <n> ObjectTypeTerm %type <n> OrTerm +%type <n> RawDataBufferTerm %type <n> RefOfTerm %type <n> ShiftLeftTerm %type <n> ShiftRightTerm @@ -867,7 +874,6 @@ AslLocalAllocate ( /* Resource Descriptors */ %type <n> ConnectionTerm -%type <n> DataBufferTerm %type <n> DMATerm %type <n> DWordIOTerm %type <n> DWordMemoryTerm @@ -961,6 +967,7 @@ AslLocalAllocate ( */ %type <n> Expression %type <n> EqualsTerm +%type <n> IndexExpTerm %% @@ -970,14 +977,12 @@ AslLocalAllocate ( /******************************************************************************* * - * Production rules start here + * ASL Root and Secondary Terms * ******************************************************************************/ /* - * ASL Names - * - * Root rule. Allow multiple #line directives before the definition block + * Root term. Allow multiple #line directives before the definition block * to handle output from preprocessors */ ASLCode @@ -986,10 +991,6 @@ ASLCode ; /* - * Blocks, Data, and Opcodes - */ - -/* * Note concerning support for "module-level code". * * ACPI 1.0 allowed Type1 and Type2 executable opcodes outside of control @@ -1016,150 +1017,167 @@ DefinitionBlockTerm '{' TermList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$6,$8,$10,$12,$14,$18);} ; - /* - * ASL Extensions: C-style math/logical operators and expressions. - * The implementation transforms these operators into the standard - * AML opcodes and syntax. - * - * Supported operators and precedence rules (high-to-low) - * - * NOTE: The operator precedence and associativity rules are - * implemented by the tokens in asltokens.y - * - * (left-to-right): - * 1) ( ) expr++ expr-- - * - * (right-to-left): - * 2) ! ~ - * - * (left-to-right): - * 3) * / % - * 4) + - - * 5) >> << - * 6) < > <= >= - * 7) == != - * 8) & - * 9) ^ - * 10) | - * 11) && - * 12) || - * - * (right-to-left): - * 13) = += -= *= /= %= <<= >>= &= ^= |= - */ -Expression +SuperName + : NameString {} + | ArgTerm {} + | LocalTerm {} + | DebugTerm {} + | Type6Opcode {} - /* Unary operators */ +Target + : {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ + | ',' {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ + | ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} + ; - : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} - TermArg {$$ = TrLinkChildren ($<n>2,1,$3);} - | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} - TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateNullTarget ());} +TermArg + : 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);} + ; - | SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} - {$$ = TrLinkChildren ($<n>3,1,$1);} - | SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} - {$$ = TrLinkChildren ($<n>3,1,$1);} +/* + NOTE: Removed from TermArg due to reduce/reduce conflicts: + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} + | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} + | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} + | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - /* Binary operators: math and logical */ +*/ - | TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} - TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), - TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} +MethodInvocationTerm + : NameString '(' {TrUpdateNode (PARSEOP_METHODCALL, $1);} + ArgList ')' {$$ = TrLinkChildNode ($1,$4);} + ; - | TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} +/* OptionalCount must appear before ByteList or an incorrect reduction will result */ - | TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - | TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - | TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - | TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} +OptionalCount + : {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ + | ',' {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ + | ',' TermArg {$$ = $2;} + ; - | TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} +VarPackageLengthTerm + : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} + | TermArg {$$ = $1;} + ; - | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - /* Parentheses */ +/******* List Terms **************************************************/ - | '(' TermArg ')' { $$ = $2;} +ArgList + : {$$ = NULL;} + | TermArg + | ArgList ',' /* Allows a trailing comma at list end */ + | ArgList ',' + TermArg {$$ = TrLinkPeerNode ($1,$3);} ; -EqualsTerm +ByteList + : {$$ = NULL;} + | ByteConstExpr + | ByteList ',' /* Allows a trailing comma at list end */ + | ByteList ',' + ByteConstExpr {$$ = TrLinkPeerNode ($1,$3);} + ; - /* All assignment-type operations */ +DWordList + : {$$ = NULL;} + | DWordConstExpr + | DWordList ',' /* Allows a trailing comma at list end */ + | DWordList ',' + DWordConstExpr {$$ = TrLinkPeerNode ($1,$3);} + ; - : SuperName PARSEOP_EXP_EQUALS - TermArg {$$ = TrCreateAssignmentNode ($1, $3);} +FieldUnitList + : {$$ = NULL;} + | FieldUnit + | FieldUnitList ',' /* Allows a trailing comma at list end */ + | FieldUnitList ',' + FieldUnit {$$ = TrLinkPeerNode ($1,$3);} + ; - | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} +FieldUnit + : FieldUnitEntry {} + | OffsetTerm {} + | AccessAsTerm {} + | ConnectionTerm {} + ; - | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} - TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} +FieldUnitEntry + : ',' AmlPackageLengthTerm {$$ = TrCreateNode (PARSEOP_RESERVED_BYTES,1,$2);} + | NameSeg ',' + AmlPackageLengthTerm {$$ = TrLinkChildNode ($1,$3);} + ; - | TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} +ObjectList + : {$$ = NULL;} + | ObjectList Object {$$ = TrLinkPeerNode ($1,$2);} + | error {$$ = AslDoError(); yyclearin;} + ; - | TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} +Object + : CompilerDirective {} + | NamedObject {} + | NameSpaceModifier {} + ; - | TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} +PackageList + : {$$ = NULL;} + | PackageElement + | PackageList ',' /* Allows a trailing comma at list end */ + | PackageList ',' + PackageElement {$$ = TrLinkPeerNode ($1,$3);} + ; - | TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} +PackageElement + : DataObject {} + | NameString {} + ; - | TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + /* Rules for specifying the type of one method argument or return value */ - | TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} +ParameterTypePackage + : {$$ = NULL;} + | ObjectTypeKeyword {$$ = $1;} + | ParameterTypePackage ',' + ObjectTypeKeyword {$$ = TrLinkPeerNodes (2,$1,$3);} + ; - | TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} +ParameterTypePackageList + : {$$ = NULL;} + | ObjectTypeKeyword {$$ = $1;} + | '{' ParameterTypePackage '}' {$$ = $2;} + ; - | TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} +OptionalParameterTypePackage + : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} + | ',' ParameterTypePackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} + ; + + /* Rules for specifying the types for method arguments */ + +ParameterTypesPackage + : ParameterTypePackageList {$$ = $1;} + | ParameterTypesPackage ',' + ParameterTypePackageList {$$ = TrLinkPeerNodes (2,$1,$3);} + ; + +ParameterTypesPackageList + : {$$ = NULL;} + | ObjectTypeKeyword {$$ = $1;} + | '{' ParameterTypesPackage '}' {$$ = $2;} ; +OptionalParameterTypesPackage + : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} + | ',' ParameterTypesPackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} + ; -/* ACPI 3.0 -- allow semicolons between terms */ + /* ACPI 3.0 -- allow semicolons between terms */ TermList : {$$ = NULL;} @@ -1180,22 +1198,44 @@ Term | error {$$ = AslDoError(); yyclearin;} ; -CompilerDirective - : IncludeTerm {} - | ExternalTerm {} - ; +/* + * Case-Default list; allow only one Default term and unlimited Case terms + */ +CaseDefaultTermList + : {$$ = NULL;} + | CaseTerm {} + | DefaultTerm {} + | CaseDefaultTermList + CaseTerm {$$ = TrLinkPeerNode ($1,$2);} + | CaseDefaultTermList + DefaultTerm {$$ = TrLinkPeerNode ($1,$2);} -ObjectList +/* Original - attempts to force zero or one default term within the switch */ + +/* +CaseDefaultTermList : {$$ = NULL;} - | ObjectList Object {$$ = TrLinkPeerNode ($1,$2);} - | error {$$ = AslDoError(); yyclearin;} + | CaseTermList + DefaultTerm + CaseTermList {$$ = TrLinkPeerNode ($1,TrLinkPeerNode ($2, $3));} + | CaseTermList + CaseTerm {$$ = TrLinkPeerNode ($1,$2);} ; -Object - : CompilerDirective {} - | NamedObject {} - | NameSpaceModifier {} +CaseTermList + : {$$ = NULL;} + | CaseTerm {} + | CaseTermList + CaseTerm {$$ = TrLinkPeerNode ($1,$2);} ; +*/ + + +/******************************************************************************* + * + * ASL Data and Constant Terms + * + ******************************************************************************/ DataObject : BufferData {} @@ -1227,6 +1267,93 @@ StringData | String {} ; +ByteConst + : Integer {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} + ; + +WordConst + : Integer {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} + ; + +DWordConst + : Integer {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} + ; + +QWordConst + : Integer {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} + ; + +/* + * The NODE_COMPILE_TIME_CONST flag in the following constant expressions + * enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes + * to simple integers. It is an error if these types of expressions cannot be + * reduced, since the AML grammar for ****ConstExpr requires a simple constant. + * Note: The required byte length of the constant is passed through to the + * constant folding code in the node AmlLength field. + */ +ByteConstExpr + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} + | ByteConst {} + ; + +WordConstExpr + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} + | WordConst {} + ; + +DWordConstExpr + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} + | DWordConst {} + ; + +QWordConstExpr + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} + | QWordConst {} + ; + +ConstTerm + : ConstExprTerm {} + | PARSEOP_REVISION {$$ = TrCreateLeafNode (PARSEOP_REVISION);} + ; + +ConstExprTerm + : PARSEOP_ZERO {$$ = TrCreateValuedLeafNode (PARSEOP_ZERO, 0);} + | PARSEOP_ONE {$$ = TrCreateValuedLeafNode (PARSEOP_ONE, 1);} + | PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_UINT64_MAX);} + | PARSEOP___DATE__ {$$ = TrCreateConstantLeafNode (PARSEOP___DATE__);} + | PARSEOP___FILE__ {$$ = TrCreateConstantLeafNode (PARSEOP___FILE__);} + | PARSEOP___LINE__ {$$ = TrCreateConstantLeafNode (PARSEOP___LINE__);} + | PARSEOP___PATH__ {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);} + ; + +Integer + : PARSEOP_INTEGER {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, AslCompilerlval.i);} + ; + +String + : PARSEOP_STRING_LITERAL {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, (ACPI_NATIVE_INT) AslCompilerlval.s);} + ; + + +/******************************************************************************* + * + * ASL Opcode Terms + * + ******************************************************************************/ + +CompilerDirective + : IncludeTerm {} + | ExternalTerm {} + ; + NamedObject : BankFieldTerm {} | CreateBitFieldTerm {} @@ -1255,40 +1382,18 @@ NameSpaceModifier | ScopeTerm {} ; -MethodInvocationTerm - : NameString '(' {TrUpdateNode (PARSEOP_METHODCALL, $1);} - ArgList ')' {$$ = TrLinkChildNode ($1,$4);} - ; - -ArgList - : {$$ = NULL;} - | TermArg - | ArgList ',' /* Allows a trailing comma at list end */ - | ArgList ',' - TermArg {$$ = TrLinkPeerNode ($1,$3);} - ; - -/* -Removed from TermArg due to reduce/reduce conflicts - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - -*/ +/* For ObjectType: SuperName except for MethodInvocationTerm */ -TermArg - : 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);} - ; +ObjectTypeName + : NameString {} + | ArgTerm {} + | LocalTerm {} + | DebugTerm {} + | RefOfTerm {} + | DerefOfTerm {} + | IndexTerm {} -Target - : {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ - | ',' {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ - | ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} +/* | MethodInvocationTerm {} */ /* Caused reduce/reduce with Type6Opcode->MethodInvocationTerm */ ; RequiredTarget @@ -1301,46 +1406,6 @@ SimpleTarget | ArgTerm {} ; -/* Rules for specifying the type of one method argument or return value */ - -ParameterTypePackage - : {$$ = NULL;} - | ObjectTypeKeyword {$$ = $1;} - | ParameterTypePackage ',' - ObjectTypeKeyword {$$ = TrLinkPeerNodes (2,$1,$3);} - ; - -ParameterTypePackageList - : {$$ = NULL;} - | ObjectTypeKeyword {$$ = $1;} - | '{' ParameterTypePackage '}' {$$ = $2;} - ; - -OptionalParameterTypePackage - : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} - | ',' ParameterTypePackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} - ; - -/* Rules for specifying the types for method arguments */ - -ParameterTypesPackage - : ParameterTypePackageList {$$ = $1;} - | ParameterTypesPackage ',' - ParameterTypePackageList {$$ = TrLinkPeerNodes (2,$1,$3);} - ; - -ParameterTypesPackageList - : {$$ = NULL;} - | ObjectTypeKeyword {$$ = $1;} - | '{' ParameterTypesPackage '}' {$$ = $2;} - ; - -OptionalParameterTypesPackage - : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} - | ',' ParameterTypesPackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} - ; - - /* Opcode types */ Type1Opcode @@ -1348,7 +1413,7 @@ Type1Opcode | BreakPointTerm {} | ContinueTerm {} | FatalTerm {} - | IfElseTerm {} + | ElseIfTerm {} | LoadTerm {} | NoOpTerm {} | NotifyTerm {} @@ -1381,7 +1446,6 @@ Type2Opcode /* * Type 3/4/5 opcodes */ - Type2IntegerOpcode /* "Type3" opcodes */ : Expression {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} | AddTerm {} @@ -1439,7 +1503,6 @@ Type2BufferOrStringOpcode /* * A type 3 opcode evaluates to an Integer and cannot have a destination operand */ - Type3Opcode : EISAIDTerm {} ; @@ -1454,7 +1517,6 @@ Type4Opcode ; */ - Type5Opcode : ResourceTemplateTerm {} | UnicodeTerm {} @@ -1466,34 +1528,74 @@ Type6Opcode : RefOfTerm {} | DerefOfTerm {} | IndexTerm {} + | IndexExpTerm {} | MethodInvocationTerm {} ; -IncludeTerm - : PARSEOP_INCLUDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCLUDE);} - String ')' {TrLinkChildren ($<n>3,1,$4);FlOpenIncludeFile ($4);} - TermList - IncludeEndTerm {$$ = TrLinkPeerNodes (3,$<n>3,$7,$8);} + +/******************************************************************************* + * + * ASL Primary Terms + * + ******************************************************************************/ + +AccessAsTerm + : PARSEOP_ACCESSAS '(' + AccessTypeKeyword + OptionalAccessAttribTerm + ')' {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);} + | PARSEOP_ACCESSAS '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -IncludeEndTerm - : PARSEOP_INCLUDE_END {$$ = TrCreateLeafNode (PARSEOP_INCLUDE_END);} +AcquireTerm + : PARSEOP_ACQUIRE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} + SuperName + ',' WordConstExpr + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$6);} + | PARSEOP_ACQUIRE '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -ExternalTerm - : PARSEOP_EXTERNAL '(' - NameString - OptionalObjectTypeKeyword - OptionalParameterTypePackage - OptionalParameterTypesPackage - ')' {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);} - | PARSEOP_EXTERNAL '(' +AddTerm + : PARSEOP_ADD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_ADD '(' error ')' {$$ = AslDoError(); yyclearin;} ; +AliasTerm + : PARSEOP_ALIAS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);} + NameString + NameStringItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4, + TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} + | PARSEOP_ALIAS '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; -/******* Named Objects *******************************************************/ +AndTerm + : PARSEOP_AND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_AND '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; +ArgTerm + : PARSEOP_ARG0 {$$ = TrCreateLeafNode (PARSEOP_ARG0);} + | PARSEOP_ARG1 {$$ = TrCreateLeafNode (PARSEOP_ARG1);} + | PARSEOP_ARG2 {$$ = TrCreateLeafNode (PARSEOP_ARG2);} + | PARSEOP_ARG3 {$$ = TrCreateLeafNode (PARSEOP_ARG3);} + | PARSEOP_ARG4 {$$ = TrCreateLeafNode (PARSEOP_ARG4);} + | PARSEOP_ARG5 {$$ = TrCreateLeafNode (PARSEOP_ARG5);} + | PARSEOP_ARG6 {$$ = TrCreateLeafNode (PARSEOP_ARG6);} + ; BankFieldTerm : PARSEOP_BANKFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BANKFIELD);} @@ -1509,41 +1611,54 @@ BankFieldTerm error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} ; -FieldUnitList - : {$$ = NULL;} - | FieldUnit - | FieldUnitList ',' /* Allows a trailing comma at list end */ - | FieldUnitList ',' - FieldUnit {$$ = TrLinkPeerNode ($1,$3);} +BreakTerm + : PARSEOP_BREAK {$$ = TrCreateNode (PARSEOP_BREAK, 0);} ; -FieldUnit - : FieldUnitEntry {} - | OffsetTerm {} - | AccessAsTerm {} - | ConnectionTerm {} - ; +BreakPointTerm + : PARSEOP_BREAKPOINT {$$ = TrCreateNode (PARSEOP_BREAKPOINT, 0);} + ; -FieldUnitEntry - : ',' AmlPackageLengthTerm {$$ = TrCreateNode (PARSEOP_RESERVED_BYTES,1,$2);} - | NameSeg ',' - AmlPackageLengthTerm {$$ = TrLinkChildNode ($1,$3);} +BufferTerm + : PARSEOP_BUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER);} + OptionalTermArg + ')' '{' + BufferTermData '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_BUFFER '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OffsetTerm - : PARSEOP_OFFSET '(' - AmlPackageLengthTerm - ')' {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);} - | PARSEOP_OFFSET '(' +BufferTermData + : ByteList {} + | StringData {} + ; + +CaseTerm + : PARSEOP_CASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);} + DataObject + ')' '{' + TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_CASE '(' error ')' {$$ = AslDoError(); yyclearin;} ; -AccessAsTerm - : PARSEOP_ACCESSAS '(' - AccessTypeKeyword - OptionalAccessAttribTerm - ')' {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);} - | PARSEOP_ACCESSAS '(' +ConcatTerm + : PARSEOP_CONCATENATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_CONCATENATE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ConcatResTerm + : PARSEOP_CONCATENATERESTEMPLATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_CONCATENATERESTEMPLATE '(' error ')' {$$ = AslDoError(); yyclearin;} ; @@ -1562,6 +1677,28 @@ ConnectionTerm error ')' {$$ = AslDoError(); yyclearin;} ; +CondRefOfTerm + : PARSEOP_CONDREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} + SuperName + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_CONDREFOF '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ContinueTerm + : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);} + ; + +CopyObjectTerm + : PARSEOP_COPYOBJECT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} + TermArg + ',' SimpleTarget + ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} + | PARSEOP_COPYOBJECT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + CreateBitFieldTerm : PARSEOP_CREATEBITFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} TermArg @@ -1634,6 +1771,33 @@ DataRegionTerm error ')' {$$ = AslDoError(); yyclearin;} ; +DebugTerm + : PARSEOP_DEBUG {$$ = TrCreateLeafNode (PARSEOP_DEBUG);} + ; + +DecTerm + : PARSEOP_DECREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_DECREMENT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +DefaultTerm + : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFAULT);} + TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_DEFAULT '{' + error '}' {$$ = AslDoError(); yyclearin;} + ; + +DerefOfTerm + : PARSEOP_DEREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);} + TermArg + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_DEREFOF '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + DeviceTerm : PARSEOP_DEVICE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);} NameString @@ -1643,6 +1807,53 @@ DeviceTerm error ')' {$$ = AslDoError(); yyclearin;} ; +DivideTerm + : PARSEOP_DIVIDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} + TermArg + TermArgItem + Target + Target + ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} + | PARSEOP_DIVIDE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +EISAIDTerm + : PARSEOP_EISAID '(' + StringData ')' {$$ = TrUpdateNode (PARSEOP_EISAID, $3);} + | PARSEOP_EISAID '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ElseIfTerm + : IfTerm ElseTerm {$$ = TrLinkPeerNode ($1,$2);} + ; + +ElseTerm + : {$$ = NULL;} + | PARSEOP_ELSE '{' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} + TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} + + | PARSEOP_ELSE '{' + error '}' {$$ = AslDoError(); yyclearin;} + + | PARSEOP_ELSE + error {$$ = AslDoError(); yyclearin;} + + | PARSEOP_ELSEIF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} + TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} + ')' '{' + 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 + error {$$ = AslDoError(); yyclearin;} + ; + EventTerm : PARSEOP_EVENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EVENT);} NameString @@ -1651,6 +1862,27 @@ EventTerm error ')' {$$ = AslDoError(); yyclearin;} ; +ExternalTerm + : PARSEOP_EXTERNAL '(' + NameString + OptionalObjectTypeKeyword + OptionalParameterTypePackage + OptionalParameterTypesPackage + ')' {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);} + | PARSEOP_EXTERNAL '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +FatalTerm + : PARSEOP_FATAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);} + ByteConstExpr + ',' DWordConstExpr + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} + | PARSEOP_FATAL '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + FieldTerm : PARSEOP_FIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIELD);} NameString @@ -1663,6 +1895,43 @@ FieldTerm error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} ; +FindSetLeftBitTerm + : PARSEOP_FINDSETLEFTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_FINDSETLEFTBIT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +FindSetRightBitTerm + : PARSEOP_FINDSETRIGHTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_FINDSETRIGHTBIT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +FprintfTerm + : PARSEOP_FPRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);} + TermArg ',' + StringData + PrintfArgList + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} + | PARSEOP_FPRINTF '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +FromBCDTerm + : PARSEOP_FROMBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_FROMBCD '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + FunctionTerm : PARSEOP_FUNCTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} NameString @@ -1677,6 +1946,35 @@ FunctionTerm error ')' {$$ = AslDoError(); yyclearin;} ; +IfTerm + : PARSEOP_IF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} + TermArg + ')' '{' + TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + + | PARSEOP_IF '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +IncludeTerm + : PARSEOP_INCLUDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCLUDE);} + String ')' {TrLinkChildren ($<n>3,1,$4);FlOpenIncludeFile ($4);} + TermList + IncludeEndTerm {$$ = TrLinkPeerNodes (3,$<n>3,$7,$8);} + ; + +IncludeEndTerm + : PARSEOP_INCLUDE_END {$$ = TrCreateLeafNode (PARSEOP_INCLUDE_END);} + ; + +IncTerm + : PARSEOP_INCREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_INCREMENT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + IndexFieldTerm : PARSEOP_INDEXFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} NameString @@ -1690,171 +1988,98 @@ IndexFieldTerm error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} ; -MethodTerm - : PARSEOP_METHOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} - NameString - OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} - OptionalSerializeRuleKeyword - OptionalByteConstExpr - OptionalParameterTypePackage - OptionalParameterTypesPackage - ')' '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$7,$8,$9,$10,$13);} - | PARSEOP_METHOD '(' +IndexTerm + : PARSEOP_INDEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_INDEX '(' error ')' {$$ = AslDoError(); yyclearin;} ; -MutexTerm - : PARSEOP_MUTEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);} - NameString - ',' ByteConstExpr - ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} - | PARSEOP_MUTEX '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -OpRegionTerm - : PARSEOP_OPERATIONREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} - NameString - ',' OpRegionSpaceIdTerm - TermArgItem +LAndTerm + : PARSEOP_LAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} + TermArg TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8);} - | PARSEOP_OPERATIONREGION '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -OpRegionSpaceIdTerm - : RegionSpaceKeyword {} - | ByteConst {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} - ; - -PowerResTerm - : PARSEOP_POWERRESOURCE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} - NameString - ',' ByteConstExpr - ',' WordConstExpr - ')' '{' - ObjectList '}' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);} - | PARSEOP_POWERRESOURCE '(' + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LAND '(' error ')' {$$ = AslDoError(); yyclearin;} ; -ProcessorTerm - : PARSEOP_PROCESSOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} - NameString - ',' ByteConstExpr - OptionalDWordConstExpr - OptionalByteConstExpr - ')' '{' - ObjectList '}' {$$ = TrLinkChildren ($<n>3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);} - | PARSEOP_PROCESSOR '(' +LEqualTerm + : PARSEOP_LEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} + TermArg + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LEQUAL '(' error ')' {$$ = AslDoError(); yyclearin;} ; -ThermalZoneTerm - : PARSEOP_THERMALZONE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} - NameString - ')' '{' - ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} - | PARSEOP_THERMALZONE '(' +LGreaterEqualTerm + : PARSEOP_LGREATEREQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} + TermArg + TermArgItem + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} + | PARSEOP_LGREATEREQUAL '(' error ')' {$$ = AslDoError(); yyclearin;} ; - -/******* Namespace modifiers *************************************************/ - - -AliasTerm - : PARSEOP_ALIAS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);} - NameString - NameStringItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} - | PARSEOP_ALIAS '(' +LGreaterTerm + : PARSEOP_LGREATER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} + TermArg + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LGREATER '(' error ')' {$$ = AslDoError(); yyclearin;} ; -NameTerm - : PARSEOP_NAME '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);} - NameString - ',' DataObject - ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} - | PARSEOP_NAME '(' +LLessEqualTerm + : PARSEOP_LLESSEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} + TermArg + TermArgItem + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} + | PARSEOP_LLESSEQUAL '(' error ')' {$$ = AslDoError(); yyclearin;} ; -ScopeTerm - : PARSEOP_SCOPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);} - NameString - ')' '{' - ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} - | PARSEOP_SCOPE '(' +LLessTerm + : PARSEOP_LLESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} + TermArg + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LLESS '(' error ')' {$$ = AslDoError(); yyclearin;} ; - -/******* Type 1 opcodes *******************************************************/ - - -BreakTerm - : PARSEOP_BREAK {$$ = TrCreateNode (PARSEOP_BREAK, 0);} - ; - -BreakPointTerm - : PARSEOP_BREAKPOINT {$$ = TrCreateNode (PARSEOP_BREAKPOINT, 0);} - ; - -ContinueTerm - : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);} - ; - -FatalTerm - : PARSEOP_FATAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);} - ByteConstExpr - ',' DWordConstExpr +LNotEqualTerm + : PARSEOP_LNOTEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} + TermArg TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} - | PARSEOP_FATAL '(' + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} + | PARSEOP_LNOTEQUAL '(' error ')' {$$ = AslDoError(); yyclearin;} ; -IfElseTerm - : IfTerm ElseTerm {$$ = TrLinkPeerNode ($1,$2);} - ; - -IfTerm - : PARSEOP_IF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} +LNotTerm + : PARSEOP_LNOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} TermArg - ')' '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - - | PARSEOP_IF '(' + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_LNOT '(' error ')' {$$ = AslDoError(); yyclearin;} ; -ElseTerm - : {$$ = NULL;} - | PARSEOP_ELSE '{' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} - TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} - - | PARSEOP_ELSE '{' - error '}' {$$ = AslDoError(); yyclearin;} - - | PARSEOP_ELSE - error {$$ = AslDoError(); yyclearin;} - - | PARSEOP_ELSEIF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} - TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} - ')' '{' - TermList '}' {TrLinkChildren ($<n>5,2,$4,$8);} - ElseTerm {TrLinkPeerNode ($<n>5,$11);} - {$$ = TrLinkChildren ($<n>3,1,$<n>5);} - - | PARSEOP_ELSEIF '(' +LoadTableTerm + : PARSEOP_LOADTABLE '(' {$<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_ELSEIF - error {$$ = AslDoError(); yyclearin;} ; LoadTerm @@ -1866,507 +2091,338 @@ LoadTerm error ')' {$$ = AslDoError(); yyclearin;} ; -NoOpTerm - : PARSEOP_NOOP {$$ = TrCreateNode (PARSEOP_NOOP, 0);} +LocalTerm + : PARSEOP_LOCAL0 {$$ = TrCreateLeafNode (PARSEOP_LOCAL0);} + | PARSEOP_LOCAL1 {$$ = TrCreateLeafNode (PARSEOP_LOCAL1);} + | PARSEOP_LOCAL2 {$$ = TrCreateLeafNode (PARSEOP_LOCAL2);} + | PARSEOP_LOCAL3 {$$ = TrCreateLeafNode (PARSEOP_LOCAL3);} + | PARSEOP_LOCAL4 {$$ = TrCreateLeafNode (PARSEOP_LOCAL4);} + | PARSEOP_LOCAL5 {$$ = TrCreateLeafNode (PARSEOP_LOCAL5);} + | PARSEOP_LOCAL6 {$$ = TrCreateLeafNode (PARSEOP_LOCAL6);} + | PARSEOP_LOCAL7 {$$ = TrCreateLeafNode (PARSEOP_LOCAL7);} ; -NotifyTerm - : PARSEOP_NOTIFY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);} - SuperName +LOrTerm + : PARSEOP_LOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} + TermArg TermArgItem ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_NOTIFY '(' + | PARSEOP_LOR '(' error ')' {$$ = AslDoError(); yyclearin;} ; -ReleaseTerm - : PARSEOP_RELEASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_RELEASE '(' +MatchTerm + : PARSEOP_MATCH '(' {$<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;} ; -ResetTerm - : PARSEOP_RESET '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_RESET '(' +MethodTerm + : PARSEOP_METHOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} + NameString + OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} + OptionalSerializeRuleKeyword + OptionalByteConstExpr + OptionalParameterTypePackage + OptionalParameterTypesPackage + ')' '{' + TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$7,$8,$9,$10,$13);} + | PARSEOP_METHOD '(' error ')' {$$ = AslDoError(); yyclearin;} ; -ReturnTerm - : PARSEOP_RETURN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);} - OptionalReturnArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_RETURN {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_RETURN),1,TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN));} - | PARSEOP_RETURN '(' +MidTerm + : PARSEOP_MID '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MID);} + TermArg + TermArgItem + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} + | PARSEOP_MID '(' error ')' {$$ = AslDoError(); yyclearin;} ; -SignalTerm - : PARSEOP_SIGNAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_SIGNAL '(' +ModTerm + : PARSEOP_MOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_MOD '(' error ')' {$$ = AslDoError(); yyclearin;} ; -SleepTerm - : PARSEOP_SLEEP '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);} +MultiplyTerm + : PARSEOP_MULTIPLY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} TermArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_SLEEP '(' + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_MULTIPLY '(' error ')' {$$ = AslDoError(); yyclearin;} ; -StallTerm - : PARSEOP_STALL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);} - TermArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_STALL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -SwitchTerm - : PARSEOP_SWITCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);} - TermArg - ')' '{' - CaseDefaultTermList '}' - {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_SWITCH '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -/* - * Case-Default list; allow only one Default term and unlimited Case terms - */ - -CaseDefaultTermList - : {$$ = NULL;} - | CaseTerm {} - | DefaultTerm {} - | CaseDefaultTermList - CaseTerm {$$ = TrLinkPeerNode ($1,$2);} - | CaseDefaultTermList - DefaultTerm {$$ = TrLinkPeerNode ($1,$2);} - -/* Original - attempts to force zero or one default term within the switch */ - -/* -CaseDefaultTermList - : {$$ = NULL;} - | CaseTermList - DefaultTerm - CaseTermList {$$ = TrLinkPeerNode ($1,TrLinkPeerNode ($2, $3));} - | CaseTermList - CaseTerm {$$ = TrLinkPeerNode ($1,$2);} - ; - -CaseTermList - : {$$ = NULL;} - | CaseTerm {} - | CaseTermList - CaseTerm {$$ = TrLinkPeerNode ($1,$2);} - ; -*/ - -CaseTerm - : PARSEOP_CASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);} - DataObject - ')' '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_CASE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -DefaultTerm - : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFAULT);} - TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_DEFAULT '{' - error '}' {$$ = AslDoError(); yyclearin;} - ; - -UnloadTerm - : PARSEOP_UNLOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_UNLOAD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -WhileTerm - : PARSEOP_WHILE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} - TermArg - ')' '{' TermList '}' - {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_WHILE '(' +MutexTerm + : PARSEOP_MUTEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);} + NameString + ',' ByteConstExpr + ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} + | PARSEOP_MUTEX '(' error ')' {$$ = AslDoError(); yyclearin;} ; - -/******* Type 2 opcodes *******************************************************/ - -AcquireTerm - : PARSEOP_ACQUIRE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} - SuperName - ',' WordConstExpr - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$6);} - | PARSEOP_ACQUIRE '(' +NameTerm + : PARSEOP_NAME '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);} + NameString + ',' DataObject + ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} + | PARSEOP_NAME '(' error ')' {$$ = AslDoError(); yyclearin;} ; -AddTerm - : PARSEOP_ADD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} +NAndTerm + : PARSEOP_NAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);} TermArg TermArgItem Target ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_ADD '(' + | PARSEOP_NAND '(' error ')' {$$ = AslDoError(); yyclearin;} ; -AndTerm - : PARSEOP_AND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_AND '(' - error ')' {$$ = AslDoError(); yyclearin;} +NoOpTerm + : PARSEOP_NOOP {$$ = TrCreateNode (PARSEOP_NOOP, 0);} ; -ConcatTerm - : PARSEOP_CONCATENATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} +NOrTerm + : PARSEOP_NOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);} TermArg TermArgItem Target ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_CONCATENATE '(' + | PARSEOP_NOR '(' error ')' {$$ = AslDoError(); yyclearin;} ; -ConcatResTerm - : PARSEOP_CONCATENATERESTEMPLATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);} - TermArg +NotifyTerm + : PARSEOP_NOTIFY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);} + SuperName TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_CONCATENATERESTEMPLATE '(' + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_NOTIFY '(' error ')' {$$ = AslDoError(); yyclearin;} ; -CondRefOfTerm - : PARSEOP_CONDREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} - SuperName +NotTerm + : PARSEOP_NOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} + TermArg Target ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_CONDREFOF '(' + | PARSEOP_NOT '(' error ')' {$$ = AslDoError(); yyclearin;} ; -CopyObjectTerm - : PARSEOP_COPYOBJECT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} - TermArg - ',' SimpleTarget - ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} - | PARSEOP_COPYOBJECT '(' +ObjectTypeTerm + : PARSEOP_OBJECTTYPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} + ObjectTypeName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_OBJECTTYPE '(' error ')' {$$ = AslDoError(); yyclearin;} ; -DecTerm - : PARSEOP_DECREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_DECREMENT '(' +OffsetTerm + : PARSEOP_OFFSET '(' + AmlPackageLengthTerm + ')' {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);} + | PARSEOP_OFFSET '(' error ')' {$$ = AslDoError(); yyclearin;} ; -DerefOfTerm - : PARSEOP_DEREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);} - TermArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_DEREFOF '(' +OpRegionTerm + : PARSEOP_OPERATIONREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} + NameString + ',' OpRegionSpaceIdTerm + TermArgItem + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8);} + | PARSEOP_OPERATIONREGION '(' error ')' {$$ = AslDoError(); yyclearin;} ; -DivideTerm - : PARSEOP_DIVIDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} +OpRegionSpaceIdTerm + : RegionSpaceKeyword {} + | ByteConst {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} + ; + +OrTerm + : PARSEOP_OR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} TermArg TermArgItem Target - Target - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} - | PARSEOP_DIVIDE '(' + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_OR '(' error ')' {$$ = AslDoError(); yyclearin;} ; -FindSetLeftBitTerm - : PARSEOP_FINDSETLEFTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_FINDSETLEFTBIT '(' +PackageTerm + : PARSEOP_PACKAGE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} + VarPackageLengthTerm + ')' '{' + PackageList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_PACKAGE '(' error ')' {$$ = AslDoError(); yyclearin;} ; -FindSetRightBitTerm - : PARSEOP_FINDSETRIGHTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_FINDSETRIGHTBIT '(' +PowerResTerm + : PARSEOP_POWERRESOURCE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} + NameString + ',' ByteConstExpr + ',' WordConstExpr + ')' '{' + ObjectList '}' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);} + | PARSEOP_POWERRESOURCE '(' error ')' {$$ = AslDoError(); yyclearin;} ; -FromBCDTerm - : PARSEOP_FROMBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);} - TermArg - Target +PrintfTerm + : PARSEOP_PRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);} + StringData + PrintfArgList ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_FROMBCD '(' + | PARSEOP_PRINTF '(' error ')' {$$ = AslDoError(); yyclearin;} ; -IncTerm - : PARSEOP_INCREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_INCREMENT '(' - error ')' {$$ = AslDoError(); yyclearin;} +PrintfArgList + : {$$ = NULL;} + | TermArg {$$ = $1;} + | PrintfArgList ',' + TermArg {$$ = TrLinkPeerNode ($1, $3);} ; -IndexTerm - : PARSEOP_INDEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_INDEX '(' +ProcessorTerm + : PARSEOP_PROCESSOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} + NameString + ',' ByteConstExpr + OptionalDWordConstExpr + OptionalByteConstExpr + ')' '{' + ObjectList '}' {$$ = TrLinkChildren ($<n>3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);} + | PARSEOP_PROCESSOR '(' error ')' {$$ = AslDoError(); yyclearin;} ; -LAndTerm - : PARSEOP_LAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LAND '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LEqualTerm - : PARSEOP_LEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LEQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LGreaterTerm - : PARSEOP_LGREATER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LGREATER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LGreaterEqualTerm - : PARSEOP_LGREATEREQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} - TermArg - TermArgItem - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} - | PARSEOP_LGREATEREQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LLessTerm - : PARSEOP_LLESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LLESS '(' +RawDataBufferTerm + : PARSEOP_DATABUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} + OptionalWordConst + ')' '{' + ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_DATABUFFER '(' error ')' {$$ = AslDoError(); yyclearin;} ; -LLessEqualTerm - : PARSEOP_LLESSEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} - TermArg - TermArgItem - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} - | PARSEOP_LLESSEQUAL '(' +/* + * In RefOf, the node isn't really a target, but we can't keep track of it after + * 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,TrSetNodeFlags ($4, NODE_IS_TARGET));} + | PARSEOP_REFOF '(' error ')' {$$ = AslDoError(); yyclearin;} ; -LNotTerm - : PARSEOP_LNOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} - TermArg +ReleaseTerm + : PARSEOP_RELEASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);} + SuperName ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_LNOT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LNotEqualTerm - : PARSEOP_LNOTEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} - TermArg - TermArgItem - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} - | PARSEOP_LNOTEQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LoadTableTerm - : PARSEOP_LOADTABLE '(' {$<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;} - ; - -LOrTerm - : PARSEOP_LOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LOR '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -MatchTerm - : PARSEOP_MATCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MATCH);} - TermArg - ',' MatchOpKeyword - TermArgItem - ',' MatchOpKeyword - TermArgItem - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);} - | PARSEOP_MATCH '(' + | PARSEOP_RELEASE '(' error ')' {$$ = AslDoError(); yyclearin;} ; -MidTerm - : PARSEOP_MID '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MID);} - TermArg - TermArgItem - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} - | PARSEOP_MID '(' +ResetTerm + : PARSEOP_RESET '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_RESET '(' error ')' {$$ = AslDoError(); yyclearin;} ; -ModTerm - : PARSEOP_MOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_MOD '(' +ReturnTerm + : PARSEOP_RETURN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);} + OptionalReturnArg + ')' {$$ = 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;} ; -MultiplyTerm - : PARSEOP_MULTIPLY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_MULTIPLY '(' +ScopeTerm + : PARSEOP_SCOPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);} + NameString + ')' '{' + ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} + | PARSEOP_SCOPE '(' error ')' {$$ = AslDoError(); yyclearin;} ; -NAndTerm - : PARSEOP_NAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);} +ShiftLeftTerm + : PARSEOP_SHIFTLEFT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} TermArg TermArgItem Target ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_NAND '(' + | PARSEOP_SHIFTLEFT '(' error ')' {$$ = AslDoError(); yyclearin;} ; -NOrTerm - : PARSEOP_NOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);} +ShiftRightTerm + : PARSEOP_SHIFTRIGHT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} TermArg TermArgItem Target ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_NOR '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -NotTerm - : PARSEOP_NOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_NOT '(' + | PARSEOP_SHIFTRIGHT '(' error ')' {$$ = AslDoError(); yyclearin;} ; -ObjectTypeTerm - : PARSEOP_OBJECTTYPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} - ObjectTypeName +SignalTerm + : PARSEOP_SIGNAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);} + SuperName ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_OBJECTTYPE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -OrTerm - : PARSEOP_OR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_OR '(' + | PARSEOP_SIGNAL '(' error ')' {$$ = AslDoError(); yyclearin;} ; -/* - * In RefOf, the node isn't really a target, but we can't keep track of it after - * we've taken a pointer to it. (hard to tell if a local becomes initialized this way.) - */ -RefOfTerm - : PARSEOP_REFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REFOF);} +SizeOfTerm + : PARSEOP_SIZEOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);} SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,TrSetNodeFlags ($4, NODE_IS_TARGET));} - | PARSEOP_REFOF '(' + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_SIZEOF '(' error ')' {$$ = AslDoError(); yyclearin;} ; -ShiftLeftTerm - : PARSEOP_SHIFTLEFT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} +SleepTerm + : PARSEOP_SLEEP '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);} TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_SHIFTLEFT '(' + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_SLEEP '(' error ')' {$$ = AslDoError(); yyclearin;} ; -ShiftRightTerm - : PARSEOP_SHIFTRIGHT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} +StallTerm + : PARSEOP_STALL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);} TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_SHIFTRIGHT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -SizeOfTerm - : PARSEOP_SIZEOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);} - SuperName ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_SIZEOF '(' + | PARSEOP_STALL '(' error ')' {$$ = AslDoError(); yyclearin;} ; @@ -2388,6 +2444,24 @@ SubtractTerm | PARSEOP_SUBTRACT '(' error ')' {$$ = AslDoError(); yyclearin;} ; +SwitchTerm + : PARSEOP_SWITCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);} + TermArg + ')' '{' + CaseDefaultTermList '}' + {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_SWITCH '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ThermalZoneTerm + : PARSEOP_THERMALZONE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} + NameString + ')' '{' + ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} + | PARSEOP_THERMALZONE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; TimerTerm : PARSEOP_TIMER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);} @@ -2442,35 +2516,12 @@ ToIntegerTerm error ')' {$$ = AslDoError(); yyclearin;} ; -PldKeyword - : PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);} - | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);} - | PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);} - | PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);} - | PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);} - | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);} - | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);} - | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);} - | PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);} - | PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);} - | PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);} - | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);} - | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);} - | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);} - | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);} - | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);} - | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);} - | PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);} - | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);} - | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);} - | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);} - | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);} - | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);} - | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);} - | PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);} - | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);} - | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);} - | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);} +ToPLDTerm + : PARSEOP_TOPLD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);} + PldKeywordList + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_TOPLD '(' + error ')' {$$ = AslDoError(); yyclearin;} ; PldKeywordList @@ -2488,39 +2539,6 @@ PldKeywordList PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} ; -ToPLDTerm - : PARSEOP_TOPLD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);} - PldKeywordList - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_TOPLD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -PrintfArgList - : {$$ = NULL;} - | TermArg {$$ = $1;} - | PrintfArgList ',' - TermArg {$$ = TrLinkPeerNode ($1, $3);} - ; - -PrintfTerm - : PARSEOP_PRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);} - StringData - PrintfArgList - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_PRINTF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -FprintfTerm - : PARSEOP_FPRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);} - TermArg ',' - StringData - PrintfArgList - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} - | PARSEOP_FPRINTF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; ToStringTerm : PARSEOP_TOSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);} @@ -2539,6 +2557,22 @@ ToUUIDTerm error ')' {$$ = AslDoError(); yyclearin;} ; +UnicodeTerm + : PARSEOP_UNICODE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);} + StringData + ')' {$$ = TrLinkChildren ($<n>3,2,0,$4);} + | PARSEOP_UNICODE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +UnloadTerm + : PARSEOP_UNLOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_UNLOAD '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + WaitTerm : PARSEOP_WAIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);} SuperName @@ -2558,9 +2592,236 @@ XOrTerm error ')' {$$ = AslDoError(); yyclearin;} ; +WhileTerm + : PARSEOP_WHILE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} + TermArg + ')' '{' TermList '}' + {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_WHILE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + + +/******************************************************************************* + * + * ASL Helper Terms + * + ******************************************************************************/ + +AmlPackageLengthTerm + : Integer {$$ = TrUpdateNode (PARSEOP_PACKAGE_LENGTH,(ACPI_PARSE_OBJECT *) $1);} + ; + +NameStringItem + : ',' NameString {$$ = $2;} + | ',' error {$$ = AslDoError (); yyclearin;} + ; + +TermArgItem + : ',' TermArg {$$ = $2;} + | ',' error {$$ = AslDoError (); yyclearin;} + ; + +OptionalReference + : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ + | ',' {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ + | ',' TermArg {$$ = $2;} + ; + +OptionalReturnArg + : {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN);} /* Placeholder is a ZeroOp object */ + | TermArg {$$ = $1;} + ; + +OptionalSerializeRuleKeyword + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' SerializeRuleKeyword {$$ = $2;} + ; + +OptionalTermArg + : {$$ = NULL;} + | TermArg {$$ = $1;} + ; + +OptionalWordConst + : {$$ = NULL;} + | WordConst {$$ = $1;} + ; + -/******* Keywords *************************************************************/ +/******************************************************************************* + * + * Production rules for the symbolic (c-style) operators + * + ******************************************************************************/ + +/* + * ASL Extensions: C-style math/logical operators and expressions. + * The implementation transforms these operators into the standard + * AML opcodes and syntax. + * + * Supported operators and precedence rules (high-to-low) + * + * NOTE: The operator precedence and associativity rules are + * implemented by the tokens in asltokens.y + * + * (left-to-right): + * 1) ( ) expr++ expr-- + * + * (right-to-left): + * 2) ! ~ + * + * (left-to-right): + * 3) * / % + * 4) + - + * 5) >> << + * 6) < > <= >= + * 7) == != + * 8) & + * 9) ^ + * 10) | + * 11) && + * 12) || + * + * (right-to-left): + * 13) = += -= *= /= %= <<= >>= &= ^= |= + */ + +Expression + + /* Unary operators */ + + : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} + TermArg {$$ = TrLinkChildren ($<n>2,1,$3);} + | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} + TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateNullTarget ());} + + | SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} + {$$ = TrLinkChildren ($<n>3,1,$1);} + | SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} + {$$ = TrLinkChildren ($<n>3,1,$1);} + + /* Binary operators: math and logical */ + + | TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} + TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), + TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + + | TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + + | TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} + | TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);} + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} + | TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} + | TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);} + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} + + | TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} + | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);} + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} + + | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} + | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} + + /* Parentheses */ + + | '(' TermArg ')' { $$ = $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 ());} + ; + + /* Index term -- "BUF1[5] = " on left-hand side of an equals (target) */ + +IndexExpTerm + + : SuperName PARSEOP_EXP_INDEX_LEFT TermArg PARSEOP_EXP_INDEX_RIGHT + {$$ = TrCreateLeafNode (PARSEOP_INDEX); + TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());} + ; + +EqualsTerm + + /* All assignment-type operations */ + + : SuperName PARSEOP_EXP_EQUALS + TermArg {$$ = TrCreateAssignmentNode ($1, $3);} + + | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} + TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + ; + + + +/******************************************************************************* + * + * ASL Parameter Keyword Terms + * + ******************************************************************************/ AccessAttribKeyword : PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK);} @@ -2677,383 +2938,198 @@ IoRestrictionKeyword ; LockRuleKeyword - : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);} - | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_NOLOCK);} - ; - -MatchOpKeyword - : PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);} - | PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);} - | PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLE);} - | PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLT);} - | PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGE);} - | PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGT);} - ; - -MaxKeyword - : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);} - | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);} - ; - -MemTypeKeyword - : PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_CACHEABLE);} - | PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_WRITECOMBINING);} - | PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_PREFETCHABLE);} - | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_NONCACHEABLE);} - ; - -MinKeyword - : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);} - | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);} - ; - -ObjectTypeKeyword - : PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} - | PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_INT);} - | PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_STR);} - | PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BUF);} - | PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PKG);} - | PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_FLD);} - | PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DEV);} - | PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_EVT);} - | PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTH);} - | PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTX);} - | PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_OPR);} - | PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_POW);} - | PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PRO);} - | PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_THZ);} - | PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BFF);} - | PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DDB);} - ; - -ParityTypeKeyword - : PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_SPACE);} - | PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_MARK);} - | PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_ODD);} - | PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_EVEN);} - | PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_NONE);} - ; - -PinConfigByte - : PinConfigKeyword {$$ = $1;} - | ByteConstExpr {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} - ; - -PinConfigKeyword - : PARSEOP_PIN_NOPULL {$$ = TrCreateLeafNode (PARSEOP_PIN_NOPULL);} - | PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDOWN);} - | PARSEOP_PIN_PULLUP {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLUP);} - | PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDEFAULT);} - ; - -RangeTypeKeyword - : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);} - | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);} - | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ENTIRE);} - ; - -RegionSpaceKeyword - : PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IO);} - | PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_MEM);} - | PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCI);} - | PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_EC);} - | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);} - | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);} - | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);} - | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);} - | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);} - | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);} - | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);} - | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);} - ; - -ResourceTypeKeyword - : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} - | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);} - ; - -SerializeRuleKeyword - : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);} - | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL);} - ; - -ShareTypeKeyword - : PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHARED);} - | PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVE);} - | PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHAREDWAKE);} - | PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);} - ; - -SlaveModeKeyword - : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_CONTROLLERINIT);} - | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_DEVICEINIT);} - ; - -StopBitsKeyword - : PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_TWO);} - | PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONEPLUSHALF);} - | PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONE);} - | PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ZERO);} - ; - -TranslationKeyword - : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);} - | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);} - ; - -TypeKeyword - : PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafNode (PARSEOP_TYPE_TRANSLATION);} - | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafNode (PARSEOP_TYPE_STATIC);} - ; - -UpdateRuleKeyword - : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);} - | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);} - | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);} - ; - -WireModeKeyword - : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_FOUR);} - | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_THREE);} - ; - -XferSizeKeyword - : PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_8, 0);} - | PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_16, 1);} - | PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} - | PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_64, 3);} - | PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_128, 4);} - | PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_256, 5);} - ; - -XferTypeKeyword - : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);} - | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);} - | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);} - ; - - -/******* Miscellaneous Types **************************************************/ - - -SuperName - : NameString {} - | ArgTerm {} - | LocalTerm {} - | DebugTerm {} - | Type6Opcode {} - -/* For ObjectType: SuperName except for MethodInvocationTerm */ - -ObjectTypeName - : NameString {} - | ArgTerm {} - | LocalTerm {} - | DebugTerm {} - | RefOfTerm {} - | DerefOfTerm {} - | IndexTerm {} - -/* | MethodInvocationTerm {} */ /* Caused reduce/reduce with Type6Opcode->MethodInvocationTerm */ - ; - -ArgTerm - : PARSEOP_ARG0 {$$ = TrCreateLeafNode (PARSEOP_ARG0);} - | PARSEOP_ARG1 {$$ = TrCreateLeafNode (PARSEOP_ARG1);} - | PARSEOP_ARG2 {$$ = TrCreateLeafNode (PARSEOP_ARG2);} - | PARSEOP_ARG3 {$$ = TrCreateLeafNode (PARSEOP_ARG3);} - | PARSEOP_ARG4 {$$ = TrCreateLeafNode (PARSEOP_ARG4);} - | PARSEOP_ARG5 {$$ = TrCreateLeafNode (PARSEOP_ARG5);} - | PARSEOP_ARG6 {$$ = TrCreateLeafNode (PARSEOP_ARG6);} - ; - -LocalTerm - : PARSEOP_LOCAL0 {$$ = TrCreateLeafNode (PARSEOP_LOCAL0);} - | PARSEOP_LOCAL1 {$$ = TrCreateLeafNode (PARSEOP_LOCAL1);} - | PARSEOP_LOCAL2 {$$ = TrCreateLeafNode (PARSEOP_LOCAL2);} - | PARSEOP_LOCAL3 {$$ = TrCreateLeafNode (PARSEOP_LOCAL3);} - | PARSEOP_LOCAL4 {$$ = TrCreateLeafNode (PARSEOP_LOCAL4);} - | PARSEOP_LOCAL5 {$$ = TrCreateLeafNode (PARSEOP_LOCAL5);} - | PARSEOP_LOCAL6 {$$ = TrCreateLeafNode (PARSEOP_LOCAL6);} - | PARSEOP_LOCAL7 {$$ = TrCreateLeafNode (PARSEOP_LOCAL7);} - ; - -DebugTerm - : PARSEOP_DEBUG {$$ = TrCreateLeafNode (PARSEOP_DEBUG);} - ; - - -ByteConst - : Integer {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} - ; - -WordConst - : Integer {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} - ; - -DWordConst - : Integer {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} - ; - -QWordConst - : Integer {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} - ; - -Integer - : PARSEOP_INTEGER {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, AslCompilerlval.i);} - ; - -String - : PARSEOP_STRING_LITERAL {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, (ACPI_NATIVE_INT) AslCompilerlval.s);} - ; - -ConstTerm - : ConstExprTerm {} - | PARSEOP_REVISION {$$ = TrCreateLeafNode (PARSEOP_REVISION);} - ; - -ConstExprTerm - : PARSEOP_ZERO {$$ = TrCreateValuedLeafNode (PARSEOP_ZERO, 0);} - | PARSEOP_ONE {$$ = TrCreateValuedLeafNode (PARSEOP_ONE, 1);} - | PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_UINT64_MAX);} - | PARSEOP___DATE__ {$$ = TrCreateConstantLeafNode (PARSEOP___DATE__);} - | PARSEOP___FILE__ {$$ = TrCreateConstantLeafNode (PARSEOP___FILE__);} - | PARSEOP___LINE__ {$$ = TrCreateConstantLeafNode (PARSEOP___LINE__);} - | PARSEOP___PATH__ {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);} - ; - -/* - * The NODE_COMPILE_TIME_CONST flag in the following constant expressions - * enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes - * to simple integers. It is an error if these types of expressions cannot be - * reduced, since the AML grammar for ****ConstExpr requires a simple constant. - * Note: The required byte length of the constant is passed through to the - * constant folding code in the node AmlLength field. - */ -ByteConstExpr - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} - | ByteConst {} + : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);} + | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_NOLOCK);} ; -WordConstExpr - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} - | WordConst {} +MatchOpKeyword + : PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);} + | PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);} + | PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLE);} + | PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLT);} + | PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGE);} + | PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGT);} ; -DWordConstExpr - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} - | DWordConst {} +MaxKeyword + : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);} + | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);} ; -QWordConstExpr - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} - | QWordConst {} +MemTypeKeyword + : PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_CACHEABLE);} + | PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_WRITECOMBINING);} + | PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_PREFETCHABLE);} + | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_NONCACHEABLE);} ; -/* OptionalCount must appear before ByteList or an incorrect reduction will result */ +MinKeyword + : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);} + | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);} + ; -OptionalCount - : {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ - | ',' {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ - | ',' TermArg {$$ = $2;} +ObjectTypeKeyword + : PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} + | PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_INT);} + | PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_STR);} + | PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BUF);} + | PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PKG);} + | PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_FLD);} + | PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DEV);} + | PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_EVT);} + | PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTH);} + | PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTX);} + | PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_OPR);} + | PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_POW);} + | PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PRO);} + | PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_THZ);} + | PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BFF);} + | PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DDB);} ; -BufferTerm - : PARSEOP_BUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER);} - OptionalTermArg - ')' '{' - BufferTermData '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_BUFFER '(' - error ')' {$$ = AslDoError(); yyclearin;} +ParityTypeKeyword + : PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_SPACE);} + | PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_MARK);} + | PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_ODD);} + | PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_EVEN);} + | PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_NONE);} ; -BufferTermData - : ByteList {} - | StringData {} +PinConfigByte + : PinConfigKeyword {$$ = $1;} + | ByteConstExpr {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} ; -ByteList - : {$$ = NULL;} - | ByteConstExpr - | ByteList ',' /* Allows a trailing comma at list end */ - | ByteList ',' - ByteConstExpr {$$ = TrLinkPeerNode ($1,$3);} +PinConfigKeyword + : PARSEOP_PIN_NOPULL {$$ = TrCreateLeafNode (PARSEOP_PIN_NOPULL);} + | PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDOWN);} + | PARSEOP_PIN_PULLUP {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLUP);} + | PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDEFAULT);} ; -DataBufferTerm - : PARSEOP_DATABUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} - OptionalWordConst - ')' '{' - ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_DATABUFFER '(' - error ')' {$$ = AslDoError(); yyclearin;} +PldKeyword + : PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);} + | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);} + | PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);} + | PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);} + | PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);} + | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);} + | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);} + | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);} + | PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);} + | PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);} + | PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);} + | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);} + | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);} + | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);} + | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);} + | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);} + | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);} + | PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);} + | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);} + | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);} + | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);} + | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);} + | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);} + | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);} + | PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);} + | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);} + | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);} + | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);} ; -DWordList - : {$$ = NULL;} - | DWordConstExpr - | DWordList ',' /* Allows a trailing comma at list end */ - | DWordList ',' - DWordConstExpr {$$ = TrLinkPeerNode ($1,$3);} +RangeTypeKeyword + : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);} + | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);} + | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ENTIRE);} ; -PackageTerm - : PARSEOP_PACKAGE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} - VarPackageLengthTerm - ')' '{' - PackageList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_PACKAGE '(' - error ')' {$$ = AslDoError(); yyclearin;} +RegionSpaceKeyword + : PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IO);} + | PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_MEM);} + | PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCI);} + | PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_EC);} + | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);} + | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);} + | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);} + | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);} + | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);} + | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);} + | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);} + | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);} ; -PackageList - : {$$ = NULL;} - | PackageElement - | PackageList ',' /* Allows a trailing comma at list end */ - | PackageList ',' - PackageElement {$$ = TrLinkPeerNode ($1,$3);} +ResourceTypeKeyword + : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} + | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);} ; -PackageElement - : DataObject {} - | NameString {} +SerializeRuleKeyword + : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);} + | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL);} ; -VarPackageLengthTerm - : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} - | TermArg {$$ = $1;} +ShareTypeKeyword + : PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHARED);} + | PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVE);} + | PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHAREDWAKE);} + | PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);} + ; + +SlaveModeKeyword + : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_CONTROLLERINIT);} + | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_DEVICEINIT);} + ; + +StopBitsKeyword + : PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_TWO);} + | PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONEPLUSHALF);} + | PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONE);} + | PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ZERO);} ; +TranslationKeyword + : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);} + | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);} + ; -/******* Macros ***********************************************/ +TypeKeyword + : PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafNode (PARSEOP_TYPE_TRANSLATION);} + | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafNode (PARSEOP_TYPE_STATIC);} + ; +UpdateRuleKeyword + : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);} + | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);} + | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);} + ; -EISAIDTerm - : PARSEOP_EISAID '(' - StringData ')' {$$ = TrUpdateNode (PARSEOP_EISAID, $3);} - | PARSEOP_EISAID '(' - error ')' {$$ = AslDoError(); yyclearin;} +WireModeKeyword + : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_FOUR);} + | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_THREE);} ; -UnicodeTerm - : PARSEOP_UNICODE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);} - StringData - ')' {$$ = TrLinkChildren ($<n>3,2,0,$4);} - | PARSEOP_UNICODE '(' - error ')' {$$ = AslDoError(); yyclearin;} +XferSizeKeyword + : PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_8, 0);} + | PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_16, 1);} + | PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} + | PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_64, 3);} + | PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_128, 4);} + | PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_256, 5);} ; +XferTypeKeyword + : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);} + | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);} + | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);} + ; -/******* Resources and Memory ***********************************************/ +/******************************************************************************* + * + * ASL Resource Template Terms + * + ******************************************************************************/ /* * Note: Create two default nodes to allow conversion to a Buffer AML opcode @@ -3189,7 +3265,6 @@ DWordSpaceTerm error ')' {$$ = AslDoError(); yyclearin;} ; - EndDependentFnTerm : PARSEOP_ENDDEPENDENTFN '(' ')' {$$ = TrCreateLeafNode (PARSEOP_ENDDEPENDENTFN);} @@ -3655,22 +3730,11 @@ NameSeg ; -/******* Helper rules ****************************************************/ - - -AmlPackageLengthTerm - : Integer {$$ = TrUpdateNode (PARSEOP_PACKAGE_LENGTH,(ACPI_PARSE_OBJECT *) $1);} - ; - -NameStringItem - : ',' NameString {$$ = $2;} - | ',' error {$$ = AslDoError (); yyclearin;} - ; - -TermArgItem - : ',' TermArg {$$ = $2;} - | ',' error {$$ = AslDoError (); yyclearin;} - ; +/******************************************************************************* + * + * ASL Helper Terms + * + ******************************************************************************/ OptionalBusMasterKeyword : ',' {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);} @@ -3710,7 +3774,7 @@ OptionalBitsPerByte OptionalBuffer_Last : {$$ = NULL;} | ',' {$$ = NULL;} - | ',' DataBufferTerm {$$ = $2;} + | ',' RawDataBufferTerm {$$ = $2;} ; OptionalByteConstExpr @@ -3815,12 +3879,6 @@ OptionalReadWriteKeyword | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_READONLY);} ; -OptionalReference - : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ - | ',' {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ - | ',' TermArg {$$ = $2;} - ; - OptionalResourceType_First : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} | ResourceTypeKeyword {$$ = $1;} @@ -3832,17 +3890,6 @@ OptionalResourceType | ',' ResourceTypeKeyword {$$ = $2;} ; -OptionalReturnArg - : {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN);} /* Placeholder is a ZeroOp object */ - | TermArg {$$ = $1;} - ; - -OptionalSerializeRuleKeyword - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' SerializeRuleKeyword {$$ = $2;} - ; - OptionalSlaveMode : ',' {$$ = NULL;} | ',' SlaveModeKeyword {$$ = $2;} @@ -3870,9 +3917,10 @@ OptionalStringData | ',' StringData {$$ = $2;} ; -OptionalTermArg +OptionalTranslationType_Last : {$$ = NULL;} - | TermArg {$$ = $1;} + | ',' {$$ = NULL;} + | ',' TranslationKeyword {$$ = $2;} ; OptionalType @@ -3887,22 +3935,11 @@ OptionalType_Last | ',' TypeKeyword {$$ = $2;} ; -OptionalTranslationType_Last - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' TranslationKeyword {$$ = $2;} - ; - OptionalWireMode : ',' {$$ = NULL;} | ',' WireModeKeyword {$$ = $2;} ; -OptionalWordConst - : {$$ = NULL;} - | WordConst {$$ = $1;} - ; - OptionalWordConstExpr : ',' {$$ = NULL;} | ',' WordConstExpr {$$ = $2;} diff --git a/src/acpica/source/compiler/aslcstyle.y b/src/acpica/source/compiler/aslcstyle.y new file mode 100644 index 0000000..074278a --- /dev/null +++ b/src/acpica/source/compiler/aslcstyle.y @@ -0,0 +1,281 @@ +NoEcho(' +/****************************************************************************** + * + * Module Name: aslcstyle.y - Production rules for symbolic operators + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2015, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +') + +/******************************************************************************* + * + * Production rules for the symbolic (c-style) operators + * + ******************************************************************************/ + +/* + * ASL Extensions: C-style math/logical operators and expressions. + * The implementation transforms these operators into the standard + * AML opcodes and syntax. + * + * Supported operators and precedence rules (high-to-low) + * + * NOTE: The operator precedence and associativity rules are + * implemented by the tokens in asltokens.y + * + * (left-to-right): + * 1) ( ) expr++ expr-- + * + * (right-to-left): + * 2) ! ~ + * + * (left-to-right): + * 3) * / % + * 4) + - + * 5) >> << + * 6) < > <= >= + * 7) == != + * 8) & + * 9) ^ + * 10) | + * 11) && + * 12) || + * + * (right-to-left): + * 13) = += -= *= /= %= <<= >>= &= ^= |= + */ + +Expression + + /* Unary operators */ + + : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} + TermArg {$$ = TrLinkChildren ($<n>2,1,$3);} + | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} + TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateNullTarget ());} + + | SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} + {$$ = TrLinkChildren ($<n>3,1,$1);} + | SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} + {$$ = TrLinkChildren ($<n>3,1,$1);} + + /* Binary operators: math and logical */ + + | TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} + TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), + TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + + | TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} + + | TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} + | TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);} + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} + | TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} + | TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);} + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} + + | TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} + | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);} + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} + + | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} + | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} + + /* Parentheses */ + + | '(' TermArg ')' { $$ = $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 ());} + ; + + /* Index term -- "BUF1[5] = " on left-hand side of an equals (target) */ + +IndexExpTerm + + : SuperName PARSEOP_EXP_INDEX_LEFT TermArg PARSEOP_EXP_INDEX_RIGHT + {$$ = TrCreateLeafNode (PARSEOP_INDEX); + TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());} + ; + +EqualsTerm + + /* All assignment-type operations */ + + : SuperName PARSEOP_EXP_EQUALS + TermArg {$$ = TrCreateAssignmentNode ($1, $3);} + + | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} + TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + ; diff --git a/src/acpica/source/compiler/asldefine.h b/src/acpica/source/compiler/asldefine.h index 168a129..87e4d35 100644 --- a/src/acpica/source/compiler/asldefine.h +++ b/src/acpica/source/compiler/asldefine.h @@ -176,26 +176,6 @@ #define AML_DEFAULT_ARG_OP (UINT16) 0xDDDD -/* filename suffixes for output files */ - -#define FILE_SUFFIX_PREPROC_USER "i " -#define FILE_SUFFIX_PREPROCESSOR "pre" -#define FILE_SUFFIX_AML_CODE "aml" -#define FILE_SUFFIX_MAP "map" -#define FILE_SUFFIX_LISTING "lst" -#define FILE_SUFFIX_HEX_DUMP "hex" -#define FILE_SUFFIX_DEBUG "txt" -#define FILE_SUFFIX_SOURCE "src" -#define FILE_SUFFIX_NAMESPACE "nsp" -#define FILE_SUFFIX_ASM_SOURCE "asm" -#define FILE_SUFFIX_C_SOURCE "c" -#define FILE_SUFFIX_DISASSEMBLY "dsl" -#define FILE_SUFFIX_ASM_INCLUDE "inc" -#define FILE_SUFFIX_C_INCLUDE "h" -#define FILE_SUFFIX_ASL_CODE "asl" -#define FILE_SUFFIX_C_OFFSET "offset.h" - - /* Types for input files */ #define ASL_INPUT_TYPE_BINARY 0 diff --git a/src/acpica/source/compiler/aslglobal.h b/src/acpica/source/compiler/aslglobal.h index 15d6485..9a9aba4 100644 --- a/src/acpica/source/compiler/aslglobal.h +++ b/src/acpica/source/compiler/aslglobal.h @@ -249,6 +249,8 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTemplates, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileGeneric, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AllExceptionsDisabled, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PruneParseTree, FALSE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTypechecking, TRUE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_EnableReferenceTypechecking, FALSE); #define HEX_OUTPUT_NONE 0 diff --git a/src/acpica/source/compiler/aslmain.c b/src/acpica/source/compiler/aslmain.c index ca1ffc6..0f90b1f 100644 --- a/src/acpica/source/compiler/aslmain.c +++ b/src/acpica/source/compiler/aslmain.c @@ -232,6 +232,7 @@ Usage ( ACPI_OPTION ("-of", "Disable constant folding"); ACPI_OPTION ("-oi", "Disable integer optimization to Zero/One/Ones"); ACPI_OPTION ("-on", "Disable named reference string optimization"); + ACPI_OPTION ("-ot", "Disable typechecking"); ACPI_OPTION ("-cr", "Disable Resource Descriptor error checking"); ACPI_OPTION ("-in", "Ignore NoOp operators"); ACPI_OPTION ("-r <revision>", "Override table header Revision (1-255)"); @@ -275,7 +276,7 @@ Usage ( ACPI_OPTION ("-f", "Ignore errors, force creation of AML output file(s)"); ACPI_OPTION ("-m <size>", "Set internal line buffer size (in Kbytes)"); ACPI_OPTION ("-n", "Parse only, no output generation"); - ACPI_OPTION ("-ot", "Display compile times and statistics"); + ACPI_OPTION ("-oc", "Display compile times and statistics"); ACPI_OPTION ("-x <level>", "Set debug level for trace output"); ACPI_OPTION ("-z", "Do not insert new compiler ID for DataTables"); } diff --git a/src/acpica/source/compiler/aslmap.c b/src/acpica/source/compiler/aslmap.c index cb6a941..a06c246 100644 --- a/src/acpica/source/compiler/aslmap.c +++ b/src/acpica/source/compiler/aslmap.c @@ -195,6 +195,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = { /*! [Begin] no source code translation (keep the table structure) */ + /* AML Opcode Value Flags Btype */ /* ACCESSAS */ OP_TABLE_ENTRY (AML_INT_ACCESSFIELD_OP, 0, 0, 0), /* ACCESSATTRIB_BLOCK */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_BLOCK, 0, 0), @@ -313,7 +314,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* INCLUDE */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* INCLUDE_END */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* INCREMENT */ OP_TABLE_ENTRY (AML_INCREMENT_OP, 0, 0, ACPI_BTYPE_INTEGER), -/* INDEX */ OP_TABLE_ENTRY (AML_INDEX_OP, 0, 0, ACPI_BTYPE_REFERENCE), +/* INDEX */ OP_TABLE_ENTRY (AML_INDEX_OP, 0, 0, ACPI_BTYPE_REFERENCE_OBJECT), /* INDEXFIELD */ OP_TABLE_ENTRY (AML_INDEX_FIELD_OP, 0, NODE_AML_PACKAGE, 0), /* INTEGER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, ACPI_BTYPE_INTEGER), /* INTERRUPT */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), @@ -429,7 +430,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* RAW_DATA */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* READWRITETYPE_BOTH */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* READWRITETYPE_READONLY */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), -/* REFOF */ OP_TABLE_ENTRY (AML_REF_OF_OP, 0, 0, ACPI_BTYPE_REFERENCE), +/* REFOF */ OP_TABLE_ENTRY (AML_REF_OF_OP, 0, 0, ACPI_BTYPE_REFERENCE_OBJECT), /* REGIONSPACE_CMOS */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_CMOS, 0, 0), /* REGIONSPACE_EC */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_EC, 0, 0), /* REGIONSPACE_FFIXEDHW */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_FIXED_HARDWARE, 0, 0), diff --git a/src/acpica/source/compiler/aslparser.y b/src/acpica/source/compiler/aslparser.y index 588e239..94fc401 100644 --- a/src/acpica/source/compiler/aslparser.y +++ b/src/acpica/source/compiler/aslparser.y @@ -194,6 +194,8 @@ m4_include(asltypes.y) /* Production rules */ m4_include(aslrules.y) +m4_include(aslcstyle.y) +m4_include(aslresources.y) %% /*! [End] no source code translation !*/ diff --git a/src/acpica/source/compiler/aslresources.y b/src/acpica/source/compiler/aslresources.y new file mode 100644 index 0000000..46d4f31 --- /dev/null +++ b/src/acpica/source/compiler/aslresources.y @@ -0,0 +1,1251 @@ +NoEcho(' +/****************************************************************************** + * + * Module Name: aslresources.y - Bison/Yacc production rules for resources + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2015, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +') + +/******************************************************************************* + * + * ASL Parameter Keyword Terms + * + ******************************************************************************/ + +AccessAttribKeyword + : PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK);} + | PARSEOP_ACCESSATTRIB_BLOCK_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK_CALL);} + | PARSEOP_ACCESSATTRIB_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BYTE);} + | PARSEOP_ACCESSATTRIB_QUICK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_QUICK );} + | PARSEOP_ACCESSATTRIB_SND_RCV {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_SND_RCV);} + | PARSEOP_ACCESSATTRIB_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD);} + | PARSEOP_ACCESSATTRIB_WORD_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD_CALL);} + | PARSEOP_ACCESSATTRIB_MULTIBYTE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);} + ByteConst + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_ACCESSATTRIB_RAW_BYTES '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);} + ByteConst + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_ACCESSATTRIB_RAW_PROCESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);} + ByteConst + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + ; + +AccessTypeKeyword + : PARSEOP_ACCESSTYPE_ANY {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_ANY);} + | PARSEOP_ACCESSTYPE_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BYTE);} + | PARSEOP_ACCESSTYPE_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_WORD);} + | PARSEOP_ACCESSTYPE_DWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_DWORD);} + | PARSEOP_ACCESSTYPE_QWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_QWORD);} + | PARSEOP_ACCESSTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BUF);} + ; + +AddressingModeKeyword + : PARSEOP_ADDRESSINGMODE_7BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_7BIT);} + | PARSEOP_ADDRESSINGMODE_10BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_10BIT);} + ; + +AddressKeyword + : PARSEOP_ADDRESSTYPE_MEMORY {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_MEMORY);} + | PARSEOP_ADDRESSTYPE_RESERVED {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_RESERVED);} + | PARSEOP_ADDRESSTYPE_NVS {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_NVS);} + | PARSEOP_ADDRESSTYPE_ACPI {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_ACPI);} + ; + +AddressSpaceKeyword + : ByteConst {$$ = UtCheckIntegerRange ($1, 0x0A, 0xFF);} + | RegionSpaceKeyword {} + ; + +BitsPerByteKeyword + : PARSEOP_BITSPERBYTE_FIVE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_FIVE);} + | PARSEOP_BITSPERBYTE_SIX {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SIX);} + | PARSEOP_BITSPERBYTE_SEVEN {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SEVEN);} + | PARSEOP_BITSPERBYTE_EIGHT {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_EIGHT);} + | PARSEOP_BITSPERBYTE_NINE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_NINE);} + ; + +ClockPhaseKeyword + : PARSEOP_CLOCKPHASE_FIRST {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_FIRST);} + | PARSEOP_CLOCKPHASE_SECOND {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_SECOND);} + ; + +ClockPolarityKeyword + : PARSEOP_CLOCKPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_LOW);} + | PARSEOP_CLOCKPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_HIGH);} + ; + +DecodeKeyword + : PARSEOP_DECODETYPE_POS {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_POS);} + | PARSEOP_DECODETYPE_SUB {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_SUB);} + ; + +DevicePolarityKeyword + : PARSEOP_DEVICEPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_LOW);} + | PARSEOP_DEVICEPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_HIGH);} + ; + +DMATypeKeyword + : PARSEOP_DMATYPE_A {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_A);} + | PARSEOP_DMATYPE_COMPATIBILITY {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_COMPATIBILITY);} + | PARSEOP_DMATYPE_B {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_B);} + | PARSEOP_DMATYPE_F {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_F);} + ; + +EndianKeyword + : PARSEOP_ENDIAN_LITTLE {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_LITTLE);} + | PARSEOP_ENDIAN_BIG {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_BIG);} + ; + +FlowControlKeyword + : PARSEOP_FLOWCONTROL_HW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_HW);} + | PARSEOP_FLOWCONTROL_NONE {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_NONE);} + | PARSEOP_FLOWCONTROL_SW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_SW);} + ; + +InterruptLevel + : PARSEOP_INTLEVEL_ACTIVEBOTH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEBOTH);} + | PARSEOP_INTLEVEL_ACTIVEHIGH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEHIGH);} + | PARSEOP_INTLEVEL_ACTIVELOW {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVELOW);} + ; + +InterruptTypeKeyword + : PARSEOP_INTTYPE_EDGE {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_EDGE);} + | PARSEOP_INTTYPE_LEVEL {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_LEVEL);} + ; + +IODecodeKeyword + : PARSEOP_IODECODETYPE_16 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_16);} + | PARSEOP_IODECODETYPE_10 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_10);} + ; + +IoRestrictionKeyword + : PARSEOP_IORESTRICT_IN {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_IN);} + | PARSEOP_IORESTRICT_OUT {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_OUT);} + | PARSEOP_IORESTRICT_NONE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_NONE);} + | PARSEOP_IORESTRICT_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_PRESERVE);} + ; + +LockRuleKeyword + : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);} + | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_NOLOCK);} + ; + +MatchOpKeyword + : PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);} + | PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);} + | PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLE);} + | PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLT);} + | PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGE);} + | PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGT);} + ; + +MaxKeyword + : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);} + | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);} + ; + +MemTypeKeyword + : PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_CACHEABLE);} + | PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_WRITECOMBINING);} + | PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_PREFETCHABLE);} + | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_NONCACHEABLE);} + ; + +MinKeyword + : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);} + | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);} + ; + +ObjectTypeKeyword + : PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} + | PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_INT);} + | PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_STR);} + | PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BUF);} + | PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PKG);} + | PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_FLD);} + | PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DEV);} + | PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_EVT);} + | PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTH);} + | PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTX);} + | PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_OPR);} + | PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_POW);} + | PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PRO);} + | PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_THZ);} + | PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BFF);} + | PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DDB);} + ; + +ParityTypeKeyword + : PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_SPACE);} + | PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_MARK);} + | PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_ODD);} + | PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_EVEN);} + | PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_NONE);} + ; + +PinConfigByte + : PinConfigKeyword {$$ = $1;} + | ByteConstExpr {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} + ; + +PinConfigKeyword + : PARSEOP_PIN_NOPULL {$$ = TrCreateLeafNode (PARSEOP_PIN_NOPULL);} + | PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDOWN);} + | PARSEOP_PIN_PULLUP {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLUP);} + | PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDEFAULT);} + ; + +PldKeyword + : PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);} + | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);} + | PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);} + | PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);} + | PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);} + | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);} + | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);} + | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);} + | PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);} + | PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);} + | PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);} + | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);} + | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);} + | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);} + | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);} + | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);} + | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);} + | PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);} + | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);} + | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);} + | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);} + | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);} + | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);} + | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);} + | PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);} + | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);} + | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);} + | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);} + ; + +RangeTypeKeyword + : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);} + | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);} + | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ENTIRE);} + ; + +RegionSpaceKeyword + : PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IO);} + | PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_MEM);} + | PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCI);} + | PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_EC);} + | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);} + | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);} + | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);} + | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);} + | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);} + | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);} + | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);} + | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);} + ; + +ResourceTypeKeyword + : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} + | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);} + ; + +SerializeRuleKeyword + : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);} + | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL);} + ; + +ShareTypeKeyword + : PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHARED);} + | PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVE);} + | PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHAREDWAKE);} + | PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);} + ; + +SlaveModeKeyword + : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_CONTROLLERINIT);} + | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_DEVICEINIT);} + ; + +StopBitsKeyword + : PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_TWO);} + | PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONEPLUSHALF);} + | PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONE);} + | PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ZERO);} + ; + +TranslationKeyword + : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);} + | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);} + ; + +TypeKeyword + : PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafNode (PARSEOP_TYPE_TRANSLATION);} + | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafNode (PARSEOP_TYPE_STATIC);} + ; + +UpdateRuleKeyword + : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);} + | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);} + | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);} + ; + +WireModeKeyword + : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_FOUR);} + | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_THREE);} + ; + +XferSizeKeyword + : PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_8, 0);} + | PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_16, 1);} + | PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} + | PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_64, 3);} + | PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_128, 4);} + | PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_256, 5);} + ; + +XferTypeKeyword + : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);} + | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);} + | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);} + ; + + +/******************************************************************************* + * + * ASL Resource Template Terms + * + ******************************************************************************/ + +/* + * Note: Create two default nodes to allow conversion to a Buffer AML opcode + * Also, insert the EndTag at the end of the template. + */ +ResourceTemplateTerm + : PARSEOP_RESOURCETEMPLATE '(' ')' + '{' + ResourceMacroList '}' {$$ = TrCreateNode (PARSEOP_RESOURCETEMPLATE,4, + TrCreateLeafNode (PARSEOP_DEFAULT_ARG), + TrCreateLeafNode (PARSEOP_DEFAULT_ARG), + $5, + TrCreateLeafNode (PARSEOP_ENDTAG));} + ; + +ResourceMacroList + : {$$ = NULL;} + | ResourceMacroList + ResourceMacroTerm {$$ = TrLinkPeerNode ($1,$2);} + ; + +ResourceMacroTerm + : DMATerm {} + | DWordIOTerm {} + | DWordMemoryTerm {} + | DWordSpaceTerm {} + | EndDependentFnTerm {} + | ExtendedIOTerm {} + | ExtendedMemoryTerm {} + | ExtendedSpaceTerm {} + | FixedDmaTerm {} + | FixedIOTerm {} + | GpioIntTerm {} + | GpioIoTerm {} + | I2cSerialBusTerm {} + | InterruptTerm {} + | IOTerm {} + | IRQNoFlagsTerm {} + | IRQTerm {} + | Memory24Term {} + | Memory32FixedTerm {} + | Memory32Term {} + | QWordIOTerm {} + | QWordMemoryTerm {} + | QWordSpaceTerm {} + | RegisterTerm {} + | SpiSerialBusTerm {} + | StartDependentFnNoPriTerm {} + | StartDependentFnTerm {} + | UartSerialBusTerm {} + | VendorLongTerm {} + | VendorShortTerm {} + | WordBusNumberTerm {} + | WordIOTerm {} + | WordSpaceTerm {} + ; + +DMATerm + : PARSEOP_DMA '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DMA);} + DMATypeKeyword + OptionalBusMasterKeyword + ',' XferTypeKeyword + OptionalNameString_Last + ')' '{' + ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$5,$7,$8,$11);} + | PARSEOP_DMA '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +DWordIOTerm + : PARSEOP_DWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDIO);} + OptionalResourceType_First + OptionalMinType + OptionalMaxType + OptionalDecodeType + OptionalRangeType + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString + OptionalType + OptionalTranslationType_Last + ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} + | PARSEOP_DWORDIO '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +DWordMemoryTerm + : PARSEOP_DWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);} + OptionalResourceType_First + OptionalDecodeType + OptionalMinType + OptionalMaxType + OptionalMemType + ',' OptionalReadWriteKeyword + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString + OptionalAddressRange + OptionalType_Last + ')' {$$ = 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;} + ; + +DWordSpaceTerm + : PARSEOP_DWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);} + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} + OptionalResourceType + OptionalDecodeType + OptionalMinType + OptionalMaxType + ',' ByteConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} + | PARSEOP_DWORDSPACE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +EndDependentFnTerm + : PARSEOP_ENDDEPENDENTFN '(' + ')' {$$ = TrCreateLeafNode (PARSEOP_ENDDEPENDENTFN);} + | PARSEOP_ENDDEPENDENTFN '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ExtendedIOTerm + : PARSEOP_EXTENDEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);} + OptionalResourceType_First + OptionalMinType + OptionalMaxType + OptionalDecodeType + OptionalRangeType + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + OptionalQWordConstExpr + OptionalNameString + OptionalType + OptionalTranslationType_Last + ')' {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22);} + | PARSEOP_EXTENDEDIO '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ExtendedMemoryTerm + : PARSEOP_EXTENDEDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);} + OptionalResourceType_First + OptionalDecodeType + OptionalMinType + OptionalMaxType + OptionalMemType + ',' OptionalReadWriteKeyword + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + OptionalQWordConstExpr + OptionalNameString + OptionalAddressRange + OptionalType_Last + ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24);} + | PARSEOP_EXTENDEDMEMORY '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ExtendedSpaceTerm + : PARSEOP_EXTENDEDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);} + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} + OptionalResourceType + OptionalDecodeType + OptionalMinType + OptionalMaxType + ',' ByteConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + OptionalQWordConstExpr + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($<n>3,13,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23);} + | PARSEOP_EXTENDEDSPACE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +FixedDmaTerm + : PARSEOP_FIXEDDMA '(' {$<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;} + ; + +FixedIOTerm + : PARSEOP_FIXEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDIO);} + WordConstExpr + ',' ByteConstExpr + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} + | PARSEOP_FIXEDIO '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +GpioIntTerm + : PARSEOP_GPIO_INT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);} + InterruptTypeKeyword /* 04: InterruptType */ + ',' InterruptLevel /* 06: InterruptLevel */ + OptionalShareType /* 07: SharedType */ + ',' PinConfigByte /* 09: PinConfig */ + OptionalWordConstExpr /* 10: DebounceTimeout */ + ',' StringData /* 12: ResourceSource */ + OptionalByteConstExpr /* 13: ResourceSourceIndex */ + OptionalResourceType /* 14: ResourceType */ + OptionalNameString /* 15: DescriptorName */ + OptionalBuffer_Last /* 16: VendorData */ + ')' '{' + DWordConstExpr '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);} + | PARSEOP_GPIO_INT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +GpioIoTerm + : PARSEOP_GPIO_IO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);} + OptionalShareType_First /* 04: SharedType */ + ',' PinConfigByte /* 06: PinConfig */ + OptionalWordConstExpr /* 07: DebounceTimeout */ + OptionalWordConstExpr /* 08: DriveStrength */ + OptionalIoRestriction /* 09: IoRestriction */ + ',' StringData /* 11: ResourceSource */ + OptionalByteConstExpr /* 12: ResourceSourceIndex */ + OptionalResourceType /* 13: ResourceType */ + OptionalNameString /* 14: DescriptorName */ + OptionalBuffer_Last /* 15: VendorData */ + ')' '{' + DWordList '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);} + | PARSEOP_GPIO_IO '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +I2cSerialBusTerm + : PARSEOP_I2C_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);} + WordConstExpr /* 04: SlaveAddress */ + OptionalSlaveMode /* 05: SlaveMode */ + ',' DWordConstExpr /* 07: ConnectionSpeed */ + OptionalAddressingMode /* 08: AddressingMode */ + ',' StringData /* 10: ResourceSource */ + OptionalByteConstExpr /* 11: ResourceSourceIndex */ + OptionalResourceType /* 12: ResourceType */ + OptionalNameString /* 13: DescriptorName */ + OptionalBuffer_Last /* 14: VendorData */ + ')' {$$ = TrLinkChildren ($<n>3,9,$4,$5,$7,$8,$10,$11,$12,$13,$14);} + | PARSEOP_I2C_SERIALBUS '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +InterruptTerm + : PARSEOP_INTERRUPT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} + OptionalResourceType_First + ',' InterruptTypeKeyword + ',' InterruptLevel + OptionalShareType + OptionalByteConstExpr + OptionalStringData + OptionalNameString_Last + ')' '{' + DWordList '}' {$$ = TrLinkChildren ($<n>3,8,$4,$6,$8,$9,$10,$11,$12,$15);} + | PARSEOP_INTERRUPT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +IOTerm + : PARSEOP_IO '(' {$<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;} + ; + +IRQNoFlagsTerm + : PARSEOP_IRQNOFLAGS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);} + OptionalNameString_First + ')' '{' + ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_IRQNOFLAGS '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +IRQTerm + : PARSEOP_IRQ '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQ);} + InterruptTypeKeyword + ',' InterruptLevel + OptionalShareType + OptionalNameString_Last + ')' '{' + ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$7,$8,$11);} + | PARSEOP_IRQ '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +Memory24Term + : PARSEOP_MEMORY24 '(' {$<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;} + ; + +Memory32FixedTerm + : PARSEOP_MEMORY32FIXED '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);} + OptionalReadWriteKeyword + ',' DWordConstExpr + ',' DWordConstExpr + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($<n>3,4,$4,$6,$8,$9);} + | PARSEOP_MEMORY32FIXED '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +Memory32Term + : PARSEOP_MEMORY32 '(' {$<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;} + ; + +QWordIOTerm + : PARSEOP_QWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDIO);} + OptionalResourceType_First + OptionalMinType + OptionalMaxType + OptionalDecodeType + OptionalRangeType + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString + OptionalType + OptionalTranslationType_Last + ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} + | PARSEOP_QWORDIO '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +QWordMemoryTerm + : PARSEOP_QWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);} + OptionalResourceType_First + OptionalDecodeType + OptionalMinType + OptionalMaxType + OptionalMemType + ',' OptionalReadWriteKeyword + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString + OptionalAddressRange + OptionalType_Last + ')' {$$ = 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;} + ; + +QWordSpaceTerm + : PARSEOP_QWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);} + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} + OptionalResourceType + OptionalDecodeType + OptionalMinType + OptionalMaxType + ',' ByteConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} + | PARSEOP_QWORDSPACE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +RegisterTerm + : PARSEOP_REGISTER '(' {$<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;} + ; + +SpiSerialBusTerm + : PARSEOP_SPI_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);} + WordConstExpr /* 04: DeviceSelection */ + OptionalDevicePolarity /* 05: DevicePolarity */ + OptionalWireMode /* 06: WireMode */ + ',' ByteConstExpr /* 08: DataBitLength */ + OptionalSlaveMode /* 09: SlaveMode */ + ',' DWordConstExpr /* 11: ConnectionSpeed */ + ',' ClockPolarityKeyword /* 13: ClockPolarity */ + ',' ClockPhaseKeyword /* 15: ClockPhase */ + ',' StringData /* 17: ResourceSource */ + OptionalByteConstExpr /* 18: ResourceSourceIndex */ + OptionalResourceType /* 19: ResourceType */ + OptionalNameString /* 20: DescriptorName */ + OptionalBuffer_Last /* 21: VendorData */ + ')' {$$ = TrLinkChildren ($<n>3,13,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21);} + | PARSEOP_SPI_SERIALBUS '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +StartDependentFnNoPriTerm + : PARSEOP_STARTDEPENDENTFN_NOPRI '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} + ')' '{' + ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,1,$6);} + | PARSEOP_STARTDEPENDENTFN_NOPRI '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +StartDependentFnTerm + : PARSEOP_STARTDEPENDENTFN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);} + ByteConstExpr + ',' ByteConstExpr + ')' '{' + ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$9);} + | PARSEOP_STARTDEPENDENTFN '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +UartSerialBusTerm + : PARSEOP_UART_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);} + DWordConstExpr /* 04: ConnectionSpeed */ + OptionalBitsPerByte /* 05: BitsPerByte */ + OptionalStopBits /* 06: StopBits */ + ',' ByteConstExpr /* 08: LinesInUse */ + OptionalEndian /* 09: Endianess */ + OptionalParityType /* 10: Parity */ + OptionalFlowControl /* 11: FlowControl */ + ',' WordConstExpr /* 13: Rx BufferSize */ + ',' WordConstExpr /* 15: Tx BufferSize */ + ',' StringData /* 17: ResourceSource */ + OptionalByteConstExpr /* 18: ResourceSourceIndex */ + OptionalResourceType /* 19: ResourceType */ + OptionalNameString /* 20: DescriptorName */ + OptionalBuffer_Last /* 21: VendorData */ + ')' {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21);} + | PARSEOP_UART_SERIALBUS '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +VendorLongTerm + : PARSEOP_VENDORLONG '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORLONG);} + OptionalNameString_First + ')' '{' + ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_VENDORLONG '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +VendorShortTerm + : PARSEOP_VENDORSHORT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);} + OptionalNameString_First + ')' '{' + ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_VENDORSHORT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +WordBusNumberTerm + : PARSEOP_WORDBUSNUMBER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);} + OptionalResourceType_First + OptionalMinType + OptionalMaxType + OptionalDecodeType + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($<n>3,12,$4,$5,$6,$7,$9,$11,$13,$15,$17,$18,$19,$20);} + | PARSEOP_WORDBUSNUMBER '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +WordIOTerm + : PARSEOP_WORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDIO);} + OptionalResourceType_First + OptionalMinType + OptionalMaxType + OptionalDecodeType + OptionalRangeType + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString + OptionalType + OptionalTranslationType_Last + ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} + | PARSEOP_WORDIO '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +WordSpaceTerm + : PARSEOP_WORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDSPACE);} + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} + OptionalResourceType + OptionalDecodeType + OptionalMinType + OptionalMaxType + ',' ByteConstExpr + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} + | PARSEOP_WORDSPACE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + + +/******* Object References ***********************************************/ + +/* Allow IO, DMA, IRQ Resource macro names to also be used as identifiers */ + +NameString + : NameSeg {} + | PARSEOP_NAMESTRING {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) AslCompilerlval.s);} + | PARSEOP_IO {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IO");} + | PARSEOP_DMA {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "DMA");} + | PARSEOP_IRQ {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IRQ");} + ; + +NameSeg + : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, (ACPI_NATIVE_INT) AslCompilerlval.s);} + ; + + +/******************************************************************************* + * + * ASL Helper Terms + * + ******************************************************************************/ + +OptionalBusMasterKeyword + : ',' {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);} + | ',' PARSEOP_BUSMASTERTYPE_MASTER {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);} + | ',' PARSEOP_BUSMASTERTYPE_NOTMASTER {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_NOTMASTER);} + ; + +OptionalAccessAttribTerm + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' ByteConstExpr {$$ = $2;} + | ',' AccessAttribKeyword {$$ = $2;} + ; + +OptionalAccessSize + : {$$ = TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0);} + | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0);} + | ',' ByteConstExpr {$$ = $2;} + ; + +OptionalAddressingMode + : ',' {$$ = NULL;} + | ',' AddressingModeKeyword {$$ = $2;} + ; + +OptionalAddressRange + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' AddressKeyword {$$ = $2;} + ; + +OptionalBitsPerByte + : ',' {$$ = NULL;} + | ',' BitsPerByteKeyword {$$ = $2;} + ; + +OptionalBuffer_Last + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' RawDataBufferTerm {$$ = $2;} + ; + +OptionalByteConstExpr + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' ByteConstExpr {$$ = $2;} + ; + +OptionalDecodeType + : ',' {$$ = NULL;} + | ',' DecodeKeyword {$$ = $2;} + ; + +OptionalDevicePolarity + : ',' {$$ = NULL;} + | ',' DevicePolarityKeyword {$$ = $2;} + ; + +OptionalDWordConstExpr + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' DWordConstExpr {$$ = $2;} + ; + +OptionalEndian + : ',' {$$ = NULL;} + | ',' EndianKeyword {$$ = $2;} + ; + +OptionalFlowControl + : ',' {$$ = NULL;} + | ',' FlowControlKeyword {$$ = $2;} + ; + +OptionalIoRestriction + : ',' {$$ = NULL;} + | ',' IoRestrictionKeyword {$$ = $2;} + ; + +OptionalListString + : {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ + | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ + | ',' TermArg {$$ = $2;} + ; + +OptionalMaxType + : ',' {$$ = NULL;} + | ',' MaxKeyword {$$ = $2;} + ; + +OptionalMemType + : ',' {$$ = NULL;} + | ',' MemTypeKeyword {$$ = $2;} + ; + +OptionalMinType + : ',' {$$ = NULL;} + | ',' MinKeyword {$$ = $2;} + ; + +OptionalNameString + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' NameString {$$ = $2;} + ; + +OptionalNameString_Last + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' NameString {$$ = $2;} + ; + +OptionalNameString_First + : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} + | NameString {$$ = $1;} + ; + +OptionalObjectTypeKeyword + : {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} + | ',' ObjectTypeKeyword {$$ = $2;} + ; + +OptionalParityType + : ',' {$$ = NULL;} + | ',' ParityTypeKeyword {$$ = $2;} + ; + +OptionalQWordConstExpr + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' QWordConstExpr {$$ = $2;} + ; + +OptionalRangeType + : ',' {$$ = NULL;} + | ',' RangeTypeKeyword {$$ = $2;} + ; + +OptionalReadWriteKeyword + : {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);} + | PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);} + | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_READONLY);} + ; + +OptionalResourceType_First + : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} + | ResourceTypeKeyword {$$ = $1;} + ; + +OptionalResourceType + : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} + | ',' {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} + | ',' ResourceTypeKeyword {$$ = $2;} + ; + +OptionalSlaveMode + : ',' {$$ = NULL;} + | ',' SlaveModeKeyword {$$ = $2;} + ; + +OptionalShareType + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' ShareTypeKeyword {$$ = $2;} + ; + +OptionalShareType_First + : {$$ = NULL;} + | ShareTypeKeyword {$$ = $1;} + ; + +OptionalStopBits + : ',' {$$ = NULL;} + | ',' StopBitsKeyword {$$ = $2;} + ; + +OptionalStringData + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' StringData {$$ = $2;} + ; + +OptionalTranslationType_Last + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' TranslationKeyword {$$ = $2;} + ; + +OptionalType + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' TypeKeyword {$$ = $2;} + ; + +OptionalType_Last + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' TypeKeyword {$$ = $2;} + ; + +OptionalWireMode + : ',' {$$ = NULL;} + | ',' WireModeKeyword {$$ = $2;} + ; + +OptionalWordConstExpr + : ',' {$$ = NULL;} + | ',' WordConstExpr {$$ = $2;} + ; + +OptionalXferSize + : {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} + | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} + | ',' XferSizeKeyword {$$ = $2;} + ; diff --git a/src/acpica/source/compiler/aslrules.y b/src/acpica/source/compiler/aslrules.y index 63a0375..789df32 100644 --- a/src/acpica/source/compiler/aslrules.y +++ b/src/acpica/source/compiler/aslrules.y @@ -1,7 +1,7 @@ NoEcho(' /****************************************************************************** * - * Module Name: aslrules.y - Bison/Yacc production rules + * Module Name: aslrules.y - Main Bison/Yacc production rules * *****************************************************************************/ @@ -118,14 +118,12 @@ NoEcho(' /******************************************************************************* * - * Production rules start here + * ASL Root and Secondary Terms * ******************************************************************************/ /* - * ASL Names - * - * Root rule. Allow multiple #line directives before the definition block + * Root term. Allow multiple #line directives before the definition block * to handle output from preprocessors */ ASLCode @@ -134,10 +132,6 @@ ASLCode ; /* - * Blocks, Data, and Opcodes - */ - -/* * Note concerning support for "module-level code". * * ACPI 1.0 allowed Type1 and Type2 executable opcodes outside of control @@ -164,292 +158,128 @@ DefinitionBlockTerm '{' TermList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$6,$8,$10,$12,$14,$18);} ; - /* - * ASL Extensions: C-style math/logical operators and expressions. - * The implementation transforms these operators into the standard - * AML opcodes and syntax. - * - * Supported operators and precedence rules (high-to-low) - * - * NOTE: The operator precedence and associativity rules are - * implemented by the tokens in asltokens.y - * - * (left-to-right): - * 1) ( ) expr++ expr-- - * - * (right-to-left): - * 2) ! ~ - * - * (left-to-right): - * 3) * / % - * 4) + - - * 5) >> << - * 6) < > <= >= - * 7) == != - * 8) & - * 9) ^ - * 10) | - * 11) && - * 12) || - * - * (right-to-left): - * 13) = += -= *= /= %= <<= >>= &= ^= |= - */ -Expression - - /* Unary operators */ - - : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} - TermArg {$$ = TrLinkChildren ($<n>2,1,$3);} - | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} - TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateNullTarget ());} - - | SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} - {$$ = TrLinkChildren ($<n>3,1,$1);} - | SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} - {$$ = TrLinkChildren ($<n>3,1,$1);} - - /* Binary operators: math and logical */ - - | TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} - TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), - TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - - | TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());} - - | TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - | TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - | TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - | TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - - | TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - - | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} - TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - - /* Parentheses */ - - | '(' TermArg ')' { $$ = $2;} - ; - -EqualsTerm - - /* All assignment-type operations */ - - : SuperName PARSEOP_EXP_EQUALS - TermArg {$$ = TrCreateAssignmentNode ($1, $3);} - - | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} - - | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} - TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (), - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} - - | TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} - - | TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} - - | TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} - - | TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} - - | TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} - - | TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} - - | TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} +SuperName + : NameString {} + | ArgTerm {} + | LocalTerm {} + | DebugTerm {} + | Type6Opcode {} - | TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} - TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} +Target + : {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ + | ',' {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ + | ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} ; +TermArg + : 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);} + ; -/* ACPI 3.0 -- allow semicolons between terms */ +/* + NOTE: Removed from TermArg due to reduce/reduce conflicts: + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} + | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} + | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} + | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} -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;} +MethodInvocationTerm + : NameString '(' {TrUpdateNode (PARSEOP_METHODCALL, $1);} + ArgList ')' {$$ = TrLinkChildNode ($1,$4);} ; -CompilerDirective - : IncludeTerm {} - | ExternalTerm {} - ; +/* OptionalCount must appear before ByteList or an incorrect reduction will result */ -ObjectList - : {$$ = NULL;} - | ObjectList Object {$$ = TrLinkPeerNode ($1,$2);} - | error {$$ = AslDoError(); yyclearin;} +OptionalCount + : {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ + | ',' {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ + | ',' TermArg {$$ = $2;} ; -Object - : CompilerDirective {} - | NamedObject {} - | NameSpaceModifier {} +VarPackageLengthTerm + : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} + | TermArg {$$ = $1;} ; -DataObject - : BufferData {} - | PackageData {} - | IntegerData {} - | StringData {} - ; -BufferData - : Type5Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} - | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} - | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} - | BufferTerm {} - ; +/******* List Terms **************************************************/ -PackageData - : PackageTerm {} +ArgList + : {$$ = NULL;} + | TermArg + | ArgList ',' /* Allows a trailing comma at list end */ + | ArgList ',' + TermArg {$$ = TrLinkPeerNode ($1,$3);} ; -IntegerData - : Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} - | Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} - | Integer {} - | ConstTerm {} +ByteList + : {$$ = NULL;} + | ByteConstExpr + | ByteList ',' /* Allows a trailing comma at list end */ + | ByteList ',' + ByteConstExpr {$$ = TrLinkPeerNode ($1,$3);} ; -StringData - : Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} - | String {} +DWordList + : {$$ = NULL;} + | DWordConstExpr + | DWordList ',' /* Allows a trailing comma at list end */ + | DWordList ',' + DWordConstExpr {$$ = TrLinkPeerNode ($1,$3);} ; -NamedObject - : BankFieldTerm {} - | CreateBitFieldTerm {} - | CreateByteFieldTerm {} - | CreateDWordFieldTerm {} - | CreateFieldTerm {} - | CreateQWordFieldTerm {} - | CreateWordFieldTerm {} - | DataRegionTerm {} - | DeviceTerm {} - | EventTerm {} - | FieldTerm {} - | FunctionTerm {} - | IndexFieldTerm {} - | MethodTerm {} - | MutexTerm {} - | OpRegionTerm {} - | PowerResTerm {} - | ProcessorTerm {} - | ThermalZoneTerm {} +FieldUnitList + : {$$ = NULL;} + | FieldUnit + | FieldUnitList ',' /* Allows a trailing comma at list end */ + | FieldUnitList ',' + FieldUnit {$$ = TrLinkPeerNode ($1,$3);} ; -NameSpaceModifier - : AliasTerm {} - | NameTerm {} - | ScopeTerm {} +FieldUnit + : FieldUnitEntry {} + | OffsetTerm {} + | AccessAsTerm {} + | ConnectionTerm {} ; -MethodInvocationTerm - : NameString '(' {TrUpdateNode (PARSEOP_METHODCALL, $1);} - ArgList ')' {$$ = TrLinkChildNode ($1,$4);} +FieldUnitEntry + : ',' AmlPackageLengthTerm {$$ = TrCreateNode (PARSEOP_RESERVED_BYTES,1,$2);} + | NameSeg ',' + AmlPackageLengthTerm {$$ = TrLinkChildNode ($1,$3);} ; -ArgList +ObjectList : {$$ = NULL;} - | TermArg - | ArgList ',' /* Allows a trailing comma at list end */ - | ArgList ',' - TermArg {$$ = TrLinkPeerNode ($1,$3);} - ; - -/* -Removed from TermArg due to reduce/reduce conflicts - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} - -*/ - -TermArg - : 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);} + | ObjectList Object {$$ = TrLinkPeerNode ($1,$2);} + | error {$$ = AslDoError(); yyclearin;} ; -Target - : {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ - | ',' {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ - | ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} +Object + : CompilerDirective {} + | NamedObject {} + | NameSpaceModifier {} ; -RequiredTarget - : ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} +PackageList + : {$$ = NULL;} + | PackageElement + | PackageList ',' /* Allows a trailing comma at list end */ + | PackageList ',' + PackageElement {$$ = TrLinkPeerNode ($1,$3);} ; -SimpleTarget - : NameString {} - | LocalTerm {} - | ArgTerm {} +PackageElement + : DataObject {} + | NameString {} ; -/* Rules for specifying the type of one method argument or return value */ + /* Rules for specifying the type of one method argument or return value */ ParameterTypePackage : {$$ = NULL;} @@ -469,7 +299,7 @@ OptionalParameterTypePackage | ',' ParameterTypePackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} ; -/* Rules for specifying the types for method arguments */ + /* Rules for specifying the types for method arguments */ ParameterTypesPackage : ParameterTypePackageList {$$ = $1;} @@ -488,50 +318,277 @@ OptionalParameterTypesPackage | ',' ParameterTypesPackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} ; + /* ACPI 3.0 -- allow semicolons between terms */ -/* Opcode types */ - -Type1Opcode - : BreakTerm {} - | BreakPointTerm {} - | ContinueTerm {} - | FatalTerm {} - | IfElseTerm {} - | LoadTerm {} - | NoOpTerm {} - | NotifyTerm {} - | ReleaseTerm {} - | ResetTerm {} - | ReturnTerm {} - | SignalTerm {} - | SleepTerm {} - | StallTerm {} - | SwitchTerm {} - | UnloadTerm {} - | WhileTerm {} +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);} ; -Type2Opcode - : AcquireTerm {} - | CondRefOfTerm {} - | CopyObjectTerm {} - | DerefOfTerm {} - | ObjectTypeTerm {} - | RefOfTerm {} - | SizeOfTerm {} - | StoreTerm {} - | EqualsTerm {} - | TimerTerm {} - | WaitTerm {} - | MethodInvocationTerm {} +Term + : Object {} + | Type1Opcode {} + | Type2Opcode {} + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} + | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} + | Type2BufferOpcode {} + | Type2BufferOrStringOpcode {} + | error {$$ = AslDoError(); yyclearin;} ; /* - * Type 3/4/5 opcodes + * Case-Default list; allow only one Default term and unlimited Case terms */ +CaseDefaultTermList + : {$$ = NULL;} + | CaseTerm {} + | DefaultTerm {} + | CaseDefaultTermList + CaseTerm {$$ = TrLinkPeerNode ($1,$2);} + | CaseDefaultTermList + DefaultTerm {$$ = TrLinkPeerNode ($1,$2);} -Type2IntegerOpcode /* "Type3" opcodes */ - : Expression {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} +/* Original - attempts to force zero or one default term within the switch */ + +/* +CaseDefaultTermList + : {$$ = NULL;} + | CaseTermList + DefaultTerm + CaseTermList {$$ = TrLinkPeerNode ($1,TrLinkPeerNode ($2, $3));} + | CaseTermList + CaseTerm {$$ = TrLinkPeerNode ($1,$2);} + ; + +CaseTermList + : {$$ = NULL;} + | CaseTerm {} + | CaseTermList + CaseTerm {$$ = TrLinkPeerNode ($1,$2);} + ; +*/ + + +/******************************************************************************* + * + * ASL Data and Constant Terms + * + ******************************************************************************/ + +DataObject + : BufferData {} + | PackageData {} + | IntegerData {} + | StringData {} + ; + +BufferData + : Type5Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} + | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} + | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} + | BufferTerm {} + ; + +PackageData + : PackageTerm {} + ; + +IntegerData + : Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} + | Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} + | Integer {} + | ConstTerm {} + ; + +StringData + : Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} + | String {} + ; + +ByteConst + : Integer {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} + ; + +WordConst + : Integer {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} + ; + +DWordConst + : Integer {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} + ; + +QWordConst + : Integer {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} + ; + +/* + * The NODE_COMPILE_TIME_CONST flag in the following constant expressions + * enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes + * to simple integers. It is an error if these types of expressions cannot be + * reduced, since the AML grammar for ****ConstExpr requires a simple constant. + * Note: The required byte length of the constant is passed through to the + * constant folding code in the node AmlLength field. + */ +ByteConstExpr + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} + | ByteConst {} + ; + +WordConstExpr + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} + | WordConst {} + ; + +DWordConstExpr + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} + | DWordConst {} + ; + +QWordConstExpr + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} + | QWordConst {} + ; + +ConstTerm + : ConstExprTerm {} + | PARSEOP_REVISION {$$ = TrCreateLeafNode (PARSEOP_REVISION);} + ; + +ConstExprTerm + : PARSEOP_ZERO {$$ = TrCreateValuedLeafNode (PARSEOP_ZERO, 0);} + | PARSEOP_ONE {$$ = TrCreateValuedLeafNode (PARSEOP_ONE, 1);} + | PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_UINT64_MAX);} + | PARSEOP___DATE__ {$$ = TrCreateConstantLeafNode (PARSEOP___DATE__);} + | PARSEOP___FILE__ {$$ = TrCreateConstantLeafNode (PARSEOP___FILE__);} + | PARSEOP___LINE__ {$$ = TrCreateConstantLeafNode (PARSEOP___LINE__);} + | PARSEOP___PATH__ {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);} + ; + +Integer + : PARSEOP_INTEGER {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, AslCompilerlval.i);} + ; + +String + : PARSEOP_STRING_LITERAL {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, (ACPI_NATIVE_INT) AslCompilerlval.s);} + ; + + +/******************************************************************************* + * + * ASL Opcode Terms + * + ******************************************************************************/ + +CompilerDirective + : IncludeTerm {} + | ExternalTerm {} + ; + +NamedObject + : BankFieldTerm {} + | CreateBitFieldTerm {} + | CreateByteFieldTerm {} + | CreateDWordFieldTerm {} + | CreateFieldTerm {} + | CreateQWordFieldTerm {} + | CreateWordFieldTerm {} + | DataRegionTerm {} + | DeviceTerm {} + | EventTerm {} + | FieldTerm {} + | FunctionTerm {} + | IndexFieldTerm {} + | MethodTerm {} + | MutexTerm {} + | OpRegionTerm {} + | PowerResTerm {} + | ProcessorTerm {} + | ThermalZoneTerm {} + ; + +NameSpaceModifier + : AliasTerm {} + | NameTerm {} + | ScopeTerm {} + ; + +/* For ObjectType: SuperName except for MethodInvocationTerm */ + +ObjectTypeName + : NameString {} + | ArgTerm {} + | LocalTerm {} + | DebugTerm {} + | RefOfTerm {} + | DerefOfTerm {} + | IndexTerm {} + +/* | MethodInvocationTerm {} */ /* Caused reduce/reduce with Type6Opcode->MethodInvocationTerm */ + ; + +RequiredTarget + : ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} + ; + +SimpleTarget + : NameString {} + | LocalTerm {} + | ArgTerm {} + ; + +/* Opcode types */ + +Type1Opcode + : BreakTerm {} + | BreakPointTerm {} + | ContinueTerm {} + | FatalTerm {} + | ElseIfTerm {} + | LoadTerm {} + | NoOpTerm {} + | NotifyTerm {} + | ReleaseTerm {} + | ResetTerm {} + | ReturnTerm {} + | SignalTerm {} + | SleepTerm {} + | StallTerm {} + | SwitchTerm {} + | UnloadTerm {} + | WhileTerm {} + ; + +Type2Opcode + : AcquireTerm {} + | CondRefOfTerm {} + | CopyObjectTerm {} + | DerefOfTerm {} + | ObjectTypeTerm {} + | RefOfTerm {} + | SizeOfTerm {} + | StoreTerm {} + | EqualsTerm {} + | TimerTerm {} + | WaitTerm {} + | MethodInvocationTerm {} + ; + +/* + * Type 3/4/5 opcodes + */ +Type2IntegerOpcode /* "Type3" opcodes */ + : Expression {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} | AddTerm {} | AndTerm {} | DecTerm {} @@ -587,7 +644,6 @@ Type2BufferOrStringOpcode /* * A type 3 opcode evaluates to an Integer and cannot have a destination operand */ - Type3Opcode : EISAIDTerm {} ; @@ -602,7 +658,6 @@ Type4Opcode ; */ - Type5Opcode : ResourceTemplateTerm {} | UnicodeTerm {} @@ -614,34 +669,74 @@ Type6Opcode : RefOfTerm {} | DerefOfTerm {} | IndexTerm {} + | IndexExpTerm {} | MethodInvocationTerm {} ; -IncludeTerm - : PARSEOP_INCLUDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCLUDE);} - String ')' {TrLinkChildren ($<n>3,1,$4);FlOpenIncludeFile ($4);} - TermList - IncludeEndTerm {$$ = TrLinkPeerNodes (3,$<n>3,$7,$8);} - ; -IncludeEndTerm - : PARSEOP_INCLUDE_END {$$ = TrCreateLeafNode (PARSEOP_INCLUDE_END);} - ; +/******************************************************************************* + * + * ASL Primary Terms + * + ******************************************************************************/ -ExternalTerm - : PARSEOP_EXTERNAL '(' - NameString - OptionalObjectTypeKeyword - OptionalParameterTypePackage - OptionalParameterTypesPackage - ')' {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);} - | PARSEOP_EXTERNAL '(' +AccessAsTerm + : PARSEOP_ACCESSAS '(' + AccessTypeKeyword + OptionalAccessAttribTerm + ')' {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);} + | PARSEOP_ACCESSAS '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +AcquireTerm + : PARSEOP_ACQUIRE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} + SuperName + ',' WordConstExpr + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$6);} + | PARSEOP_ACQUIRE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +AddTerm + : PARSEOP_ADD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_ADD '(' error ')' {$$ = AslDoError(); yyclearin;} ; +AliasTerm + : PARSEOP_ALIAS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);} + NameString + NameStringItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4, + TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} + | PARSEOP_ALIAS '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; -/******* Named Objects *******************************************************/ +AndTerm + : PARSEOP_AND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_AND '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; +ArgTerm + : PARSEOP_ARG0 {$$ = TrCreateLeafNode (PARSEOP_ARG0);} + | PARSEOP_ARG1 {$$ = TrCreateLeafNode (PARSEOP_ARG1);} + | PARSEOP_ARG2 {$$ = TrCreateLeafNode (PARSEOP_ARG2);} + | PARSEOP_ARG3 {$$ = TrCreateLeafNode (PARSEOP_ARG3);} + | PARSEOP_ARG4 {$$ = TrCreateLeafNode (PARSEOP_ARG4);} + | PARSEOP_ARG5 {$$ = TrCreateLeafNode (PARSEOP_ARG5);} + | PARSEOP_ARG6 {$$ = TrCreateLeafNode (PARSEOP_ARG6);} + ; BankFieldTerm : PARSEOP_BANKFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BANKFIELD);} @@ -657,41 +752,54 @@ BankFieldTerm error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} ; -FieldUnitList - : {$$ = NULL;} - | FieldUnit - | FieldUnitList ',' /* Allows a trailing comma at list end */ - | FieldUnitList ',' - FieldUnit {$$ = TrLinkPeerNode ($1,$3);} +BreakTerm + : PARSEOP_BREAK {$$ = TrCreateNode (PARSEOP_BREAK, 0);} ; -FieldUnit - : FieldUnitEntry {} - | OffsetTerm {} - | AccessAsTerm {} - | ConnectionTerm {} +BreakPointTerm + : PARSEOP_BREAKPOINT {$$ = TrCreateNode (PARSEOP_BREAKPOINT, 0);} ; -FieldUnitEntry - : ',' AmlPackageLengthTerm {$$ = TrCreateNode (PARSEOP_RESERVED_BYTES,1,$2);} - | NameSeg ',' - AmlPackageLengthTerm {$$ = TrLinkChildNode ($1,$3);} +BufferTerm + : PARSEOP_BUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER);} + OptionalTermArg + ')' '{' + BufferTermData '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_BUFFER '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OffsetTerm - : PARSEOP_OFFSET '(' - AmlPackageLengthTerm - ')' {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);} - | PARSEOP_OFFSET '(' +BufferTermData + : ByteList {} + | StringData {} + ; + +CaseTerm + : PARSEOP_CASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);} + DataObject + ')' '{' + TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_CASE '(' error ')' {$$ = AslDoError(); yyclearin;} ; -AccessAsTerm - : PARSEOP_ACCESSAS '(' - AccessTypeKeyword - OptionalAccessAttribTerm - ')' {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);} - | PARSEOP_ACCESSAS '(' +ConcatTerm + : PARSEOP_CONCATENATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_CONCATENATE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ConcatResTerm + : PARSEOP_CONCATENATERESTEMPLATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_CONCATENATERESTEMPLATE '(' error ')' {$$ = AslDoError(); yyclearin;} ; @@ -710,6 +818,28 @@ ConnectionTerm error ')' {$$ = AslDoError(); yyclearin;} ; +CondRefOfTerm + : PARSEOP_CONDREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} + SuperName + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_CONDREFOF '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ContinueTerm + : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);} + ; + +CopyObjectTerm + : PARSEOP_COPYOBJECT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} + TermArg + ',' SimpleTarget + ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} + | PARSEOP_COPYOBJECT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + CreateBitFieldTerm : PARSEOP_CREATEBITFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} TermArg @@ -782,6 +912,33 @@ DataRegionTerm error ')' {$$ = AslDoError(); yyclearin;} ; +DebugTerm + : PARSEOP_DEBUG {$$ = TrCreateLeafNode (PARSEOP_DEBUG);} + ; + +DecTerm + : PARSEOP_DECREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_DECREMENT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +DefaultTerm + : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFAULT);} + TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_DEFAULT '{' + error '}' {$$ = AslDoError(); yyclearin;} + ; + +DerefOfTerm + : PARSEOP_DEREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);} + TermArg + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_DEREFOF '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + DeviceTerm : PARSEOP_DEVICE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);} NameString @@ -791,6 +948,53 @@ DeviceTerm error ')' {$$ = AslDoError(); yyclearin;} ; +DivideTerm + : PARSEOP_DIVIDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} + TermArg + TermArgItem + Target + Target + ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} + | PARSEOP_DIVIDE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +EISAIDTerm + : PARSEOP_EISAID '(' + StringData ')' {$$ = TrUpdateNode (PARSEOP_EISAID, $3);} + | PARSEOP_EISAID '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ElseIfTerm + : IfTerm ElseTerm {$$ = TrLinkPeerNode ($1,$2);} + ; + +ElseTerm + : {$$ = NULL;} + | PARSEOP_ELSE '{' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} + TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} + + | PARSEOP_ELSE '{' + error '}' {$$ = AslDoError(); yyclearin;} + + | PARSEOP_ELSE + error {$$ = AslDoError(); yyclearin;} + + | PARSEOP_ELSEIF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} + TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} + ')' '{' + 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 + error {$$ = AslDoError(); yyclearin;} + ; + EventTerm : PARSEOP_EVENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EVENT);} NameString @@ -799,6 +1003,27 @@ EventTerm error ')' {$$ = AslDoError(); yyclearin;} ; +ExternalTerm + : PARSEOP_EXTERNAL '(' + NameString + OptionalObjectTypeKeyword + OptionalParameterTypePackage + OptionalParameterTypesPackage + ')' {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);} + | PARSEOP_EXTERNAL '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +FatalTerm + : PARSEOP_FATAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);} + ByteConstExpr + ',' DWordConstExpr + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} + | PARSEOP_FATAL '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + FieldTerm : PARSEOP_FIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIELD);} NameString @@ -811,198 +1036,191 @@ FieldTerm error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} ; -FunctionTerm - : PARSEOP_FUNCTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} - NameString - OptionalParameterTypePackage - OptionalParameterTypesPackage - ')' '{' - 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 '(' +FindSetLeftBitTerm + : PARSEOP_FINDSETLEFTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_FINDSETLEFTBIT '(' error ')' {$$ = AslDoError(); yyclearin;} ; -IndexFieldTerm - : PARSEOP_INDEXFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} - NameString - NameStringItem - ',' AccessTypeKeyword - ',' LockRuleKeyword - ',' UpdateRuleKeyword - ')' '{' - FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$7,$9,$11,$14);} - | PARSEOP_INDEXFIELD '(' - error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} - ; - -MethodTerm - : PARSEOP_METHOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} - NameString - OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} - OptionalSerializeRuleKeyword - OptionalByteConstExpr - OptionalParameterTypePackage - OptionalParameterTypesPackage - ')' '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$7,$8,$9,$10,$13);} - | PARSEOP_METHOD '(' +FindSetRightBitTerm + : PARSEOP_FINDSETRIGHTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_FINDSETRIGHTBIT '(' error ')' {$$ = AslDoError(); yyclearin;} ; -MutexTerm - : PARSEOP_MUTEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);} - NameString - ',' ByteConstExpr - ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} - | PARSEOP_MUTEX '(' +FprintfTerm + : PARSEOP_FPRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);} + TermArg ',' + StringData + PrintfArgList + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} + | PARSEOP_FPRINTF '(' error ')' {$$ = AslDoError(); yyclearin;} ; -OpRegionTerm - : PARSEOP_OPERATIONREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} - NameString - ',' OpRegionSpaceIdTerm - TermArgItem - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8);} - | PARSEOP_OPERATIONREGION '(' +FromBCDTerm + : PARSEOP_FROMBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_FROMBCD '(' error ')' {$$ = AslDoError(); yyclearin;} ; -OpRegionSpaceIdTerm - : RegionSpaceKeyword {} - | ByteConst {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} - ; - -PowerResTerm - : PARSEOP_POWERRESOURCE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} +FunctionTerm + : PARSEOP_FUNCTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} NameString - ',' ByteConstExpr - ',' WordConstExpr + OptionalParameterTypePackage + OptionalParameterTypesPackage ')' '{' - ObjectList '}' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);} - | PARSEOP_POWERRESOURCE '(' + 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;} ; -ProcessorTerm - : PARSEOP_PROCESSOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} - NameString - ',' ByteConstExpr - OptionalDWordConstExpr - OptionalByteConstExpr +IfTerm + : PARSEOP_IF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} + TermArg ')' '{' - ObjectList '}' {$$ = TrLinkChildren ($<n>3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);} - | PARSEOP_PROCESSOR '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; + TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} -ThermalZoneTerm - : PARSEOP_THERMALZONE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} - NameString - ')' '{' - ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} - | PARSEOP_THERMALZONE '(' + | PARSEOP_IF '(' error ')' {$$ = AslDoError(); yyclearin;} ; +IncludeTerm + : PARSEOP_INCLUDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCLUDE);} + String ')' {TrLinkChildren ($<n>3,1,$4);FlOpenIncludeFile ($4);} + TermList + IncludeEndTerm {$$ = TrLinkPeerNodes (3,$<n>3,$7,$8);} + ; -/******* Namespace modifiers *************************************************/ +IncludeEndTerm + : PARSEOP_INCLUDE_END {$$ = TrCreateLeafNode (PARSEOP_INCLUDE_END);} + ; +IncTerm + : PARSEOP_INCREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_INCREMENT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; -AliasTerm - : PARSEOP_ALIAS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);} +IndexFieldTerm + : PARSEOP_INDEXFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} NameString NameStringItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} - | PARSEOP_ALIAS '(' - error ')' {$$ = AslDoError(); yyclearin;} + ',' AccessTypeKeyword + ',' LockRuleKeyword + ',' UpdateRuleKeyword + ')' '{' + FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$7,$9,$11,$14);} + | PARSEOP_INDEXFIELD '(' + error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} ; -NameTerm - : PARSEOP_NAME '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);} - NameString - ',' DataObject - ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} - | PARSEOP_NAME '(' +IndexTerm + : PARSEOP_INDEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_INDEX '(' error ')' {$$ = AslDoError(); yyclearin;} ; -ScopeTerm - : PARSEOP_SCOPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);} - NameString - ')' '{' - ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} - | PARSEOP_SCOPE '(' +LAndTerm + : PARSEOP_LAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} + TermArg + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LAND '(' error ')' {$$ = AslDoError(); yyclearin;} ; - -/******* Type 1 opcodes *******************************************************/ - - -BreakTerm - : PARSEOP_BREAK {$$ = TrCreateNode (PARSEOP_BREAK, 0);} +LEqualTerm + : PARSEOP_LEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} + TermArg + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LEQUAL '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -BreakPointTerm - : PARSEOP_BREAKPOINT {$$ = TrCreateNode (PARSEOP_BREAKPOINT, 0);} +LGreaterEqualTerm + : PARSEOP_LGREATEREQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} + TermArg + TermArgItem + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} + | PARSEOP_LGREATEREQUAL '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -ContinueTerm - : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);} +LGreaterTerm + : PARSEOP_LGREATER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} + TermArg + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LGREATER '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -FatalTerm - : PARSEOP_FATAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);} - ByteConstExpr - ',' DWordConstExpr +LLessEqualTerm + : PARSEOP_LLESSEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} + TermArg TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} - | PARSEOP_FATAL '(' + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} + | PARSEOP_LLESSEQUAL '(' error ')' {$$ = AslDoError(); yyclearin;} ; -IfElseTerm - : IfTerm ElseTerm {$$ = TrLinkPeerNode ($1,$2);} +LLessTerm + : PARSEOP_LLESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} + TermArg + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LLESS '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -IfTerm - : PARSEOP_IF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} +LNotEqualTerm + : PARSEOP_LNOTEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} TermArg - ')' '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - - | PARSEOP_IF '(' + TermArgItem + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} + | PARSEOP_LNOTEQUAL '(' error ')' {$$ = AslDoError(); yyclearin;} ; -ElseTerm - : {$$ = NULL;} - | PARSEOP_ELSE '{' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} - TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} - - | PARSEOP_ELSE '{' - error '}' {$$ = AslDoError(); yyclearin;} - - | PARSEOP_ELSE - error {$$ = AslDoError(); yyclearin;} - - | PARSEOP_ELSEIF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} - TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} - ')' '{' - TermList '}' {TrLinkChildren ($<n>5,2,$4,$8);} - ElseTerm {TrLinkPeerNode ($<n>5,$11);} - {$$ = TrLinkChildren ($<n>3,1,$<n>5);} - - | PARSEOP_ELSEIF '(' +LNotTerm + : PARSEOP_LNOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} + TermArg + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_LNOT '(' error ')' {$$ = AslDoError(); yyclearin;} + ; - | PARSEOP_ELSEIF - error {$$ = AslDoError(); yyclearin;} +LoadTableTerm + : PARSEOP_LOADTABLE '(' {$<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;} ; LoadTerm @@ -1014,1953 +1232,535 @@ LoadTerm error ')' {$$ = AslDoError(); yyclearin;} ; -NoOpTerm - : PARSEOP_NOOP {$$ = TrCreateNode (PARSEOP_NOOP, 0);} +LocalTerm + : PARSEOP_LOCAL0 {$$ = TrCreateLeafNode (PARSEOP_LOCAL0);} + | PARSEOP_LOCAL1 {$$ = TrCreateLeafNode (PARSEOP_LOCAL1);} + | PARSEOP_LOCAL2 {$$ = TrCreateLeafNode (PARSEOP_LOCAL2);} + | PARSEOP_LOCAL3 {$$ = TrCreateLeafNode (PARSEOP_LOCAL3);} + | PARSEOP_LOCAL4 {$$ = TrCreateLeafNode (PARSEOP_LOCAL4);} + | PARSEOP_LOCAL5 {$$ = TrCreateLeafNode (PARSEOP_LOCAL5);} + | PARSEOP_LOCAL6 {$$ = TrCreateLeafNode (PARSEOP_LOCAL6);} + | PARSEOP_LOCAL7 {$$ = TrCreateLeafNode (PARSEOP_LOCAL7);} ; -NotifyTerm - : PARSEOP_NOTIFY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);} - SuperName - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_NOTIFY '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ReleaseTerm - : PARSEOP_RELEASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_RELEASE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ResetTerm - : PARSEOP_RESET '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_RESET '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ReturnTerm - : PARSEOP_RETURN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);} - OptionalReturnArg - ')' {$$ = 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;} - ; - -SignalTerm - : PARSEOP_SIGNAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_SIGNAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -SleepTerm - : PARSEOP_SLEEP '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);} - TermArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_SLEEP '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -StallTerm - : PARSEOP_STALL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);} - TermArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_STALL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -SwitchTerm - : PARSEOP_SWITCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);} - TermArg - ')' '{' - CaseDefaultTermList '}' - {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_SWITCH '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -/* - * Case-Default list; allow only one Default term and unlimited Case terms - */ - -CaseDefaultTermList - : {$$ = NULL;} - | CaseTerm {} - | DefaultTerm {} - | CaseDefaultTermList - CaseTerm {$$ = TrLinkPeerNode ($1,$2);} - | CaseDefaultTermList - DefaultTerm {$$ = TrLinkPeerNode ($1,$2);} - -/* Original - attempts to force zero or one default term within the switch */ - -/* -CaseDefaultTermList - : {$$ = NULL;} - | CaseTermList - DefaultTerm - CaseTermList {$$ = TrLinkPeerNode ($1,TrLinkPeerNode ($2, $3));} - | CaseTermList - CaseTerm {$$ = TrLinkPeerNode ($1,$2);} - ; - -CaseTermList - : {$$ = NULL;} - | CaseTerm {} - | CaseTermList - CaseTerm {$$ = TrLinkPeerNode ($1,$2);} - ; -*/ - -CaseTerm - : PARSEOP_CASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);} - DataObject - ')' '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_CASE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -DefaultTerm - : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFAULT);} - TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_DEFAULT '{' - error '}' {$$ = AslDoError(); yyclearin;} - ; - -UnloadTerm - : PARSEOP_UNLOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_UNLOAD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -WhileTerm - : PARSEOP_WHILE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} - TermArg - ')' '{' TermList '}' - {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_WHILE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - - -/******* Type 2 opcodes *******************************************************/ - -AcquireTerm - : PARSEOP_ACQUIRE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} - SuperName - ',' WordConstExpr - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$6);} - | PARSEOP_ACQUIRE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -AddTerm - : PARSEOP_ADD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} +LOrTerm + : PARSEOP_LOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} TermArg TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_ADD '(' + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LOR '(' error ')' {$$ = AslDoError(); yyclearin;} ; -AndTerm - : PARSEOP_AND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} +MatchTerm + : PARSEOP_MATCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MATCH);} TermArg + ',' MatchOpKeyword TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_AND '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ConcatTerm - : PARSEOP_CONCATENATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} - TermArg + ',' MatchOpKeyword TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_CONCATENATE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ConcatResTerm - : PARSEOP_CONCATENATERESTEMPLATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);} - TermArg TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_CONCATENATERESTEMPLATE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -CondRefOfTerm - : PARSEOP_CONDREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} - SuperName - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_CONDREFOF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -CopyObjectTerm - : PARSEOP_COPYOBJECT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} - TermArg - ',' SimpleTarget - ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} - | PARSEOP_COPYOBJECT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -DecTerm - : PARSEOP_DECREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_DECREMENT '(' + ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);} + | PARSEOP_MATCH '(' error ')' {$$ = AslDoError(); yyclearin;} ; -DerefOfTerm - : PARSEOP_DEREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);} - TermArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_DEREFOF '(' +MethodTerm + : PARSEOP_METHOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} + NameString + OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} + OptionalSerializeRuleKeyword + OptionalByteConstExpr + OptionalParameterTypePackage + OptionalParameterTypesPackage + ')' '{' + TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$7,$8,$9,$10,$13);} + | PARSEOP_METHOD '(' error ')' {$$ = AslDoError(); yyclearin;} ; -DivideTerm - : PARSEOP_DIVIDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} +MidTerm + : PARSEOP_MID '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MID);} TermArg TermArgItem - Target + TermArgItem Target ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} - | PARSEOP_DIVIDE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -FindSetLeftBitTerm - : PARSEOP_FINDSETLEFTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_FINDSETLEFTBIT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -FindSetRightBitTerm - : PARSEOP_FINDSETRIGHTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_FINDSETRIGHTBIT '(' + | PARSEOP_MID '(' error ')' {$$ = AslDoError(); yyclearin;} ; -FromBCDTerm - : PARSEOP_FROMBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);} +ModTerm + : PARSEOP_MOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} TermArg + TermArgItem Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_FROMBCD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -IncTerm - : PARSEOP_INCREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_INCREMENT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -IndexTerm - : PARSEOP_INDEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_INDEX '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LAndTerm - : PARSEOP_LAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LAND '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LEqualTerm - : PARSEOP_LEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LEQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LGreaterTerm - : PARSEOP_LGREATER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LGREATER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LGreaterEqualTerm - : PARSEOP_LGREATEREQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} - TermArg - TermArgItem - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} - | PARSEOP_LGREATEREQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LLessTerm - : PARSEOP_LLESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LLESS '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LLessEqualTerm - : PARSEOP_LLESSEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} - TermArg - TermArgItem - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} - | PARSEOP_LLESSEQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LNotTerm - : PARSEOP_LNOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} - TermArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_LNOT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LNotEqualTerm - : PARSEOP_LNOTEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} - TermArg - TermArgItem - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} - | PARSEOP_LNOTEQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LoadTableTerm - : PARSEOP_LOADTABLE '(' {$<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;} - ; - -LOrTerm - : PARSEOP_LOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LOR '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -MatchTerm - : PARSEOP_MATCH '(' {$<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;} - ; - -MidTerm - : PARSEOP_MID '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MID);} - TermArg - TermArgItem - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} - | PARSEOP_MID '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ModTerm - : PARSEOP_MOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_MOD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -MultiplyTerm - : PARSEOP_MULTIPLY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_MULTIPLY '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -NAndTerm - : PARSEOP_NAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_NAND '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -NOrTerm - : PARSEOP_NOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_NOR '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -NotTerm - : PARSEOP_NOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_NOT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ObjectTypeTerm - : PARSEOP_OBJECTTYPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} - ObjectTypeName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_OBJECTTYPE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -OrTerm - : PARSEOP_OR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_OR '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -/* - * In RefOf, the node isn't really a target, but we can't keep track of it after - * 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,TrSetNodeFlags ($4, NODE_IS_TARGET));} - | PARSEOP_REFOF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ShiftLeftTerm - : PARSEOP_SHIFTLEFT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_SHIFTLEFT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ShiftRightTerm - : PARSEOP_SHIFTRIGHT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_SHIFTRIGHT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -SizeOfTerm - : PARSEOP_SIZEOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_SIZEOF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -StoreTerm - : PARSEOP_STORE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STORE);} - TermArg - ',' SuperName - ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} - | PARSEOP_STORE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -SubtractTerm - : PARSEOP_SUBTRACT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_SUBTRACT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -TimerTerm - : PARSEOP_TIMER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);} - ')' {$$ = TrLinkChildren ($<n>3,0);} - | PARSEOP_TIMER {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_TIMER),0);} - | PARSEOP_TIMER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToBCDTerm - : PARSEOP_TOBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBCD);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_TOBCD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToBufferTerm - : PARSEOP_TOBUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_TOBUFFER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToDecimalStringTerm - : PARSEOP_TODECIMALSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_TODECIMALSTRING '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToHexStringTerm - : PARSEOP_TOHEXSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_TOHEXSTRING '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToIntegerTerm - : PARSEOP_TOINTEGER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_TOINTEGER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -PldKeyword - : PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);} - | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);} - | PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);} - | PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);} - | PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);} - | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);} - | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);} - | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);} - | PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);} - | PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);} - | PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);} - | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);} - | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);} - | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);} - | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);} - | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);} - | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);} - | PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);} - | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);} - | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);} - | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);} - | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);} - | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);} - | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);} - | PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);} - | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);} - | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);} - | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);} - ; - -PldKeywordList - : {$$ = NULL;} - | PldKeyword - PARSEOP_EXP_EQUALS Integer {$$ = TrLinkChildren ($1,1,$3);} - | PldKeyword - PARSEOP_EXP_EQUALS String {$$ = TrLinkChildren ($1,1,$3);} - | PldKeywordList ',' /* Allows a trailing comma at list end */ - | PldKeywordList ',' - PldKeyword - PARSEOP_EXP_EQUALS Integer {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} - | PldKeywordList ',' - PldKeyword - PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} - ; - -ToPLDTerm - : PARSEOP_TOPLD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);} - PldKeywordList - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_TOPLD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -PrintfArgList - : {$$ = NULL;} - | TermArg {$$ = $1;} - | PrintfArgList ',' - TermArg {$$ = TrLinkPeerNode ($1, $3);} - ; - -PrintfTerm - : PARSEOP_PRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);} - StringData - PrintfArgList - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_PRINTF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -FprintfTerm - : PARSEOP_FPRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);} - TermArg ',' - StringData - PrintfArgList - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} - | PARSEOP_FPRINTF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToStringTerm - : PARSEOP_TOSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);} - TermArg - OptionalCount - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_TOSTRING '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToUUIDTerm - : PARSEOP_TOUUID '(' - StringData ')' {$$ = TrUpdateNode (PARSEOP_TOUUID, $3);} - | PARSEOP_TOUUID '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -WaitTerm - : PARSEOP_WAIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);} - SuperName - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_WAIT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -XOrTerm - : PARSEOP_XOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_XOR '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - - -/******* Keywords *************************************************************/ - - -AccessAttribKeyword - : PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK);} - | PARSEOP_ACCESSATTRIB_BLOCK_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK_CALL);} - | PARSEOP_ACCESSATTRIB_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BYTE);} - | PARSEOP_ACCESSATTRIB_QUICK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_QUICK );} - | PARSEOP_ACCESSATTRIB_SND_RCV {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_SND_RCV);} - | PARSEOP_ACCESSATTRIB_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD);} - | PARSEOP_ACCESSATTRIB_WORD_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD_CALL);} - | PARSEOP_ACCESSATTRIB_MULTIBYTE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);} - ByteConst - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_ACCESSATTRIB_RAW_BYTES '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);} - ByteConst - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_ACCESSATTRIB_RAW_PROCESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);} - ByteConst - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - ; - -AccessTypeKeyword - : PARSEOP_ACCESSTYPE_ANY {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_ANY);} - | PARSEOP_ACCESSTYPE_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BYTE);} - | PARSEOP_ACCESSTYPE_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_WORD);} - | PARSEOP_ACCESSTYPE_DWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_DWORD);} - | PARSEOP_ACCESSTYPE_QWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_QWORD);} - | PARSEOP_ACCESSTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BUF);} - ; - -AddressingModeKeyword - : PARSEOP_ADDRESSINGMODE_7BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_7BIT);} - | PARSEOP_ADDRESSINGMODE_10BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_10BIT);} - ; - -AddressKeyword - : PARSEOP_ADDRESSTYPE_MEMORY {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_MEMORY);} - | PARSEOP_ADDRESSTYPE_RESERVED {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_RESERVED);} - | PARSEOP_ADDRESSTYPE_NVS {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_NVS);} - | PARSEOP_ADDRESSTYPE_ACPI {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_ACPI);} - ; - -AddressSpaceKeyword - : ByteConst {$$ = UtCheckIntegerRange ($1, 0x0A, 0xFF);} - | RegionSpaceKeyword {} - ; - -BitsPerByteKeyword - : PARSEOP_BITSPERBYTE_FIVE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_FIVE);} - | PARSEOP_BITSPERBYTE_SIX {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SIX);} - | PARSEOP_BITSPERBYTE_SEVEN {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SEVEN);} - | PARSEOP_BITSPERBYTE_EIGHT {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_EIGHT);} - | PARSEOP_BITSPERBYTE_NINE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_NINE);} - ; - -ClockPhaseKeyword - : PARSEOP_CLOCKPHASE_FIRST {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_FIRST);} - | PARSEOP_CLOCKPHASE_SECOND {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_SECOND);} - ; - -ClockPolarityKeyword - : PARSEOP_CLOCKPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_LOW);} - | PARSEOP_CLOCKPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_HIGH);} - ; - -DecodeKeyword - : PARSEOP_DECODETYPE_POS {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_POS);} - | PARSEOP_DECODETYPE_SUB {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_SUB);} - ; - -DevicePolarityKeyword - : PARSEOP_DEVICEPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_LOW);} - | PARSEOP_DEVICEPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_HIGH);} - ; - -DMATypeKeyword - : PARSEOP_DMATYPE_A {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_A);} - | PARSEOP_DMATYPE_COMPATIBILITY {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_COMPATIBILITY);} - | PARSEOP_DMATYPE_B {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_B);} - | PARSEOP_DMATYPE_F {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_F);} - ; - -EndianKeyword - : PARSEOP_ENDIAN_LITTLE {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_LITTLE);} - | PARSEOP_ENDIAN_BIG {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_BIG);} - ; - -FlowControlKeyword - : PARSEOP_FLOWCONTROL_HW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_HW);} - | PARSEOP_FLOWCONTROL_NONE {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_NONE);} - | PARSEOP_FLOWCONTROL_SW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_SW);} - ; - -InterruptLevel - : PARSEOP_INTLEVEL_ACTIVEBOTH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEBOTH);} - | PARSEOP_INTLEVEL_ACTIVEHIGH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEHIGH);} - | PARSEOP_INTLEVEL_ACTIVELOW {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVELOW);} - ; - -InterruptTypeKeyword - : PARSEOP_INTTYPE_EDGE {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_EDGE);} - | PARSEOP_INTTYPE_LEVEL {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_LEVEL);} - ; - -IODecodeKeyword - : PARSEOP_IODECODETYPE_16 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_16);} - | PARSEOP_IODECODETYPE_10 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_10);} - ; - -IoRestrictionKeyword - : PARSEOP_IORESTRICT_IN {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_IN);} - | PARSEOP_IORESTRICT_OUT {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_OUT);} - | PARSEOP_IORESTRICT_NONE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_NONE);} - | PARSEOP_IORESTRICT_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_PRESERVE);} - ; - -LockRuleKeyword - : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);} - | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_NOLOCK);} - ; - -MatchOpKeyword - : PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);} - | PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);} - | PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLE);} - | PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLT);} - | PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGE);} - | PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGT);} - ; - -MaxKeyword - : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);} - | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);} - ; - -MemTypeKeyword - : PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_CACHEABLE);} - | PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_WRITECOMBINING);} - | PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_PREFETCHABLE);} - | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_NONCACHEABLE);} - ; - -MinKeyword - : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);} - | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);} - ; - -ObjectTypeKeyword - : PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} - | PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_INT);} - | PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_STR);} - | PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BUF);} - | PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PKG);} - | PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_FLD);} - | PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DEV);} - | PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_EVT);} - | PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTH);} - | PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTX);} - | PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_OPR);} - | PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_POW);} - | PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PRO);} - | PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_THZ);} - | PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BFF);} - | PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DDB);} - ; - -ParityTypeKeyword - : PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_SPACE);} - | PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_MARK);} - | PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_ODD);} - | PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_EVEN);} - | PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_NONE);} - ; - -PinConfigByte - : PinConfigKeyword {$$ = $1;} - | ByteConstExpr {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} - ; - -PinConfigKeyword - : PARSEOP_PIN_NOPULL {$$ = TrCreateLeafNode (PARSEOP_PIN_NOPULL);} - | PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDOWN);} - | PARSEOP_PIN_PULLUP {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLUP);} - | PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDEFAULT);} - ; - -RangeTypeKeyword - : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);} - | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);} - | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ENTIRE);} - ; - -RegionSpaceKeyword - : PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IO);} - | PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_MEM);} - | PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCI);} - | PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_EC);} - | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);} - | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);} - | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);} - | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);} - | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);} - | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);} - | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);} - | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);} - ; - -ResourceTypeKeyword - : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} - | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);} - ; - -SerializeRuleKeyword - : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);} - | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL);} - ; - -ShareTypeKeyword - : PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHARED);} - | PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVE);} - | PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHAREDWAKE);} - | PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);} - ; - -SlaveModeKeyword - : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_CONTROLLERINIT);} - | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_DEVICEINIT);} - ; - -StopBitsKeyword - : PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_TWO);} - | PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONEPLUSHALF);} - | PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONE);} - | PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ZERO);} - ; - -TranslationKeyword - : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);} - | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);} - ; - -TypeKeyword - : PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafNode (PARSEOP_TYPE_TRANSLATION);} - | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafNode (PARSEOP_TYPE_STATIC);} - ; - -UpdateRuleKeyword - : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);} - | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);} - | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);} - ; - -WireModeKeyword - : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_FOUR);} - | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_THREE);} - ; - -XferSizeKeyword - : PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_8, 0);} - | PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_16, 1);} - | PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} - | PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_64, 3);} - | PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_128, 4);} - | PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_256, 5);} - ; - -XferTypeKeyword - : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);} - | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);} - | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);} - ; - - -/******* Miscellaneous Types **************************************************/ - - -SuperName - : NameString {} - | ArgTerm {} - | LocalTerm {} - | DebugTerm {} - | Type6Opcode {} - -/* For ObjectType: SuperName except for MethodInvocationTerm */ - -ObjectTypeName - : NameString {} - | ArgTerm {} - | LocalTerm {} - | DebugTerm {} - | RefOfTerm {} - | DerefOfTerm {} - | IndexTerm {} - -/* | MethodInvocationTerm {} */ /* Caused reduce/reduce with Type6Opcode->MethodInvocationTerm */ - ; - -ArgTerm - : PARSEOP_ARG0 {$$ = TrCreateLeafNode (PARSEOP_ARG0);} - | PARSEOP_ARG1 {$$ = TrCreateLeafNode (PARSEOP_ARG1);} - | PARSEOP_ARG2 {$$ = TrCreateLeafNode (PARSEOP_ARG2);} - | PARSEOP_ARG3 {$$ = TrCreateLeafNode (PARSEOP_ARG3);} - | PARSEOP_ARG4 {$$ = TrCreateLeafNode (PARSEOP_ARG4);} - | PARSEOP_ARG5 {$$ = TrCreateLeafNode (PARSEOP_ARG5);} - | PARSEOP_ARG6 {$$ = TrCreateLeafNode (PARSEOP_ARG6);} - ; - -LocalTerm - : PARSEOP_LOCAL0 {$$ = TrCreateLeafNode (PARSEOP_LOCAL0);} - | PARSEOP_LOCAL1 {$$ = TrCreateLeafNode (PARSEOP_LOCAL1);} - | PARSEOP_LOCAL2 {$$ = TrCreateLeafNode (PARSEOP_LOCAL2);} - | PARSEOP_LOCAL3 {$$ = TrCreateLeafNode (PARSEOP_LOCAL3);} - | PARSEOP_LOCAL4 {$$ = TrCreateLeafNode (PARSEOP_LOCAL4);} - | PARSEOP_LOCAL5 {$$ = TrCreateLeafNode (PARSEOP_LOCAL5);} - | PARSEOP_LOCAL6 {$$ = TrCreateLeafNode (PARSEOP_LOCAL6);} - | PARSEOP_LOCAL7 {$$ = TrCreateLeafNode (PARSEOP_LOCAL7);} - ; - -DebugTerm - : PARSEOP_DEBUG {$$ = TrCreateLeafNode (PARSEOP_DEBUG);} - ; - - -ByteConst - : Integer {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} - ; - -WordConst - : Integer {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} - ; - -DWordConst - : Integer {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} - ; - -QWordConst - : Integer {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} - ; - -Integer - : PARSEOP_INTEGER {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, AslCompilerlval.i);} - ; - -String - : PARSEOP_STRING_LITERAL {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, (ACPI_NATIVE_INT) AslCompilerlval.s);} - ; - -ConstTerm - : ConstExprTerm {} - | PARSEOP_REVISION {$$ = TrCreateLeafNode (PARSEOP_REVISION);} - ; - -ConstExprTerm - : PARSEOP_ZERO {$$ = TrCreateValuedLeafNode (PARSEOP_ZERO, 0);} - | PARSEOP_ONE {$$ = TrCreateValuedLeafNode (PARSEOP_ONE, 1);} - | PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_UINT64_MAX);} - | PARSEOP___DATE__ {$$ = TrCreateConstantLeafNode (PARSEOP___DATE__);} - | PARSEOP___FILE__ {$$ = TrCreateConstantLeafNode (PARSEOP___FILE__);} - | PARSEOP___LINE__ {$$ = TrCreateConstantLeafNode (PARSEOP___LINE__);} - | PARSEOP___PATH__ {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);} - ; - -/* - * The NODE_COMPILE_TIME_CONST flag in the following constant expressions - * enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes - * to simple integers. It is an error if these types of expressions cannot be - * reduced, since the AML grammar for ****ConstExpr requires a simple constant. - * Note: The required byte length of the constant is passed through to the - * constant folding code in the node AmlLength field. - */ -ByteConstExpr - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} - | ByteConst {} - ; - -WordConstExpr - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} - | WordConst {} - ; - -DWordConstExpr - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} - | DWordConst {} - ; - -QWordConstExpr - : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} - | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} - | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} - | QWordConst {} - ; - -/* OptionalCount must appear before ByteList or an incorrect reduction will result */ - -OptionalCount - : {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ - | ',' {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ - | ',' TermArg {$$ = $2;} - ; - -BufferTerm - : PARSEOP_BUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER);} - OptionalTermArg - ')' '{' - BufferTermData '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_BUFFER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -BufferTermData - : ByteList {} - | StringData {} - ; - -ByteList - : {$$ = NULL;} - | ByteConstExpr - | ByteList ',' /* Allows a trailing comma at list end */ - | ByteList ',' - ByteConstExpr {$$ = TrLinkPeerNode ($1,$3);} - ; - -DataBufferTerm - : PARSEOP_DATABUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} - OptionalWordConst - ')' '{' - ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_DATABUFFER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -DWordList - : {$$ = NULL;} - | DWordConstExpr - | DWordList ',' /* Allows a trailing comma at list end */ - | DWordList ',' - DWordConstExpr {$$ = TrLinkPeerNode ($1,$3);} - ; - -PackageTerm - : PARSEOP_PACKAGE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} - VarPackageLengthTerm - ')' '{' - PackageList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_PACKAGE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -PackageList - : {$$ = NULL;} - | PackageElement - | PackageList ',' /* Allows a trailing comma at list end */ - | PackageList ',' - PackageElement {$$ = TrLinkPeerNode ($1,$3);} + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_MOD '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -PackageElement - : DataObject {} - | NameString {} +MultiplyTerm + : PARSEOP_MULTIPLY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_MULTIPLY '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -VarPackageLengthTerm - : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} - | TermArg {$$ = $1;} +MutexTerm + : PARSEOP_MUTEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);} + NameString + ',' ByteConstExpr + ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} + | PARSEOP_MUTEX '(' + error ')' {$$ = AslDoError(); yyclearin;} ; - -/******* Macros ***********************************************/ - - -EISAIDTerm - : PARSEOP_EISAID '(' - StringData ')' {$$ = TrUpdateNode (PARSEOP_EISAID, $3);} - | PARSEOP_EISAID '(' +NameTerm + : PARSEOP_NAME '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);} + NameString + ',' DataObject + ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} + | PARSEOP_NAME '(' error ')' {$$ = AslDoError(); yyclearin;} ; -UnicodeTerm - : PARSEOP_UNICODE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);} - StringData - ')' {$$ = TrLinkChildren ($<n>3,2,0,$4);} - | PARSEOP_UNICODE '(' +NAndTerm + : PARSEOP_NAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_NAND '(' error ')' {$$ = AslDoError(); yyclearin;} ; - -/******* Resources and Memory ***********************************************/ - - -/* - * Note: Create two default nodes to allow conversion to a Buffer AML opcode - * Also, insert the EndTag at the end of the template. - */ -ResourceTemplateTerm - : PARSEOP_RESOURCETEMPLATE '(' ')' - '{' - ResourceMacroList '}' {$$ = TrCreateNode (PARSEOP_RESOURCETEMPLATE,4, - TrCreateLeafNode (PARSEOP_DEFAULT_ARG), - TrCreateLeafNode (PARSEOP_DEFAULT_ARG), - $5, - TrCreateLeafNode (PARSEOP_ENDTAG));} +NoOpTerm + : PARSEOP_NOOP {$$ = TrCreateNode (PARSEOP_NOOP, 0);} ; -ResourceMacroList - : {$$ = NULL;} - | ResourceMacroList - ResourceMacroTerm {$$ = TrLinkPeerNode ($1,$2);} - ; - -ResourceMacroTerm - : DMATerm {} - | DWordIOTerm {} - | DWordMemoryTerm {} - | DWordSpaceTerm {} - | EndDependentFnTerm {} - | ExtendedIOTerm {} - | ExtendedMemoryTerm {} - | ExtendedSpaceTerm {} - | FixedDmaTerm {} - | FixedIOTerm {} - | GpioIntTerm {} - | GpioIoTerm {} - | I2cSerialBusTerm {} - | InterruptTerm {} - | IOTerm {} - | IRQNoFlagsTerm {} - | IRQTerm {} - | Memory24Term {} - | Memory32FixedTerm {} - | Memory32Term {} - | QWordIOTerm {} - | QWordMemoryTerm {} - | QWordSpaceTerm {} - | RegisterTerm {} - | SpiSerialBusTerm {} - | StartDependentFnNoPriTerm {} - | StartDependentFnTerm {} - | UartSerialBusTerm {} - | VendorLongTerm {} - | VendorShortTerm {} - | WordBusNumberTerm {} - | WordIOTerm {} - | WordSpaceTerm {} - ; - -DMATerm - : PARSEOP_DMA '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DMA);} - DMATypeKeyword - OptionalBusMasterKeyword - ',' XferTypeKeyword - OptionalNameString_Last - ')' '{' - ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$5,$7,$8,$11);} - | PARSEOP_DMA '(' +NOrTerm + : PARSEOP_NOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_NOR '(' error ')' {$$ = AslDoError(); yyclearin;} ; -DWordIOTerm - : PARSEOP_DWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDIO);} - OptionalResourceType_First - OptionalMinType - OptionalMaxType - OptionalDecodeType - OptionalRangeType - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString - OptionalType - OptionalTranslationType_Last - ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} - | PARSEOP_DWORDIO '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -DWordMemoryTerm - : PARSEOP_DWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);} - OptionalResourceType_First - OptionalDecodeType - OptionalMinType - OptionalMaxType - OptionalMemType - ',' OptionalReadWriteKeyword - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString - OptionalAddressRange - OptionalType_Last - ')' {$$ = 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;} - ; - -DWordSpaceTerm - : PARSEOP_DWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);} - ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} - OptionalResourceType - OptionalDecodeType - OptionalMinType - OptionalMaxType - ',' ByteConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} - | PARSEOP_DWORDSPACE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - - -EndDependentFnTerm - : PARSEOP_ENDDEPENDENTFN '(' - ')' {$$ = TrCreateLeafNode (PARSEOP_ENDDEPENDENTFN);} - | PARSEOP_ENDDEPENDENTFN '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ExtendedIOTerm - : PARSEOP_EXTENDEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);} - OptionalResourceType_First - OptionalMinType - OptionalMaxType - OptionalDecodeType - OptionalRangeType - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - OptionalQWordConstExpr - OptionalNameString - OptionalType - OptionalTranslationType_Last - ')' {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22);} - | PARSEOP_EXTENDEDIO '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ExtendedMemoryTerm - : PARSEOP_EXTENDEDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);} - OptionalResourceType_First - OptionalDecodeType - OptionalMinType - OptionalMaxType - OptionalMemType - ',' OptionalReadWriteKeyword - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - OptionalQWordConstExpr - OptionalNameString - OptionalAddressRange - OptionalType_Last - ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24);} - | PARSEOP_EXTENDEDMEMORY '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ExtendedSpaceTerm - : PARSEOP_EXTENDEDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);} - ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} - OptionalResourceType - OptionalDecodeType - OptionalMinType - OptionalMaxType - ',' ByteConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - OptionalQWordConstExpr - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,13,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23);} - | PARSEOP_EXTENDEDSPACE '(' +NotifyTerm + : PARSEOP_NOTIFY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);} + SuperName + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_NOTIFY '(' error ')' {$$ = AslDoError(); yyclearin;} ; -FixedDmaTerm - : PARSEOP_FIXEDDMA '(' {$<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 '(' +NotTerm + : PARSEOP_NOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_NOT '(' error ')' {$$ = AslDoError(); yyclearin;} ; -FixedIOTerm - : PARSEOP_FIXEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDIO);} - WordConstExpr - ',' ByteConstExpr - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} - | PARSEOP_FIXEDIO '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -GpioIntTerm - : PARSEOP_GPIO_INT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);} - InterruptTypeKeyword /* 04: InterruptType */ - ',' InterruptLevel /* 06: InterruptLevel */ - OptionalShareType /* 07: SharedType */ - ',' PinConfigByte /* 09: PinConfig */ - OptionalWordConstExpr /* 10: DebounceTimeout */ - ',' StringData /* 12: ResourceSource */ - OptionalByteConstExpr /* 13: ResourceSourceIndex */ - OptionalResourceType /* 14: ResourceType */ - OptionalNameString /* 15: DescriptorName */ - OptionalBuffer_Last /* 16: VendorData */ - ')' '{' - DWordConstExpr '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);} - | PARSEOP_GPIO_INT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -GpioIoTerm - : PARSEOP_GPIO_IO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);} - OptionalShareType_First /* 04: SharedType */ - ',' PinConfigByte /* 06: PinConfig */ - OptionalWordConstExpr /* 07: DebounceTimeout */ - OptionalWordConstExpr /* 08: DriveStrength */ - OptionalIoRestriction /* 09: IoRestriction */ - ',' StringData /* 11: ResourceSource */ - OptionalByteConstExpr /* 12: ResourceSourceIndex */ - OptionalResourceType /* 13: ResourceType */ - OptionalNameString /* 14: DescriptorName */ - OptionalBuffer_Last /* 15: VendorData */ - ')' '{' - DWordList '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);} - | PARSEOP_GPIO_IO '(' +ObjectTypeTerm + : PARSEOP_OBJECTTYPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} + ObjectTypeName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_OBJECTTYPE '(' error ')' {$$ = AslDoError(); yyclearin;} ; -I2cSerialBusTerm - : PARSEOP_I2C_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);} - WordConstExpr /* 04: SlaveAddress */ - OptionalSlaveMode /* 05: SlaveMode */ - ',' DWordConstExpr /* 07: ConnectionSpeed */ - OptionalAddressingMode /* 08: AddressingMode */ - ',' StringData /* 10: ResourceSource */ - OptionalByteConstExpr /* 11: ResourceSourceIndex */ - OptionalResourceType /* 12: ResourceType */ - OptionalNameString /* 13: DescriptorName */ - OptionalBuffer_Last /* 14: VendorData */ - ')' {$$ = TrLinkChildren ($<n>3,9,$4,$5,$7,$8,$10,$11,$12,$13,$14);} - | PARSEOP_I2C_SERIALBUS '(' +OffsetTerm + : PARSEOP_OFFSET '(' + AmlPackageLengthTerm + ')' {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);} + | PARSEOP_OFFSET '(' error ')' {$$ = AslDoError(); yyclearin;} ; -InterruptTerm - : PARSEOP_INTERRUPT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} - OptionalResourceType_First - ',' InterruptTypeKeyword - ',' InterruptLevel - OptionalShareType - OptionalByteConstExpr - OptionalStringData - OptionalNameString_Last - ')' '{' - DWordList '}' {$$ = TrLinkChildren ($<n>3,8,$4,$6,$8,$9,$10,$11,$12,$15);} - | PARSEOP_INTERRUPT '(' +OpRegionTerm + : PARSEOP_OPERATIONREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} + NameString + ',' OpRegionSpaceIdTerm + TermArgItem + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8);} + | PARSEOP_OPERATIONREGION '(' error ')' {$$ = AslDoError(); yyclearin;} ; -IOTerm - : PARSEOP_IO '(' {$<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;} +OpRegionSpaceIdTerm + : RegionSpaceKeyword {} + | ByteConst {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} ; -IRQNoFlagsTerm - : PARSEOP_IRQNOFLAGS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);} - OptionalNameString_First - ')' '{' - ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_IRQNOFLAGS '(' +OrTerm + : PARSEOP_OR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_OR '(' error ')' {$$ = AslDoError(); yyclearin;} ; -IRQTerm - : PARSEOP_IRQ '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQ);} - InterruptTypeKeyword - ',' InterruptLevel - OptionalShareType - OptionalNameString_Last +PackageTerm + : PARSEOP_PACKAGE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} + VarPackageLengthTerm ')' '{' - ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$7,$8,$11);} - | PARSEOP_IRQ '(' + PackageList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_PACKAGE '(' error ')' {$$ = AslDoError(); yyclearin;} ; -Memory24Term - : PARSEOP_MEMORY24 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY24);} - OptionalReadWriteKeyword - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr +PowerResTerm + : PARSEOP_POWERRESOURCE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} + NameString + ',' ByteConstExpr ',' WordConstExpr - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} - | PARSEOP_MEMORY24 '(' + ')' '{' + ObjectList '}' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);} + | PARSEOP_POWERRESOURCE '(' error ')' {$$ = AslDoError(); yyclearin;} ; -Memory32FixedTerm - : PARSEOP_MEMORY32FIXED '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);} - OptionalReadWriteKeyword - ',' DWordConstExpr - ',' DWordConstExpr - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$6,$8,$9);} - | PARSEOP_MEMORY32FIXED '(' +PrintfTerm + : PARSEOP_PRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);} + StringData + PrintfArgList + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_PRINTF '(' error ')' {$$ = AslDoError(); yyclearin;} ; -Memory32Term - : PARSEOP_MEMORY32 '(' {$<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;} - ; - -QWordIOTerm - : PARSEOP_QWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDIO);} - OptionalResourceType_First - OptionalMinType - OptionalMaxType - OptionalDecodeType - OptionalRangeType - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString - OptionalType - OptionalTranslationType_Last - ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} - | PARSEOP_QWORDIO '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -QWordMemoryTerm - : PARSEOP_QWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);} - OptionalResourceType_First - OptionalDecodeType - OptionalMinType - OptionalMaxType - OptionalMemType - ',' OptionalReadWriteKeyword - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString - OptionalAddressRange - OptionalType_Last - ')' {$$ = 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;} - ; - -QWordSpaceTerm - : PARSEOP_QWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);} - ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} - OptionalResourceType - OptionalDecodeType - OptionalMinType - OptionalMaxType - ',' ByteConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} - | PARSEOP_QWORDSPACE '(' - error ')' {$$ = AslDoError(); yyclearin;} +PrintfArgList + : {$$ = NULL;} + | TermArg {$$ = $1;} + | PrintfArgList ',' + TermArg {$$ = TrLinkPeerNode ($1, $3);} ; -RegisterTerm - : PARSEOP_REGISTER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REGISTER);} - AddressSpaceKeyword - ',' ByteConstExpr +ProcessorTerm + : PARSEOP_PROCESSOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} + NameString ',' ByteConstExpr - ',' QWordConstExpr - OptionalAccessSize - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$11,$12);} - | PARSEOP_REGISTER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -SpiSerialBusTerm - : PARSEOP_SPI_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);} - WordConstExpr /* 04: DeviceSelection */ - OptionalDevicePolarity /* 05: DevicePolarity */ - OptionalWireMode /* 06: WireMode */ - ',' ByteConstExpr /* 08: DataBitLength */ - OptionalSlaveMode /* 09: SlaveMode */ - ',' DWordConstExpr /* 11: ConnectionSpeed */ - ',' ClockPolarityKeyword /* 13: ClockPolarity */ - ',' ClockPhaseKeyword /* 15: ClockPhase */ - ',' StringData /* 17: ResourceSource */ - OptionalByteConstExpr /* 18: ResourceSourceIndex */ - OptionalResourceType /* 19: ResourceType */ - OptionalNameString /* 20: DescriptorName */ - OptionalBuffer_Last /* 21: VendorData */ - ')' {$$ = TrLinkChildren ($<n>3,13,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21);} - | PARSEOP_SPI_SERIALBUS '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -StartDependentFnNoPriTerm - : PARSEOP_STARTDEPENDENTFN_NOPRI '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} + OptionalDWordConstExpr + OptionalByteConstExpr ')' '{' - ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,1,$6);} - | PARSEOP_STARTDEPENDENTFN_NOPRI '(' + ObjectList '}' {$$ = TrLinkChildren ($<n>3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);} + | PARSEOP_PROCESSOR '(' error ')' {$$ = AslDoError(); yyclearin;} ; -StartDependentFnTerm - : PARSEOP_STARTDEPENDENTFN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);} - ByteConstExpr - ',' ByteConstExpr - ')' '{' - ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$9);} - | PARSEOP_STARTDEPENDENTFN '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -UartSerialBusTerm - : PARSEOP_UART_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);} - DWordConstExpr /* 04: ConnectionSpeed */ - OptionalBitsPerByte /* 05: BitsPerByte */ - OptionalStopBits /* 06: StopBits */ - ',' ByteConstExpr /* 08: LinesInUse */ - OptionalEndian /* 09: Endianess */ - OptionalParityType /* 10: Parity */ - OptionalFlowControl /* 11: FlowControl */ - ',' WordConstExpr /* 13: Rx BufferSize */ - ',' WordConstExpr /* 15: Tx BufferSize */ - ',' StringData /* 17: ResourceSource */ - OptionalByteConstExpr /* 18: ResourceSourceIndex */ - OptionalResourceType /* 19: ResourceType */ - OptionalNameString /* 20: DescriptorName */ - OptionalBuffer_Last /* 21: VendorData */ - ')' {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21);} - | PARSEOP_UART_SERIALBUS '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -VendorLongTerm - : PARSEOP_VENDORLONG '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORLONG);} - OptionalNameString_First +RawDataBufferTerm + : PARSEOP_DATABUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} + OptionalWordConst ')' '{' ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_VENDORLONG '(' + | PARSEOP_DATABUFFER '(' error ')' {$$ = AslDoError(); yyclearin;} ; -VendorShortTerm - : PARSEOP_VENDORSHORT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);} - OptionalNameString_First - ')' '{' - ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_VENDORSHORT '(' +/* + * In RefOf, the node isn't really a target, but we can't keep track of it after + * 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,TrSetNodeFlags ($4, NODE_IS_TARGET));} + | PARSEOP_REFOF '(' error ')' {$$ = AslDoError(); yyclearin;} ; -WordBusNumberTerm - : PARSEOP_WORDBUSNUMBER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);} - OptionalResourceType_First - OptionalMinType - OptionalMaxType - OptionalDecodeType - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,12,$4,$5,$6,$7,$9,$11,$13,$15,$17,$18,$19,$20);} - | PARSEOP_WORDBUSNUMBER '(' +ReleaseTerm + : PARSEOP_RELEASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_RELEASE '(' error ')' {$$ = AslDoError(); yyclearin;} ; -WordIOTerm - : PARSEOP_WORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDIO);} - OptionalResourceType_First - OptionalMinType - OptionalMaxType - OptionalDecodeType - OptionalRangeType - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString - OptionalType - OptionalTranslationType_Last - ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} - | PARSEOP_WORDIO '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -WordSpaceTerm - : PARSEOP_WORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDSPACE);} - ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} - OptionalResourceType - OptionalDecodeType - OptionalMinType - OptionalMaxType - ',' ByteConstExpr - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} - | PARSEOP_WORDSPACE '(' +ResetTerm + : PARSEOP_RESET '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_RESET '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ReturnTerm + : PARSEOP_RETURN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);} + OptionalReturnArg + ')' {$$ = 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;} + ; + +ScopeTerm + : PARSEOP_SCOPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);} + NameString + ')' '{' + ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} + | PARSEOP_SCOPE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ShiftLeftTerm + : PARSEOP_SHIFTLEFT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_SHIFTLEFT '(' error ')' {$$ = AslDoError(); yyclearin;} ; - -/******* Object References ***********************************************/ - -/* Allow IO, DMA, IRQ Resource macro names to also be used as identifiers */ - -NameString - : NameSeg {} - | PARSEOP_NAMESTRING {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) AslCompilerlval.s);} - | PARSEOP_IO {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IO");} - | PARSEOP_DMA {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "DMA");} - | PARSEOP_IRQ {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IRQ");} - ; - -NameSeg - : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, (ACPI_NATIVE_INT) AslCompilerlval.s);} +ShiftRightTerm + : PARSEOP_SHIFTRIGHT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_SHIFTRIGHT '(' + error ')' {$$ = AslDoError(); yyclearin;} ; - -/******* Helper rules ****************************************************/ - - -AmlPackageLengthTerm - : Integer {$$ = TrUpdateNode (PARSEOP_PACKAGE_LENGTH,(ACPI_PARSE_OBJECT *) $1);} +SignalTerm + : PARSEOP_SIGNAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_SIGNAL '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -NameStringItem - : ',' NameString {$$ = $2;} - | ',' error {$$ = AslDoError (); yyclearin;} +SizeOfTerm + : PARSEOP_SIZEOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_SIZEOF '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -TermArgItem - : ',' TermArg {$$ = $2;} - | ',' error {$$ = AslDoError (); yyclearin;} +SleepTerm + : PARSEOP_SLEEP '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);} + TermArg + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_SLEEP '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalBusMasterKeyword - : ',' {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);} - | ',' PARSEOP_BUSMASTERTYPE_MASTER {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);} - | ',' PARSEOP_BUSMASTERTYPE_NOTMASTER {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_NOTMASTER);} +StallTerm + : PARSEOP_STALL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);} + TermArg + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_STALL '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalAccessAttribTerm - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' ByteConstExpr {$$ = $2;} - | ',' AccessAttribKeyword {$$ = $2;} +StoreTerm + : PARSEOP_STORE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STORE);} + TermArg + ',' SuperName + ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} + | PARSEOP_STORE '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalAccessSize - : {$$ = TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0);} - | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0);} - | ',' ByteConstExpr {$$ = $2;} +SubtractTerm + : PARSEOP_SUBTRACT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_SUBTRACT '(' + error ')' {$$ = AslDoError(); yyclearin;} ; - -OptionalAddressingMode - : ',' {$$ = NULL;} - | ',' AddressingModeKeyword {$$ = $2;} +SwitchTerm + : PARSEOP_SWITCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);} + TermArg + ')' '{' + CaseDefaultTermList '}' + {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_SWITCH '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalAddressRange - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' AddressKeyword {$$ = $2;} +ThermalZoneTerm + : PARSEOP_THERMALZONE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} + NameString + ')' '{' + ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} + | PARSEOP_THERMALZONE '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalBitsPerByte - : ',' {$$ = NULL;} - | ',' BitsPerByteKeyword {$$ = $2;} +TimerTerm + : PARSEOP_TIMER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);} + ')' {$$ = TrLinkChildren ($<n>3,0);} + | PARSEOP_TIMER {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_TIMER),0);} + | PARSEOP_TIMER '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalBuffer_Last - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' DataBufferTerm {$$ = $2;} +ToBCDTerm + : PARSEOP_TOBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBCD);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_TOBCD '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalByteConstExpr - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' ByteConstExpr {$$ = $2;} +ToBufferTerm + : PARSEOP_TOBUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_TOBUFFER '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalDecodeType - : ',' {$$ = NULL;} - | ',' DecodeKeyword {$$ = $2;} +ToDecimalStringTerm + : PARSEOP_TODECIMALSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_TODECIMALSTRING '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalDevicePolarity - : ',' {$$ = NULL;} - | ',' DevicePolarityKeyword {$$ = $2;} +ToHexStringTerm + : PARSEOP_TOHEXSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_TOHEXSTRING '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalDWordConstExpr - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' DWordConstExpr {$$ = $2;} +ToIntegerTerm + : PARSEOP_TOINTEGER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_TOINTEGER '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalEndian - : ',' {$$ = NULL;} - | ',' EndianKeyword {$$ = $2;} +ToPLDTerm + : PARSEOP_TOPLD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);} + PldKeywordList + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_TOPLD '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalFlowControl - : ',' {$$ = NULL;} - | ',' FlowControlKeyword {$$ = $2;} +PldKeywordList + : {$$ = NULL;} + | PldKeyword + PARSEOP_EXP_EQUALS Integer {$$ = TrLinkChildren ($1,1,$3);} + | PldKeyword + PARSEOP_EXP_EQUALS String {$$ = TrLinkChildren ($1,1,$3);} + | PldKeywordList ',' /* Allows a trailing comma at list end */ + | PldKeywordList ',' + PldKeyword + PARSEOP_EXP_EQUALS Integer {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} + | PldKeywordList ',' + PldKeyword + PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} ; -OptionalIoRestriction - : ',' {$$ = NULL;} - | ',' IoRestrictionKeyword {$$ = $2;} - ; -OptionalListString - : {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ - | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ - | ',' TermArg {$$ = $2;} +ToStringTerm + : PARSEOP_TOSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);} + TermArg + OptionalCount + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_TOSTRING '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalMaxType - : ',' {$$ = NULL;} - | ',' MaxKeyword {$$ = $2;} +ToUUIDTerm + : PARSEOP_TOUUID '(' + StringData ')' {$$ = TrUpdateNode (PARSEOP_TOUUID, $3);} + | PARSEOP_TOUUID '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalMemType - : ',' {$$ = NULL;} - | ',' MemTypeKeyword {$$ = $2;} +UnicodeTerm + : PARSEOP_UNICODE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);} + StringData + ')' {$$ = TrLinkChildren ($<n>3,2,0,$4);} + | PARSEOP_UNICODE '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalMinType - : ',' {$$ = NULL;} - | ',' MinKeyword {$$ = $2;} +UnloadTerm + : PARSEOP_UNLOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_UNLOAD '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalNameString - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' NameString {$$ = $2;} +WaitTerm + : PARSEOP_WAIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);} + SuperName + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_WAIT '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalNameString_Last - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' NameString {$$ = $2;} +XOrTerm + : PARSEOP_XOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_XOR '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalNameString_First - : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} - | NameString {$$ = $1;} +WhileTerm + : PARSEOP_WHILE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} + TermArg + ')' '{' TermList '}' + {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_WHILE '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalObjectTypeKeyword - : {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} - | ',' ObjectTypeKeyword {$$ = $2;} - ; -OptionalParityType - : ',' {$$ = NULL;} - | ',' ParityTypeKeyword {$$ = $2;} - ; +/******************************************************************************* + * + * ASL Helper Terms + * + ******************************************************************************/ -OptionalQWordConstExpr - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' QWordConstExpr {$$ = $2;} +AmlPackageLengthTerm + : Integer {$$ = TrUpdateNode (PARSEOP_PACKAGE_LENGTH,(ACPI_PARSE_OBJECT *) $1);} ; -OptionalRangeType - : ',' {$$ = NULL;} - | ',' RangeTypeKeyword {$$ = $2;} +NameStringItem + : ',' NameString {$$ = $2;} + | ',' error {$$ = AslDoError (); yyclearin;} ; -OptionalReadWriteKeyword - : {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);} - | PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);} - | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_READONLY);} +TermArgItem + : ',' TermArg {$$ = $2;} + | ',' error {$$ = AslDoError (); yyclearin;} ; OptionalReference @@ -2969,17 +1769,6 @@ OptionalReference | ',' TermArg {$$ = $2;} ; -OptionalResourceType_First - : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} - | ResourceTypeKeyword {$$ = $1;} - ; - -OptionalResourceType - : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} - | ',' {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} - | ',' ResourceTypeKeyword {$$ = $2;} - ; - OptionalReturnArg : {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN);} /* Placeholder is a ZeroOp object */ | TermArg {$$ = $1;} @@ -2991,73 +1780,12 @@ OptionalSerializeRuleKeyword | ',' SerializeRuleKeyword {$$ = $2;} ; -OptionalSlaveMode - : ',' {$$ = NULL;} - | ',' SlaveModeKeyword {$$ = $2;} - ; - -OptionalShareType - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' ShareTypeKeyword {$$ = $2;} - ; - -OptionalShareType_First - : {$$ = NULL;} - | ShareTypeKeyword {$$ = $1;} - ; - -OptionalStopBits - : ',' {$$ = NULL;} - | ',' StopBitsKeyword {$$ = $2;} - ; - -OptionalStringData - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' StringData {$$ = $2;} - ; - OptionalTermArg : {$$ = NULL;} | TermArg {$$ = $1;} ; -OptionalType - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' TypeKeyword {$$ = $2;} - ; - -OptionalType_Last - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' TypeKeyword {$$ = $2;} - ; - -OptionalTranslationType_Last - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' TranslationKeyword {$$ = $2;} - ; - -OptionalWireMode - : ',' {$$ = NULL;} - | ',' WireModeKeyword {$$ = $2;} - ; - OptionalWordConst : {$$ = NULL;} | WordConst {$$ = $1;} ; - -OptionalWordConstExpr - : ',' {$$ = NULL;} - | ',' WordConstExpr {$$ = $2;} - ; - -OptionalXferSize - : {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} - | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} - | ',' XferSizeKeyword {$$ = $2;} - ; diff --git a/src/acpica/source/compiler/asltokens.y b/src/acpica/source/compiler/asltokens.y index 0e99c24..89ce095 100644 --- a/src/acpica/source/compiler/asltokens.y +++ b/src/acpica/source/compiler/asltokens.y @@ -524,8 +524,14 @@ NoEcho(' %left <i> PARSEOP_EXP_INCREMENT PARSEOP_EXP_DECREMENT +/* Brackets for Index() support */ + +%left <i> PARSEOP_EXP_INDEX_LEFT +%right <i> PARSEOP_EXP_INDEX_RIGHT + %token <i> PARSEOP_PRINTF %token <i> PARSEOP_FPRINTF + /* Specific parentheses tokens are not used at this time */ /* PARSEOP_EXP_PAREN_OPEN */ /* PARSEOP_EXP_PAREN_CLOSE */ diff --git a/src/acpica/source/compiler/asltree.c b/src/acpica/source/compiler/asltree.c index 33194af..e54a690 100644 --- a/src/acpica/source/compiler/asltree.c +++ b/src/acpica/source/compiler/asltree.c @@ -610,6 +610,7 @@ TrCreateAssignmentNode ( case PARSEOP_ADD: case PARSEOP_AND: case PARSEOP_DIVIDE: + case PARSEOP_INDEX: case PARSEOP_MOD: case PARSEOP_MULTIPLY: case PARSEOP_NOT: diff --git a/src/acpica/source/compiler/asltypes.h b/src/acpica/source/compiler/asltypes.h index a536e02..b08c5df 100644 --- a/src/acpica/source/compiler/asltypes.h +++ b/src/acpica/source/compiler/asltypes.h @@ -242,7 +242,7 @@ typedef enum ASL_FILE_C_SOURCE_OUTPUT, /* .c */ ASL_FILE_ASM_INCLUDE_OUTPUT,/* .inc */ ASL_FILE_C_INCLUDE_OUTPUT, /* .h */ - ASL_FILE_C_OFFSET_OUTPUT, /* offset.h */ + ASL_FILE_C_OFFSET_OUTPUT, /* .offset.h */ ASL_FILE_MAP_OUTPUT /* .map */ } ASL_FILE_TYPES; @@ -251,24 +251,23 @@ typedef enum #define ASL_MAX_FILE_TYPE 16 #define ASL_NUM_FILES (ASL_MAX_FILE_TYPE + 1) -/* filename suffixes for output files */ +/* Name suffixes used to create filenames for output files */ -#define FILE_SUFFIX_PREPROC_USER "i " -#define FILE_SUFFIX_PREPROCESSOR "pre" +#define FILE_SUFFIX_ASL_CODE "asl" #define FILE_SUFFIX_AML_CODE "aml" -#define FILE_SUFFIX_MAP "map" +#define FILE_SUFFIX_SOURCE "src" +#define FILE_SUFFIX_PREPROCESSOR "pre" +#define FILE_SUFFIX_PREPROC_USER "i" #define FILE_SUFFIX_LISTING "lst" #define FILE_SUFFIX_HEX_DUMP "hex" -#define FILE_SUFFIX_DEBUG "txt" -#define FILE_SUFFIX_SOURCE "src" #define FILE_SUFFIX_NAMESPACE "nsp" +#define FILE_SUFFIX_DEBUG "txt" #define FILE_SUFFIX_ASM_SOURCE "asm" #define FILE_SUFFIX_C_SOURCE "c" -#define FILE_SUFFIX_DISASSEMBLY "dsl" #define FILE_SUFFIX_ASM_INCLUDE "inc" #define FILE_SUFFIX_C_INCLUDE "h" -#define FILE_SUFFIX_ASL_CODE "asl" #define FILE_SUFFIX_C_OFFSET "offset.h" +#define FILE_SUFFIX_MAP "map" /* Cache block structure for ParseOps and Strings */ diff --git a/src/acpica/source/compiler/asltypes.y b/src/acpica/source/compiler/asltypes.y index 7051966..832d67c 100644 --- a/src/acpica/source/compiler/asltypes.y +++ b/src/acpica/source/compiler/asltypes.y @@ -208,7 +208,7 @@ NoEcho(' %type <n> DefaultTerm %type <n> ElseTerm %type <n> FatalTerm -%type <n> IfElseTerm +%type <n> ElseIfTerm %type <n> IfTerm %type <n> LoadTerm %type <n> NoOpTerm @@ -260,6 +260,7 @@ NoEcho(' %type <n> NotTerm %type <n> ObjectTypeTerm %type <n> OrTerm +%type <n> RawDataBufferTerm %type <n> RefOfTerm %type <n> ShiftLeftTerm %type <n> ShiftRightTerm @@ -369,7 +370,6 @@ NoEcho(' /* Resource Descriptors */ %type <n> ConnectionTerm -%type <n> DataBufferTerm %type <n> DMATerm %type <n> DWordIOTerm %type <n> DWordMemoryTerm @@ -463,3 +463,4 @@ NoEcho(' */ %type <n> Expression %type <n> EqualsTerm +%type <n> IndexExpTerm diff --git a/src/acpica/source/compiler/aslwalks.c b/src/acpica/source/compiler/aslwalks.c index e1f2743..1675cad 100644 --- a/src/acpica/source/compiler/aslwalks.c +++ b/src/acpica/source/compiler/aslwalks.c @@ -123,6 +123,13 @@ ACPI_MODULE_NAME ("aslwalks") +/* Local prototypes */ + +static void +AnAnalyzeStoreOperator ( + ACPI_PARSE_OBJECT *Op); + + /******************************************************************************* * * FUNCTION: AnMethodTypingWalkEnd @@ -145,7 +152,7 @@ AnMethodTypingWalkEnd ( UINT32 Level, void *Context) { - UINT32 ThisNodeBtype; + UINT32 ThisOpBtype; switch (Op->Asl.ParseOpcode) @@ -160,10 +167,10 @@ AnMethodTypingWalkEnd ( if ((Op->Asl.Child) && (Op->Asl.Child->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)) { - ThisNodeBtype = AnGetBtype (Op->Asl.Child); + ThisOpBtype = AnGetBtype (Op->Asl.Child); if ((Op->Asl.Child->Asl.ParseOpcode == PARSEOP_METHODCALL) && - (ThisNodeBtype == (ACPI_UINT32_MAX -1))) + (ThisOpBtype == (ACPI_UINT32_MAX -1))) { /* * The called method is untyped at this time (typically a @@ -179,7 +186,7 @@ AnMethodTypingWalkEnd ( ASL_WALK_VISIT_UPWARD, NULL, AnMethodTypingWalkEnd, NULL); - ThisNodeBtype = AnGetBtype (Op->Asl.Child); + ThisOpBtype = AnGetBtype (Op->Asl.Child); } } @@ -187,7 +194,7 @@ AnMethodTypingWalkEnd ( if (Op->Asl.ParentMethod) { - Op->Asl.ParentMethod->Asl.AcpiBtype |= ThisNodeBtype; + Op->Asl.ParentMethod->Asl.AcpiBtype |= ThisOpBtype; } } break; @@ -258,9 +265,9 @@ AnOperandTypecheckWalkEnd ( return (AE_OK); } - ArgOp = Op->Asl.Child; + ArgOp = Op->Asl.Child; + OpcodeClass = OpInfo->Class; RuntimeArgTypes = OpInfo->RuntimeArgs; - OpcodeClass = OpInfo->Class; #ifdef ASL_ERROR_NAMED_OBJECT_IN_WHILE /* @@ -319,6 +326,7 @@ AnOperandTypecheckWalkEnd ( { return (AE_OK); } + AnCheckMethodReturnValue (Op, OpInfo, ArgOp, RequiredBtypes, ThisNodeBtype); } @@ -343,6 +351,70 @@ AnOperandTypecheckWalkEnd ( return (AE_OK); } + /* + * Special handling for certain opcodes. + */ + switch (Op->Asl.AmlOpcode) + { + /* BankField has one TermArg */ + + case AML_BANK_FIELD_OP: + + OpcodeClass = AML_CLASS_EXECUTE; + ArgOp = ArgOp->Asl.Next; + ArgOp = ArgOp->Asl.Next; + break; + + /* Operation Region has 2 TermArgs */ + + case AML_REGION_OP: + + OpcodeClass = AML_CLASS_EXECUTE; + ArgOp = ArgOp->Asl.Next; + ArgOp = ArgOp->Asl.Next; + break; + + /* DataTableRegion has 3 TermArgs */ + + case AML_DATA_REGION_OP: + + OpcodeClass = AML_CLASS_EXECUTE; + ArgOp = ArgOp->Asl.Next; + break; + + /* Buffers/Packages have a length that is a TermArg */ + + case AML_BUFFER_OP: + case AML_PACKAGE_OP: + case AML_VAR_PACKAGE_OP: + + /* If length is a constant, we are done */ + + if ((ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER) || + (ArgOp->Asl.ParseOpcode == PARSEOP_RAW_DATA)) + { + return (AE_OK); + } + break; + + /* Store can write any object to the Debug object */ + + case AML_STORE_OP: + /* + * If this is a Store() to the Debug object, we don't need + * to perform any further validation -- because a Store of + * any object to Debug is permitted and supported. + */ + if (ArgOp->Asl.Next->Asl.AmlOpcode == AML_DEBUG_OP) + { + return (AE_OK); + } + break; + + default: + break; + } + switch (OpcodeClass) { case AML_CLASS_EXECUTE: @@ -350,15 +422,6 @@ AnOperandTypecheckWalkEnd ( case AML_CLASS_CONTROL: case AML_CLASS_RETURN_VALUE: - /* TBD: Change class or fix typechecking for these */ - - if ((Op->Asl.AmlOpcode == AML_BUFFER_OP) || - (Op->Asl.AmlOpcode == AML_PACKAGE_OP) || - (Op->Asl.AmlOpcode == AML_VAR_PACKAGE_OP)) - { - break; - } - /* Reverse the runtime argument list */ RuntimeArgTypes2 = 0; @@ -369,8 +432,12 @@ AnOperandTypecheckWalkEnd ( INCREMENT_ARG_LIST (RuntimeArgTypes); } + /* Typecheck each argument */ + while ((ArgType = GET_CURRENT_ARG_TYPE (RuntimeArgTypes2))) { + /* Get the required type(s) for the argument */ + RequiredBtypes = AnMapArgTypeToBtype (ArgType); if (!ArgOp) @@ -380,6 +447,8 @@ AnOperandTypecheckWalkEnd ( AslAbort (); } + /* Get the actual type of the argument */ + ThisNodeBtype = AnGetBtype (ArgOp); if (ThisNodeBtype == ACPI_UINT32_MAX) { @@ -400,6 +469,10 @@ AnOperandTypecheckWalkEnd ( break; } + /* Fallthrough */ + + case ARGI_STORE_TARGET: + if (ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER) { /* @@ -411,25 +484,22 @@ AnOperandTypecheckWalkEnd ( if ((ArgOp->Asl.Node->Type == ACPI_TYPE_LOCAL_RESOURCE_FIELD) || (ArgOp->Asl.Node->Type == ACPI_TYPE_LOCAL_RESOURCE)) { - AslError (ASL_ERROR, ASL_MSG_RESOURCE_FIELD, ArgOp, NULL); + AslError (ASL_ERROR, ASL_MSG_RESOURCE_FIELD, + ArgOp, NULL); } else { - AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, NULL); + AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, + ArgOp, NULL); } - break; } - - if ((ArgOp->Asl.ParseOpcode == PARSEOP_METHODCALL) || - (ArgOp->Asl.ParseOpcode == PARSEOP_DEREFOF)) - { - break; - } - - ThisNodeBtype = RequiredBtypes; break; +#ifdef __FUTURE_IMPLEMENTATION +/* + * Possible future typechecking support + */ case ARGI_REFERENCE: /* References */ case ARGI_INTEGER_REF: case ARGI_OBJECT_REF: @@ -460,8 +530,8 @@ AnOperandTypecheckWalkEnd ( case PARSEOP_ARG5: case PARSEOP_ARG6: - /* Hard to analyze argument types, sow we won't */ - /* For now, just treat any arg as a typematch */ + /* Hard to analyze argument types, so we won't */ + /* for now. Just treat any arg as a typematch */ /* ThisNodeBtype = RequiredBtypes; */ break; @@ -472,10 +542,9 @@ AnOperandTypecheckWalkEnd ( default: break; - } break; - +#endif case ARGI_INTEGER: default: @@ -483,6 +552,8 @@ AnOperandTypecheckWalkEnd ( } + /* Check for a type mismatch (required versus actual) */ + CommonBtypes = ThisNodeBtype & RequiredBtypes; if (ArgOp->Asl.ParseOpcode == PARSEOP_METHODCALL) @@ -510,9 +581,10 @@ AnOperandTypecheckWalkEnd ( AnFormatBtype (StringBuffer2, RequiredBtypes); sprintf (MsgBuffer, "[%s] found, %s operator requires [%s]", - StringBuffer, OpInfo->Name, StringBuffer2); + StringBuffer, OpInfo->Name, StringBuffer2); - AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, MsgBuffer); + AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, + ArgOp, MsgBuffer); } NextArgument: @@ -549,14 +621,15 @@ AnOtherSemanticAnalysisWalkBegin ( UINT32 Level, void *Context) { - ACPI_PARSE_OBJECT *ArgNode; - ACPI_PARSE_OBJECT *PrevArgNode = NULL; + ACPI_PARSE_OBJECT *ArgOp; + ACPI_PARSE_OBJECT *PrevArgOp = NULL; const ACPI_OPCODE_INFO *OpInfo; ACPI_NAMESPACE_NODE *Node; OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode); + /* * Determine if an execution class operator actually does something by * checking if it has a target and/or the function return value is used. @@ -569,30 +642,31 @@ AnOtherSemanticAnalysisWalkBegin ( if (OpInfo->Flags & AML_HAS_TARGET) { /* - * Find the target node, it is always the last child. If the traget + * Find the target node, it is always the last child. If the target * is not specified in the ASL, a default node of type Zero was * created by the parser. */ - ArgNode = Op->Asl.Child; - while (ArgNode->Asl.Next) + ArgOp = Op->Asl.Child; + while (ArgOp->Asl.Next) { - PrevArgNode = ArgNode; - ArgNode = ArgNode->Asl.Next; + PrevArgOp = ArgOp; + ArgOp = ArgOp->Asl.Next; } /* Divide() is the only weird case, it has two targets */ if (Op->Asl.AmlOpcode == AML_DIVIDE_OP) { - if ((ArgNode->Asl.ParseOpcode == PARSEOP_ZERO) && - (PrevArgNode) && - (PrevArgNode->Asl.ParseOpcode == PARSEOP_ZERO)) + if ((ArgOp->Asl.ParseOpcode == PARSEOP_ZERO) && + (PrevArgOp) && + (PrevArgOp->Asl.ParseOpcode == PARSEOP_ZERO)) { AslError (ASL_ERROR, ASL_MSG_RESULT_NOT_USED, Op, Op->Asl.ExternalName); } } - else if (ArgNode->Asl.ParseOpcode == PARSEOP_ZERO) + + else if (ArgOp->Asl.ParseOpcode == PARSEOP_ZERO) { AslError (ASL_ERROR, ASL_MSG_RESULT_NOT_USED, Op, Op->Asl.ExternalName); @@ -627,6 +701,15 @@ AnOtherSemanticAnalysisWalkBegin ( */ switch (Op->Asl.ParseOpcode) { + case PARSEOP_STORE: + + if (Gbl_DoTypechecking) + { + AnAnalyzeStoreOperator (Op); + } + break; + + case PARSEOP_ACQUIRE: case PARSEOP_WAIT: /* @@ -638,16 +721,16 @@ AnOtherSemanticAnalysisWalkBegin ( /* First child is the namepath, 2nd child is timeout */ - ArgNode = Op->Asl.Child; - ArgNode = ArgNode->Asl.Next; + ArgOp = Op->Asl.Child; + ArgOp = ArgOp->Asl.Next; /* * Check for the WAIT_FOREVER case - defined by the ACPI spec to be * 0xFFFF or greater */ - if (((ArgNode->Asl.ParseOpcode == PARSEOP_WORDCONST) || - (ArgNode->Asl.ParseOpcode == PARSEOP_INTEGER)) && - (ArgNode->Asl.Value.Integer >= (UINT64) ACPI_WAIT_FOREVER)) + if (((ArgOp->Asl.ParseOpcode == PARSEOP_WORDCONST) || + (ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER)) && + (ArgOp->Asl.Value.Integer >= (UINT64) ACPI_WAIT_FOREVER)) { break; } @@ -658,7 +741,7 @@ AnOtherSemanticAnalysisWalkBegin ( */ if (!AnIsResultUsed (Op)) { - AslError (ASL_WARNING, ASL_MSG_TIMEOUT, ArgNode, + AslError (ASL_WARNING, ASL_MSG_TIMEOUT, ArgOp, Op->Asl.ExternalName); } break; @@ -667,15 +750,15 @@ AnOtherSemanticAnalysisWalkBegin ( /* * Check for a zero Length (NumBits) operand. NumBits is the 3rd operand */ - ArgNode = Op->Asl.Child; - ArgNode = ArgNode->Asl.Next; - ArgNode = ArgNode->Asl.Next; + ArgOp = Op->Asl.Child; + ArgOp = ArgOp->Asl.Next; + ArgOp = ArgOp->Asl.Next; - if ((ArgNode->Asl.ParseOpcode == PARSEOP_ZERO) || - ((ArgNode->Asl.ParseOpcode == PARSEOP_INTEGER) && - (ArgNode->Asl.Value.Integer == 0))) + if ((ArgOp->Asl.ParseOpcode == PARSEOP_ZERO) || + ((ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER) && + (ArgOp->Asl.Value.Integer == 0))) { - AslError (ASL_ERROR, ASL_MSG_NON_ZERO, ArgNode, NULL); + AslError (ASL_ERROR, ASL_MSG_NON_ZERO, ArgOp, NULL); } break; @@ -684,24 +767,24 @@ AnOtherSemanticAnalysisWalkBegin ( * Ensure that the referenced operation region has the correct SPACE_ID. * From the grammar/parser, we know the parent is a FIELD definition. */ - ArgNode = Op->Asl.Parent; /* Field definition */ - ArgNode = ArgNode->Asl.Child; /* First child is the OpRegion Name */ - Node = ArgNode->Asl.Node; /* OpRegion namespace node */ + ArgOp = Op->Asl.Parent; /* Field definition */ + ArgOp = ArgOp->Asl.Child; /* First child is the OpRegion Name */ + Node = ArgOp->Asl.Node; /* OpRegion namespace node */ if (!Node) { break; } - ArgNode = Node->Op; /* OpRegion definition */ - ArgNode = ArgNode->Asl.Child; /* First child is the OpRegion Name */ - ArgNode = ArgNode->Asl.Next; /* Next peer is the SPACE_ID (what we want) */ + ArgOp = Node->Op; /* OpRegion definition */ + ArgOp = ArgOp->Asl.Child; /* First child is the OpRegion Name */ + ArgOp = ArgOp->Asl.Next; /* Next peer is the SPACE_ID (what we want) */ /* * The Connection() operator is only valid for the following operation * region SpaceIds: GeneralPurposeIo and GenericSerialBus. */ - if ((ArgNode->Asl.Value.Integer != ACPI_ADR_SPACE_GPIO) && - (ArgNode->Asl.Value.Integer != ACPI_ADR_SPACE_GSBUS)) + if ((ArgOp->Asl.Value.Integer != ACPI_ADR_SPACE_GPIO) && + (ArgOp->Asl.Value.Integer != ACPI_ADR_SPACE_GSBUS)) { AslError (ASL_ERROR, ASL_MSG_CONNECTION_INVALID, Op, NULL); } @@ -712,46 +795,46 @@ AnOtherSemanticAnalysisWalkBegin ( * Ensure that fields for GeneralPurposeIo and GenericSerialBus * contain at least one Connection() operator */ - ArgNode = Op->Asl.Child; /* 1st child is the OpRegion Name */ - Node = ArgNode->Asl.Node; /* OpRegion namespace node */ + ArgOp = Op->Asl.Child; /* 1st child is the OpRegion Name */ + Node = ArgOp->Asl.Node; /* OpRegion namespace node */ if (!Node) { break; } - ArgNode = Node->Op; /* OpRegion definition */ - ArgNode = ArgNode->Asl.Child; /* First child is the OpRegion Name */ - ArgNode = ArgNode->Asl.Next; /* Next peer is the SPACE_ID (what we want) */ + ArgOp = Node->Op; /* OpRegion definition */ + ArgOp = ArgOp->Asl.Child; /* First child is the OpRegion Name */ + ArgOp = ArgOp->Asl.Next; /* Next peer is the SPACE_ID (what we want) */ /* We are only interested in GeneralPurposeIo and GenericSerialBus */ - if ((ArgNode->Asl.Value.Integer != ACPI_ADR_SPACE_GPIO) && - (ArgNode->Asl.Value.Integer != ACPI_ADR_SPACE_GSBUS)) + if ((ArgOp->Asl.Value.Integer != ACPI_ADR_SPACE_GPIO) && + (ArgOp->Asl.Value.Integer != ACPI_ADR_SPACE_GSBUS)) { break; } - ArgNode = Op->Asl.Child; /* 1st child is the OpRegion Name */ - ArgNode = ArgNode->Asl.Next; /* AccessType */ - ArgNode = ArgNode->Asl.Next; /* LockRule */ - ArgNode = ArgNode->Asl.Next; /* UpdateRule */ - ArgNode = ArgNode->Asl.Next; /* Start of FieldUnitList */ + ArgOp = Op->Asl.Child; /* 1st child is the OpRegion Name */ + ArgOp = ArgOp->Asl.Next; /* AccessType */ + ArgOp = ArgOp->Asl.Next; /* LockRule */ + ArgOp = ArgOp->Asl.Next; /* UpdateRule */ + ArgOp = ArgOp->Asl.Next; /* Start of FieldUnitList */ /* Walk the FieldUnitList */ - while (ArgNode) + while (ArgOp) { - if (ArgNode->Asl.ParseOpcode == PARSEOP_CONNECTION) + if (ArgOp->Asl.ParseOpcode == PARSEOP_CONNECTION) { break; } - else if (ArgNode->Asl.ParseOpcode == PARSEOP_NAMESEG) + else if (ArgOp->Asl.ParseOpcode == PARSEOP_NAMESEG) { - AslError (ASL_ERROR, ASL_MSG_CONNECTION_MISSING, ArgNode, NULL); + AslError (ASL_ERROR, ASL_MSG_CONNECTION_MISSING, ArgOp, NULL); break; } - ArgNode = ArgNode->Asl.Next; + ArgOp = ArgOp->Asl.Next; } break; @@ -762,3 +845,204 @@ AnOtherSemanticAnalysisWalkBegin ( return (AE_OK); } + + +/******************************************************************************* + * + * FUNCTION: AnAnalyzeStoreOperator + * + * PARAMETERS: Op - Store() operator + * + * RETURN: None + * + * DESCRIPTION: Analyze a store operator. Mostly for stores to/from package + * objects where there are more restrictions than other data + * types. + * + ******************************************************************************/ + +static void +AnAnalyzeStoreOperator ( + ACPI_PARSE_OBJECT *Op) +{ + ACPI_NAMESPACE_NODE *SourceNode; + ACPI_NAMESPACE_NODE *TargetNode; + ACPI_PARSE_OBJECT *SourceOperandOp; + ACPI_PARSE_OBJECT *TargetOperandOp; + UINT32 SourceOperandBtype; + UINT32 TargetOperandBtype; + + + /* Extract the two operands for STORE */ + + SourceOperandOp = Op->Asl.Child; + TargetOperandOp = SourceOperandOp->Asl.Next; + + /* + * Ignore these Source operand opcodes, they cannot be typechecked, + * the actual result is unknown here. + */ + switch (SourceOperandOp->Asl.ParseOpcode) + { + /* For these, type of the returned value is unknown at compile time */ + + case PARSEOP_DEREFOF: + case PARSEOP_METHODCALL: + case PARSEOP_STORE: + case PARSEOP_COPYOBJECT: + + return; + + case PARSEOP_INDEX: + case PARSEOP_REFOF: + + if (!Gbl_EnableReferenceTypechecking) + { + return; + } + + /* + * These opcodes always return an object reference, and thus + * the result can only be stored to a Local, Arg, or Debug. + */ + if (TargetOperandOp->Asl.AmlOpcode == AML_DEBUG_OP) + { + return; + } + + if ((TargetOperandOp->Asl.AmlOpcode < AML_LOCAL0) || + (TargetOperandOp->Asl.AmlOpcode > AML_ARG6)) + { + AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, TargetOperandOp, + "Source [Reference], Target must be [Local/Arg/Debug]"); + } + return; + + default: + break; + } + + /* + * Ignore these Target operand opcodes, they cannot be typechecked + */ + switch (TargetOperandOp->Asl.ParseOpcode) + { + case PARSEOP_DEBUG: + case PARSEOP_DEREFOF: + case PARSEOP_REFOF: + case PARSEOP_INDEX: + + return; + + case PARSEOP_METHODCALL: + /* + * A target is not allowed to be a method call. + * It is technically allowed to be a method call, but this only + * makes sense in one case: if the method returns a reference object, + * which will then allow the Store to complete successfully. + * However, this is not supported by the ACPICA interpreter, + * and not supported by the MS ASL compiler + * at this time. (09/2015) + */ + AslError (ASL_ERROR, ASL_MSG_UNSUPPORTED, + TargetOperandOp, "Method invocation cannot be a target"); + return; + + default: + break; + } + + /* + * Ignore typecheck for External() operands of type "UnknownObj", + * we don't know the actual type (source or target). + */ + SourceNode = SourceOperandOp->Asl.Node; + if (SourceNode && + (SourceNode->Flags & ANOBJ_IS_EXTERNAL) && + (SourceNode->Type == ACPI_TYPE_ANY)) + { + return; + } + + TargetNode = TargetOperandOp->Asl.Node; + if (TargetNode && + (TargetNode->Flags & ANOBJ_IS_EXTERNAL) && + (TargetNode->Type == ACPI_TYPE_ANY)) + { + return; + } + + /* + * A NULL node with a namepath AML opcode indicates non-existent + * name. Just return, the error message is generated elsewhere. + */ + if ((!SourceNode && (SourceOperandOp->Asl.AmlOpcode == AML_INT_NAMEPATH_OP)) || + (!TargetNode && (TargetOperandOp->Asl.AmlOpcode == AML_INT_NAMEPATH_OP))) + { + return; + } + + /* + * Simple check for source same as target via NS node. + * -- Could be expanded to locals and args. + */ + if (SourceNode && TargetNode) + { + if (SourceNode == TargetNode) + { + AslError (ASL_WARNING, ASL_MSG_DUPLICATE_ITEM, + TargetOperandOp, "Source is the same as Target"); + return; + } + } + + /* Ignore typecheck if either source or target is a local or arg */ + + if ((SourceOperandOp->Asl.AmlOpcode >= AML_LOCAL0) && + (SourceOperandOp->Asl.AmlOpcode <= AML_ARG6)) + { + return; /* Cannot type a local/arg at compile time */ + } + + if ((TargetOperandOp->Asl.AmlOpcode >= AML_LOCAL0) && + (TargetOperandOp->Asl.AmlOpcode <= AML_ARG6)) + { + return; /* Cannot type a local/arg at compile time */ + } + + /* + * Package objects are a special case because they cannot by implicitly + * converted to/from anything. Check for these two illegal cases: + * + * Store (non-package, package) + * Store (package, non-package) + */ + SourceOperandBtype = AnGetBtype (SourceOperandOp); + TargetOperandBtype = AnGetBtype (TargetOperandOp); + + /* Check source first for (package, non-package) case */ + + if (SourceOperandBtype & ACPI_BTYPE_PACKAGE) + { + /* If Source is PACKAGE-->Target must be PACKAGE */ + + if (!(TargetOperandBtype & ACPI_BTYPE_PACKAGE)) + { + AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, TargetOperandOp, + "Source is [Package], Target must be a package also"); + } + } + + /* Else check target for (non-package, package) case */ + + else if (TargetOperandBtype & ACPI_BTYPE_PACKAGE) + { + /* If Target is PACKAGE, Source must be PACKAGE */ + + if (!(SourceOperandBtype & ACPI_BTYPE_PACKAGE)) + { + AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, SourceOperandOp, + "Target is [Package], Source must be a package also"); + } + } +} diff --git a/src/acpica/source/components/debugger/dbexec.c b/src/acpica/source/components/debugger/dbexec.c index 2f3c1b3..c2b02d2 100644 --- a/src/acpica/source/components/debugger/dbexec.c +++ b/src/acpica/source/components/debugger/dbexec.c @@ -491,8 +491,20 @@ AcpiDbExecute ( #ifdef ACPI_DEBUG_OUTPUT UINT32 PreviousAllocations; UINT32 Allocations; +#endif + + /* + * Allow one execution to be performed by debugger or single step + * execution will be dead locked by the interpreter mutexes. + */ + if (AcpiGbl_MethodExecuting) + { + AcpiOsPrintf ("Only one debugger execution is allowed.\n"); + return; + } +#ifdef ACPI_DEBUG_OUTPUT /* Memory allocation tracking */ PreviousAllocations = AcpiDbGetOutstandingAllocations (); diff --git a/src/acpica/source/components/debugger/dbinput.c b/src/acpica/source/components/debugger/dbinput.c index d40a504..b3ee71f 100644 --- a/src/acpica/source/components/debugger/dbinput.c +++ b/src/acpica/source/components/debugger/dbinput.c @@ -195,6 +195,7 @@ enum AcpiExDebuggerCommands CMD_OSI, CMD_OWNER, CMD_PATHS, + CMD_PREDEFINED, CMD_PREFIX, CMD_QUIT, CMD_REFERENCES, @@ -224,7 +225,6 @@ enum AcpiExDebuggerCommands CMD_TERMINATE, CMD_THREADS, - CMD_PREDEFINED, CMD_TEST, #endif }; @@ -273,6 +273,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] = {"OSI", 0}, {"OWNER", 1}, {"PATHS", 0}, + {"PREDEFINED", 0}, {"PREFIX", 0}, {"QUIT", 0}, {"REFERENCES", 1}, @@ -302,7 +303,6 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] = {"TERMINATE", 0}, {"THREADS", 3}, - {"PREDEFINED", 0}, {"TEST", 1}, #endif {NULL, 0} @@ -1301,7 +1301,8 @@ AcpiDbExecuteThread ( AcpiGbl_MethodExecuting = FALSE; AcpiGbl_StepToNextCall = FALSE; - MStatus = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY); + MStatus = AcpiOsAcquireMutex (AcpiGbl_DbCommandReady, + ACPI_WAIT_FOREVER); if (ACPI_FAILURE (MStatus)) { return; @@ -1309,11 +1310,7 @@ AcpiDbExecuteThread ( Status = AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL); - MStatus = AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_COMPLETE); - if (ACPI_FAILURE (MStatus)) - { - return; - } + AcpiOsReleaseMutex (AcpiGbl_DbCommandComplete); } } @@ -1404,13 +1401,14 @@ AcpiDbUserCommands ( * Signal the debug thread that we have a command to execute, * and wait for the command to complete. */ - Status = AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_READY); + AcpiOsReleaseMutex (AcpiGbl_DbCommandReady); if (ACPI_FAILURE (Status)) { return (Status); } - Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_COMPLETE); + Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandComplete, + ACPI_WAIT_FOREVER); if (ACPI_FAILURE (Status)) { return (Status); diff --git a/src/acpica/source/components/debugger/dbobject.c b/src/acpica/source/components/debugger/dbobject.c index 35cea65..e52d1ca 100644 --- a/src/acpica/source/components/debugger/dbobject.c +++ b/src/acpica/source/components/debugger/dbobject.c @@ -517,6 +517,7 @@ AcpiDbDecodeLocals ( UINT32 i; ACPI_OPERAND_OBJECT *ObjDesc; ACPI_NAMESPACE_NODE *Node; + BOOLEAN DisplayLocals = FALSE; ObjDesc = WalkState->MethodDesc; @@ -535,14 +536,39 @@ AcpiDbDecodeLocals ( return; } - AcpiOsPrintf ("Local Variables for method [%4.4s]:\n", - AcpiUtGetNodeName (Node)); + /* Are any locals actually set? */ for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) { ObjDesc = WalkState->LocalVariables[i].Object; - AcpiOsPrintf (" Local%X: ", i); - AcpiDbDisplayInternalObject (ObjDesc, WalkState); + if (ObjDesc) + { + DisplayLocals = TRUE; + break; + } + } + + /* If any are set, only display the ones that are set */ + + if (DisplayLocals) + { + AcpiOsPrintf ("\nInitialized Local Variables for method [%4.4s]:\n", + AcpiUtGetNodeName (Node)); + + for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) + { + ObjDesc = WalkState->LocalVariables[i].Object; + if (ObjDesc) + { + AcpiOsPrintf (" Local%X: ", i); + AcpiDbDisplayInternalObject (ObjDesc, WalkState); + } + } + } + else + { + AcpiOsPrintf ("No Local Variables are initialized for method [%4.4s]\n", + AcpiUtGetNodeName (Node)); } } @@ -566,10 +592,11 @@ AcpiDbDecodeArguments ( UINT32 i; ACPI_OPERAND_OBJECT *ObjDesc; ACPI_NAMESPACE_NODE *Node; + BOOLEAN DisplayArgs = FALSE; + Node = WalkState->MethodNode; ObjDesc = WalkState->MethodDesc; - Node = WalkState->MethodNode; if (!Node) { @@ -584,16 +611,40 @@ AcpiDbDecodeArguments ( return; } - AcpiOsPrintf ( - "Arguments for Method [%4.4s]: " - "(%X arguments defined, max concurrency = %X)\n", - AcpiUtGetNodeName (Node), ObjDesc->Method.ParamCount, - ObjDesc->Method.SyncLevel); + /* Are any arguments actually set? */ for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) { ObjDesc = WalkState->Arguments[i].Object; - AcpiOsPrintf (" Arg%u: ", i); - AcpiDbDisplayInternalObject (ObjDesc, WalkState); + if (ObjDesc) + { + DisplayArgs = TRUE; + break; + } + } + + /* If any are set, only display the ones that are set */ + + if (DisplayArgs) + { + AcpiOsPrintf ( + "Initialized Arguments for Method [%4.4s]: " + "(%X arguments defined for method invocation)\n", + AcpiUtGetNodeName (Node), ObjDesc->Method.ParamCount); + + for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) + { + ObjDesc = WalkState->Arguments[i].Object; + if (ObjDesc) + { + AcpiOsPrintf (" Arg%u: ", i); + AcpiDbDisplayInternalObject (ObjDesc, WalkState); + } + } + } + else + { + AcpiOsPrintf ("No Arguments are initialized for method [%4.4s]\n", + AcpiUtGetNodeName (Node)); } } diff --git a/src/acpica/source/components/debugger/dbxface.c b/src/acpica/source/components/debugger/dbxface.c index eadcc16..0004665 100644 --- a/src/acpica/source/components/debugger/dbxface.c +++ b/src/acpica/source/components/debugger/dbxface.c @@ -173,12 +173,10 @@ AcpiDbStartCommand ( { /* Handshake with the front-end that gets user command lines */ - Status = AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_COMPLETE); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY); + AcpiOsReleaseMutex (AcpiGbl_DbCommandComplete); + + Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandReady, + ACPI_WAIT_FOREVER); if (ACPI_FAILURE (Status)) { return (Status); @@ -522,14 +520,16 @@ AcpiInitializeDebugger ( { /* These were created with one unit, grab it */ - Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_COMPLETE); + Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandComplete, + ACPI_WAIT_FOREVER); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not get debugger mutex\n"); return_ACPI_STATUS (Status); } - Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY); + Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandReady, + ACPI_WAIT_FOREVER); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not get debugger mutex\n"); @@ -583,33 +583,3 @@ AcpiTerminateDebugger ( } ACPI_EXPORT_SYMBOL (AcpiTerminateDebugger) - - -#ifdef ACPI_OBSOLETE_FUNCTIONS -/******************************************************************************* - * - * FUNCTION: AcpiDbMethodEnd - * - * PARAMETERS: WalkState - Current walk - * - * RETURN: Status - * - * DESCRIPTION: Called at method termination - * - ******************************************************************************/ - -void -AcpiDbMethodEnd ( - ACPI_WALK_STATE *WalkState) -{ - - if (!AcpiGbl_CmSingleStep) - { - return; - } - - AcpiOsPrintf ("<Method Terminating>\n"); - - AcpiDbStartCommand (WalkState, NULL); -} -#endif diff --git a/src/acpica/source/components/disassembler/dmcstyle.c b/src/acpica/source/components/disassembler/dmcstyle.c index 37f31e8..0dbbb60 100644 --- a/src/acpica/source/components/disassembler/dmcstyle.c +++ b/src/acpica/source/components/disassembler/dmcstyle.c @@ -299,12 +299,27 @@ AcpiDmCheckForSymbolicOpcode ( Child2->Common.OperatorSymbol = OperatorSymbol; return (TRUE); -#ifdef INDEX_SUPPORT case AML_INDEX_OP: + /* + * Check for constant source operand. Note: although technically + * legal syntax, the iASL compiler does not support this with + * 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)) + { + Op->Common.DisasmFlags |= ACPI_PARSEOP_CLOSING_PAREN; + return (FALSE); + } + + /* Index operator is [] */ + Child1->Common.OperatorSymbol = " ["; Child2->Common.OperatorSymbol = "]"; break; -#endif /* Unary operators */ @@ -514,7 +529,6 @@ AcpiDmCheckForSymbolicOpcode ( case AML_INCREMENT_OP: return (TRUE); -#ifdef INDEX_SUPPORT case AML_INDEX_OP: /* Target is optional, 3rd operand */ @@ -530,7 +544,6 @@ AcpiDmCheckForSymbolicOpcode ( } } return (TRUE); -#endif case AML_STORE_OP: /* @@ -650,12 +663,18 @@ AcpiDmCloseOperator ( } break; + case AML_INDEX_OP: + + /* This is case for unsupported Index() source constants */ + + if (Op->Common.DisasmFlags & ACPI_PARSEOP_CLOSING_PAREN) + { + AcpiOsPrintf (")"); + } + return; /* No need for parens for these */ -#ifdef INDEX_SUPPORT - case AML_INDEX_OP: -#endif case AML_DECREMENT_OP: case AML_INCREMENT_OP: case AML_LNOT_OP: diff --git a/src/acpica/source/components/disassembler/dmobject.c b/src/acpica/source/components/disassembler/dmobject.c deleted file mode 100644 index c4680ef..0000000 --- a/src/acpica/source/components/disassembler/dmobject.c +++ /dev/null @@ -1,648 +0,0 @@ -/******************************************************************************* - * - * Module Name: dmobject - ACPI object decode and display - * - ******************************************************************************/ - -/****************************************************************************** - * - * 1. Copyright Notice - * - * Some or all of this work - Copyright (c) 1999 - 2015, Intel Corp. - * All rights reserved. - * - * 2. License - * - * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided - * you this software, covering your right to use that party's intellectual - * property rights. - * - * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a - * copy of the source code appearing in this file ("Covered Code") an - * irrevocable, perpetual, worldwide license under Intel's copyrights in the - * base code distributed originally by Intel ("Original Intel Code") to copy, - * make derivatives, distribute, use and display any portion of the Covered - * Code in any form, with the right to sublicense such rights; and - * - * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent - * license (with the right to sublicense), under only those claims of Intel - * patents that are infringed by the Original Intel Code, to make, use, sell, - * offer to sell, and import the Covered Code and derivative works thereof - * solely to the minimum extent necessary to exercise the above copyright - * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right - * is granted directly or by implication, estoppel or otherwise; - * - * The above copyright and patent license is granted only if the following - * conditions are met: - * - * 3. Conditions - * - * 3.1. Redistribution of Source with Rights to Further Distribute Source. - * Redistribution of source code of any substantial portion of the Covered - * Code or modification with rights to further distribute source must include - * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, - * Licensee must cause all Covered Code to which Licensee contributes to - * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee - * must include a prominent statement that the modification is derived, - * directly or indirectly, from Original Intel Code. - * - * 3.2. Redistribution of Source with no Rights to Further Distribute Source. - * Redistribution of source code of any substantial portion of the Covered - * Code or modification without rights to further distribute source must - * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In - * addition, Licensee may not authorize further sublicense of source of any - * portion of the Covered Code, and must include terms to the effect that the - * license from Licensee to its licensee is limited to the intellectual - * property embodied in the software Licensee provides to its licensee, and - * not to intellectual property embodied in modifications its licensee may - * make. - * - * 3.3. Redistribution of Executable. Redistribution in executable form of any - * substantial portion of the Covered Code or modification must reproduce the - * above Copyright Notice, and the following Disclaimer and Export Compliance - * provision in the documentation and/or other materials provided with the - * distribution. - * - * 3.4. Intel retains all right, title, and interest in and to the Original - * Intel Code. - * - * 3.5. Neither the name Intel nor any other trademark owned or controlled by - * Intel shall be used in advertising or otherwise to promote the sale, use or - * other dealings in products derived from or relating to the Covered Code - * without prior written authorization from Intel. - * - * 4. Disclaimer and Export Compliance - * - * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A - * PARTICULAR PURPOSE. - * - * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES - * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR - * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, - * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY - * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS - * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY - * LIMITED REMEDY. - * - * 4.3. Licensee shall not export, either directly or indirectly, any of this - * software or system incorporating such software without first obtaining any - * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the - * event Licensee exports any such software from the United States or - * re-exports any such software from a foreign destination, Licensee shall - * ensure that the distribution and export/re-export of the software is in - * compliance with all laws, regulations, orders, or other restrictions of the - * U.S. Export Administration Regulations. Licensee agrees that neither it nor - * any of its subsidiaries will export/re-export any technical data, process, - * software, or service, directly or indirectly, to any country for which the - * United States government or any agency thereof requires an export license, - * other governmental approval, or letter of assurance, without first obtaining - * such license, approval or letter. - * - *****************************************************************************/ - -#include "acpi.h" -#include "accommon.h" -#include "acnamesp.h" -#include "acdisasm.h" - - -#ifdef ACPI_DISASSEMBLER - -#define _COMPONENT ACPI_CA_DEBUGGER - ACPI_MODULE_NAME ("dmnames") - -/* Local prototypes */ - -static void -AcpiDmDecodeNode ( - ACPI_NAMESPACE_NODE *Node); - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpMethodInfo - * - * PARAMETERS: Status - Method execution status - * WalkState - Current state of the parse tree walk - * Op - Executing parse op - * - * RETURN: None - * - * DESCRIPTION: Called when a method has been aborted because of an error. - * Dumps the method execution stack, and the method locals/args, - * and disassembles the AML opcode that failed. - * - ******************************************************************************/ - -void -AcpiDmDumpMethodInfo ( - ACPI_STATUS Status, - ACPI_WALK_STATE *WalkState, - ACPI_PARSE_OBJECT *Op) -{ - ACPI_PARSE_OBJECT *Next; - ACPI_THREAD_STATE *Thread; - ACPI_WALK_STATE *NextWalkState; - ACPI_NAMESPACE_NODE *PreviousMethod = NULL; - - - /* Ignore control codes, they are not errors */ - - if ((Status & AE_CODE_MASK) == AE_CODE_CONTROL) - { - return; - } - - /* We may be executing a deferred opcode */ - - if (WalkState->DeferredNode) - { - AcpiOsPrintf ("Executing subtree for Buffer/Package/Region\n"); - return; - } - - /* - * If there is no Thread, we are not actually executing a method. - * This can happen when the iASL compiler calls the interpreter - * to perform constant folding. - */ - Thread = WalkState->Thread; - if (!Thread) - { - return; - } - - /* Display exception and method name */ - - AcpiOsPrintf ("\n**** Exception %s during execution of method ", - AcpiFormatException (Status)); - AcpiNsPrintNodePathname (WalkState->MethodNode, NULL); - - /* Display stack of executing methods */ - - AcpiOsPrintf ("\n\nMethod Execution Stack:\n"); - NextWalkState = Thread->WalkStateList; - - /* Walk list of linked walk states */ - - while (NextWalkState) - { - AcpiOsPrintf (" Method [%4.4s] executing: ", - AcpiUtGetNodeName (NextWalkState->MethodNode)); - - /* First method is the currently executing method */ - - if (NextWalkState == WalkState) - { - if (Op) - { - /* Display currently executing ASL statement */ - - Next = Op->Common.Next; - Op->Common.Next = NULL; - - AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX); - Op->Common.Next = Next; - } - } - else - { - /* - * This method has called another method - * NOTE: the method call parse subtree is already deleted at this - * point, so we cannot disassemble the method invocation. - */ - AcpiOsPrintf ("Call to method "); - AcpiNsPrintNodePathname (PreviousMethod, NULL); - } - - PreviousMethod = NextWalkState->MethodNode; - NextWalkState = NextWalkState->Next; - AcpiOsPrintf ("\n"); - } - - /* Display the method locals and arguments */ - - AcpiOsPrintf ("\n"); - AcpiDmDisplayLocals (WalkState); - AcpiOsPrintf ("\n"); - AcpiDmDisplayArguments (WalkState); - AcpiOsPrintf ("\n"); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDecodeInternalObject - * - * PARAMETERS: ObjDesc - Object to be displayed - * - * RETURN: None - * - * DESCRIPTION: Short display of an internal object. Numbers/Strings/Buffers. - * - ******************************************************************************/ - -void -AcpiDmDecodeInternalObject ( - ACPI_OPERAND_OBJECT *ObjDesc) -{ - UINT32 i; - - - if (!ObjDesc) - { - AcpiOsPrintf (" Uninitialized"); - return; - } - - if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) - { - AcpiOsPrintf (" %p [%s]", ObjDesc, AcpiUtGetDescriptorName (ObjDesc)); - return; - } - - AcpiOsPrintf (" %s", AcpiUtGetObjectTypeName (ObjDesc)); - - switch (ObjDesc->Common.Type) - { - case ACPI_TYPE_INTEGER: - - AcpiOsPrintf (" %8.8X%8.8X", - ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); - break; - - case ACPI_TYPE_STRING: - - AcpiOsPrintf ("(%u) \"%.24s", - ObjDesc->String.Length, ObjDesc->String.Pointer); - - if (ObjDesc->String.Length > 24) - { - AcpiOsPrintf ("..."); - } - else - { - AcpiOsPrintf ("\""); - } - break; - - case ACPI_TYPE_BUFFER: - - AcpiOsPrintf ("(%u)", ObjDesc->Buffer.Length); - for (i = 0; (i < 8) && (i < ObjDesc->Buffer.Length); i++) - { - AcpiOsPrintf (" %2.2X", ObjDesc->Buffer.Pointer[i]); - } - break; - - default: - - AcpiOsPrintf (" %p", ObjDesc); - break; - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDecodeNode - * - * PARAMETERS: Node - Object to be displayed - * - * RETURN: None - * - * DESCRIPTION: Short display of a namespace node - * - ******************************************************************************/ - -static void -AcpiDmDecodeNode ( - ACPI_NAMESPACE_NODE *Node) -{ - - AcpiOsPrintf ("<Node> Name %4.4s", - AcpiUtGetNodeName (Node)); - - if (Node->Flags & ANOBJ_METHOD_ARG) - { - AcpiOsPrintf (" [Method Arg]"); - } - if (Node->Flags & ANOBJ_METHOD_LOCAL) - { - AcpiOsPrintf (" [Method Local]"); - } - - switch (Node->Type) - { - /* These types have no attached object */ - - case ACPI_TYPE_DEVICE: - - AcpiOsPrintf (" Device"); - break; - - case ACPI_TYPE_THERMAL: - - AcpiOsPrintf (" Thermal Zone"); - break; - - default: - - AcpiDmDecodeInternalObject (AcpiNsGetAttachedObject (Node)); - break; - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDisplayInternalObject - * - * PARAMETERS: ObjDesc - Object to be displayed - * WalkState - Current walk state - * - * RETURN: None - * - * DESCRIPTION: Short display of an internal object - * - ******************************************************************************/ - -void -AcpiDmDisplayInternalObject ( - ACPI_OPERAND_OBJECT *ObjDesc, - ACPI_WALK_STATE *WalkState) -{ - UINT8 Type; - - - AcpiOsPrintf ("%p ", ObjDesc); - - if (!ObjDesc) - { - AcpiOsPrintf ("<Null Object>\n"); - return; - } - - /* Decode the object type */ - - switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc)) - { - case ACPI_DESC_TYPE_PARSER: - - AcpiOsPrintf ("<Parser> "); - break; - - case ACPI_DESC_TYPE_NAMED: - - AcpiDmDecodeNode ((ACPI_NAMESPACE_NODE *) ObjDesc); - break; - - case ACPI_DESC_TYPE_OPERAND: - - Type = ObjDesc->Common.Type; - if (Type > ACPI_TYPE_LOCAL_MAX) - { - AcpiOsPrintf (" Type %X [Invalid Type]", (UINT32) Type); - return; - } - - /* Decode the ACPI object type */ - - switch (ObjDesc->Common.Type) - { - case ACPI_TYPE_LOCAL_REFERENCE: - - AcpiOsPrintf ("[%s] ", AcpiUtGetReferenceName (ObjDesc)); - - /* Decode the refererence */ - - switch (ObjDesc->Reference.Class) - { - case ACPI_REFCLASS_LOCAL: - - AcpiOsPrintf ("%X ", ObjDesc->Reference.Value); - if (WalkState) - { - ObjDesc = WalkState->LocalVariables - [ObjDesc->Reference.Value].Object; - AcpiOsPrintf ("%p", ObjDesc); - AcpiDmDecodeInternalObject (ObjDesc); - } - break; - - case ACPI_REFCLASS_ARG: - - AcpiOsPrintf ("%X ", ObjDesc->Reference.Value); - if (WalkState) - { - ObjDesc = WalkState->Arguments - [ObjDesc->Reference.Value].Object; - AcpiOsPrintf ("%p", ObjDesc); - AcpiDmDecodeInternalObject (ObjDesc); - } - break; - - case ACPI_REFCLASS_INDEX: - - switch (ObjDesc->Reference.TargetType) - { - case ACPI_TYPE_BUFFER_FIELD: - - AcpiOsPrintf ("%p", ObjDesc->Reference.Object); - AcpiDmDecodeInternalObject (ObjDesc->Reference.Object); - break; - - case ACPI_TYPE_PACKAGE: - - AcpiOsPrintf ("%p", ObjDesc->Reference.Where); - if (!ObjDesc->Reference.Where) - { - AcpiOsPrintf (" Uninitialized WHERE pointer"); - } - else - { - AcpiDmDecodeInternalObject ( - *(ObjDesc->Reference.Where)); - } - break; - - default: - - AcpiOsPrintf ("Unknown index target type"); - break; - } - break; - - case ACPI_REFCLASS_REFOF: - - if (!ObjDesc->Reference.Object) - { - AcpiOsPrintf ("Uninitialized reference subobject pointer"); - break; - } - - /* Reference can be to a Node or an Operand object */ - - switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc->Reference.Object)) - { - case ACPI_DESC_TYPE_NAMED: - AcpiDmDecodeNode (ObjDesc->Reference.Object); - break; - - case ACPI_DESC_TYPE_OPERAND: - AcpiDmDecodeInternalObject (ObjDesc->Reference.Object); - break; - - default: - break; - } - break; - - case ACPI_REFCLASS_NAME: - - AcpiDmDecodeNode (ObjDesc->Reference.Node); - break; - - case ACPI_REFCLASS_DEBUG: - case ACPI_REFCLASS_TABLE: - - AcpiOsPrintf ("\n"); - break; - - default: /* Unknown reference class */ - - AcpiOsPrintf ("%2.2X\n", ObjDesc->Reference.Class); - break; - } - break; - - default: - - AcpiOsPrintf ("<Obj> "); - AcpiDmDecodeInternalObject (ObjDesc); - break; - } - break; - - default: - - AcpiOsPrintf ("<Not a valid ACPI Object Descriptor> [%s]", - AcpiUtGetDescriptorName (ObjDesc)); - break; - } - - AcpiOsPrintf ("\n"); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDisplayLocals - * - * PARAMETERS: WalkState - State for current method - * - * RETURN: None - * - * DESCRIPTION: Display all locals for the currently running control method - * - ******************************************************************************/ - -void -AcpiDmDisplayLocals ( - ACPI_WALK_STATE *WalkState) -{ - UINT32 i; - ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_NAMESPACE_NODE *Node; - - - ObjDesc = WalkState->MethodDesc; - Node = WalkState->MethodNode; - if (!Node) - { - AcpiOsPrintf ( - "No method node (Executing subtree for buffer or opregion)\n"); - return; - } - - if (Node->Type != ACPI_TYPE_METHOD) - { - AcpiOsPrintf ("Executing subtree for Buffer/Package/Region\n"); - return; - } - - AcpiOsPrintf ("Local Variables for method [%4.4s]:\n", - AcpiUtGetNodeName (Node)); - - for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) - { - ObjDesc = WalkState->LocalVariables[i].Object; - AcpiOsPrintf (" Local%X: ", i); - AcpiDmDisplayInternalObject (ObjDesc, WalkState); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDisplayArguments - * - * PARAMETERS: WalkState - State for current method - * - * RETURN: None - * - * DESCRIPTION: Display all arguments for the currently running control method - * - ******************************************************************************/ - -void -AcpiDmDisplayArguments ( - ACPI_WALK_STATE *WalkState) -{ - UINT32 i; - ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_NAMESPACE_NODE *Node; - - - ObjDesc = WalkState->MethodDesc; - Node = WalkState->MethodNode; - if (!Node) - { - AcpiOsPrintf ( - "No method node (Executing subtree for buffer or opregion)\n"); - return; - } - - if (Node->Type != ACPI_TYPE_METHOD) - { - AcpiOsPrintf ("Executing subtree for Buffer/Package/Region\n"); - return; - } - - AcpiOsPrintf ( - "Arguments for Method [%4.4s]: (%X arguments defined, max concurrency = %X)\n", - AcpiUtGetNodeName (Node), ObjDesc->Method.ParamCount, ObjDesc->Method.SyncLevel); - - for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) - { - ObjDesc = WalkState->Arguments[i].Object; - AcpiOsPrintf (" Arg%u: ", i); - AcpiDmDisplayInternalObject (ObjDesc, WalkState); - } -} - -#endif diff --git a/src/acpica/source/components/executer/exconvrt.c b/src/acpica/source/components/executer/exconvrt.c index 0023668..019a490 100644 --- a/src/acpica/source/components/executer/exconvrt.c +++ b/src/acpica/source/components/executer/exconvrt.c @@ -745,6 +745,7 @@ AcpiExConvertToTargetType ( break; case ARGI_TARGETREF: + case ARGI_STORE_TARGET: switch (DestinationType) { diff --git a/src/acpica/source/components/executer/exresolv.c b/src/acpica/source/components/executer/exresolv.c index d32e842..a273a71 100644 --- a/src/acpica/source/components/executer/exresolv.c +++ b/src/acpica/source/components/executer/exresolv.c @@ -297,7 +297,6 @@ AcpiExResolveObjectToValue ( * (i.e., dereference the package index) * Delete the ref object, increment the returned object */ - AcpiUtRemoveReference (StackDesc); AcpiUtAddReference (ObjDesc); *StackPtr = ObjDesc; } diff --git a/src/acpica/source/components/executer/exresop.c b/src/acpica/source/components/executer/exresop.c index fab4993..3cfe472 100644 --- a/src/acpica/source/components/executer/exresop.c +++ b/src/acpica/source/components/executer/exresop.c @@ -392,6 +392,8 @@ AcpiExResolveOperands ( 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: + /* * Need an operand of type ACPI_TYPE_LOCAL_REFERENCE * A Namespace Node is OK as-is diff --git a/src/acpica/source/components/executer/exstore.c b/src/acpica/source/components/executer/exstore.c index 47c212d..cb6ebc0 100644 --- a/src/acpica/source/components/executer/exstore.c +++ b/src/acpica/source/components/executer/exstore.c @@ -219,7 +219,7 @@ AcpiExStore ( /* Destination is not a Reference object */ ACPI_ERROR ((AE_INFO, - "Target is not a Reference or Constant object - %s [%p]", + "Target is not a Reference or Constant object - [%s] %p", AcpiUtGetObjectTypeName (DestDesc), DestDesc)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); @@ -266,7 +266,7 @@ AcpiExStore ( * displayed and otherwise has no effect -- see ACPI Specification */ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "**** Write to Debug Object: Object %p %s ****:\n\n", + "**** Write to Debug Object: Object %p [%s] ****:\n\n", SourceDesc, AcpiUtGetObjectTypeName (SourceDesc))); ACPI_DEBUG_OBJECT (SourceDesc, 0, 0); @@ -428,7 +428,7 @@ AcpiExStoreObjectToIndex ( /* All other types are invalid */ ACPI_ERROR ((AE_INFO, - "Source must be Integer/Buffer/String type, not %s", + "Source must be type [Integer/Buffer/String], found [%s]", AcpiUtGetObjectTypeName (SourceDesc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -440,8 +440,8 @@ AcpiExStoreObjectToIndex ( default: ACPI_ERROR ((AE_INFO, - "Target is not a Package or BufferField")); - Status = AE_AML_OPERAND_TYPE; + "Target is not of type [Package/BufferField]")); + Status = AE_AML_TARGET_TYPE; break; } @@ -462,20 +462,20 @@ AcpiExStoreObjectToIndex ( * * DESCRIPTION: Store the object to the named object. * - * The Assignment of an object to a named object is handled here - * The value passed in will replace the current value (if any) - * with the input value. + * The assignment of an object to a named object is handled here. + * The value passed in will replace the current value (if any) + * with the input value. * - * When storing into an object the data is converted to the - * target object type then stored in the object. This means - * that the target object type (for an initialized target) will - * not be changed by a store operation. A CopyObject can change - * the target type, however. + * When storing into an object the data is converted to the + * target object type then stored in the object. This means + * that the target object type (for an initialized target) will + * not be changed by a store operation. A CopyObject can change + * the target type, however. * - * The ImplicitConversion flag is set to NO/FALSE only when - * storing to an ArgX -- as per the rules of the ACPI spec. + * The ImplicitConversion flag is set to NO/FALSE only when + * storing to an ArgX -- as per the rules of the ACPI spec. * - * Assumes parameters are already validated. + * Assumes parameters are already validated. * ******************************************************************************/ @@ -500,9 +500,74 @@ AcpiExStoreObjectToNode ( TargetType = AcpiNsGetType (Node); TargetDesc = AcpiNsGetAttachedObject (Node); - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p (%s) to node %p (%s)\n", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p [%s] to node %p [%s]\n", SourceDesc, AcpiUtGetObjectTypeName (SourceDesc), - Node, AcpiUtGetTypeName (TargetType))); + Node, AcpiUtGetTypeName (TargetType))); + + /* Only limited target types possible for everything except CopyObject */ + + if (WalkState->Opcode != AML_COPY_OP) + { + /* + * Only CopyObject allows all object types to be overwritten. For + * TargetRef(s), there are restrictions on the object types that + * are allowed. + * + * Allowable operations/typing for Store: + * + * 1) Simple Store + * Integer --> Integer (Named/Local/Arg) + * String --> String (Named/Local/Arg) + * Buffer --> Buffer (Named/Local/Arg) + * Package --> Package (Named/Local/Arg) + * + * 2) Store with implicit conversion + * Integer --> String or Buffer (Named) + * String --> Integer or Buffer (Named) + * Buffer --> Integer or String (Named) + */ + switch (TargetType) + { + case ACPI_TYPE_PACKAGE: + /* + * Here, can only store a package to an existing package. + * Storing a package to a Local/Arg is OK, and handled + * elsewhere. + */ + if (WalkState->Opcode == AML_STORE_OP) + { + if (SourceDesc->Common.Type != ACPI_TYPE_PACKAGE) + { + ACPI_ERROR ((AE_INFO, + "Cannot assign type [%s] to [Package] " + "(source must be type Pkg)", + AcpiUtGetObjectTypeName (SourceDesc))); + + return_ACPI_STATUS (AE_AML_TARGET_TYPE); + } + break; + } + + /* Fallthrough */ + + case ACPI_TYPE_DEVICE: + case ACPI_TYPE_EVENT: + case ACPI_TYPE_MUTEX: + case ACPI_TYPE_REGION: + case ACPI_TYPE_POWER: + case ACPI_TYPE_PROCESSOR: + case ACPI_TYPE_THERMAL: + + ACPI_ERROR ((AE_INFO, + "Target must be [Buffer/Integer/String/Reference], found [%s] (%4.4s)", + AcpiUtGetTypeName (Node->Type), Node->Name.Ascii)); + + return_ACPI_STATUS (AE_AML_TARGET_TYPE); + + default: + break; + } + } /* * Resolve the source object to an actual value @@ -518,13 +583,13 @@ AcpiExStoreObjectToNode ( switch (TargetType) { - case ACPI_TYPE_INTEGER: - case ACPI_TYPE_STRING: - case ACPI_TYPE_BUFFER: /* * The simple data types all support implicit source operand * conversion before the store. */ + case ACPI_TYPE_INTEGER: + case ACPI_TYPE_STRING: + case ACPI_TYPE_BUFFER: if ((WalkState->Opcode == AML_COPY_OP) || !ImplicitConversion) @@ -563,7 +628,7 @@ AcpiExStoreObjectToNode ( NewDesc->Common.Type); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "Store %s into %s via Convert/Attach\n", + "Store type [%s] into [%s] via Convert/Attach\n", AcpiUtGetObjectTypeName (SourceDesc), AcpiUtGetObjectTypeName (NewDesc))); } @@ -585,15 +650,12 @@ AcpiExStoreObjectToNode ( default: /* - * No conversions for all other types. Directly store a copy of - * the source object. This is the ACPI spec-defined behavior for - * the CopyObject operator. + * CopyObject operator: No conversions for all other types. + * Instead, directly store a copy of the source object. * - * NOTE: For the Store operator, this is a departure from the - * ACPI spec, which states "If conversion is impossible, abort - * the running control method". Instead, this code implements - * "If conversion is impossible, treat the Store operation as - * a CopyObject". + * This is the ACPI spec-defined behavior for the CopyObject + * operator. (Note, for this default case, all normal + * Store/Target operations exited above with an error). */ Status = AcpiExStoreDirectToNode (SourceDesc, Node, WalkState); diff --git a/src/acpica/source/components/executer/exstoren.c b/src/acpica/source/components/executer/exstoren.c index c1879b4..6a1be4c 100644 --- a/src/acpica/source/components/executer/exstoren.c +++ b/src/acpica/source/components/executer/exstoren.c @@ -201,9 +201,10 @@ AcpiExResolveObject ( /* Conversion successful but still not a valid type */ ACPI_ERROR ((AE_INFO, - "Cannot assign type %s to %s (must be type Int/Str/Buf)", + "Cannot assign type [%s] to [%s] (must be type Int/Str/Buf)", AcpiUtGetObjectTypeName (SourceDesc), AcpiUtGetTypeName (TargetType))); + Status = AE_AML_OPERAND_TYPE; } break; @@ -356,7 +357,7 @@ AcpiExStoreObjectToObject ( /* * All other types come here. */ - ACPI_WARNING ((AE_INFO, "Store into type %s not implemented", + ACPI_WARNING ((AE_INFO, "Store into type [%s] not implemented", AcpiUtGetObjectTypeName (DestDesc))); Status = AE_NOT_IMPLEMENTED; diff --git a/src/acpica/source/components/namespace/nspredef.c b/src/acpica/source/components/namespace/nspredef.c index 8a522d2..85793f9 100644 --- a/src/acpica/source/components/namespace/nspredef.c +++ b/src/acpica/source/components/namespace/nspredef.c @@ -321,7 +321,7 @@ AcpiNsCheckObjectType ( { ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; ACPI_STATUS Status = AE_OK; - char TypeBuffer[48]; /* Room for 5 types */ + char TypeBuffer[96]; /* Room for 10 types */ /* A Namespace node should not get here, but make sure */ diff --git a/src/acpica/source/components/utilities/utdecode.c b/src/acpica/source/components/utilities/utdecode.c index eb0dc9f..99468d5 100644 --- a/src/acpica/source/components/utilities/utdecode.c +++ b/src/acpica/source/components/utilities/utdecode.c @@ -333,13 +333,29 @@ char * AcpiUtGetObjectTypeName ( ACPI_OPERAND_OBJECT *ObjDesc) { + ACPI_FUNCTION_TRACE (UtGetObjectTypeName); + if (!ObjDesc) { - return ("[NULL Object Descriptor]"); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Null Object Descriptor\n")); + return_PTR ("[NULL Object Descriptor]"); + } + + /* These descriptor types share a common area */ + + if ((ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) && + (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_NAMED)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "Invalid object descriptor type: 0x%2.2X [%s] (%p)\n", + ACPI_GET_DESCRIPTOR_TYPE (ObjDesc), + AcpiUtGetDescriptorName (ObjDesc), ObjDesc)); + + return_PTR ("Invalid object"); } - return (AcpiUtGetTypeName (ObjDesc->Common.Type)); + return_PTR (AcpiUtGetTypeName (ObjDesc->Common.Type)); } @@ -533,8 +549,6 @@ static char *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] = "ACPI_MTX_Events", "ACPI_MTX_Caches", "ACPI_MTX_Memory", - "ACPI_MTX_CommandComplete", - "ACPI_MTX_CommandReady" }; char * diff --git a/src/acpica/source/components/utilities/utfileio.c b/src/acpica/source/components/utilities/utfileio.c index 7d6c225..756c14b 100644 --- a/src/acpica/source/components/utilities/utfileio.c +++ b/src/acpica/source/components/utilities/utfileio.c @@ -117,6 +117,7 @@ #include "accommon.h" #include "actables.h" #include "acapps.h" +#include "errno.h" #ifdef ACPI_ASL_COMPILER #include "aslcompiler.h" @@ -402,6 +403,12 @@ AcpiUtReadTableFromFile ( if (!File) { perror ("Could not open input file"); + + if (errno == ENOENT) + { + return (AE_NOT_EXIST); + } + return (Status); } diff --git a/src/acpica/source/components/utilities/utmutex.c b/src/acpica/source/components/utilities/utmutex.c index f5b864f..0fa4c36 100644 --- a/src/acpica/source/components/utilities/utmutex.c +++ b/src/acpica/source/components/utilities/utmutex.c @@ -196,6 +196,24 @@ AcpiUtMutexInitialize ( /* Create the reader/writer lock for namespace access */ Status = AcpiUtCreateRwLock (&AcpiGbl_NamespaceRwLock); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + +#ifdef ACPI_DEBUGGER + + /* Debugger Support */ + + Status = AcpiOsCreateMutex (&AcpiGbl_DbCommandReady); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + Status = AcpiOsCreateMutex (&AcpiGbl_DbCommandComplete); +#endif + return_ACPI_STATUS (Status); } @@ -241,6 +259,12 @@ AcpiUtMutexTerminate ( /* Delete the reader/writer lock */ AcpiUtDeleteRwLock (&AcpiGbl_NamespaceRwLock); + +#ifdef ACPI_DEBUGGER + AcpiOsDeleteMutex (AcpiGbl_DbCommandReady); + AcpiOsDeleteMutex (AcpiGbl_DbCommandComplete); +#endif + return_VOID; } diff --git a/src/acpica/source/include/acapps.h b/src/acpica/source/include/acapps.h index 1153642..1c2004d 100644 --- a/src/acpica/source/include/acapps.h +++ b/src/acpica/source/include/acapps.h @@ -166,7 +166,7 @@ #define FILE_SUFFIX_DISASSEMBLY "dsl" -#define ACPI_TABLE_FILE_SUFFIX ".dat" +#define FILE_SUFFIX_BINARY_TABLE ".dat" /* Needs the dot */ /* diff --git a/src/acpica/source/include/acexcep.h b/src/acpica/source/include/acexcep.h index cf89df2..ca09e6b 100644 --- a/src/acpica/source/include/acexcep.h +++ b/src/acpica/source/include/acexcep.h @@ -270,8 +270,9 @@ typedef struct acpi_exception_info #define AE_AML_ILLEGAL_ADDRESS EXCEP_AML (0x0020) #define AE_AML_INFINITE_LOOP EXCEP_AML (0x0021) #define AE_AML_UNINITIALIZED_NODE EXCEP_AML (0x0022) +#define AE_AML_TARGET_TYPE EXCEP_AML (0x0023) -#define AE_CODE_AML_MAX 0x0022 +#define AE_CODE_AML_MAX 0x0023 /* @@ -396,7 +397,8 @@ static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Aml[] = EXCEP_TXT ("AE_AML_BAD_RESOURCE_LENGTH", "The length of a Resource Descriptor in the AML is incorrect"), EXCEP_TXT ("AE_AML_ILLEGAL_ADDRESS", "A memory, I/O, or PCI configuration address is invalid"), EXCEP_TXT ("AE_AML_INFINITE_LOOP", "An apparent infinite AML While loop, method was aborted"), - EXCEP_TXT ("AE_AML_UNINITIALIZED_NODE", "A namespace node is uninitialized or unresolved") + EXCEP_TXT ("AE_AML_UNINITIALIZED_NODE", "A namespace node is uninitialized or unresolved"), + EXCEP_TXT ("AE_AML_TARGET_TYPE", "A target operand of an incorrect type was encountered") }; static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Ctrl[] = diff --git a/src/acpica/source/include/acglobal.h b/src/acpica/source/include/acglobal.h index d9ef98c..2733f39 100644 --- a/src/acpica/source/include/acglobal.h +++ b/src/acpica/source/include/acglobal.h @@ -389,7 +389,6 @@ ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnoreNoopOperator, FALSE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CstyleDisassembly, TRUE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ForceAmlDisassembly, FALSE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Verbose, TRUE); -//ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Verbose, FALSE); OK ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Disasm); ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Listing); @@ -434,6 +433,9 @@ ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCountMisc); ACPI_GLOBAL (UINT32, AcpiGbl_NumNodes); ACPI_GLOBAL (UINT32, AcpiGbl_NumObjects); +ACPI_GLOBAL (ACPI_MUTEX, AcpiGbl_DbCommandReady); +ACPI_GLOBAL (ACPI_MUTEX, AcpiGbl_DbCommandComplete); + #endif /* ACPI_DEBUGGER */ diff --git a/src/acpica/source/include/aclocal.h b/src/acpica/source/include/aclocal.h index 58f2320..fdeafff 100644 --- a/src/acpica/source/include/aclocal.h +++ b/src/acpica/source/include/aclocal.h @@ -159,10 +159,8 @@ union acpi_parse_object; #define ACPI_MTX_EVENTS 3 /* Data for ACPI events */ #define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */ #define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */ -#define ACPI_MTX_DEBUG_CMD_COMPLETE 6 /* AML debugger */ -#define ACPI_MTX_DEBUG_CMD_READY 7 /* AML debugger */ -#define ACPI_MAX_MUTEX 7 +#define ACPI_MAX_MUTEX 5 #define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1 @@ -400,13 +398,17 @@ ACPI_STATUS (*ACPI_INTERNAL_METHOD) ( #define ACPI_BTYPE_BUFFER_FIELD 0x00002000 #define ACPI_BTYPE_DDB_HANDLE 0x00004000 #define ACPI_BTYPE_DEBUG_OBJECT 0x00008000 -#define ACPI_BTYPE_REFERENCE 0x00010000 +#define ACPI_BTYPE_REFERENCE_OBJECT 0x00010000 /* From Index(), RefOf(), etc (Type6Opcodes) */ #define ACPI_BTYPE_RESOURCE 0x00020000 +#define ACPI_BTYPE_NAMED_REFERENCE 0x00040000 /* Generic unresolved Name or Namepath */ #define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER) #define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE) -#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE) + + /* Used by Copy, DeRefOf, Store, Printf, Fprintf */ + +#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE_OBJECT | ACPI_BTYPE_DDB_HANDLE) #define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR) #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF @@ -1089,7 +1091,7 @@ typedef struct acpi_parse_state #define ACPI_PARSEOP_PARAMLIST 0x02 #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 #define ACPI_PARSEOP_PREDEF_CHECKED 0x08 -#define ACPI_PARSEOP_SPECIAL 0x10 +#define ACPI_PARSEOP_CLOSING_PAREN 0x10 #define ACPI_PARSEOP_COMPOUND 0x20 #define ACPI_PARSEOP_ASSIGNMENT 0x40 diff --git a/src/acpica/source/include/acopcode.h b/src/acpica/source/include/acopcode.h index 133e134..50bac80 100644 --- a/src/acpica/source/include/acopcode.h +++ b/src/acpica/source/include/acopcode.h @@ -285,7 +285,7 @@ #define ARGI_ARG4 ARG_NONE #define ARGI_ARG5 ARG_NONE #define ARGI_ARG6 ARG_NONE -#define ARGI_BANK_FIELD_OP ARGI_INVALID_OPCODE +#define ARGI_BANK_FIELD_OP ARGI_LIST1 (ARGI_INTEGER) #define ARGI_BIT_AND_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) #define ARGI_BIT_NAND_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) #define ARGI_BIT_NOR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) @@ -381,7 +381,7 @@ #define ARGI_SLEEP_OP ARGI_LIST1 (ARGI_INTEGER) #define ARGI_STALL_OP ARGI_LIST1 (ARGI_INTEGER) #define ARGI_STATICSTRING_OP ARGI_INVALID_OPCODE -#define ARGI_STORE_OP ARGI_LIST2 (ARGI_DATAREFOBJ, ARGI_TARGETREF) +#define ARGI_STORE_OP ARGI_LIST2 (ARGI_DATAREFOBJ, ARGI_STORE_TARGET) #define ARGI_STRING_OP ARGI_INVALID_OPCODE #define ARGI_SUBTRACT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) #define ARGI_THERMAL_ZONE_OP ARGI_INVALID_OPCODE diff --git a/src/acpica/source/include/acpixf.h b/src/acpica/source/include/acpixf.h index e0cd0d0..55412c8 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 0x20150818 +#define ACPI_CA_VERSION 0x20150930 #include "acconfig.h" #include "actypes.h" diff --git a/src/acpica/source/include/actbl1.h b/src/acpica/source/include/actbl1.h index f7eaa4c..dd00f20 100644 --- a/src/acpica/source/include/actbl1.h +++ b/src/acpica/source/include/actbl1.h @@ -1256,7 +1256,7 @@ typedef struct acpi_nfit_memory_map #define ACPI_NFIT_MEM_SAVE_FAILED (1) /* 00: Last SAVE to Memory Device failed */ #define ACPI_NFIT_MEM_RESTORE_FAILED (1<<1) /* 01: Last RESTORE from Memory Device failed */ #define ACPI_NFIT_MEM_FLUSH_FAILED (1<<2) /* 02: Platform flush failed */ -#define ACPI_NFIT_MEM_ARMED (1<<3) /* 03: Memory Device observed to be not armed */ +#define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed */ #define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */ #define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */ diff --git a/src/acpica/source/include/amlcode.h b/src/acpica/source/include/amlcode.h index 34ac987..6940b7a 100644 --- a/src/acpica/source/include/amlcode.h +++ b/src/acpica/source/include/amlcode.h @@ -352,14 +352,15 @@ #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 */ /* Multiple/complex types */ -#define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by SizeOf operator*/ -#define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */ -#define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */ -#define ARGI_REGION_OR_BUFFER 0x15 /* Used by LOAD op only */ -#define ARGI_DATAREFOBJ 0x16 +#define ARGI_DATAOBJECT 0x13 /* Buffer, String, package or reference to a Node - Used only by SizeOf operator*/ +#define ARGI_COMPLEXOBJ 0x14 /* Buffer, String, or package (Used by INDEX op only) */ +#define ARGI_REF_OR_STRING 0x15 /* Reference or String (Used by DEREFOF op only) */ +#define ARGI_REGION_OR_BUFFER 0x16 /* Used by LOAD op only */ +#define ARGI_DATAREFOBJ 0x17 /* Note: types above can expand to 0x1F maximum */ diff --git a/src/acpica/source/include/platform/acenv.h b/src/acpica/source/include/platform/acenv.h index 614a538..d393af2 100644 --- a/src/acpica/source/include/platform/acenv.h +++ b/src/acpica/source/include/platform/acenv.h @@ -369,6 +369,7 @@ #define ACPI_INTERNAL_VAR_XFACE #endif + /* * Debugger threading model * Use single threaded if the entire subsystem is contained in an application @@ -378,11 +379,11 @@ * multi-threaded if ACPI_APPLICATION is not set. */ #ifndef DEBUGGER_THREADING -#ifdef ACPI_APPLICATION -#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED +#if !defined (ACPI_APPLICATION) || defined (ACPI_EXEC_APP) +#define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED #else -#define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED +#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED #endif #endif /* !DEBUGGER_THREADING */ diff --git a/src/acpica/source/tools/acpiexec/aehandlers.c b/src/acpica/source/tools/acpiexec/aehandlers.c index c4eb02a..97ea103 100644 --- a/src/acpica/source/tools/acpiexec/aehandlers.c +++ b/src/acpica/source/tools/acpiexec/aehandlers.c @@ -490,7 +490,7 @@ AeExceptionHandler ( if (NewAmlStatus != AmlStatus) { - AcpiOsPrintf ("[AcpiExec] Exception override, new status %s\n", + AcpiOsPrintf ("[AcpiExec] Exception override, new status %s\n\n", AcpiFormatException (NewAmlStatus)); }