From ef4931cd5704685e4fae0154abbb237c7efbde85 Mon Sep 17 00:00:00 2001 From: Al Stone Date: Oct 15 2015 18:30:02 +0000 Subject: Imported Upstream version 20150930 --- diff --git a/changes.txt b/changes.txt index 2782921..78a19ea 100644 --- a/changes.txt +++ b/changes.txt @@ -1,7 +1,97 @@ ---------------------------------------- -18 August 2015. Summary of changes for version 20150818: +30 September 2015. Summary of changes for version 20150930: -This release is available at https://acpica.org/downloads +1) ACPICA kernel-resident subsystem: + +Debugger: Implemented several changes and bug fixes to assist support for +the in-kernel version of the AML debugger. Lv Zheng. +- Fix the "predefined" command for in-kernel debugger. +- Do not enter debug command loop for the help and version commands. +- Disallow "execute" command during execution/single-step of a method. + +Interpreter: Updated runtime typechecking for all operators that have +target operands. The operand is resolved and validated that it is legal. +For example, the target cannot be a non-data object such as a Device, +Mutex, ThermalZone, etc., as per the ACPI specification. + +Debugger: Fixed the double-mutex user I/O handshake to work when local +deadlock detection is enabled. + +Debugger: limited display of method locals and arguments (LocalX and +ArgX) to only those that have actually been initialized. This prevents +lines of extraneous output. + +Updated the definition of the NFIT table to correct the bit polarity of +one flag: ACPI_NFIT_MEM_ARMED --> ACPI_NFIT_MEM_NOT_ARMED + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 101.7K Code, 27.9K Data, 129.6K Total + Debug Version: 199.3K Code, 81.4K Data, 280.7K Total + Previous Release: + Non-Debug Version: 101.3K Code, 27.7K Data, 129.0K Total + Debug Version: 198.6K Code, 80.9K Data, 279.5K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Improved the compile-time typechecking for operands of many of the +ASL operators: + +-- Added an option to disable compiler operand/operator typechecking (- +ot). + +-- For the following operators, the TermArg operands are now validated +when possible to be Integer data objects: BankField, OperationRegion, +DataTableRegion, Buffer, and Package. + +-- Store (Source, Target): Both the source and target operands are +resolved and checked that the operands are both legal. For example, +neither operand can be a non-data object such as a Device, Mutex, +ThermalZone, etc. Note, as per the ACPI specification, the CopyObject +operator can be used to store an object to any type of target object. + +-- Store (Source, Target): If the source is a Package object, the target +must be a Package object, LocalX, ArgX, or Debug. Likewise, if the target +is a Package, the source must also be a Package. + +-- Store (Source, Target): A warning is issued if the source and target +resolve to the identical named object. + +-- Store (Source, ): An error is generated for the +target method invocation, as this construct is not supported by the AML +interpreter. + +-- For all ASL math and logic operators, the target operand must be a +data object (Integer, String, Buffer, LocalX, ArgX, or Debug). This +includes the function return value also. + +-- External declarations are also included in the typechecking where +possible. External objects defined using the UnknownObj keyword cannot be +typechecked, however. + +iASL and Disassembler: Added symbolic (ASL+) support for the ASL Index +operator: +- Legacy code: Index(PKG1, 3) +- New ASL+ code: PKG1[3] +This completes the ACPI 6.0 ASL+ support as it was the only operator not +supported. + +iASL: Fixed the file suffix for the preprocessor output file (.i). Two +spaces were inadvertently appended to the filename, causing file access +and deletion problems on some systems. + +ASL Test Suite (ASLTS): Updated the master makefile to generate all +possible compiler output files when building the test suite -- thus +exercising these features of the compiler. These files are automatically +deleted when the test suite exits. + +---------------------------------------- +18 August 2015. Summary of changes for version 20150818: 1) ACPICA kernel-resident subsystem: diff --git a/generate/unix/Makefile.config b/generate/unix/Makefile.config index 1e3f6e3..3137821 100644 --- a/generate/unix/Makefile.config +++ b/generate/unix/Makefile.config @@ -195,7 +195,6 @@ CWARNINGFLAGS += \ -Wmissing-field-initializers\ -Wnested-externs\ -Wold-style-definition\ - -Woverride-init\ -Wno-format-nonliteral\ -Wredundant-decls # @@ -207,10 +206,11 @@ ifneq ($(HOST), _FreeBSD) ifneq ($(HOST), _APPLE) CWARNINGFLAGS += \ - -Wlogical-op\ - -Wmissing-parameter-type\ - -Wold-style-declaration\ - -Wtype-limits + -Woverride-init\ + -Wlogical-op\ + -Wmissing-parameter-type\ + -Wold-style-declaration\ + -Wtype-limits endif endif diff --git a/generate/unix/iasl/Makefile b/generate/unix/iasl/Makefile index 4d15aa9..14c894e 100644 --- a/generate/unix/iasl/Makefile +++ b/generate/unix/iasl/Makefile @@ -234,7 +234,9 @@ MISC = \ $(OBJDIR)/prparser.y.h ASL_PARSER = \ + $(ASL_COMPILER)/aslcstyle.y\ $(ASL_COMPILER)/aslparser.y\ + $(ASL_COMPILER)/aslresources.y\ $(ASL_COMPILER)/aslsupport.y\ $(ASL_COMPILER)/asltokens.y\ $(ASL_COMPILER)/asltypes.y\ diff --git a/source/common/adfile.c b/source/common/adfile.c index fc7c6b2..902521f 100644 --- a/source/common/adfile.c +++ b/source/common/adfile.c @@ -99,7 +99,7 @@ AdGenerateFilename ( } FilenameBuf[i] = 0; - strcat (FilenameBuf, ACPI_TABLE_FILE_SUFFIX); + strcat (FilenameBuf, FILE_SUFFIX_BINARY_TABLE); return (FilenameBuf); } diff --git a/source/compiler/aslbtypes.c b/source/compiler/aslbtypes.c index 15c4ecd..4b6fd4f 100644 --- a/source/compiler/aslbtypes.c +++ b/source/compiler/aslbtypes.c @@ -100,9 +100,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 */ /* @@ -133,9 +134,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: @@ -149,28 +165,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: @@ -274,7 +295,7 @@ AnMapEtypeToBtype ( case ACPI_TYPE_LOCAL_RESOURCE: case ACPI_TYPE_LOCAL_RESOURCE_FIELD: - return (ACPI_BTYPE_REFERENCE); + return (ACPI_BTYPE_REFERENCE_OBJECT); default: @@ -401,12 +422,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; @@ -442,7 +457,6 @@ AnGetBtype ( return (ThisNodeBtype); } - /******************************************************************************* * * FUNCTION: AnMapObjTypeToBtype diff --git a/source/compiler/aslcompile.c b/source/compiler/aslcompile.c index 9e5b53a..a45814e 100644 --- a/source/compiler/aslcompile.c +++ b/source/compiler/aslcompile.c @@ -302,8 +302,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/source/compiler/aslcompiler.l b/source/compiler/aslcompiler.l index e0b2423..37e99ae 100644 --- a/source/compiler/aslcompiler.l +++ b/source/compiler/aslcompiler.l @@ -156,6 +156,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/source/compiler/aslcstyle.y b/source/compiler/aslcstyle.y new file mode 100644 index 0000000..70524fd --- /dev/null +++ b/source/compiler/aslcstyle.y @@ -0,0 +1,209 @@ +NoEcho(' +/****************************************************************************** + * + * Module Name: aslcstyle.y - Production rules for symbolic operators + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2015, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +') + +/******************************************************************************* + * + * 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 {$$ = TrCreateLeafNode (PARSEOP_LNOT);} + TermArg {$$ = TrLinkChildren ($2,1,$3);} + | PARSEOP_EXP_NOT {$$ = TrCreateLeafNode (PARSEOP_NOT);} + TermArg {$$ = TrLinkChildren ($2,2,$3,TrCreateNullTarget ());} + + | SuperName PARSEOP_EXP_INCREMENT {$$ = TrCreateLeafNode (PARSEOP_INCREMENT);} + {$$ = TrLinkChildren ($3,1,$1);} + | SuperName PARSEOP_EXP_DECREMENT {$$ = TrCreateLeafNode (PARSEOP_DECREMENT);} + {$$ = TrLinkChildren ($3,1,$1);} + + /* Binary operators: math and logical */ + + | TermArg PARSEOP_EXP_ADD {$$ = TrCreateLeafNode (PARSEOP_ADD);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_DIVIDE {$$ = TrCreateLeafNode (PARSEOP_DIVIDE);} + TermArg {$$ = TrLinkChildren ($3,4,$1,$4,TrCreateNullTarget (), + TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_MODULO {$$ = TrCreateLeafNode (PARSEOP_MOD);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_MULTIPLY {$$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_SHIFT_LEFT {$$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_SHIFT_RIGHT {$$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_SUBTRACT {$$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} + + | TermArg PARSEOP_EXP_AND {$$ = TrCreateLeafNode (PARSEOP_AND);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_OR {$$ = TrCreateLeafNode (PARSEOP_OR);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_XOR {$$ = TrCreateLeafNode (PARSEOP_XOR);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} + + | TermArg PARSEOP_EXP_GREATER {$$ = TrCreateLeafNode (PARSEOP_LGREATER);} + TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} + | TermArg PARSEOP_EXP_GREATER_EQUAL {$$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);} + TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} + | TermArg PARSEOP_EXP_LESS {$$ = TrCreateLeafNode (PARSEOP_LLESS);} + TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} + | TermArg PARSEOP_EXP_LESS_EQUAL {$$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);} + TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} + + | TermArg PARSEOP_EXP_EQUAL {$$ = TrCreateLeafNode (PARSEOP_LEQUAL);} + TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} + | TermArg PARSEOP_EXP_NOT_EQUAL {$$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);} + TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} + + | TermArg PARSEOP_EXP_LOGICAL_AND {$$ = TrCreateLeafNode (PARSEOP_LAND);} + TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} + | TermArg PARSEOP_EXP_LOGICAL_OR {$$ = TrCreateLeafNode (PARSEOP_LOR);} + TermArg {$$ = TrLinkChildren ($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 {$$ = TrCreateLeafNode (PARSEOP_ADD);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_DIV_EQ {$$ = TrCreateLeafNode (PARSEOP_DIVIDE);} + TermArg {$$ = TrLinkChildren ($3,4,$1,$4,TrCreateNullTarget (), + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_MOD_EQ {$$ = TrCreateLeafNode (PARSEOP_MOD);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_MUL_EQ {$$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_SHL_EQ {$$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_SHR_EQ {$$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_SUB_EQ {$$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_AND_EQ {$$ = TrCreateLeafNode (PARSEOP_AND);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_OR_EQ {$$ = TrCreateLeafNode (PARSEOP_OR);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + + | TermArg PARSEOP_EXP_XOR_EQ {$$ = TrCreateLeafNode (PARSEOP_XOR);} + TermArg {$$ = TrLinkChildren ($3,3,$1,$4, + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + ; diff --git a/source/compiler/asldefine.h b/source/compiler/asldefine.h index 9e42ddf..64ecff3 100644 --- a/source/compiler/asldefine.h +++ b/source/compiler/asldefine.h @@ -104,26 +104,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/source/compiler/aslglobal.h b/source/compiler/aslglobal.h index 0696b67..e78e58f 100644 --- a/source/compiler/aslglobal.h +++ b/source/compiler/aslglobal.h @@ -177,6 +177,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/source/compiler/aslmain.c b/source/compiler/aslmain.c index 4550ea1..c0a3d3f 100644 --- a/source/compiler/aslmain.c +++ b/source/compiler/aslmain.c @@ -160,6 +160,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 ", "Override table header Revision (1-255)"); @@ -203,7 +204,7 @@ Usage ( ACPI_OPTION ("-f", "Ignore errors, force creation of AML output file(s)"); ACPI_OPTION ("-m ", "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 ", "Set debug level for trace output"); ACPI_OPTION ("-z", "Do not insert new compiler ID for DataTables"); } diff --git a/source/compiler/aslmap.c b/source/compiler/aslmap.c index ade7173..5338204 100644 --- a/source/compiler/aslmap.c +++ b/source/compiler/aslmap.c @@ -123,6 +123,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), @@ -241,7 +242,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), @@ -357,7 +358,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/source/compiler/asloptions.c b/source/compiler/asloptions.c index 0be33e7..ef6ad8b 100644 --- a/source/compiler/asloptions.c +++ b/source/compiler/asloptions.c @@ -68,7 +68,7 @@ AslDoResponseFile ( #define ASL_TOKEN_SEPARATORS " \t\n" -#define ASL_SUPPORTED_OPTIONS "@:b|c|d^D:e:f^gh^i|I:l^m:no|p:P^r:s|t|T+G^v^w|x:z" +#define ASL_SUPPORTED_OPTIONS "@:a:b|c|d^D:e:f^gh^i|I:l^m:no|p:P^r:s|t|T+G^v^w|x:z" /******************************************************************************* @@ -184,6 +184,24 @@ AslDoOptions ( } break; + case 'a': /* Debug options */ + + switch (AcpiGbl_Optarg[0]) + { + case 'r': + + Gbl_EnableReferenceTypechecking = TRUE; + break; + + default: + + printf ("Unknown option: -a%s\n", AcpiGbl_Optarg); + return (-1); + } + + break; + + case 'b': /* Debug options */ switch (AcpiGbl_Optarg[0]) @@ -506,6 +524,13 @@ AslDoOptions ( Gbl_ReferenceOptimizationFlag = FALSE; break; + case 'c': + + /* Display compile time(s) */ + + Gbl_CompileTimesFlag = TRUE; + break; + case 'f': /* Disable folding on "normal" expressions */ @@ -529,9 +554,9 @@ AslDoOptions ( case 't': - /* Display compile time(s) */ + /* Disable heavy typechecking */ - Gbl_CompileTimesFlag = TRUE; + Gbl_DoTypechecking = FALSE; break; default: diff --git a/source/compiler/aslparser.y b/source/compiler/aslparser.y index cf09ddf..d80316c 100644 --- a/source/compiler/aslparser.y +++ b/source/compiler/aslparser.y @@ -122,6 +122,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/source/compiler/aslresources.y b/source/compiler/aslresources.y new file mode 100644 index 0000000..5e8ccde --- /dev/null +++ b/source/compiler/aslresources.y @@ -0,0 +1,1179 @@ +NoEcho(' +/****************************************************************************** + * + * Module Name: aslresources.y - Bison/Yacc production rules for resources + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2015, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +') + +/******************************************************************************* + * + * 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 '(' {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);} + ByteConst + ')' {$$ = TrLinkChildren ($3,1,$4);} + | PARSEOP_ACCESSATTRIB_RAW_BYTES '(' {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);} + ByteConst + ')' {$$ = TrLinkChildren ($3,1,$4);} + | PARSEOP_ACCESSATTRIB_RAW_PROCESS '(' {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);} + ByteConst + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_DMA);} + DMATypeKeyword + OptionalBusMasterKeyword + ',' XferTypeKeyword + OptionalNameString_Last + ')' '{' + ByteList '}' {$$ = TrLinkChildren ($3,5,$4,$5,$7,$8,$11);} + | PARSEOP_DMA '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +DWordIOTerm + : PARSEOP_DWORDIO '(' {$$ = TrCreateLeafNode (PARSEOP_DWORDIO);} + OptionalResourceType_First + OptionalMinType + OptionalMaxType + OptionalDecodeType + OptionalRangeType + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString + OptionalType + OptionalTranslationType_Last + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);} + OptionalResourceType_First + OptionalDecodeType + OptionalMinType + OptionalMaxType + OptionalMemType + ',' OptionalReadWriteKeyword + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString + OptionalAddressRange + OptionalType_Last + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);} + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} + OptionalResourceType + OptionalDecodeType + OptionalMinType + OptionalMaxType + ',' ByteConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);} + OptionalResourceType_First + OptionalMinType + OptionalMaxType + OptionalDecodeType + OptionalRangeType + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + OptionalQWordConstExpr + OptionalNameString + OptionalType + OptionalTranslationType_Last + ')' {$$ = TrLinkChildren ($3,14,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22);} + | PARSEOP_EXTENDEDIO '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ExtendedMemoryTerm + : PARSEOP_EXTENDEDMEMORY '(' {$$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);} + OptionalResourceType_First + OptionalDecodeType + OptionalMinType + OptionalMaxType + OptionalMemType + ',' OptionalReadWriteKeyword + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + OptionalQWordConstExpr + OptionalNameString + OptionalAddressRange + OptionalType_Last + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);} + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} + OptionalResourceType + OptionalDecodeType + OptionalMinType + OptionalMaxType + ',' ByteConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + OptionalQWordConstExpr + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($3,13,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23);} + | PARSEOP_EXTENDEDSPACE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +FixedDmaTerm + : PARSEOP_FIXEDDMA '(' {$$ = TrCreateLeafNode (PARSEOP_FIXEDDMA);} + WordConstExpr /* 04: DMA RequestLines */ + ',' WordConstExpr /* 06: DMA Channels */ + OptionalXferSize /* 07: DMA TransferSize */ + OptionalNameString /* 08: DescriptorName */ + ')' {$$ = TrLinkChildren ($3,4,$4,$6,$7,$8);} + | PARSEOP_FIXEDDMA '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +FixedIOTerm + : PARSEOP_FIXEDIO '(' {$$ = TrCreateLeafNode (PARSEOP_FIXEDIO);} + WordConstExpr + ',' ByteConstExpr + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($3,3,$4,$6,$7);} + | PARSEOP_FIXEDIO '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +GpioIntTerm + : PARSEOP_GPIO_INT '(' {$$ = 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 ($3,11,$4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);} + | PARSEOP_GPIO_INT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +GpioIoTerm + : PARSEOP_GPIO_IO '(' {$$ = 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 ($3,11,$4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);} + | PARSEOP_GPIO_IO '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +I2cSerialBusTerm + : PARSEOP_I2C_SERIALBUS '(' {$$ = 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 ($3,9,$4,$5,$7,$8,$10,$11,$12,$13,$14);} + | PARSEOP_I2C_SERIALBUS '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +InterruptTerm + : PARSEOP_INTERRUPT '(' {$$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} + OptionalResourceType_First + ',' InterruptTypeKeyword + ',' InterruptLevel + OptionalShareType + OptionalByteConstExpr + OptionalStringData + OptionalNameString_Last + ')' '{' + DWordList '}' {$$ = TrLinkChildren ($3,8,$4,$6,$8,$9,$10,$11,$12,$15);} + | PARSEOP_INTERRUPT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +IOTerm + : PARSEOP_IO '(' {$$ = TrCreateLeafNode (PARSEOP_IO);} + IODecodeKeyword + ',' WordConstExpr + ',' WordConstExpr + ',' ByteConstExpr + ',' ByteConstExpr + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($3,6,$4,$6,$8,$10,$12,$13);} + | PARSEOP_IO '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +IRQNoFlagsTerm + : PARSEOP_IRQNOFLAGS '(' {$$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);} + OptionalNameString_First + ')' '{' + ByteList '}' {$$ = TrLinkChildren ($3,2,$4,$7);} + | PARSEOP_IRQNOFLAGS '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +IRQTerm + : PARSEOP_IRQ '(' {$$ = TrCreateLeafNode (PARSEOP_IRQ);} + InterruptTypeKeyword + ',' InterruptLevel + OptionalShareType + OptionalNameString_Last + ')' '{' + ByteList '}' {$$ = TrLinkChildren ($3,5,$4,$6,$7,$8,$11);} + | PARSEOP_IRQ '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +Memory24Term + : PARSEOP_MEMORY24 '(' {$$ = TrCreateLeafNode (PARSEOP_MEMORY24);} + OptionalReadWriteKeyword + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($3,6,$4,$6,$8,$10,$12,$13);} + | PARSEOP_MEMORY24 '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +Memory32FixedTerm + : PARSEOP_MEMORY32FIXED '(' {$$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);} + OptionalReadWriteKeyword + ',' DWordConstExpr + ',' DWordConstExpr + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($3,4,$4,$6,$8,$9);} + | PARSEOP_MEMORY32FIXED '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +Memory32Term + : PARSEOP_MEMORY32 '(' {$$ = TrCreateLeafNode (PARSEOP_MEMORY32);} + OptionalReadWriteKeyword + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + ',' DWordConstExpr + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($3,6,$4,$6,$8,$10,$12,$13);} + | PARSEOP_MEMORY32 '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +QWordIOTerm + : PARSEOP_QWORDIO '(' {$$ = TrCreateLeafNode (PARSEOP_QWORDIO);} + OptionalResourceType_First + OptionalMinType + OptionalMaxType + OptionalDecodeType + OptionalRangeType + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString + OptionalType + OptionalTranslationType_Last + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);} + OptionalResourceType_First + OptionalDecodeType + OptionalMinType + OptionalMaxType + OptionalMemType + ',' OptionalReadWriteKeyword + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString + OptionalAddressRange + OptionalType_Last + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);} + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} + OptionalResourceType + OptionalDecodeType + OptionalMinType + OptionalMaxType + ',' ByteConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + ',' QWordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} + | PARSEOP_QWORDSPACE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +RegisterTerm + : PARSEOP_REGISTER '(' {$$ = TrCreateLeafNode (PARSEOP_REGISTER);} + AddressSpaceKeyword + ',' ByteConstExpr + ',' ByteConstExpr + ',' QWordConstExpr + OptionalAccessSize + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($3,6,$4,$6,$8,$10,$11,$12);} + | PARSEOP_REGISTER '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +SpiSerialBusTerm + : PARSEOP_SPI_SERIALBUS '(' {$$ = 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 ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} + ')' '{' + ResourceMacroList '}' {$$ = TrLinkChildren ($3,1,$6);} + | PARSEOP_STARTDEPENDENTFN_NOPRI '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +StartDependentFnTerm + : PARSEOP_STARTDEPENDENTFN '(' {$$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);} + ByteConstExpr + ',' ByteConstExpr + ')' '{' + ResourceMacroList '}' {$$ = TrLinkChildren ($3,3,$4,$6,$9);} + | PARSEOP_STARTDEPENDENTFN '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +UartSerialBusTerm + : PARSEOP_UART_SERIALBUS '(' {$$ = 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 ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_VENDORLONG);} + OptionalNameString_First + ')' '{' + ByteList '}' {$$ = TrLinkChildren ($3,2,$4,$7);} + | PARSEOP_VENDORLONG '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +VendorShortTerm + : PARSEOP_VENDORSHORT '(' {$$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);} + OptionalNameString_First + ')' '{' + ByteList '}' {$$ = TrLinkChildren ($3,2,$4,$7);} + | PARSEOP_VENDORSHORT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +WordBusNumberTerm + : PARSEOP_WORDBUSNUMBER '(' {$$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);} + OptionalResourceType_First + OptionalMinType + OptionalMaxType + OptionalDecodeType + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($3,12,$4,$5,$6,$7,$9,$11,$13,$15,$17,$18,$19,$20);} + | PARSEOP_WORDBUSNUMBER '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +WordIOTerm + : PARSEOP_WORDIO '(' {$$ = TrCreateLeafNode (PARSEOP_WORDIO);} + OptionalResourceType_First + OptionalMinType + OptionalMaxType + OptionalDecodeType + OptionalRangeType + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString + OptionalType + OptionalTranslationType_Last + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_WORDSPACE);} + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} + OptionalResourceType + OptionalDecodeType + OptionalMinType + OptionalMaxType + ',' ByteConstExpr + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + ',' WordConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString_Last + ')' {$$ = TrLinkChildren ($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/source/compiler/aslrules.y b/source/compiler/aslrules.y index dbe0882..cac37c3 100644 --- a/source/compiler/aslrules.y +++ b/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 * *****************************************************************************/ @@ -46,14 +46,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 @@ -62,10 +60,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 @@ -92,292 +86,128 @@ DefinitionBlockTerm '{' TermList '}' {$$ = TrLinkChildren ($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 {$$ = TrCreateLeafNode (PARSEOP_LNOT);} - TermArg {$$ = TrLinkChildren ($2,1,$3);} - | PARSEOP_EXP_NOT {$$ = TrCreateLeafNode (PARSEOP_NOT);} - TermArg {$$ = TrLinkChildren ($2,2,$3,TrCreateNullTarget ());} - - | SuperName PARSEOP_EXP_INCREMENT {$$ = TrCreateLeafNode (PARSEOP_INCREMENT);} - {$$ = TrLinkChildren ($3,1,$1);} - | SuperName PARSEOP_EXP_DECREMENT {$$ = TrCreateLeafNode (PARSEOP_DECREMENT);} - {$$ = TrLinkChildren ($3,1,$1);} - - /* Binary operators: math and logical */ - - | TermArg PARSEOP_EXP_ADD {$$ = TrCreateLeafNode (PARSEOP_ADD);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_DIVIDE {$$ = TrCreateLeafNode (PARSEOP_DIVIDE);} - TermArg {$$ = TrLinkChildren ($3,4,$1,$4,TrCreateNullTarget (), - TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_MODULO {$$ = TrCreateLeafNode (PARSEOP_MOD);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_MULTIPLY {$$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_SHIFT_LEFT {$$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_SHIFT_RIGHT {$$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_SUBTRACT {$$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} - - | TermArg PARSEOP_EXP_AND {$$ = TrCreateLeafNode (PARSEOP_AND);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_OR {$$ = TrCreateLeafNode (PARSEOP_OR);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_XOR {$$ = TrCreateLeafNode (PARSEOP_XOR);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} - - | TermArg PARSEOP_EXP_GREATER {$$ = TrCreateLeafNode (PARSEOP_LGREATER);} - TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} - | TermArg PARSEOP_EXP_GREATER_EQUAL {$$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);} - TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} - | TermArg PARSEOP_EXP_LESS {$$ = TrCreateLeafNode (PARSEOP_LLESS);} - TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} - | TermArg PARSEOP_EXP_LESS_EQUAL {$$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);} - TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} - - | TermArg PARSEOP_EXP_EQUAL {$$ = TrCreateLeafNode (PARSEOP_LEQUAL);} - TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} - | TermArg PARSEOP_EXP_NOT_EQUAL {$$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);} - TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} - - | TermArg PARSEOP_EXP_LOGICAL_AND {$$ = TrCreateLeafNode (PARSEOP_LAND);} - TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} - | TermArg PARSEOP_EXP_LOGICAL_OR {$$ = TrCreateLeafNode (PARSEOP_LOR);} - TermArg {$$ = TrLinkChildren ($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 {$$ = TrCreateLeafNode (PARSEOP_ADD);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} - - | TermArg PARSEOP_EXP_DIV_EQ {$$ = TrCreateLeafNode (PARSEOP_DIVIDE);} - TermArg {$$ = TrLinkChildren ($3,4,$1,$4,TrCreateNullTarget (), - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} - - | TermArg PARSEOP_EXP_MOD_EQ {$$ = TrCreateLeafNode (PARSEOP_MOD);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} - - | TermArg PARSEOP_EXP_MUL_EQ {$$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} - - | TermArg PARSEOP_EXP_SHL_EQ {$$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} - - | TermArg PARSEOP_EXP_SHR_EQ {$$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} - - | TermArg PARSEOP_EXP_SUB_EQ {$$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} - - | TermArg PARSEOP_EXP_AND_EQ {$$ = TrCreateLeafNode (PARSEOP_AND);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} - - | TermArg PARSEOP_EXP_OR_EQ {$$ = TrCreateLeafNode (PARSEOP_OR);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} +SuperName + : NameString {} + | ArgTerm {} + | LocalTerm {} + | DebugTerm {} + | Type6Opcode {} - | TermArg PARSEOP_EXP_XOR_EQ {$$ = TrCreateLeafNode (PARSEOP_XOR);} - TermArg {$$ = TrLinkChildren ($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;} @@ -397,7 +227,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;} @@ -416,50 +246,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 {} @@ -515,7 +572,6 @@ Type2BufferOrStringOpcode /* * A type 3 opcode evaluates to an Integer and cannot have a destination operand */ - Type3Opcode : EISAIDTerm {} ; @@ -530,7 +586,6 @@ Type4Opcode ; */ - Type5Opcode : ResourceTemplateTerm {} | UnicodeTerm {} @@ -542,34 +597,74 @@ Type6Opcode : RefOfTerm {} | DerefOfTerm {} | IndexTerm {} + | IndexExpTerm {} | MethodInvocationTerm {} ; -IncludeTerm - : PARSEOP_INCLUDE '(' {$$ = TrCreateLeafNode (PARSEOP_INCLUDE);} - String ')' {TrLinkChildren ($3,1,$4);FlOpenIncludeFile ($4);} - TermList - IncludeEndTerm {$$ = TrLinkPeerNodes (3,$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 '(' {$$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} + SuperName + ',' WordConstExpr + ')' {$$ = TrLinkChildren ($3,2,$4,$6);} + | PARSEOP_ACQUIRE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +AddTerm + : PARSEOP_ADD '(' {$$ = TrCreateLeafNode (PARSEOP_ADD);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} + | PARSEOP_ADD '(' error ')' {$$ = AslDoError(); yyclearin;} ; +AliasTerm + : PARSEOP_ALIAS '(' {$$ = TrCreateLeafNode (PARSEOP_ALIAS);} + NameString + NameStringItem + ')' {$$ = TrLinkChildren ($3,2,$4, + TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} + | PARSEOP_ALIAS '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; -/******* Named Objects *******************************************************/ +AndTerm + : PARSEOP_AND '(' {$$ = TrCreateLeafNode (PARSEOP_AND);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_BANKFIELD);} @@ -585,41 +680,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 '(' {$$ = TrCreateLeafNode (PARSEOP_BUFFER);} + OptionalTermArg + ')' '{' + BufferTermData '}' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_CASE);} + DataObject + ')' '{' + TermList '}' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} + | PARSEOP_CONCATENATE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ConcatResTerm + : PARSEOP_CONCATENATERESTEMPLATE '(' {$$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} + | PARSEOP_CONCATENATERESTEMPLATE '(' error ')' {$$ = AslDoError(); yyclearin;} ; @@ -638,6 +746,28 @@ ConnectionTerm error ')' {$$ = AslDoError(); yyclearin;} ; +CondRefOfTerm + : PARSEOP_CONDREFOF '(' {$$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} + SuperName + Target + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_CONDREFOF '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ContinueTerm + : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);} + ; + +CopyObjectTerm + : PARSEOP_COPYOBJECT '(' {$$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} + TermArg + ',' SimpleTarget + ')' {$$ = TrLinkChildren ($3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} + | PARSEOP_COPYOBJECT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + CreateBitFieldTerm : PARSEOP_CREATEBITFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} TermArg @@ -710,6 +840,33 @@ DataRegionTerm error ')' {$$ = AslDoError(); yyclearin;} ; +DebugTerm + : PARSEOP_DEBUG {$$ = TrCreateLeafNode (PARSEOP_DEBUG);} + ; + +DecTerm + : PARSEOP_DECREMENT '(' {$$ = TrCreateLeafNode (PARSEOP_DECREMENT);} + SuperName + ')' {$$ = TrLinkChildren ($3,1,$4);} + | PARSEOP_DECREMENT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +DefaultTerm + : PARSEOP_DEFAULT '{' {$$ = TrCreateLeafNode (PARSEOP_DEFAULT);} + TermList '}' {$$ = TrLinkChildren ($3,1,$4);} + | PARSEOP_DEFAULT '{' + error '}' {$$ = AslDoError(); yyclearin;} + ; + +DerefOfTerm + : PARSEOP_DEREFOF '(' {$$ = TrCreateLeafNode (PARSEOP_DEREFOF);} + TermArg + ')' {$$ = TrLinkChildren ($3,1,$4);} + | PARSEOP_DEREFOF '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + DeviceTerm : PARSEOP_DEVICE '(' {$$ = TrCreateLeafNode (PARSEOP_DEVICE);} NameString @@ -719,6 +876,53 @@ DeviceTerm error ')' {$$ = AslDoError(); yyclearin;} ; +DivideTerm + : PARSEOP_DIVIDE '(' {$$ = TrCreateLeafNode (PARSEOP_DIVIDE);} + TermArg + TermArgItem + Target + Target + ')' {$$ = TrLinkChildren ($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 '{' {$$ = TrCreateLeafNode (PARSEOP_ELSE);} + TermList '}' {$$ = TrLinkChildren ($3,1,$4);} + + | PARSEOP_ELSE '{' + error '}' {$$ = AslDoError(); yyclearin;} + + | PARSEOP_ELSE + error {$$ = AslDoError(); yyclearin;} + + | PARSEOP_ELSEIF '(' {$$ = TrCreateLeafNode (PARSEOP_ELSE);} + TermArg {$$ = TrCreateLeafNode (PARSEOP_IF);} + ')' '{' + TermList '}' {TrLinkChildren ($5,2,$4,$8);} + ElseTerm {TrLinkPeerNode ($5,$11);} + {$$ = TrLinkChildren ($3,1,$5);} + + | PARSEOP_ELSEIF '(' + error ')' {$$ = AslDoError(); yyclearin;} + + | PARSEOP_ELSEIF + error {$$ = AslDoError(); yyclearin;} + ; + EventTerm : PARSEOP_EVENT '(' {$$ = TrCreateLeafNode (PARSEOP_EVENT);} NameString @@ -727,6 +931,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 '(' {$$ = TrCreateLeafNode (PARSEOP_FATAL);} + ByteConstExpr + ',' DWordConstExpr + TermArgItem + ')' {$$ = TrLinkChildren ($3,3,$4,$6,$7);} + | PARSEOP_FATAL '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + FieldTerm : PARSEOP_FIELD '(' {$$ = TrCreateLeafNode (PARSEOP_FIELD);} NameString @@ -739,198 +964,191 @@ FieldTerm error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} ; -FunctionTerm - : PARSEOP_FUNCTION '(' {$$ = TrCreateLeafNode (PARSEOP_METHOD);} - NameString - OptionalParameterTypePackage - OptionalParameterTypesPackage - ')' '{' - TermList '}' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} + TermArg + Target + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_FINDSETLEFTBIT '(' error ')' {$$ = AslDoError(); yyclearin;} ; -IndexFieldTerm - : PARSEOP_INDEXFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} - NameString - NameStringItem - ',' AccessTypeKeyword - ',' LockRuleKeyword - ',' UpdateRuleKeyword - ')' '{' - FieldUnitList '}' {$$ = TrLinkChildren ($3,6,$4,$5,$7,$9,$11,$14);} - | PARSEOP_INDEXFIELD '(' - error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} - ; - -MethodTerm - : PARSEOP_METHOD '(' {$$ = TrCreateLeafNode (PARSEOP_METHOD);} - NameString - OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} - OptionalSerializeRuleKeyword - OptionalByteConstExpr - OptionalParameterTypePackage - OptionalParameterTypesPackage - ')' '{' - TermList '}' {$$ = TrLinkChildren ($3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$7,$8,$9,$10,$13);} - | PARSEOP_METHOD '(' +FindSetRightBitTerm + : PARSEOP_FINDSETRIGHTBIT '(' {$$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} + TermArg + Target + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_FINDSETRIGHTBIT '(' error ')' {$$ = AslDoError(); yyclearin;} ; -MutexTerm - : PARSEOP_MUTEX '(' {$$ = TrCreateLeafNode (PARSEOP_MUTEX);} - NameString - ',' ByteConstExpr - ')' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} - | PARSEOP_MUTEX '(' +FprintfTerm + : PARSEOP_FPRINTF '(' {$$ = TrCreateLeafNode (PARSEOP_FPRINTF);} + TermArg ',' + StringData + PrintfArgList + ')' {$$ = TrLinkChildren ($3,3,$4,$6,$7);} + | PARSEOP_FPRINTF '(' error ')' {$$ = AslDoError(); yyclearin;} ; -OpRegionTerm - : PARSEOP_OPERATIONREGION '(' {$$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} - NameString - ',' OpRegionSpaceIdTerm - TermArgItem - TermArgItem - ')' {$$ = TrLinkChildren ($3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8);} - | PARSEOP_OPERATIONREGION '(' +FromBCDTerm + : PARSEOP_FROMBCD '(' {$$ = TrCreateLeafNode (PARSEOP_FROMBCD);} + TermArg + Target + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_FROMBCD '(' error ')' {$$ = AslDoError(); yyclearin;} ; -OpRegionSpaceIdTerm - : RegionSpaceKeyword {} - | ByteConst {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} - ; - -PowerResTerm - : PARSEOP_POWERRESOURCE '(' {$$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} +FunctionTerm + : PARSEOP_FUNCTION '(' {$$ = TrCreateLeafNode (PARSEOP_METHOD);} NameString - ',' ByteConstExpr - ',' WordConstExpr + OptionalParameterTypePackage + OptionalParameterTypesPackage ')' '{' - ObjectList '}' {$$ = TrLinkChildren ($3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);} - | PARSEOP_POWERRESOURCE '(' + TermList '}' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} - NameString - ',' ByteConstExpr - OptionalDWordConstExpr - OptionalByteConstExpr +IfTerm + : PARSEOP_IF '(' {$$ = TrCreateLeafNode (PARSEOP_IF);} + TermArg ')' '{' - ObjectList '}' {$$ = TrLinkChildren ($3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);} - | PARSEOP_PROCESSOR '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; + TermList '}' {$$ = TrLinkChildren ($3,2,$4,$7);} -ThermalZoneTerm - : PARSEOP_THERMALZONE '(' {$$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} - NameString - ')' '{' - ObjectList '}' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} - | PARSEOP_THERMALZONE '(' + | PARSEOP_IF '(' error ')' {$$ = AslDoError(); yyclearin;} ; +IncludeTerm + : PARSEOP_INCLUDE '(' {$$ = TrCreateLeafNode (PARSEOP_INCLUDE);} + String ')' {TrLinkChildren ($3,1,$4);FlOpenIncludeFile ($4);} + TermList + IncludeEndTerm {$$ = TrLinkPeerNodes (3,$3,$7,$8);} + ; -/******* Namespace modifiers *************************************************/ +IncludeEndTerm + : PARSEOP_INCLUDE_END {$$ = TrCreateLeafNode (PARSEOP_INCLUDE_END);} + ; +IncTerm + : PARSEOP_INCREMENT '(' {$$ = TrCreateLeafNode (PARSEOP_INCREMENT);} + SuperName + ')' {$$ = TrLinkChildren ($3,1,$4);} + | PARSEOP_INCREMENT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; -AliasTerm - : PARSEOP_ALIAS '(' {$$ = TrCreateLeafNode (PARSEOP_ALIAS);} +IndexFieldTerm + : PARSEOP_INDEXFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} NameString NameStringItem - ')' {$$ = TrLinkChildren ($3,2,$4,TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} - | PARSEOP_ALIAS '(' - error ')' {$$ = AslDoError(); yyclearin;} + ',' AccessTypeKeyword + ',' LockRuleKeyword + ',' UpdateRuleKeyword + ')' '{' + FieldUnitList '}' {$$ = TrLinkChildren ($3,6,$4,$5,$7,$9,$11,$14);} + | PARSEOP_INDEXFIELD '(' + error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} ; -NameTerm - : PARSEOP_NAME '(' {$$ = TrCreateLeafNode (PARSEOP_NAME);} - NameString - ',' DataObject - ')' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} - | PARSEOP_NAME '(' +IndexTerm + : PARSEOP_INDEX '(' {$$ = TrCreateLeafNode (PARSEOP_INDEX);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} + | PARSEOP_INDEX '(' error ')' {$$ = AslDoError(); yyclearin;} ; -ScopeTerm - : PARSEOP_SCOPE '(' {$$ = TrCreateLeafNode (PARSEOP_SCOPE);} - NameString - ')' '{' - ObjectList '}' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} - | PARSEOP_SCOPE '(' +LAndTerm + : PARSEOP_LAND '(' {$$ = TrCreateLeafNode (PARSEOP_LAND);} + TermArg + TermArgItem + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_LAND '(' error ')' {$$ = AslDoError(); yyclearin;} ; - -/******* Type 1 opcodes *******************************************************/ - - -BreakTerm - : PARSEOP_BREAK {$$ = TrCreateNode (PARSEOP_BREAK, 0);} +LEqualTerm + : PARSEOP_LEQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LEQUAL);} + TermArg + TermArgItem + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_LEQUAL '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -BreakPointTerm - : PARSEOP_BREAKPOINT {$$ = TrCreateNode (PARSEOP_BREAKPOINT, 0);} +LGreaterEqualTerm + : PARSEOP_LGREATEREQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LLESS);} + TermArg + TermArgItem + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($3,2,$4,$5));} + | PARSEOP_LGREATEREQUAL '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -ContinueTerm - : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);} +LGreaterTerm + : PARSEOP_LGREATER '(' {$$ = TrCreateLeafNode (PARSEOP_LGREATER);} + TermArg + TermArgItem + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_LGREATER '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -FatalTerm - : PARSEOP_FATAL '(' {$$ = TrCreateLeafNode (PARSEOP_FATAL);} - ByteConstExpr - ',' DWordConstExpr +LLessEqualTerm + : PARSEOP_LLESSEQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LGREATER);} + TermArg TermArgItem - ')' {$$ = TrLinkChildren ($3,3,$4,$6,$7);} - | PARSEOP_FATAL '(' + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($3,2,$4,$5));} + | PARSEOP_LLESSEQUAL '(' error ')' {$$ = AslDoError(); yyclearin;} ; -IfElseTerm - : IfTerm ElseTerm {$$ = TrLinkPeerNode ($1,$2);} +LLessTerm + : PARSEOP_LLESS '(' {$$ = TrCreateLeafNode (PARSEOP_LLESS);} + TermArg + TermArgItem + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_LLESS '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -IfTerm - : PARSEOP_IF '(' {$$ = TrCreateLeafNode (PARSEOP_IF);} +LNotEqualTerm + : PARSEOP_LNOTEQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LEQUAL);} TermArg - ')' '{' - TermList '}' {$$ = TrLinkChildren ($3,2,$4,$7);} - - | PARSEOP_IF '(' + TermArgItem + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($3,2,$4,$5));} + | PARSEOP_LNOTEQUAL '(' error ')' {$$ = AslDoError(); yyclearin;} ; -ElseTerm - : {$$ = NULL;} - | PARSEOP_ELSE '{' {$$ = TrCreateLeafNode (PARSEOP_ELSE);} - TermList '}' {$$ = TrLinkChildren ($3,1,$4);} - - | PARSEOP_ELSE '{' - error '}' {$$ = AslDoError(); yyclearin;} - - | PARSEOP_ELSE - error {$$ = AslDoError(); yyclearin;} - - | PARSEOP_ELSEIF '(' {$$ = TrCreateLeafNode (PARSEOP_ELSE);} - TermArg {$$ = TrCreateLeafNode (PARSEOP_IF);} - ')' '{' - TermList '}' {TrLinkChildren ($5,2,$4,$8);} - ElseTerm {TrLinkPeerNode ($5,$11);} - {$$ = TrLinkChildren ($3,1,$5);} - - | PARSEOP_ELSEIF '(' +LNotTerm + : PARSEOP_LNOT '(' {$$ = TrCreateLeafNode (PARSEOP_LNOT);} + TermArg + ')' {$$ = TrLinkChildren ($3,1,$4);} + | PARSEOP_LNOT '(' error ')' {$$ = AslDoError(); yyclearin;} + ; - | PARSEOP_ELSEIF - error {$$ = AslDoError(); yyclearin;} +LoadTableTerm + : PARSEOP_LOADTABLE '(' {$$ = TrCreateLeafNode (PARSEOP_LOADTABLE);} + TermArg + TermArgItem + TermArgItem + OptionalListString + OptionalListString + OptionalReference + ')' {$$ = TrLinkChildren ($3,6,$4,$5,$6,$7,$8,$9);} + | PARSEOP_LOADTABLE '(' + error ')' {$$ = AslDoError(); yyclearin;} ; LoadTerm @@ -942,1953 +1160,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 '(' {$$ = TrCreateLeafNode (PARSEOP_NOTIFY);} - SuperName - TermArgItem - ')' {$$ = TrLinkChildren ($3,2,$4,$5);} - | PARSEOP_NOTIFY '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ReleaseTerm - : PARSEOP_RELEASE '(' {$$ = TrCreateLeafNode (PARSEOP_RELEASE);} - SuperName - ')' {$$ = TrLinkChildren ($3,1,$4);} - | PARSEOP_RELEASE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ResetTerm - : PARSEOP_RESET '(' {$$ = TrCreateLeafNode (PARSEOP_RESET);} - SuperName - ')' {$$ = TrLinkChildren ($3,1,$4);} - | PARSEOP_RESET '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ReturnTerm - : PARSEOP_RETURN '(' {$$ = TrCreateLeafNode (PARSEOP_RETURN);} - OptionalReturnArg - ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_SIGNAL);} - SuperName - ')' {$$ = TrLinkChildren ($3,1,$4);} - | PARSEOP_SIGNAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -SleepTerm - : PARSEOP_SLEEP '(' {$$ = TrCreateLeafNode (PARSEOP_SLEEP);} - TermArg - ')' {$$ = TrLinkChildren ($3,1,$4);} - | PARSEOP_SLEEP '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -StallTerm - : PARSEOP_STALL '(' {$$ = TrCreateLeafNode (PARSEOP_STALL);} - TermArg - ')' {$$ = TrLinkChildren ($3,1,$4);} - | PARSEOP_STALL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -SwitchTerm - : PARSEOP_SWITCH '(' {$$ = TrCreateLeafNode (PARSEOP_SWITCH);} - TermArg - ')' '{' - CaseDefaultTermList '}' - {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_CASE);} - DataObject - ')' '{' - TermList '}' {$$ = TrLinkChildren ($3,2,$4,$7);} - | PARSEOP_CASE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -DefaultTerm - : PARSEOP_DEFAULT '{' {$$ = TrCreateLeafNode (PARSEOP_DEFAULT);} - TermList '}' {$$ = TrLinkChildren ($3,1,$4);} - | PARSEOP_DEFAULT '{' - error '}' {$$ = AslDoError(); yyclearin;} - ; - -UnloadTerm - : PARSEOP_UNLOAD '(' {$$ = TrCreateLeafNode (PARSEOP_UNLOAD);} - SuperName - ')' {$$ = TrLinkChildren ($3,1,$4);} - | PARSEOP_UNLOAD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -WhileTerm - : PARSEOP_WHILE '(' {$$ = TrCreateLeafNode (PARSEOP_WHILE);} - TermArg - ')' '{' TermList '}' - {$$ = TrLinkChildren ($3,2,$4,$7);} - | PARSEOP_WHILE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - - -/******* Type 2 opcodes *******************************************************/ - -AcquireTerm - : PARSEOP_ACQUIRE '(' {$$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} - SuperName - ',' WordConstExpr - ')' {$$ = TrLinkChildren ($3,2,$4,$6);} - | PARSEOP_ACQUIRE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -AddTerm - : PARSEOP_ADD '(' {$$ = TrCreateLeafNode (PARSEOP_ADD);} +LOrTerm + : PARSEOP_LOR '(' {$$ = TrCreateLeafNode (PARSEOP_LOR);} TermArg TermArgItem - Target - ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} - | PARSEOP_ADD '(' + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_LOR '(' error ')' {$$ = AslDoError(); yyclearin;} ; -AndTerm - : PARSEOP_AND '(' {$$ = TrCreateLeafNode (PARSEOP_AND);} +MatchTerm + : PARSEOP_MATCH '(' {$$ = TrCreateLeafNode (PARSEOP_MATCH);} TermArg + ',' MatchOpKeyword TermArgItem - Target - ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} - | PARSEOP_AND '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ConcatTerm - : PARSEOP_CONCATENATE '(' {$$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} - TermArg + ',' MatchOpKeyword TermArgItem - Target - ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} - | PARSEOP_CONCATENATE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ConcatResTerm - : PARSEOP_CONCATENATERESTEMPLATE '(' {$$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);} - TermArg TermArgItem - Target - ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} - | PARSEOP_CONCATENATERESTEMPLATE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -CondRefOfTerm - : PARSEOP_CONDREFOF '(' {$$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} - SuperName - Target - ')' {$$ = TrLinkChildren ($3,2,$4,$5);} - | PARSEOP_CONDREFOF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -CopyObjectTerm - : PARSEOP_COPYOBJECT '(' {$$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} - TermArg - ',' SimpleTarget - ')' {$$ = TrLinkChildren ($3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} - | PARSEOP_COPYOBJECT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -DecTerm - : PARSEOP_DECREMENT '(' {$$ = TrCreateLeafNode (PARSEOP_DECREMENT);} - SuperName - ')' {$$ = TrLinkChildren ($3,1,$4);} - | PARSEOP_DECREMENT '(' + ')' {$$ = TrLinkChildren ($3,6,$4,$6,$7,$9,$10,$11);} + | PARSEOP_MATCH '(' error ')' {$$ = AslDoError(); yyclearin;} ; -DerefOfTerm - : PARSEOP_DEREFOF '(' {$$ = TrCreateLeafNode (PARSEOP_DEREFOF);} - TermArg - ')' {$$ = TrLinkChildren ($3,1,$4);} - | PARSEOP_DEREFOF '(' +MethodTerm + : PARSEOP_METHOD '(' {$$ = TrCreateLeafNode (PARSEOP_METHOD);} + NameString + OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} + OptionalSerializeRuleKeyword + OptionalByteConstExpr + OptionalParameterTypePackage + OptionalParameterTypesPackage + ')' '{' + TermList '}' {$$ = TrLinkChildren ($3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$7,$8,$9,$10,$13);} + | PARSEOP_METHOD '(' error ')' {$$ = AslDoError(); yyclearin;} ; -DivideTerm - : PARSEOP_DIVIDE '(' {$$ = TrCreateLeafNode (PARSEOP_DIVIDE);} +MidTerm + : PARSEOP_MID '(' {$$ = TrCreateLeafNode (PARSEOP_MID);} TermArg TermArgItem - Target + TermArgItem Target ')' {$$ = TrLinkChildren ($3,4,$4,$5,$6,$7);} - | PARSEOP_DIVIDE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -FindSetLeftBitTerm - : PARSEOP_FINDSETLEFTBIT '(' {$$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} - TermArg - Target - ')' {$$ = TrLinkChildren ($3,2,$4,$5);} - | PARSEOP_FINDSETLEFTBIT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -FindSetRightBitTerm - : PARSEOP_FINDSETRIGHTBIT '(' {$$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} - TermArg - Target - ')' {$$ = TrLinkChildren ($3,2,$4,$5);} - | PARSEOP_FINDSETRIGHTBIT '(' + | PARSEOP_MID '(' error ')' {$$ = AslDoError(); yyclearin;} ; -FromBCDTerm - : PARSEOP_FROMBCD '(' {$$ = TrCreateLeafNode (PARSEOP_FROMBCD);} +ModTerm + : PARSEOP_MOD '(' {$$ = TrCreateLeafNode (PARSEOP_MOD);} TermArg + TermArgItem Target - ')' {$$ = TrLinkChildren ($3,2,$4,$5);} - | PARSEOP_FROMBCD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -IncTerm - : PARSEOP_INCREMENT '(' {$$ = TrCreateLeafNode (PARSEOP_INCREMENT);} - SuperName - ')' {$$ = TrLinkChildren ($3,1,$4);} - | PARSEOP_INCREMENT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -IndexTerm - : PARSEOP_INDEX '(' {$$ = TrCreateLeafNode (PARSEOP_INDEX);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} - | PARSEOP_INDEX '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LAndTerm - : PARSEOP_LAND '(' {$$ = TrCreateLeafNode (PARSEOP_LAND);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($3,2,$4,$5);} - | PARSEOP_LAND '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LEqualTerm - : PARSEOP_LEQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LEQUAL);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($3,2,$4,$5);} - | PARSEOP_LEQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LGreaterTerm - : PARSEOP_LGREATER '(' {$$ = TrCreateLeafNode (PARSEOP_LGREATER);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($3,2,$4,$5);} - | PARSEOP_LGREATER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LGreaterEqualTerm - : PARSEOP_LGREATEREQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LLESS);} - TermArg - TermArgItem - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($3,2,$4,$5));} - | PARSEOP_LGREATEREQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LLessTerm - : PARSEOP_LLESS '(' {$$ = TrCreateLeafNode (PARSEOP_LLESS);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($3,2,$4,$5);} - | PARSEOP_LLESS '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LLessEqualTerm - : PARSEOP_LLESSEQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LGREATER);} - TermArg - TermArgItem - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($3,2,$4,$5));} - | PARSEOP_LLESSEQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LNotTerm - : PARSEOP_LNOT '(' {$$ = TrCreateLeafNode (PARSEOP_LNOT);} - TermArg - ')' {$$ = TrLinkChildren ($3,1,$4);} - | PARSEOP_LNOT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LNotEqualTerm - : PARSEOP_LNOTEQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LEQUAL);} - TermArg - TermArgItem - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($3,2,$4,$5));} - | PARSEOP_LNOTEQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LoadTableTerm - : PARSEOP_LOADTABLE '(' {$$ = TrCreateLeafNode (PARSEOP_LOADTABLE);} - TermArg - TermArgItem - TermArgItem - OptionalListString - OptionalListString - OptionalReference - ')' {$$ = TrLinkChildren ($3,6,$4,$5,$6,$7,$8,$9);} - | PARSEOP_LOADTABLE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LOrTerm - : PARSEOP_LOR '(' {$$ = TrCreateLeafNode (PARSEOP_LOR);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($3,2,$4,$5);} - | PARSEOP_LOR '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -MatchTerm - : PARSEOP_MATCH '(' {$$ = TrCreateLeafNode (PARSEOP_MATCH);} - TermArg - ',' MatchOpKeyword - TermArgItem - ',' MatchOpKeyword - TermArgItem - TermArgItem - ')' {$$ = TrLinkChildren ($3,6,$4,$6,$7,$9,$10,$11);} - | PARSEOP_MATCH '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -MidTerm - : PARSEOP_MID '(' {$$ = TrCreateLeafNode (PARSEOP_MID);} - TermArg - TermArgItem - TermArgItem - Target - ')' {$$ = TrLinkChildren ($3,4,$4,$5,$6,$7);} - | PARSEOP_MID '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ModTerm - : PARSEOP_MOD '(' {$$ = TrCreateLeafNode (PARSEOP_MOD);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} - | PARSEOP_MOD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -MultiplyTerm - : PARSEOP_MULTIPLY '(' {$$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} - | PARSEOP_MULTIPLY '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -NAndTerm - : PARSEOP_NAND '(' {$$ = TrCreateLeafNode (PARSEOP_NAND);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} - | PARSEOP_NAND '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -NOrTerm - : PARSEOP_NOR '(' {$$ = TrCreateLeafNode (PARSEOP_NOR);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} - | PARSEOP_NOR '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -NotTerm - : PARSEOP_NOT '(' {$$ = TrCreateLeafNode (PARSEOP_NOT);} - TermArg - Target - ')' {$$ = TrLinkChildren ($3,2,$4,$5);} - | PARSEOP_NOT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ObjectTypeTerm - : PARSEOP_OBJECTTYPE '(' {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} - ObjectTypeName - ')' {$$ = TrLinkChildren ($3,1,$4);} - | PARSEOP_OBJECTTYPE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -OrTerm - : PARSEOP_OR '(' {$$ = TrCreateLeafNode (PARSEOP_OR);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_REFOF);} - SuperName - ')' {$$ = TrLinkChildren ($3,1,TrSetNodeFlags ($4, NODE_IS_TARGET));} - | PARSEOP_REFOF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ShiftLeftTerm - : PARSEOP_SHIFTLEFT '(' {$$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} - | PARSEOP_SHIFTLEFT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ShiftRightTerm - : PARSEOP_SHIFTRIGHT '(' {$$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} - | PARSEOP_SHIFTRIGHT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -SizeOfTerm - : PARSEOP_SIZEOF '(' {$$ = TrCreateLeafNode (PARSEOP_SIZEOF);} - SuperName - ')' {$$ = TrLinkChildren ($3,1,$4);} - | PARSEOP_SIZEOF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -StoreTerm - : PARSEOP_STORE '(' {$$ = TrCreateLeafNode (PARSEOP_STORE);} - TermArg - ',' SuperName - ')' {$$ = TrLinkChildren ($3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} - | PARSEOP_STORE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -SubtractTerm - : PARSEOP_SUBTRACT '(' {$$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} - | PARSEOP_SUBTRACT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -TimerTerm - : PARSEOP_TIMER '(' {$$ = TrCreateLeafNode (PARSEOP_TIMER);} - ')' {$$ = TrLinkChildren ($3,0);} - | PARSEOP_TIMER {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_TIMER),0);} - | PARSEOP_TIMER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToBCDTerm - : PARSEOP_TOBCD '(' {$$ = TrCreateLeafNode (PARSEOP_TOBCD);} - TermArg - Target - ')' {$$ = TrLinkChildren ($3,2,$4,$5);} - | PARSEOP_TOBCD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToBufferTerm - : PARSEOP_TOBUFFER '(' {$$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} - TermArg - Target - ')' {$$ = TrLinkChildren ($3,2,$4,$5);} - | PARSEOP_TOBUFFER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToDecimalStringTerm - : PARSEOP_TODECIMALSTRING '(' {$$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} - TermArg - Target - ')' {$$ = TrLinkChildren ($3,2,$4,$5);} - | PARSEOP_TODECIMALSTRING '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToHexStringTerm - : PARSEOP_TOHEXSTRING '(' {$$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} - TermArg - Target - ')' {$$ = TrLinkChildren ($3,2,$4,$5);} - | PARSEOP_TOHEXSTRING '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToIntegerTerm - : PARSEOP_TOINTEGER '(' {$$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} - TermArg - Target - ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_TOPLD);} - PldKeywordList - ')' {$$ = TrLinkChildren ($3,1,$4);} - | PARSEOP_TOPLD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -PrintfArgList - : {$$ = NULL;} - | TermArg {$$ = $1;} - | PrintfArgList ',' - TermArg {$$ = TrLinkPeerNode ($1, $3);} - ; - -PrintfTerm - : PARSEOP_PRINTF '(' {$$ = TrCreateLeafNode (PARSEOP_PRINTF);} - StringData - PrintfArgList - ')' {$$ = TrLinkChildren ($3,2,$4,$5);} - | PARSEOP_PRINTF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -FprintfTerm - : PARSEOP_FPRINTF '(' {$$ = TrCreateLeafNode (PARSEOP_FPRINTF);} - TermArg ',' - StringData - PrintfArgList - ')' {$$ = TrLinkChildren ($3,3,$4,$6,$7);} - | PARSEOP_FPRINTF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToStringTerm - : PARSEOP_TOSTRING '(' {$$ = TrCreateLeafNode (PARSEOP_TOSTRING);} - TermArg - OptionalCount - Target - ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_WAIT);} - SuperName - TermArgItem - ')' {$$ = TrLinkChildren ($3,2,$4,$5);} - | PARSEOP_WAIT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -XOrTerm - : PARSEOP_XOR '(' {$$ = TrCreateLeafNode (PARSEOP_XOR);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);} - ByteConst - ')' {$$ = TrLinkChildren ($3,1,$4);} - | PARSEOP_ACCESSATTRIB_RAW_BYTES '(' {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);} - ByteConst - ')' {$$ = TrLinkChildren ($3,1,$4);} - | PARSEOP_ACCESSATTRIB_RAW_PROCESS '(' {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);} - ByteConst - ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_BUFFER);} - OptionalTermArg - ')' '{' - BufferTermData '}' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} - OptionalWordConst - ')' '{' - ByteList '}' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} - VarPackageLengthTerm - ')' '{' - PackageList '}' {$$ = TrLinkChildren ($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 ($3,3,$4,$5,$6);} + | PARSEOP_MOD '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -PackageElement - : DataObject {} - | NameString {} +MultiplyTerm + : PARSEOP_MULTIPLY '(' {$$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} + | PARSEOP_MULTIPLY '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -VarPackageLengthTerm - : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} - | TermArg {$$ = $1;} +MutexTerm + : PARSEOP_MUTEX '(' {$$ = TrCreateLeafNode (PARSEOP_MUTEX);} + NameString + ',' ByteConstExpr + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_NAME);} + NameString + ',' DataObject + ')' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} + | PARSEOP_NAME '(' error ')' {$$ = AslDoError(); yyclearin;} ; -UnicodeTerm - : PARSEOP_UNICODE '(' {$$ = TrCreateLeafNode (PARSEOP_UNICODE);} - StringData - ')' {$$ = TrLinkChildren ($3,2,0,$4);} - | PARSEOP_UNICODE '(' +NAndTerm + : PARSEOP_NAND '(' {$$ = TrCreateLeafNode (PARSEOP_NAND);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_DMA);} - DMATypeKeyword - OptionalBusMasterKeyword - ',' XferTypeKeyword - OptionalNameString_Last - ')' '{' - ByteList '}' {$$ = TrLinkChildren ($3,5,$4,$5,$7,$8,$11);} - | PARSEOP_DMA '(' +NOrTerm + : PARSEOP_NOR '(' {$$ = TrCreateLeafNode (PARSEOP_NOR);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} + | PARSEOP_NOR '(' error ')' {$$ = AslDoError(); yyclearin;} ; -DWordIOTerm - : PARSEOP_DWORDIO '(' {$$ = TrCreateLeafNode (PARSEOP_DWORDIO);} - OptionalResourceType_First - OptionalMinType - OptionalMaxType - OptionalDecodeType - OptionalRangeType - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString - OptionalType - OptionalTranslationType_Last - ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);} - OptionalResourceType_First - OptionalDecodeType - OptionalMinType - OptionalMaxType - OptionalMemType - ',' OptionalReadWriteKeyword - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString - OptionalAddressRange - OptionalType_Last - ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);} - ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} - OptionalResourceType - OptionalDecodeType - OptionalMinType - OptionalMaxType - ',' ByteConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);} - OptionalResourceType_First - OptionalMinType - OptionalMaxType - OptionalDecodeType - OptionalRangeType - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - OptionalQWordConstExpr - OptionalNameString - OptionalType - OptionalTranslationType_Last - ')' {$$ = TrLinkChildren ($3,14,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22);} - | PARSEOP_EXTENDEDIO '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ExtendedMemoryTerm - : PARSEOP_EXTENDEDMEMORY '(' {$$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);} - OptionalResourceType_First - OptionalDecodeType - OptionalMinType - OptionalMaxType - OptionalMemType - ',' OptionalReadWriteKeyword - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - OptionalQWordConstExpr - OptionalNameString - OptionalAddressRange - OptionalType_Last - ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);} - ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} - OptionalResourceType - OptionalDecodeType - OptionalMinType - OptionalMaxType - ',' ByteConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - OptionalQWordConstExpr - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($3,13,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23);} - | PARSEOP_EXTENDEDSPACE '(' +NotifyTerm + : PARSEOP_NOTIFY '(' {$$ = TrCreateLeafNode (PARSEOP_NOTIFY);} + SuperName + TermArgItem + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_NOTIFY '(' error ')' {$$ = AslDoError(); yyclearin;} ; -FixedDmaTerm - : PARSEOP_FIXEDDMA '(' {$$ = TrCreateLeafNode (PARSEOP_FIXEDDMA);} - WordConstExpr /* 04: DMA RequestLines */ - ',' WordConstExpr /* 06: DMA Channels */ - OptionalXferSize /* 07: DMA TransferSize */ - OptionalNameString /* 08: DescriptorName */ - ')' {$$ = TrLinkChildren ($3,4,$4,$6,$7,$8);} - | PARSEOP_FIXEDDMA '(' +NotTerm + : PARSEOP_NOT '(' {$$ = TrCreateLeafNode (PARSEOP_NOT);} + TermArg + Target + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_NOT '(' error ')' {$$ = AslDoError(); yyclearin;} ; -FixedIOTerm - : PARSEOP_FIXEDIO '(' {$$ = TrCreateLeafNode (PARSEOP_FIXEDIO);} - WordConstExpr - ',' ByteConstExpr - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($3,3,$4,$6,$7);} - | PARSEOP_FIXEDIO '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -GpioIntTerm - : PARSEOP_GPIO_INT '(' {$$ = 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 ($3,11,$4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);} - | PARSEOP_GPIO_INT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -GpioIoTerm - : PARSEOP_GPIO_IO '(' {$$ = 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 ($3,11,$4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);} - | PARSEOP_GPIO_IO '(' +ObjectTypeTerm + : PARSEOP_OBJECTTYPE '(' {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} + ObjectTypeName + ')' {$$ = TrLinkChildren ($3,1,$4);} + | PARSEOP_OBJECTTYPE '(' error ')' {$$ = AslDoError(); yyclearin;} ; -I2cSerialBusTerm - : PARSEOP_I2C_SERIALBUS '(' {$$ = 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 ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} - OptionalResourceType_First - ',' InterruptTypeKeyword - ',' InterruptLevel - OptionalShareType - OptionalByteConstExpr - OptionalStringData - OptionalNameString_Last - ')' '{' - DWordList '}' {$$ = TrLinkChildren ($3,8,$4,$6,$8,$9,$10,$11,$12,$15);} - | PARSEOP_INTERRUPT '(' +OpRegionTerm + : PARSEOP_OPERATIONREGION '(' {$$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} + NameString + ',' OpRegionSpaceIdTerm + TermArgItem + TermArgItem + ')' {$$ = TrLinkChildren ($3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8);} + | PARSEOP_OPERATIONREGION '(' error ')' {$$ = AslDoError(); yyclearin;} ; -IOTerm - : PARSEOP_IO '(' {$$ = TrCreateLeafNode (PARSEOP_IO);} - IODecodeKeyword - ',' WordConstExpr - ',' WordConstExpr - ',' ByteConstExpr - ',' ByteConstExpr - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($3,6,$4,$6,$8,$10,$12,$13);} - | PARSEOP_IO '(' - error ')' {$$ = AslDoError(); yyclearin;} +OpRegionSpaceIdTerm + : RegionSpaceKeyword {} + | ByteConst {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} ; -IRQNoFlagsTerm - : PARSEOP_IRQNOFLAGS '(' {$$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);} - OptionalNameString_First - ')' '{' - ByteList '}' {$$ = TrLinkChildren ($3,2,$4,$7);} - | PARSEOP_IRQNOFLAGS '(' +OrTerm + : PARSEOP_OR '(' {$$ = TrCreateLeafNode (PARSEOP_OR);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} + | PARSEOP_OR '(' error ')' {$$ = AslDoError(); yyclearin;} ; -IRQTerm - : PARSEOP_IRQ '(' {$$ = TrCreateLeafNode (PARSEOP_IRQ);} - InterruptTypeKeyword - ',' InterruptLevel - OptionalShareType - OptionalNameString_Last +PackageTerm + : PARSEOP_PACKAGE '(' {$$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} + VarPackageLengthTerm ')' '{' - ByteList '}' {$$ = TrLinkChildren ($3,5,$4,$6,$7,$8,$11);} - | PARSEOP_IRQ '(' + PackageList '}' {$$ = TrLinkChildren ($3,2,$4,$7);} + | PARSEOP_PACKAGE '(' error ')' {$$ = AslDoError(); yyclearin;} ; -Memory24Term - : PARSEOP_MEMORY24 '(' {$$ = TrCreateLeafNode (PARSEOP_MEMORY24);} - OptionalReadWriteKeyword - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr +PowerResTerm + : PARSEOP_POWERRESOURCE '(' {$$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} + NameString + ',' ByteConstExpr ',' WordConstExpr - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($3,6,$4,$6,$8,$10,$12,$13);} - | PARSEOP_MEMORY24 '(' + ')' '{' + ObjectList '}' {$$ = TrLinkChildren ($3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);} + | PARSEOP_POWERRESOURCE '(' error ')' {$$ = AslDoError(); yyclearin;} ; -Memory32FixedTerm - : PARSEOP_MEMORY32FIXED '(' {$$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);} - OptionalReadWriteKeyword - ',' DWordConstExpr - ',' DWordConstExpr - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($3,4,$4,$6,$8,$9);} - | PARSEOP_MEMORY32FIXED '(' +PrintfTerm + : PARSEOP_PRINTF '(' {$$ = TrCreateLeafNode (PARSEOP_PRINTF);} + StringData + PrintfArgList + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_PRINTF '(' error ')' {$$ = AslDoError(); yyclearin;} ; -Memory32Term - : PARSEOP_MEMORY32 '(' {$$ = TrCreateLeafNode (PARSEOP_MEMORY32);} - OptionalReadWriteKeyword - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - ',' DWordConstExpr - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($3,6,$4,$6,$8,$10,$12,$13);} - | PARSEOP_MEMORY32 '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -QWordIOTerm - : PARSEOP_QWORDIO '(' {$$ = TrCreateLeafNode (PARSEOP_QWORDIO);} - OptionalResourceType_First - OptionalMinType - OptionalMaxType - OptionalDecodeType - OptionalRangeType - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString - OptionalType - OptionalTranslationType_Last - ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);} - OptionalResourceType_First - OptionalDecodeType - OptionalMinType - OptionalMaxType - OptionalMemType - ',' OptionalReadWriteKeyword - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString - OptionalAddressRange - OptionalType_Last - ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);} - ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} - OptionalResourceType - OptionalDecodeType - OptionalMinType - OptionalMaxType - ',' ByteConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - ',' QWordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_REGISTER);} - AddressSpaceKeyword - ',' ByteConstExpr +ProcessorTerm + : PARSEOP_PROCESSOR '(' {$$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} + NameString ',' ByteConstExpr - ',' QWordConstExpr - OptionalAccessSize - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($3,6,$4,$6,$8,$10,$11,$12);} - | PARSEOP_REGISTER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -SpiSerialBusTerm - : PARSEOP_SPI_SERIALBUS '(' {$$ = 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 ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} + OptionalDWordConstExpr + OptionalByteConstExpr ')' '{' - ResourceMacroList '}' {$$ = TrLinkChildren ($3,1,$6);} - | PARSEOP_STARTDEPENDENTFN_NOPRI '(' + ObjectList '}' {$$ = TrLinkChildren ($3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);} + | PARSEOP_PROCESSOR '(' error ')' {$$ = AslDoError(); yyclearin;} ; -StartDependentFnTerm - : PARSEOP_STARTDEPENDENTFN '(' {$$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);} - ByteConstExpr - ',' ByteConstExpr - ')' '{' - ResourceMacroList '}' {$$ = TrLinkChildren ($3,3,$4,$6,$9);} - | PARSEOP_STARTDEPENDENTFN '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -UartSerialBusTerm - : PARSEOP_UART_SERIALBUS '(' {$$ = 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 ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_VENDORLONG);} - OptionalNameString_First +RawDataBufferTerm + : PARSEOP_DATABUFFER '(' {$$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} + OptionalWordConst ')' '{' ByteList '}' {$$ = TrLinkChildren ($3,2,$4,$7);} - | PARSEOP_VENDORLONG '(' + | PARSEOP_DATABUFFER '(' error ')' {$$ = AslDoError(); yyclearin;} ; -VendorShortTerm - : PARSEOP_VENDORSHORT '(' {$$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);} - OptionalNameString_First - ')' '{' - ByteList '}' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_REFOF);} + SuperName + ')' {$$ = TrLinkChildren ($3,1,TrSetNodeFlags ($4, NODE_IS_TARGET));} + | PARSEOP_REFOF '(' error ')' {$$ = AslDoError(); yyclearin;} ; -WordBusNumberTerm - : PARSEOP_WORDBUSNUMBER '(' {$$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);} - OptionalResourceType_First - OptionalMinType - OptionalMaxType - OptionalDecodeType - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($3,12,$4,$5,$6,$7,$9,$11,$13,$15,$17,$18,$19,$20);} - | PARSEOP_WORDBUSNUMBER '(' +ReleaseTerm + : PARSEOP_RELEASE '(' {$$ = TrCreateLeafNode (PARSEOP_RELEASE);} + SuperName + ')' {$$ = TrLinkChildren ($3,1,$4);} + | PARSEOP_RELEASE '(' error ')' {$$ = AslDoError(); yyclearin;} ; -WordIOTerm - : PARSEOP_WORDIO '(' {$$ = TrCreateLeafNode (PARSEOP_WORDIO);} - OptionalResourceType_First - OptionalMinType - OptionalMaxType - OptionalDecodeType - OptionalRangeType - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString - OptionalType - OptionalTranslationType_Last - ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_WORDSPACE);} - ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} - OptionalResourceType - OptionalDecodeType - OptionalMinType - OptionalMaxType - ',' ByteConstExpr - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - ',' WordConstExpr - OptionalByteConstExpr - OptionalStringData - OptionalNameString_Last - ')' {$$ = TrLinkChildren ($3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} - | PARSEOP_WORDSPACE '(' +ResetTerm + : PARSEOP_RESET '(' {$$ = TrCreateLeafNode (PARSEOP_RESET);} + SuperName + ')' {$$ = TrLinkChildren ($3,1,$4);} + | PARSEOP_RESET '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ReturnTerm + : PARSEOP_RETURN '(' {$$ = TrCreateLeafNode (PARSEOP_RETURN);} + OptionalReturnArg + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_SCOPE);} + NameString + ')' '{' + ObjectList '}' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} + | PARSEOP_SCOPE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ShiftLeftTerm + : PARSEOP_SHIFTLEFT '(' {$$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_SIGNAL);} + SuperName + ')' {$$ = TrLinkChildren ($3,1,$4);} + | PARSEOP_SIGNAL '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -NameStringItem - : ',' NameString {$$ = $2;} - | ',' error {$$ = AslDoError (); yyclearin;} +SizeOfTerm + : PARSEOP_SIZEOF '(' {$$ = TrCreateLeafNode (PARSEOP_SIZEOF);} + SuperName + ')' {$$ = TrLinkChildren ($3,1,$4);} + | PARSEOP_SIZEOF '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -TermArgItem - : ',' TermArg {$$ = $2;} - | ',' error {$$ = AslDoError (); yyclearin;} +SleepTerm + : PARSEOP_SLEEP '(' {$$ = TrCreateLeafNode (PARSEOP_SLEEP);} + TermArg + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_STALL);} + TermArg + ')' {$$ = TrLinkChildren ($3,1,$4);} + | PARSEOP_STALL '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalAccessAttribTerm - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' ByteConstExpr {$$ = $2;} - | ',' AccessAttribKeyword {$$ = $2;} +StoreTerm + : PARSEOP_STORE '(' {$$ = TrCreateLeafNode (PARSEOP_STORE);} + TermArg + ',' SuperName + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} + | PARSEOP_SUBTRACT '(' + error ')' {$$ = AslDoError(); yyclearin;} ; - -OptionalAddressingMode - : ',' {$$ = NULL;} - | ',' AddressingModeKeyword {$$ = $2;} +SwitchTerm + : PARSEOP_SWITCH '(' {$$ = TrCreateLeafNode (PARSEOP_SWITCH);} + TermArg + ')' '{' + CaseDefaultTermList '}' + {$$ = TrLinkChildren ($3,2,$4,$7);} + | PARSEOP_SWITCH '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalAddressRange - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' AddressKeyword {$$ = $2;} +ThermalZoneTerm + : PARSEOP_THERMALZONE '(' {$$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} + NameString + ')' '{' + ObjectList '}' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} + | PARSEOP_THERMALZONE '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalBitsPerByte - : ',' {$$ = NULL;} - | ',' BitsPerByteKeyword {$$ = $2;} +TimerTerm + : PARSEOP_TIMER '(' {$$ = TrCreateLeafNode (PARSEOP_TIMER);} + ')' {$$ = TrLinkChildren ($3,0);} + | PARSEOP_TIMER {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_TIMER),0);} + | PARSEOP_TIMER '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalBuffer_Last - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' DataBufferTerm {$$ = $2;} +ToBCDTerm + : PARSEOP_TOBCD '(' {$$ = TrCreateLeafNode (PARSEOP_TOBCD);} + TermArg + Target + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_TOBCD '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalByteConstExpr - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' ByteConstExpr {$$ = $2;} +ToBufferTerm + : PARSEOP_TOBUFFER '(' {$$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} + TermArg + Target + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_TOBUFFER '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalDecodeType - : ',' {$$ = NULL;} - | ',' DecodeKeyword {$$ = $2;} +ToDecimalStringTerm + : PARSEOP_TODECIMALSTRING '(' {$$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} + TermArg + Target + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_TODECIMALSTRING '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalDevicePolarity - : ',' {$$ = NULL;} - | ',' DevicePolarityKeyword {$$ = $2;} +ToHexStringTerm + : PARSEOP_TOHEXSTRING '(' {$$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} + TermArg + Target + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_TOHEXSTRING '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalDWordConstExpr - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' DWordConstExpr {$$ = $2;} +ToIntegerTerm + : PARSEOP_TOINTEGER '(' {$$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} + TermArg + Target + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_TOINTEGER '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalEndian - : ',' {$$ = NULL;} - | ',' EndianKeyword {$$ = $2;} +ToPLDTerm + : PARSEOP_TOPLD '(' {$$ = TrCreateLeafNode (PARSEOP_TOPLD);} + PldKeywordList + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_TOSTRING);} + TermArg + OptionalCount + Target + ')' {$$ = TrLinkChildren ($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 '(' {$$ = TrCreateLeafNode (PARSEOP_UNICODE);} + StringData + ')' {$$ = TrLinkChildren ($3,2,0,$4);} + | PARSEOP_UNICODE '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalMinType - : ',' {$$ = NULL;} - | ',' MinKeyword {$$ = $2;} +UnloadTerm + : PARSEOP_UNLOAD '(' {$$ = TrCreateLeafNode (PARSEOP_UNLOAD);} + SuperName + ')' {$$ = TrLinkChildren ($3,1,$4);} + | PARSEOP_UNLOAD '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalNameString - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' NameString {$$ = $2;} +WaitTerm + : PARSEOP_WAIT '(' {$$ = TrCreateLeafNode (PARSEOP_WAIT);} + SuperName + TermArgItem + ')' {$$ = TrLinkChildren ($3,2,$4,$5);} + | PARSEOP_WAIT '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalNameString_Last - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' NameString {$$ = $2;} +XOrTerm + : PARSEOP_XOR '(' {$$ = TrCreateLeafNode (PARSEOP_XOR);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($3,3,$4,$5,$6);} + | PARSEOP_XOR '(' + error ')' {$$ = AslDoError(); yyclearin;} ; -OptionalNameString_First - : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} - | NameString {$$ = $1;} +WhileTerm + : PARSEOP_WHILE '(' {$$ = TrCreateLeafNode (PARSEOP_WHILE);} + TermArg + ')' '{' TermList '}' + {$$ = TrLinkChildren ($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 @@ -2897,17 +1697,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;} @@ -2919,73 +1708,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/source/compiler/asltokens.y b/source/compiler/asltokens.y index 511fa9b..d52bb50 100644 --- a/source/compiler/asltokens.y +++ b/source/compiler/asltokens.y @@ -452,8 +452,14 @@ NoEcho(' %left PARSEOP_EXP_INCREMENT PARSEOP_EXP_DECREMENT +/* Brackets for Index() support */ + +%left PARSEOP_EXP_INDEX_LEFT +%right PARSEOP_EXP_INDEX_RIGHT + %token PARSEOP_PRINTF %token PARSEOP_FPRINTF + /* Specific parentheses tokens are not used at this time */ /* PARSEOP_EXP_PAREN_OPEN */ /* PARSEOP_EXP_PAREN_CLOSE */ diff --git a/source/compiler/asltree.c b/source/compiler/asltree.c index c76720a..1738861 100644 --- a/source/compiler/asltree.c +++ b/source/compiler/asltree.c @@ -538,6 +538,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/source/compiler/asltypes.h b/source/compiler/asltypes.h index ce2f758..6205dbf 100644 --- a/source/compiler/asltypes.h +++ b/source/compiler/asltypes.h @@ -170,7 +170,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; @@ -179,24 +179,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/source/compiler/asltypes.y b/source/compiler/asltypes.y index 650b856..2ed708f 100644 --- a/source/compiler/asltypes.y +++ b/source/compiler/asltypes.y @@ -136,7 +136,7 @@ NoEcho(' %type DefaultTerm %type ElseTerm %type FatalTerm -%type IfElseTerm +%type ElseIfTerm %type IfTerm %type LoadTerm %type NoOpTerm @@ -188,6 +188,7 @@ NoEcho(' %type NotTerm %type ObjectTypeTerm %type OrTerm +%type RawDataBufferTerm %type RefOfTerm %type ShiftLeftTerm %type ShiftRightTerm @@ -297,7 +298,6 @@ NoEcho(' /* Resource Descriptors */ %type ConnectionTerm -%type DataBufferTerm %type DMATerm %type DWordIOTerm %type DWordMemoryTerm @@ -391,3 +391,4 @@ NoEcho(' */ %type Expression %type EqualsTerm +%type IndexExpTerm diff --git a/source/compiler/aslwalks.c b/source/compiler/aslwalks.c index bbc15c5..9485a0a 100644 --- a/source/compiler/aslwalks.c +++ b/source/compiler/aslwalks.c @@ -51,6 +51,13 @@ ACPI_MODULE_NAME ("aslwalks") +/* Local prototypes */ + +static void +AnAnalyzeStoreOperator ( + ACPI_PARSE_OBJECT *Op); + + /******************************************************************************* * * FUNCTION: AnMethodTypingWalkEnd @@ -73,7 +80,7 @@ AnMethodTypingWalkEnd ( UINT32 Level, void *Context) { - UINT32 ThisNodeBtype; + UINT32 ThisOpBtype; switch (Op->Asl.ParseOpcode) @@ -88,10 +95,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 @@ -107,7 +114,7 @@ AnMethodTypingWalkEnd ( ASL_WALK_VISIT_UPWARD, NULL, AnMethodTypingWalkEnd, NULL); - ThisNodeBtype = AnGetBtype (Op->Asl.Child); + ThisOpBtype = AnGetBtype (Op->Asl.Child); } } @@ -115,7 +122,7 @@ AnMethodTypingWalkEnd ( if (Op->Asl.ParentMethod) { - Op->Asl.ParentMethod->Asl.AcpiBtype |= ThisNodeBtype; + Op->Asl.ParentMethod->Asl.AcpiBtype |= ThisOpBtype; } } break; @@ -186,9 +193,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 /* @@ -247,6 +254,7 @@ AnOperandTypecheckWalkEnd ( { return (AE_OK); } + AnCheckMethodReturnValue (Op, OpInfo, ArgOp, RequiredBtypes, ThisNodeBtype); } @@ -271,6 +279,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: @@ -278,15 +350,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; @@ -297,8 +360,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) @@ -308,6 +375,8 @@ AnOperandTypecheckWalkEnd ( AslAbort (); } + /* Get the actual type of the argument */ + ThisNodeBtype = AnGetBtype (ArgOp); if (ThisNodeBtype == ACPI_UINT32_MAX) { @@ -328,6 +397,10 @@ AnOperandTypecheckWalkEnd ( break; } + /* Fallthrough */ + + case ARGI_STORE_TARGET: + if (ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER) { /* @@ -339,25 +412,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: @@ -388,8 +458,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; @@ -400,10 +470,9 @@ AnOperandTypecheckWalkEnd ( default: break; - } break; - +#endif case ARGI_INTEGER: default: @@ -411,6 +480,8 @@ AnOperandTypecheckWalkEnd ( } + /* Check for a type mismatch (required versus actual) */ + CommonBtypes = ThisNodeBtype & RequiredBtypes; if (ArgOp->Asl.ParseOpcode == PARSEOP_METHODCALL) @@ -438,9 +509,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: @@ -477,14 +549,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. @@ -497,30 +570,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); @@ -555,6 +629,15 @@ AnOtherSemanticAnalysisWalkBegin ( */ switch (Op->Asl.ParseOpcode) { + case PARSEOP_STORE: + + if (Gbl_DoTypechecking) + { + AnAnalyzeStoreOperator (Op); + } + break; + + case PARSEOP_ACQUIRE: case PARSEOP_WAIT: /* @@ -566,16 +649,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; } @@ -586,7 +669,7 @@ AnOtherSemanticAnalysisWalkBegin ( */ if (!AnIsResultUsed (Op)) { - AslError (ASL_WARNING, ASL_MSG_TIMEOUT, ArgNode, + AslError (ASL_WARNING, ASL_MSG_TIMEOUT, ArgOp, Op->Asl.ExternalName); } break; @@ -595,15 +678,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; @@ -612,24 +695,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); } @@ -640,46 +723,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; @@ -690,3 +773,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/source/components/debugger/dbexec.c b/source/components/debugger/dbexec.c index ebd02b7..af01ca2 100644 --- a/source/components/debugger/dbexec.c +++ b/source/components/debugger/dbexec.c @@ -419,8 +419,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/source/components/debugger/dbinput.c b/source/components/debugger/dbinput.c index 981d706..1b9a917 100644 --- a/source/components/debugger/dbinput.c +++ b/source/components/debugger/dbinput.c @@ -123,6 +123,7 @@ enum AcpiExDebuggerCommands CMD_OSI, CMD_OWNER, CMD_PATHS, + CMD_PREDEFINED, CMD_PREFIX, CMD_QUIT, CMD_REFERENCES, @@ -152,7 +153,6 @@ enum AcpiExDebuggerCommands CMD_TERMINATE, CMD_THREADS, - CMD_PREDEFINED, CMD_TEST, #endif }; @@ -201,6 +201,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] = {"OSI", 0}, {"OWNER", 1}, {"PATHS", 0}, + {"PREDEFINED", 0}, {"PREFIX", 0}, {"QUIT", 0}, {"REFERENCES", 1}, @@ -230,7 +231,6 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] = {"TERMINATE", 0}, {"THREADS", 3}, - {"PREDEFINED", 0}, {"TEST", 1}, #endif {NULL, 0} @@ -1229,7 +1229,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; @@ -1237,11 +1238,7 @@ AcpiDbExecuteThread ( Status = AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL); - MStatus = AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_COMPLETE); - if (ACPI_FAILURE (MStatus)) - { - return; - } + AcpiOsReleaseMutex (AcpiGbl_DbCommandComplete); } } @@ -1332,13 +1329,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/source/components/debugger/dbobject.c b/source/components/debugger/dbobject.c index eef1b9e..019e811 100644 --- a/source/components/debugger/dbobject.c +++ b/source/components/debugger/dbobject.c @@ -445,6 +445,7 @@ AcpiDbDecodeLocals ( UINT32 i; ACPI_OPERAND_OBJECT *ObjDesc; ACPI_NAMESPACE_NODE *Node; + BOOLEAN DisplayLocals = FALSE; ObjDesc = WalkState->MethodDesc; @@ -463,14 +464,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)); } } @@ -494,10 +520,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) { @@ -512,16 +539,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/source/components/debugger/dbxface.c b/source/components/debugger/dbxface.c index a6a5a62..9e7c31d 100644 --- a/source/components/debugger/dbxface.c +++ b/source/components/debugger/dbxface.c @@ -101,12 +101,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); @@ -450,14 +448,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"); @@ -511,33 +511,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 ("\n"); - - AcpiDbStartCommand (WalkState, NULL); -} -#endif diff --git a/source/components/disassembler/dmcstyle.c b/source/components/disassembler/dmcstyle.c index 04436a8..7616723 100644 --- a/source/components/disassembler/dmcstyle.c +++ b/source/components/disassembler/dmcstyle.c @@ -227,12 +227,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 */ @@ -442,7 +457,6 @@ AcpiDmCheckForSymbolicOpcode ( case AML_INCREMENT_OP: return (TRUE); -#ifdef INDEX_SUPPORT case AML_INDEX_OP: /* Target is optional, 3rd operand */ @@ -458,7 +472,6 @@ AcpiDmCheckForSymbolicOpcode ( } } return (TRUE); -#endif case AML_STORE_OP: /* @@ -578,12 +591,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/source/components/executer/exconvrt.c b/source/components/executer/exconvrt.c index b8f032c..c964217 100644 --- a/source/components/executer/exconvrt.c +++ b/source/components/executer/exconvrt.c @@ -673,6 +673,7 @@ AcpiExConvertToTargetType ( break; case ARGI_TARGETREF: + case ARGI_STORE_TARGET: switch (DestinationType) { diff --git a/source/components/executer/exresolv.c b/source/components/executer/exresolv.c index 868c90d..79878c6 100644 --- a/source/components/executer/exresolv.c +++ b/source/components/executer/exresolv.c @@ -225,7 +225,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/source/components/executer/exresop.c b/source/components/executer/exresop.c index e2262de..d4c5289 100644 --- a/source/components/executer/exresop.c +++ b/source/components/executer/exresop.c @@ -320,6 +320,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/source/components/executer/exstore.c b/source/components/executer/exstore.c index 6215ff3..1f2f912 100644 --- a/source/components/executer/exstore.c +++ b/source/components/executer/exstore.c @@ -147,7 +147,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); @@ -194,7 +194,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); @@ -356,7 +356,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); } @@ -368,8 +368,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; } @@ -390,20 +390,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. * ******************************************************************************/ @@ -428,9 +428,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 @@ -446,13 +511,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) @@ -491,7 +556,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))); } @@ -513,15 +578,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/source/components/executer/exstoren.c b/source/components/executer/exstoren.c index c14b30d..f584438 100644 --- a/source/components/executer/exstoren.c +++ b/source/components/executer/exstoren.c @@ -129,9 +129,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; @@ -284,7 +285,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/source/components/namespace/nspredef.c b/source/components/namespace/nspredef.c index 1b3b082..7221c88 100644 --- a/source/components/namespace/nspredef.c +++ b/source/components/namespace/nspredef.c @@ -249,7 +249,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/source/components/utilities/utdecode.c b/source/components/utilities/utdecode.c index 849a1bc..fc21e20 100644 --- a/source/components/utilities/utdecode.c +++ b/source/components/utilities/utdecode.c @@ -261,13 +261,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)); } @@ -461,8 +477,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/source/components/utilities/utfileio.c b/source/components/utilities/utfileio.c index 0180efe..8c50354 100644 --- a/source/components/utilities/utfileio.c +++ b/source/components/utilities/utfileio.c @@ -45,6 +45,7 @@ #include "accommon.h" #include "actables.h" #include "acapps.h" +#include "errno.h" #ifdef ACPI_ASL_COMPILER #include "aslcompiler.h" @@ -330,6 +331,12 @@ AcpiUtReadTableFromFile ( if (!File) { perror ("Could not open input file"); + + if (errno == ENOENT) + { + return (AE_NOT_EXIST); + } + return (Status); } diff --git a/source/components/utilities/utmutex.c b/source/components/utilities/utmutex.c index 4fe866e..60b94c1 100644 --- a/source/components/utilities/utmutex.c +++ b/source/components/utilities/utmutex.c @@ -124,6 +124,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); } @@ -169,6 +187,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/source/include/acapps.h b/source/include/acapps.h index 7c4880a..9ca8e73 100644 --- a/source/include/acapps.h +++ b/source/include/acapps.h @@ -94,7 +94,7 @@ #define FILE_SUFFIX_DISASSEMBLY "dsl" -#define ACPI_TABLE_FILE_SUFFIX ".dat" +#define FILE_SUFFIX_BINARY_TABLE ".dat" /* Needs the dot */ /* diff --git a/source/include/acexcep.h b/source/include/acexcep.h index 714e3b1..f021eaf 100644 --- a/source/include/acexcep.h +++ b/source/include/acexcep.h @@ -198,8 +198,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 /* @@ -324,7 +325,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/source/include/acglobal.h b/source/include/acglobal.h index 08d60fd..a9e349f 100644 --- a/source/include/acglobal.h +++ b/source/include/acglobal.h @@ -361,6 +361,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/source/include/aclocal.h b/source/include/aclocal.h index ea3d219..15759e1 100644 --- a/source/include/aclocal.h +++ b/source/include/aclocal.h @@ -87,10 +87,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 @@ -328,13 +326,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 @@ -1017,7 +1019,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/source/include/acopcode.h b/source/include/acopcode.h index 9432d61..a2d8d3c 100644 --- a/source/include/acopcode.h +++ b/source/include/acopcode.h @@ -213,7 +213,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) @@ -309,7 +309,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/source/include/acpixf.h b/source/include/acpixf.h index 888d6b2..7997271 100644 --- a/source/include/acpixf.h +++ b/source/include/acpixf.h @@ -46,7 +46,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/source/include/actbl1.h b/source/include/actbl1.h index 3a11553..67f1592 100644 --- a/source/include/actbl1.h +++ b/source/include/actbl1.h @@ -1184,7 +1184,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/source/include/amlcode.h b/source/include/amlcode.h index d56f6d9..b9b8ad5 100644 --- a/source/include/amlcode.h +++ b/source/include/amlcode.h @@ -280,14 +280,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/source/include/platform/acenv.h b/source/include/platform/acenv.h index 6150f2b..051c3bb 100644 --- a/source/include/platform/acenv.h +++ b/source/include/platform/acenv.h @@ -297,6 +297,7 @@ #define ACPI_INTERNAL_VAR_XFACE #endif + /* * Debugger threading model * Use single threaded if the entire subsystem is contained in an application @@ -306,11 +307,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/source/tools/acpidump/apfiles.c b/source/tools/acpidump/apfiles.c index 1b05984..4e866ef 100644 --- a/source/tools/acpidump/apfiles.c +++ b/source/tools/acpidump/apfiles.c @@ -173,7 +173,7 @@ ApWriteToBinaryFile ( strcat (Filename, InstanceStr); } - strcat (Filename, ACPI_TABLE_FILE_SUFFIX); + strcat (Filename, FILE_SUFFIX_BINARY_TABLE); if (Gbl_VerboseMode) { diff --git a/source/tools/acpiexec/aehandlers.c b/source/tools/acpiexec/aehandlers.c index 895a27f..9fce63d 100644 --- a/source/tools/acpiexec/aehandlers.c +++ b/source/tools/acpiexec/aehandlers.c @@ -418,7 +418,7 @@ AeExceptionHandler ( if (NewAmlStatus != AmlStatus) { - AcpiOsPrintf ("[AcpiExec] Exception override, new status %s\n", + AcpiOsPrintf ("[AcpiExec] Exception override, new status %s\n\n", AcpiFormatException (NewAmlStatus)); } diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c index 6e839e9..861cb49 100644 --- a/source/tools/acpiexec/aemain.c +++ b/source/tools/acpiexec/aemain.c @@ -336,7 +336,7 @@ AeDoOptions ( case '?': usage(); - return (0); + return (1); case 'i': @@ -344,7 +344,7 @@ AeDoOptions ( if (!Temp || (Temp > ACPI_UINT16_MAX)) { printf ("%s: Invalid max loops value\n", AcpiGbl_Optarg); - return (1); + return (-1); } AcpiGbl_MaxLoopIterations = (UINT16) Temp; @@ -387,7 +387,7 @@ AeDoOptions ( case '^': /* -v: (Version): signon already emitted, just exit */ (void) AcpiOsTerminate (); - exit (0); + return (1); case 'i': @@ -445,6 +445,7 @@ main ( ACPI_TABLE_HEADER *Table = NULL; UINT32 TableCount; AE_TABLE_DESC *TableDesc; + int ExitCode = 0; ACPI_DEBUG_INITIALIZE (); /* For debug version only */ @@ -488,8 +489,13 @@ main ( /* Get the command line options */ - if (AeDoOptions (argc, argv)) + ExitCode = AeDoOptions (argc, argv); + if (ExitCode) { + if (ExitCode > 0) + { + ExitCode = 0; + } goto ErrorExit; } @@ -660,7 +666,7 @@ EnterDebugger: ErrorExit: (void) AcpiOsTerminate (); - return (-1); + return (ExitCode); } diff --git a/source/tools/acpinames/AcpiNames.h b/source/tools/acpinames/AcpiNames.h deleted file mode 100644 index 62d0069..0000000 --- a/source/tools/acpinames/AcpiNames.h +++ /dev/null @@ -1,58 +0,0 @@ -/****************************************************************************** - * - * Module Name: acpinames.h - Common include for AcpiNames utility - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2015, Intel Corp. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification. - * 2. Redistributions in binary form must reproduce at minimum a disclaimer - * substantially similar to the "NO WARRANTY" disclaimer below - * ("Disclaimer") and any redistribution must be conditioned upon - * including a substantially similar Disclaimer requirement for further - * binary redistribution. - * 3. Neither the names of the above-listed copyright holders nor the names - * of any contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * NO WARRANTY - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - */ - -#ifndef _ACPINAMES_H -#define _ACPINAMES_H - -#include "acpi.h" -#include "accommon.h" -#include "acapps.h" -#include "acutils.h" -#include "../acpiexec/aecommon.h" - -#include - -#define ACPI_MAX_INIT_TABLES (32) - -extern BOOLEAN AcpiGbl_NsLoadOnly; -#endif diff --git a/source/tools/acpinames/acpinames.h b/source/tools/acpinames/acpinames.h new file mode 100644 index 0000000..62d0069 --- /dev/null +++ b/source/tools/acpinames/acpinames.h @@ -0,0 +1,58 @@ +/****************************************************************************** + * + * Module Name: acpinames.h - Common include for AcpiNames utility + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2015, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#ifndef _ACPINAMES_H +#define _ACPINAMES_H + +#include "acpi.h" +#include "accommon.h" +#include "acapps.h" +#include "acutils.h" +#include "../acpiexec/aecommon.h" + +#include + +#define ACPI_MAX_INIT_TABLES (32) + +extern BOOLEAN AcpiGbl_NsLoadOnly; +#endif diff --git a/tests/aslts/Makefile.def b/tests/aslts/Makefile.def index 75f6bd6..e25e009 100644 --- a/tests/aslts/Makefile.def +++ b/tests/aslts/Makefile.def @@ -25,7 +25,7 @@ SETOF_INDEXES= 0 1 2 3 SETOF_AMLDIRS= nopt/32 nopt/64 opt/32 opt/64 SETOF_ASLFAGS= "-oa -r 1" "-oa -r 2" "-r 1" "-r 2" -COMMON_ASL_FLAGS= "-cr -vs" +COMMON_ASL_FLAGS= "-cr -vs -l -sc -sa -ic -ta -ts -so -lm -ln -ls -li" COMPILER_LOG="$(TOP)/tmp/aml/$(aslversion)/compile.txt" COMPILER_ERROR_LOG="$(TOP)/tmp/aml/$(aslversion)/error.txt" @@ -72,6 +72,16 @@ install_all_modes_of_test_case: ${SETOF_AMLDIRS:%=$(TOP)/tmp/aml/$(aslversion)/% "$(ASL)" $$CUR_ASLFLAGS "$(COMMON_ASL_FLAGS)" $(ADD_ASLFLAGS) $$j.asl >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \ ret=$$?; \ echo "" >> $(COMPILER_LOG); \ + rm $$j.asm; \ + rm $$j.c; \ + rm $$j.h; \ + rm $$j.i; \ + rm $$j.hex; \ + rm $$j.lst; \ + rm $$j.map; \ + rm $$j.nsp; \ + rm $$j.offset.h; \ + rm $$j.src; \ if [ $$ret != 0 ]; then \ rval=1; \ >&2 echo "**** Unexpected iASL failure in $$dd/$$j.asl!"; \ diff --git a/tests/aslts/src/runtime/cntl/runmode.asl b/tests/aslts/src/runtime/cntl/runmode.asl index 4454e0d..0949601 100644 --- a/tests/aslts/src/runtime/cntl/runmode.asl +++ b/tests/aslts/src/runtime/cntl/runmode.asl @@ -342,7 +342,7 @@ Name(y520, 0) // ArgX term effectively becomes a LocalX term // CopyObject(x,ArgX-Object) should be identical to CopyObject(x,LocalX) // Now, DerefOf(arg0) causes exception Name(y521, 0) // Store reference to NamedX -Name(y522, 0) // CopyObject reference to NamedX +Name(y522, 1) // CopyObject reference to NamedX Name(y523, 0) // Store(RefOf(NamedX), NamedX) Name(y524, 0) // Store(RefOf(NamedX), DerefOf(Expr_resulting_in_ORef)) Name(y525, 0) // Store(RefOf(NamedX), RefOf(Named_X)) diff --git a/tests/aslts/src/runtime/collections/Identity2MS/abbu/MsFail/msfail.asl b/tests/aslts/src/runtime/collections/Identity2MS/abbu/MsFail/msfail.asl index 2ec484f..6dff45a 100644 --- a/tests/aslts/src/runtime/collections/Identity2MS/abbu/MsFail/msfail.asl +++ b/tests/aslts/src/runtime/collections/Identity2MS/abbu/MsFail/msfail.asl @@ -1547,6 +1547,8 @@ Method(mf24,, Serialized) */ Method(mf25,, Serialized) { +/* +// Removed 09/2015. iASL now disallows these stores Name(ts, "mf25") Device(d000) { Name(id00, 0xabcd0005) } @@ -1556,7 +1558,7 @@ Method(mf25,, Serialized) if (LNotEqual(Local0, c00e)) { err(ts, z161, 0x000, 0, 0, Local0, c00e) } - +*/ Return(POUT) } @@ -1567,6 +1569,8 @@ Method(mf25,, Serialized) */ Method(mf27,, Serialized) { +/* +// Removed 09/2015. iASL now disallows these stores Name(ts, "mf27") Event(e000) @@ -1576,7 +1580,7 @@ Method(mf27,, Serialized) if (LNotEqual(Local0, c00f)) { err(ts, z161, 0x000, 0, 0, Local0, c00f) } - +*/ Return(POUT) } @@ -1587,6 +1591,9 @@ Method(mf27,, Serialized) */ Method(mf28,, Serialized) { +/* +// Removed 09/2015. iASL now disallows these stores + Name(ts, "mf28") Mutex(mx00, 0) @@ -1596,7 +1603,7 @@ Method(mf28,, Serialized) if (LNotEqual(Local0, c011)) { err(ts, z161, 0x000, 0, 0, Local0, c011) } - +*/ Return(POUT) } @@ -1607,6 +1614,9 @@ Method(mf28,, Serialized) */ Method(mf29, 1, Serialized) { +/* +// Removed 09/2015. iASL now disallows these stores + Name(ts, "mf29") Event(e000) @@ -1616,7 +1626,7 @@ Method(mf29, 1, Serialized) if (LNotEqual(Local0, c00f)) { err(ts, z161, 0x000, 0, 0, Local0, c00f) } - +*/ Return(POUT) } @@ -1627,6 +1637,9 @@ Method(mf29, 1, Serialized) */ Method(mf2a, 1, Serialized) { +/* +// Removed 09/2015. iASL now disallows these stores + Name(ts, "mf2a") Mutex(mx00, 0) @@ -1636,7 +1649,7 @@ Method(mf2a, 1, Serialized) if (LNotEqual(Local0, c011)) { err(ts, z161, 0x000, 0, 0, Local0, c011) } - +*/ Return(POUT) } @@ -1648,6 +1661,9 @@ Method(mf2a, 1, Serialized) */ Method(mf2b,, Serialized) { +/* +// Removed 09/2015. iASL now disallows these stores + Name(ts, "mf2b") Device(d000) { Name(id00, 0xabcd0005) } @@ -1661,7 +1677,7 @@ Method(mf2b,, Serialized) err(ts, z161, 0x000, 0, 0, Local0, c00e) } } - +*/ Return(POUT) } @@ -1673,6 +1689,9 @@ Method(mf2b,, Serialized) */ Method(mf2c, 1, Serialized) { +/* +// Removed 09/2015. iASL now disallows these stores + Name(ts, "mf2c") Device(d000) { Name(id00, 0xabcd0005) } @@ -1686,7 +1705,7 @@ Method(mf2c, 1, Serialized) err(ts, z161, 0x000, 0, 0, Local0, c00e) } } - +*/ Return(POUT) } diff --git a/tests/aslts/src/runtime/collections/Identity2MS/abbu/initial/ns_in40.asl b/tests/aslts/src/runtime/collections/Identity2MS/abbu/initial/ns_in40.asl index 2859f6b..c81f443 100644 --- a/tests/aslts/src/runtime/collections/Identity2MS/abbu/initial/ns_in40.asl +++ b/tests/aslts/src/runtime/collections/Identity2MS/abbu/initial/ns_in40.asl @@ -3097,9 +3097,13 @@ Method(in41, 7, Serialized) * Some params are intermediately stored to Locals */ +/* +// Removed 09/2015. iASL now disallows these stores + Store(d000, Local1) Store(d000, Local3) Store(d000, Local5) +*/ mI01(d000) mI02(d000, Local1) @@ -3162,10 +3166,13 @@ Method(in41, 7, Serialized) * Some params are intermediately stored to Args (efectively local) */ +/* +// Removed 09/2015. iASL now disallows these stores + Store(d000, Arg1) Store(d000, Arg3) Store(d000, Arg5) - +*/ mI01(d000) mI02(d000, Arg1) mI03(d000, Arg1, d000) @@ -3312,9 +3319,17 @@ Method(in41, 7, Serialized) * So, here I use Local0,Local2,Local4. */ +/* +// Removed 09/2015. iASL now disallows these stores + Store(e000, Local0) Store(e000, Local2) Store(e000, Local4) +*/ + + Store (0, Local0) + Store (2, Local2) + Store (4, Local4) mI01(e000) mI02(e000, Local0) @@ -3383,9 +3398,13 @@ Method(in41, 7, Serialized) * So, here I use Arg0,Arg2,Arg4. */ +/* +// Removed 09/2015. iASL now disallows these stores + Store(e000, Arg0) Store(e000, Arg2) Store(e000, Arg4) +*/ mI01(e000) mI02(e000, Arg0) @@ -3533,9 +3552,13 @@ Method(in41, 7, Serialized) * So, I have no more Locals for checking (SLCK here - because of that). */ +/* +// Removed 09/2015. iASL now disallows these stores + Store(mx00, Local1) Store(mx00, Local3) Store(mx00, Local5) +*/ mI01(mx00) mI02(mx00, Local1) @@ -3604,9 +3627,13 @@ Method(in41, 7, Serialized) * So, I have no more Args for checking (SLCK here - because of that). */ +/* +// Removed 09/2015. iASL now disallows these stores + Store(mx00, Arg1) Store(mx00, Arg3) Store(mx00, Arg5) +*/ mI01(mx00) mI02(mx00, Arg1) @@ -3749,9 +3776,13 @@ Method(in41, 7, Serialized) * So, I have no more Locals for checking (SLCK here - because of that). */ +/* +// Removed 09/2015. iASL now disallows these stores + Store(r000, Local1) Store(r000, Local3) Store(r000, Local5) +*/ mI01(r000) mI02(r000, Local1) @@ -3820,9 +3851,13 @@ Method(in41, 7, Serialized) * So, I have no more Args for checking (SLCK here - because of that). */ +/* +// Removed 09/2015. iASL now disallows these stores + Store(r000, Arg1) Store(r000, Arg3) Store(r000, Arg5) +*/ mI01(r000) mI02(r000, Arg1) @@ -3958,9 +3993,13 @@ Method(in41, 7, Serialized) * Note: no Locals for this checking (see comment above). */ +/* +// Removed 09/2015. iASL now disallows these stores + Store(pw00, Local1) Store(pw00, Local3) Store(pw00, Local5) +*/ mI01(pw00) mI02(pw00, Local1) @@ -4025,9 +4064,13 @@ Method(in41, 7, Serialized) * Note: no Args for this checking (see comment above). */ +/* +// Removed 09/2015. iASL now disallows these stores + Store(pw00, Arg1) Store(pw00, Arg3) Store(pw00, Arg5) +*/ mI01(pw00) mI02(pw00, Arg1) @@ -4161,9 +4204,13 @@ Method(in41, 7, Serialized) * Note: no Locals for this checking (see comment above). */ +/* +// Removed 09/2015. iASL now disallows these stores + Store(pr00, Local1) Store(pr00, Local3) Store(pr00, Local5) +*/ mI01(pr00) mI02(pr00, Local1) @@ -4228,9 +4275,13 @@ Method(in41, 7, Serialized) * Note: no Args for this checking (see comment above). */ +/* +// Removed 09/2015. iASL now disallows these stores + Store(pr00, Arg1) Store(pr00, Arg3) Store(pr00, Arg5) +*/ mI01(pr00) mI02(pr00, Arg1) @@ -4364,9 +4415,13 @@ Method(in41, 7, Serialized) * Note: no Locals for this checking (see comment above). */ +/* +// Removed 09/2015. iASL now disallows these stores + Store(tz00, Local1) Store(tz00, Local3) Store(tz00, Local5) +*/ mI01(tz00) mI02(tz00, Local1) @@ -4431,9 +4486,13 @@ Method(in41, 7, Serialized) * Note: no Args for this checking (see comment above). */ +/* +// Removed 09/2015. iASL now disallows these stores + Store(tz00, Arg1) Store(tz00, Arg3) Store(tz00, Arg5) +*/ mI01(tz00) mI02(tz00, Arg1) diff --git a/tests/aslts/src/runtime/collections/Identity2MS/abbu/misc/ms1.asl b/tests/aslts/src/runtime/collections/Identity2MS/abbu/misc/ms1.asl index 196476d..1a900f8 100644 --- a/tests/aslts/src/runtime/collections/Identity2MS/abbu/misc/ms1.asl +++ b/tests/aslts/src/runtime/collections/Identity2MS/abbu/misc/ms1.asl @@ -1317,7 +1317,10 @@ Method(ms1a, 1, Serialized) OUTP("Case return (RefOf(i000))") +/* +// Removed 09/2015. iASL store to method invocation is not supported Store(5, m000()) +*/ if (LEqual(i001, 0)) { err(ts, z179, 0x059, 0, 0, i001, 0) @@ -1348,7 +1351,11 @@ Method(ms1a, 1, Serialized) OUTP("Case return (Local0) (= RefOf(i000))") +/* +// Removed 09/2015. iASL store to method invocation not supported + Store(0x15, m001()) +*/ if (LEqual(i001, 0)) { err(ts, z179, 0x05b, 0, 0, i001, 0) @@ -6648,9 +6655,13 @@ Method(ms33, 1, Serialized) Method(asdl) { +/* +// Removed 09/2015. iASL now disallows these stores + OUTP("Store _SB.ABBU Device object into LocalX, don't check the type") Store(\_SB.ABBU, Local0) +*/ if (LOr(ABUU, SLCK)) { CH03(ts, z179, 0x2fa, 0, 0) @@ -6661,9 +6672,12 @@ Method(ms33, 1, Serialized) Method(bsdl) { +/* +// Removed 09/2015. iASL now disallows these stores OUTP("Store _SB.ABBU Device object into LocalX") Store(\_SB.ABBU, Local0) +*/ if (LOr(ABUU, SLCK)) { Store(ObjectType(Local0), Local1) @@ -6679,9 +6693,13 @@ Method(ms33, 1, Serialized) { Device(DLOC) {} +/* +// Removed 09/2015. iASL now disallows these stores + OUTP("Store an improper dynamic Device object into LocalX") Store(DLOC, Local0) +*/ if (LOr(ABUU, SLCK)) { Store(ObjectType(Local0), Local1) diff --git a/tests/aslts/src/runtime/collections/bdemo/ACPICA/0061/DECL.asl b/tests/aslts/src/runtime/collections/bdemo/ACPICA/0061/DECL.asl index 76cc1be..7a55945 100644 --- a/tests/aslts/src/runtime/collections/bdemo/ACPICA/0061/DECL.asl +++ b/tests/aslts/src/runtime/collections/bdemo/ACPICA/0061/DECL.asl @@ -50,9 +50,13 @@ Method(me02) // Store directly a region should not be allowed. +/* +// Removed 09/2015 + CH03("", 0, 0x000, 0, 0) Store(rd01, Local7) m206(0x001, 0x002) +*/ return (Local0) } @@ -68,10 +72,13 @@ Method(me04) Store(0, Local0) // Store directly a region should not be allowed. +/* +// Removed 09/2015 CH03("", 0, 0x003, 0, 0) Store(rd02, Local7) m206(0x004, 0x005) +*/ return (Local0) } diff --git a/tests/aslts/src/runtime/collections/bdemo/ACPICA/0131/DECL.asl b/tests/aslts/src/runtime/collections/bdemo/ACPICA/0131/DECL.asl index 2a7b7ed..71aadff 100644 --- a/tests/aslts/src/runtime/collections/bdemo/ACPICA/0131/DECL.asl +++ b/tests/aslts/src/runtime/collections/bdemo/ACPICA/0131/DECL.asl @@ -64,6 +64,10 @@ Method(m126,, Serialized) err("", zFFF, 0x000, 0, 0, Local0, 0xabcd0001) } +/* +// Removed 09/2015 +Store to method invocation is not supported + Store(0xabcd0004, m002()) Store(DerefOf(Index(p000, 1)), Local0) if (LNotEqual(Local0, 0xabcd0004)) { @@ -81,6 +85,7 @@ Method(m126,, Serialized) if (LNotEqual(Local0, 0xabcd0006)) { err("", zFFF, 0x000, 0, 0, Local0, 0xabcd0006) } +*/ } m005() diff --git a/tests/aslts/src/runtime/collections/bdemo/ACPICA/0228/DECL.asl b/tests/aslts/src/runtime/collections/bdemo/ACPICA/0228/DECL.asl index 6e35311..4174ee7 100644 --- a/tests/aslts/src/runtime/collections/bdemo/ACPICA/0228/DECL.asl +++ b/tests/aslts/src/runtime/collections/bdemo/ACPICA/0228/DECL.asl @@ -45,6 +45,10 @@ Method(mf1e) { +/* +// Removed 09/2015 +Store to method invocation is not supported + // Case mf1c Store(5, mf1c()) @@ -60,6 +64,7 @@ if (LNotEqual(id12, 6)) { err("", zFFF, 0x001, 0, 0, id12, 6) } +*/ } diff --git a/tests/aslts/src/runtime/collections/bdemo/ACPICA/bdemo/DECL.asl b/tests/aslts/src/runtime/collections/bdemo/ACPICA/bdemo/DECL.asl index d3de763..279b8df 100644 --- a/tests/aslts/src/runtime/collections/bdemo/ACPICA/bdemo/DECL.asl +++ b/tests/aslts/src/runtime/collections/bdemo/ACPICA/bdemo/DECL.asl @@ -52,7 +52,7 @@ Include("../../../../../runtime/collections/bdemo/ACPICA/0010/DECL.asl") // 0011_ASL -Include("../../../../../runtime/collections/bdemo/ACPICA/0012/DECL.asl") +//Include("../../../../../runtime/collections/bdemo/ACPICA/0012/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0013/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0014/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0015/DECL.asl") @@ -83,7 +83,7 @@ Include("../../../../../runtime/collections/bdemo/ACPICA/0034/DECL.asl") // 0035_ASL // 0036_ASL -Include("../../../../../runtime/collections/bdemo/ACPICA/0037/DECL.asl") +//Include("../../../../../runtime/collections/bdemo/ACPICA/0037/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0038/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0039_ASL_RUNTIME/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0040/DECL.asl") @@ -144,7 +144,7 @@ Include("../../../../../runtime/collections/bdemo/ACPICA/0081/DECL.asl") // 0082_SPEC -Include("../../../../../runtime/collections/bdemo/ACPICA/0083/DECL.asl") +//Include("../../../../../runtime/collections/bdemo/ACPICA/0083/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0084/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0085/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0086/DECL.asl") @@ -208,7 +208,7 @@ Include("../../../../../runtime/collections/bdemo/ACPICA/0131/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0132/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0133/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0134/DECL.asl") -Include("../../../../../runtime/collections/bdemo/ACPICA/0135/DECL.asl") +//Include("../../../../../runtime/collections/bdemo/ACPICA/0135/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0136/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0137/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0138/DECL.asl") @@ -234,7 +234,7 @@ Include("../../../../../runtime/collections/bdemo/ACPICA/0151/DECL.asl") // 0152_ASL -Include("../../../../../runtime/collections/bdemo/ACPICA/0153/DECL.asl") +//Include("../../../../../runtime/collections/bdemo/ACPICA/0153/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0154/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0155/DECL.asl") @@ -293,8 +293,8 @@ Include("../../../../../runtime/collections/bdemo/ACPICA/0194/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0195/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0196/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0197/DECL.asl") -Include("../../../../../runtime/collections/bdemo/ACPICA/0198/DECL.asl") -Include("../../../../../runtime/collections/bdemo/ACPICA/0199/DECL.asl") +//Include("../../../../../runtime/collections/bdemo/ACPICA/0198/DECL.asl") +//Include("../../../../../runtime/collections/bdemo/ACPICA/0199/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0200/DECL.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0201_OUTSTAND_ALLOC/DECL.asl") diff --git a/tests/aslts/src/runtime/collections/bdemo/ACPICA/bdemo/RUN.asl b/tests/aslts/src/runtime/collections/bdemo/ACPICA/bdemo/RUN.asl index 8b0c532..56bb094 100644 --- a/tests/aslts/src/runtime/collections/bdemo/ACPICA/bdemo/RUN.asl +++ b/tests/aslts/src/runtime/collections/bdemo/ACPICA/bdemo/RUN.asl @@ -46,7 +46,7 @@ Include("../../../../../runtime/collections/bdemo/ACPICA/0010/RUN.asl") // 0011_ASL -Include("../../../../../runtime/collections/bdemo/ACPICA/0012/RUN.asl") +//Include("../../../../../runtime/collections/bdemo/ACPICA/0012/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0013/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0014/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0015/RUN.asl") @@ -77,7 +77,7 @@ Include("../../../../../runtime/collections/bdemo/ACPICA/0034/RUN.asl") // 0035_ASL // 0036_ASL -Include("../../../../../runtime/collections/bdemo/ACPICA/0037/RUN.asl") +//Include("../../../../../runtime/collections/bdemo/ACPICA/0037/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0038/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0039_ASL_RUNTIME/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0040/RUN.asl") @@ -138,7 +138,7 @@ Include("../../../../../runtime/collections/bdemo/ACPICA/0081/RUN.asl") // 0082_SPEC -Include("../../../../../runtime/collections/bdemo/ACPICA/0083/RUN.asl") +//Include("../../../../../runtime/collections/bdemo/ACPICA/0083/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0084/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0085/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0086/RUN.asl") @@ -202,7 +202,7 @@ Include("../../../../../runtime/collections/bdemo/ACPICA/0131/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0132/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0133/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0134/RUN.asl") -Include("../../../../../runtime/collections/bdemo/ACPICA/0135/RUN.asl") +//Include("../../../../../runtime/collections/bdemo/ACPICA/0135/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0136/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0137/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0138/RUN.asl") @@ -228,7 +228,7 @@ Include("../../../../../runtime/collections/bdemo/ACPICA/0151/RUN.asl") // 0152_ASL -Include("../../../../../runtime/collections/bdemo/ACPICA/0153/RUN.asl") +//Include("../../../../../runtime/collections/bdemo/ACPICA/0153/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0154/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0155/RUN.asl") @@ -287,8 +287,8 @@ Include("../../../../../runtime/collections/bdemo/ACPICA/0194/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0195/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0196/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0197/RUN.asl") -Include("../../../../../runtime/collections/bdemo/ACPICA/0198/RUN.asl") -Include("../../../../../runtime/collections/bdemo/ACPICA/0199/RUN.asl") +//Include("../../../../../runtime/collections/bdemo/ACPICA/0198/RUN.asl") +//Include("../../../../../runtime/collections/bdemo/ACPICA/0199/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0200/RUN.asl") Include("../../../../../runtime/collections/bdemo/ACPICA/0201_OUTSTAND_ALLOC/RUN.asl") diff --git a/tests/aslts/src/runtime/collections/complex/result/common/rcommon.asl b/tests/aslts/src/runtime/collections/complex/result/common/rcommon.asl index 5176352..7b12a96 100644 --- a/tests/aslts/src/runtime/collections/complex/result/common/rcommon.asl +++ b/tests/aslts/src/runtime/collections/complex/result/common/rcommon.asl @@ -666,6 +666,9 @@ if (y361) { Store(FLU0, Local0) m003(ObjectType(FLU0)) +/* +// Removed 09/2015: iASL now disallows stores to these objects + Store(DEV0, Local0) m003(ObjectType(DEV0)) @@ -686,7 +689,7 @@ if (y361) { Store(TZN0, Local0) m003(ObjectType(TZN0)) - +*/ Store(BFL0, Local0) m003(ObjectType(BFL0)) @@ -1092,11 +1095,11 @@ if (y361) { } Case(17) { CopyObject(Refof(ORF1), REF1) - if (y522) { + //if (y522) { CopyObject(REF1, arg2) - } else { - CopyObject(DeRefof(REF1), arg2) - } + //} else { + // CopyObject(DeRefof(REF1), arg2) + //} } Default { // Unexpected Target Type @@ -1198,11 +1201,11 @@ if (y361) { } Case(17) { CopyObject(Refof(ORF0), REF0) - if (y522) { + //if (y522) { CopyObject(REF0, arg2) - } else { - CopyObject(DeRefof(REF0), arg2) - } + //} else { + // CopyObject(DeRefof(REF0), arg2) + //} } Default { // Unexpected Source Type @@ -3178,11 +3181,11 @@ if (y361) { } Case(17) { CopyObject(Refof(ORF1), REF1) - if (y522) { + //if (y522) { Store(REF1, Index(arg2, 0)) - } else { - Store(DeRefof(REF1), Index(arg2, 0)) - } + //} else { + // Store(DeRefof(REF1), Index(arg2, 0)) + //} } Default { // Unexpected Target Type @@ -3282,7 +3285,8 @@ if (y361) { Store(14, Local0) } Case(17) { - Store(Derefof(REF1), Local3) + //Store(Derefof(REF1), Local3) + Store (REF1, Local3) if (CH03(arg0, z122, 103, arg1, Local0)) { // Derefof caused unexpected exception Return (1) @@ -3464,7 +3468,8 @@ if (y361) { Store(14, Local0) } Case(17) { - Store(Derefof(REF1), Local3) + //Store(Derefof(REF1), Local3) + Store(REF1, Local3) if (CH03(arg0, z122, 121, arg1, 0)) { // Derefof caused unexpected exception Return (1) diff --git a/tests/aslts/src/runtime/collections/complex/result/tests/rexplicitconv/rexplicitconv.asl b/tests/aslts/src/runtime/collections/complex/result/tests/rexplicitconv/rexplicitconv.asl index 862989d..ac9c70a 100644 --- a/tests/aslts/src/runtime/collections/complex/result/tests/rexplicitconv/rexplicitconv.asl +++ b/tests/aslts/src/runtime/collections/complex/result/tests/rexplicitconv/rexplicitconv.asl @@ -296,11 +296,11 @@ Method(m693, 5, Serialized) } Case(17) { CopyObject(Refof(REF0), REF1) - if (y522) { + //if (y522) { CopyObject(REF1, arg2) - } else { - CopyObject(DeRefof(REF1), arg2) - } + //} else { + // CopyObject(DeRefof(REF1), arg2) + //} } Default { // Unexpected Target Type diff --git a/tests/aslts/src/runtime/collections/complex/result/tests/roptional/roptional.asl b/tests/aslts/src/runtime/collections/complex/result/tests/roptional/roptional.asl index fb802f5..219904c 100644 --- a/tests/aslts/src/runtime/collections/complex/result/tests/roptional/roptional.asl +++ b/tests/aslts/src/runtime/collections/complex/result/tests/roptional/roptional.asl @@ -325,11 +325,11 @@ Method(m694, 5, Serialized) } Case(17) { CopyObject(Refof(REF0), REF1) - if (y522) { + //if (y522) { CopyObject(REF1, arg2) - } else { - CopyObject(DeRefof(REF1), arg2) - } + //} else { + // CopyObject(DeRefof(REF1), arg2) + //} } Default { // Unexpected Target Type diff --git a/tests/aslts/src/runtime/collections/complex/result/tests/rstore/rstore.asl b/tests/aslts/src/runtime/collections/complex/result/tests/rstore/rstore.asl index 3eb279c..8a24265 100644 --- a/tests/aslts/src/runtime/collections/complex/result/tests/rstore/rstore.asl +++ b/tests/aslts/src/runtime/collections/complex/result/tests/rstore/rstore.asl @@ -773,9 +773,13 @@ Method(m690,, Serialized) m680(arg0, 143, 0, i68b, 0xc179b3fe) m680(arg0, 144, 0, b6e0, Buffer() {0x84, 0xA2, 0x50, 0xD6, 0x91, 0xB3, 0x7C, 0xFE}) } + +/* +// Removed 09/2015: iASL now disallows store of package to integer Case(4) { // Package Store(Package(){0xfe7cb391d650a284}, i684) } +*/ Case(5) { // Field Unit Store("Not implemented", Debug) err(terr, z123, 145, 0, 0, arg1, arg2) diff --git a/tests/aslts/src/runtime/collections/exceptions/exc/exc.asl b/tests/aslts/src/runtime/collections/exceptions/exc/exc.asl index 8b7e642..d1b9ec3 100644 --- a/tests/aslts/src/runtime/collections/exceptions/exc/exc.asl +++ b/tests/aslts/src/runtime/collections/exceptions/exc/exc.asl @@ -159,6 +159,7 @@ Method(m143,, Serialized) Store(SizeOf(Local1), Local5) CH04(ts, 1, 49, z058, 12, 0, 0) // AE_AML_UNINITIALIZED_LOCAL +#if 0 /* These are now caught by the compiler - Aug 2015 */ Store(SizeOf(DEV0), Local5) CH04(ts, 1, 47, z058, 13, 0, 0) // AE_AML_OPERAND_TYPE @@ -179,6 +180,7 @@ Method(m143,, Serialized) Store(SizeOf(TZN0), Local5) CH04(ts, 1, 47, z058, 19, 0, 0) // AE_AML_OPERAND_TYPE +#endif } // ToString() when the number of characters copied from buffer exceeds 200 @@ -1302,6 +1304,8 @@ Method(m709,, Serialized) Name(lenp, Package(1){0x123}) Name(i000, 0x100) +#if 0 /* These are now caught by the compiler - Aug 2015 */ + Method(m000,, Serialized) { OperationRegion(OPR0, SystemMemory, offp, 1) } @@ -1315,6 +1319,7 @@ Method(m709,, Serialized) OperationRegion(OPR1, SystemMemory, 1, lenp) CH04(ts, 0, 47, z058, 190, 0, 0) // AE_AML_OPERAND_TYPE +#endif } // Try OpRegion arguments when Offset + Length > MaxInteger @@ -1393,6 +1398,8 @@ Method(m7f5,, Serialized) DataTableRegion (DR05, "SSDT", "", i000) CH04(ts, 0, 5, z058, 201, 0, 0) // AE_NOT_FOUND +#if 0 /* These are now caught by the compiler - Aug 2015 */ + DataTableRegion (DR06, p000, "", i000) CH04(ts, 0, 47, z058, 202, 0, 0) // AE_AML_OPERAND_TYPE @@ -1401,6 +1408,7 @@ Method(m7f5,, Serialized) DataTableRegion (DR08, "SSDT", "", p000) CH04(ts, 0, 47, z058, 204, 0, 0) // AE_AML_OPERAND_TYPE +#endif } // Check SMBus OpRegion restictions diff --git a/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_04_pckg.asl b/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_04_pckg.asl index 116a519..d0d3e39 100644 --- a/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_04_pckg.asl +++ b/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_04_pckg.asl @@ -74,11 +74,13 @@ Method(m4b4, 1, Serialized) // DerefOf +/* These are now caught by the compiler - Aug 2015 + if (y083) { Store (DerefOf(p000), Local1) CH06(arg0, 0, 47) } - +*/ // FindSetLeftBit // FindSetRightBit @@ -213,12 +215,13 @@ Method(m4b4, 1, Serialized) // Decrement // DerefOf +/* These are now caught by the compiler - Aug 2015 if (y083) { Store (DerefOf(p100), Local1) CH06(arg0, 1, 47) } - +*/ // FindSetLeftBit // FindSetRightBit diff --git a/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_06_dev.asl b/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_06_dev.asl index 9969f87..b837640 100644 --- a/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_06_dev.asl +++ b/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_06_dev.asl @@ -51,6 +51,8 @@ Method(m4b6,, Serialized) Name(i000, 0) // Local Named Object +/* These are now caught by the compiler - Aug 2015 + Method(m000, 1, Serialized) { Device(dev2) {} @@ -58,8 +60,9 @@ Method(m4b6,, Serialized) Store (DerefOf(dev2), Local1) CH06(arg0, 0, 47) } - +*/ // Global Named Object +/* These are now caught by the compiler - Aug 2015 Method(m001, 1) { if (y083) { @@ -67,7 +70,7 @@ Method(m4b6,, Serialized) CH06(arg0, 1, 47) } } - +*/ // Local Method(m002, 1, Serialized) { @@ -1215,10 +1218,10 @@ Method(m4b6,, Serialized) CH03(ts, z098, 11, 0, 0) // Local Named Object - m000(ts) +// m000(ts) // Global Named Object - m001(ts) +// m001(ts) // Local m002(Concatenate(ts, "-m002")) diff --git a/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_07_event.asl b/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_07_event.asl index 8fefd1d..9b00876 100644 --- a/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_07_event.asl +++ b/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_07_event.asl @@ -50,6 +50,8 @@ Method(m4b7,, Serialized) Name(i000, 0) +/* These are now caught by the compiler - Aug 2015 + // Local Named Object Method(m000, 1, Serialized) { @@ -69,7 +71,7 @@ Method(m4b7,, Serialized) CH06(arg0, 0x101, 47) } } - +*/ // Local Method(m002, 1, Serialized) { @@ -1224,10 +1226,10 @@ Method(m4b7,, Serialized) CH03(ts, z099, 11, 0, 0) // Local Named Object - m000(ts) +// m000(ts) // Global Named Object - m001(ts) +// m001(ts) // Local m002(Concatenate(ts, "-m002")) diff --git a/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_09_mux.asl b/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_09_mux.asl index 6c3b0f9..48c78e8 100644 --- a/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_09_mux.asl +++ b/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_09_mux.asl @@ -53,21 +53,26 @@ Method(m4b9,, Serialized) // Local Named Object Method(m000, 1, Serialized) { +/* These are now caught by the compiler - Aug 2015 + Mutex(mx02, 0) if (y083) { Store (DerefOf(mx02), Local1) CH06(arg0, 0, 47) } +*/ } // Global Named Object Method(m001, 1) { +/* These are now caught by the compiler - Aug 2015 if (y083) { Store (DerefOf(mx10), Local1) CH06(arg0, 1, 47) } +*/ } // Local diff --git a/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_10_oreg.asl b/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_10_oreg.asl index b1d31ac..5a5f0ee 100644 --- a/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_10_oreg.asl +++ b/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_10_oreg.asl @@ -53,19 +53,24 @@ Method(m4ba,, Serialized) // Local Named Object Method(m000, 1, Serialized) { +/* These are now caught by the compiler - Aug 2015 + OperationRegion(opr2, SystemMemory, 0x100, 0x100) Store (DerefOf(opr2), Local1) CH06(arg0, 0, 47) +*/ } // Global Named Object Method(m001, 1) { +/* These are now caught by the compiler - Aug 2015 if (y083) { Store (DerefOf(opr9), Local1) CH06(arg0, 1, 47) } +*/ } // Local diff --git a/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_11_pwr.asl b/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_11_pwr.asl index 90c6b70..084434a 100644 --- a/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_11_pwr.asl +++ b/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_11_pwr.asl @@ -53,21 +53,25 @@ Method(m4bb,, Serialized) // Local Named Object Method(m000, 1, Serialized) { +/* These are now caught by the compiler - Aug 2015 PowerResource(pw02, 1, 0) {Method(m000){return (0)}} if (y083) { Store (DerefOf(pw02), Local1) CH06(arg0, 0, 47) } +*/ } // Global Named Object Method(m001, 1) { +/* These are now caught by the compiler - Aug 2015 if (y083) { Store (DerefOf(pw00), Local1) CH06(arg0, 1, 47) } +*/ } // Local diff --git a/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_12_proc.asl b/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_12_proc.asl index 79ed4d9..11bc61b 100644 --- a/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_12_proc.asl +++ b/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_12_proc.asl @@ -53,21 +53,27 @@ Method(m4bc,, Serialized) // Local Named Object Method(m000, 1, Serialized) { +/* These are now caught by the compiler - Aug 2015 + Processor(prc2, 0, 0xFFFFFFFF, 0) {} if (y083) { Store (DerefOf(prc2), Local1) CH06(arg0, 0, 47) } +*/ } // Global Named Object Method(m001, 1) { +/* These are now caught by the compiler - Aug 2015 + if (y083) { Store (DerefOf(pr10), Local1) CH06(arg0, 1, 47) } +*/ } // Local diff --git a/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_13_tzone.asl b/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_13_tzone.asl index 73ba586..0e4072b 100644 --- a/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_13_tzone.asl +++ b/tests/aslts/src/runtime/collections/exceptions/exc_operand/exc_operand2/exc_13_tzone.asl @@ -53,19 +53,25 @@ Method(m4bd,, Serialized) // Local Named Object Method(m000, 1, Serialized) { +/* These are now caught by the compiler - Aug 2015 + ThermalZone (tz02) {Name(n000, "tz02")} Store (DerefOf(tz02), Local1) CH06(arg0, 0, 47) +*/ } // Global Named Object Method(m001, 1) { +/* These are now caught by the compiler - Aug 2015 + if (y083) { Store (DerefOf(tz00), Local1) CH06(arg0, 1, 47) } +*/ } // Local diff --git a/tests/aslts/src/runtime/collections/functional/reference/ref50.asl b/tests/aslts/src/runtime/collections/functional/reference/ref50.asl index 869f0df..77d3b2a 100644 --- a/tests/aslts/src/runtime/collections/functional/reference/ref50.asl +++ b/tests/aslts/src/runtime/collections/functional/reference/ref50.asl @@ -1535,6 +1535,9 @@ Method(m258, 1, Serialized) Store(p953, Index(p100, 4)) Store(f900, Index(p100, 5)) +/* +// Removed 09/2015. iASL now disallows these stores + if (arg0) { // Check these for exceptions but not there Store(d900, Index(p100, 6)) @@ -1546,6 +1549,7 @@ Method(m258, 1, Serialized) Store(pr90, Index(p100, 12)) Store(tz90, Index(p100, 13)) } +*/ Store(bf90, Index(p100, 14)) diff --git a/tests/aslts/src/runtime/collections/functional/reference/ref71.asl b/tests/aslts/src/runtime/collections/functional/reference/ref71.asl index 7dc8090..cc03c1a 100644 --- a/tests/aslts/src/runtime/collections/functional/reference/ref71.asl +++ b/tests/aslts/src/runtime/collections/functional/reference/ref71.asl @@ -90,6 +90,9 @@ Method(m1b3,, Serialized) err(ts, z109, 6, 0, 0, Local7, c009) } +/* +// Removed 09/2015. iASL now disallows these stores + CH03(ts, z109, 7, 0, 0) Store(d900, Local0) if (LNot(SLCK)){ @@ -101,7 +104,7 @@ Method(m1b3,, Serialized) if (LNot(SLCK)){ CH04(ts, 0, 0xff, z109, 10, 0, 0) } - +*/ /* * 21.12.2005. * No exception now. @@ -116,6 +119,9 @@ Method(m1b3,, Serialized) //CH04(ts, 0, 0xff, z109, 12, 0, 0) } +/* +// Removed 09/2015. iASL now disallows these stores + CH03(ts, z109, 13, 0, 0) Store(mx90, Local0) if (LNot(SLCK)){ @@ -146,6 +152,7 @@ Method(m1b3,, Serialized) { CH04(ts, 0, 0xff, z109, 22, 0, 0) } +*/ Store(bf90, Local0) Store(ObjectType(Local0), Local7) diff --git a/tests/aslts/src/runtime/common/conversion/oproc.asl b/tests/aslts/src/runtime/common/conversion/oproc.asl index 43bde69..f27c9b9 100644 --- a/tests/aslts/src/runtime/common/conversion/oproc.asl +++ b/tests/aslts/src/runtime/common/conversion/oproc.asl @@ -437,6 +437,8 @@ Method(m484, 1, Serialized) Store(f00a, Local7) } +/* +// Removed 09/2015: iASL now disallows these stores // Devices case (0x600) { @@ -504,7 +506,7 @@ Method(m484, 1, Serialized) } // Thermal Zones - +*/ /* * case (0xd00) { * Store(Debug, Local7) diff --git a/tests/aslts/src/runtime/common/conversion/otest.asl b/tests/aslts/src/runtime/common/conversion/otest.asl index 8928bcc..e728a34 100644 --- a/tests/aslts/src/runtime/common/conversion/otest.asl +++ b/tests/aslts/src/runtime/common/conversion/otest.asl @@ -366,11 +366,11 @@ Method(m401, 1, Serialized) } elseif (0) { Store(1, FLG1) Store(1, com2) - Store(p000, PKG1) - Store(PKG0, PKG2) +// Store(p000, PKG1) +// Store(PKG0, PKG2) m48b(op, 0x104) - Store(PKG0, PKG1) - Store(PKG0, PKG2) +// Store(PKG0, PKG1) +// Store(PKG0, PKG2) Store(0, com2) Store(0, FLG1) } else { @@ -470,11 +470,11 @@ Method(m402, 1, Serialized) } else { Store(1, FLG1) Store(1, com2) - Store(p000, PKG1) - Store(PKG0, PKG2) +// Store(p000, PKG1) +// Store(PKG0, PKG2) m48b(op, 0x106) - Store(PKG0, PKG1) - Store(PKG0, PKG2) +// Store(PKG0, PKG1) +// Store(PKG0, PKG2) Store(0, com2) Store(0, FLG1) } @@ -1698,26 +1698,26 @@ Method(m403, 1, Serialized) // (Integer ==> All other types) // (All other types ==> Integer) Store(2, com2) - Store(p000, PKG1) - Store(p001, PKG2) +// Store(p000, PKG1) +// Store(p001, PKG2) m48b(op, 0x103) // (String ==> All other types) // (All other types ==> String) Store(2, com2) - Store(p002, PKG1) - Store(p003, PKG2) +// Store(p002, PKG1) +// Store(p003, PKG2) m48b(op, 0x204) // (Buffer ==> All other types) // (All other types ==> Buffer) Store(2, com2) - Store(p004, PKG1) - Store(p005, PKG2) +// Store(p004, PKG1) +// Store(p005, PKG2) m48b(op, 0x302) - Store(PKG0, PKG1) - Store(PKG0, PKG2) +// Store(PKG0, PKG1) +// Store(PKG0, PKG2) Store(0, com2) Store(0, FLG1) } @@ -2287,28 +2287,28 @@ Method(m417, 1, Serialized) Store(1, FLG1) // (Integer ==> All other types) - // (All other types ==> Integer) + // (All other types ==> Integer)2556 Store(2, com2) - Store(p000, PKG1) - Store(p001, PKG2) +// Store(p000, PKG1) +// Store(p001, PKG2) m48b(op, 0x103) // (String ==> All other types) // (All other types ==> String) Store(2, com2) - Store(p002, PKG1) - Store(p003, PKG2) +// Store(p002, PKG1) +// Store(p003, PKG2) m48b(op, 0x204) // (Buffer ==> All other types) // (All other types ==> Buffer) Store(2, com2) - Store(p004, PKG1) - Store(p005, PKG2) +// Store(p004, PKG1) +// Store(p005, PKG2) m48b(op, 0x302) - Store(PKG0, PKG1) - Store(PKG0, PKG2) +// Store(PKG0, PKG1) +// Store(PKG0, PKG2) Store(0, com2) Store(0, FLG1) } @@ -2553,26 +2553,26 @@ Method(m418, 1, Serialized) // (Integer ==> All other types) // (All other types ==> Integer) Store(2, com2) - Store(p000, PKG1) - Store(p001, PKG2) +// Store(p000, PKG1) +// Store(p001, PKG2) m48b(op, 0x103) // (String ==> All other types) // (All other types ==> String) Store(2, com2) - Store(p002, PKG1) - Store(p003, PKG2) +// Store(p002, PKG1) +// Store(p003, PKG2) m48b(op, 0x204) // (Buffer ==> All other types) // (All other types ==> Buffer) Store(2, com2) - Store(p004, PKG1) - Store(p005, PKG2) +// Store(p004, PKG1) +// Store(p005, PKG2) m48b(op, 0x302) - Store(PKG0, PKG1) - Store(PKG0, PKG2) +// Store(PKG0, PKG1) +// Store(PKG0, PKG2) Store(0, com2) Store(0, FLG1) } @@ -2818,26 +2818,26 @@ Method(m419, 1, Serialized) // (Integer ==> All other types) // (All other types ==> Integer) Store(2, com2) - Store(p000, PKG1) - Store(p001, PKG2) +// Store(p000, PKG1) +// Store(p001, PKG2) m48b(op, 0x103) // (String ==> All other types) // (All other types ==> String) Store(2, com2) - Store(p002, PKG1) - Store(p003, PKG2) +// Store(p002, PKG1) +// Store(p003, PKG2) m48b(op, 0x204) // (Buffer ==> All other types) // (All other types ==> Buffer) Store(2, com2) - Store(p004, PKG1) - Store(p005, PKG2) +// Store(p004, PKG1) +// Store(p005, PKG2) m48b(op, 0x302) - Store(PKG0, PKG1) - Store(PKG0, PKG2) +// Store(PKG0, PKG1) +// Store(PKG0, PKG2) Store(0, com2) Store(0, FLG1) } @@ -3083,26 +3083,26 @@ Method(m420, 1, Serialized) // (Integer ==> All other types) // (All other types ==> Integer) Store(2, com2) - Store(p000, PKG1) - Store(p001, PKG2) +// Store(p000, PKG1) +// Store(p001, PKG2) m48b(op, 0x103) // (String ==> All other types) // (All other types ==> String) Store(2, com2) - Store(p002, PKG1) - Store(p003, PKG2) +// Store(p002, PKG1) +// Store(p003, PKG2) m48b(op, 0x204) // (Buffer ==> All other types) // (All other types ==> Buffer) Store(2, com2) - Store(p004, PKG1) - Store(p005, PKG2) +// Store(p004, PKG1) +// Store(p005, PKG2) m48b(op, 0x302) - Store(PKG0, PKG1) - Store(PKG0, PKG2) +// Store(PKG0, PKG1) +// Store(PKG0, PKG2) Store(0, com2) Store(0, FLG1) } @@ -3348,26 +3348,26 @@ Method(m421, 1, Serialized) // (Integer ==> All other types) // (All other types ==> Integer) Store(2, com2) - Store(p000, PKG1) - Store(p001, PKG2) +// Store(p000, PKG1) +// Store(p001, PKG2) m48b(op, 0x103) // (String ==> All other types) // (All other types ==> String) Store(2, com2) - Store(p002, PKG1) - Store(p003, PKG2) +// Store(p002, PKG1) +// Store(p003, PKG2) m48b(op, 0x204) // (Buffer ==> All other types) // (All other types ==> Buffer) Store(2, com2) - Store(p004, PKG1) - Store(p005, PKG2) +// Store(p004, PKG1) +// Store(p005, PKG2) m48b(op, 0x302) - Store(PKG0, PKG1) - Store(PKG0, PKG2) +// Store(PKG0, PKG1) +// Store(PKG0, PKG2) Store(0, com2) Store(0, FLG1) } @@ -3613,26 +3613,26 @@ Method(m423, 1, Serialized) // (Integer ==> All other types) // (All other types ==> Integer) Store(2, com2) - Store(p000, PKG1) - Store(p001, PKG2) +// Store(p000, PKG1) +// Store(p001, PKG2) m48b(op, 0x103) // (String ==> All other types) // (All other types ==> String) Store(2, com2) - Store(p002, PKG1) - Store(p003, PKG2) +// Store(p002, PKG1) +// Store(p003, PKG2) m48b(op, 0x204) // (Buffer ==> All other types) // (All other types ==> Buffer) Store(2, com2) - Store(p004, PKG1) - Store(p005, PKG2) +// Store(p004, PKG1) +// Store(p005, PKG2) m48b(op, 0x302) - Store(PKG0, PKG1) - Store(PKG0, PKG2) +// Store(PKG0, PKG1) +// Store(PKG0, PKG2) Store(0, com2) Store(0, FLG1) } diff --git a/tests/misc/grammar.aml b/tests/misc/grammar.aml deleted file mode 100644 index dce03e6..0000000 Binary files a/tests/misc/grammar.aml and /dev/null differ