ACK: [PATCH 1/2] ACPICA: update to version 20141107. (LP: #1391860)
IvanHu
ivan.hu at canonical.com
Fri Nov 14 08:00:34 UTC 2014
On 11/12/2014 08:43 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Update to ACPICA version 20141107. Refer to
> https://lists.acpica.org/pipermail/devel/2014-November/000668.html
>
> for a full list of new features and fixes.
>
> I had to re-work some of the Makefile rules to cater for the
> changes in the .y sources and clear a new ACPICA global variable
> that controls the style of AML disassembly output.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/acpica/Makefile.am | 2 +
> src/acpica/source/common/adisasm.c | 16 +-
> src/acpica/source/compiler/Makefile.am | 36 +-
> src/acpica/source/compiler/aslbtypes.c | 6 +
> src/acpica/source/compiler/aslcodegen.c | 27 +-
> src/acpica/source/compiler/aslcompile.c | 7 +
> src/acpica/source/compiler/aslcompiler.h | 31 +
> src/acpica/source/compiler/aslcompiler.l | 86 +-
> src/acpica/source/compiler/aslcompiler.y | 411 ++-
> src/acpica/source/compiler/asldefine.h | 4 +-
> src/acpica/source/compiler/aslglobal.h | 3 +
> src/acpica/source/compiler/aslload.c | 2 -
> src/acpica/source/compiler/aslmain.c | 6 +-
> src/acpica/source/compiler/aslmap.c | 33 +-
> src/acpica/source/compiler/aslopcodes.c | 766 ++++-
> src/acpica/source/compiler/aslparser.y | 203 ++
> src/acpica/source/compiler/aslprintf.c | 452 +++
> src/acpica/source/compiler/aslprune.c | 311 ++
> src/acpica/source/compiler/aslrules.y | 3064 ++++++++++++++++++++
> src/acpica/source/compiler/aslsupport.y | 192 ++
> src/acpica/source/compiler/asltokens.y | 540 ++++
> src/acpica/source/compiler/asltree.c | 193 ++
> src/acpica/source/compiler/asltypes.y | 465 +++
> src/acpica/source/compiler/aslwalks.c | 7 +
> src/acpica/source/compiler/aslxref.c | 2 +
> src/acpica/source/compiler/dtcompile.c | 1 -
> src/acpica/source/compiler/dtexpress.c | 2 -
> src/acpica/source/compiler/dtfield.c | 2 -
> src/acpica/source/compiler/dtio.c | 2 -
> src/acpica/source/compiler/dtsubtable.c | 2 -
> src/acpica/source/compiler/dttable.c | 2 -
> src/acpica/source/compiler/dtutils.c | 2 -
> src/acpica/source/compiler/fwts_iasl_interface.c | 1 +
> src/acpica/source/components/debugger/dbconvert.c | 56 +-
> .../source/components/disassembler/dmbuffer.c | 203 +-
> .../source/components/disassembler/dmcstyle.c | 845 ++++++
> .../source/components/disassembler/dmopcode.c | 38 +-
> .../source/components/disassembler/dmutils.c | 15 +-
> src/acpica/source/components/disassembler/dmwalk.c | 50 +-
> src/acpica/source/components/dispatcher/dsargs.c | 2 -
> .../source/components/dispatcher/dscontrol.c | 2 -
> src/acpica/source/components/dispatcher/dsfield.c | 2 -
> src/acpica/source/components/dispatcher/dsinit.c | 2 -
> src/acpica/source/components/dispatcher/dsmethod.c | 2 -
> src/acpica/source/components/dispatcher/dsmthdat.c | 2 -
> src/acpica/source/components/dispatcher/dsobject.c | 2 -
> src/acpica/source/components/dispatcher/dsopcode.c | 2 -
> src/acpica/source/components/dispatcher/dsutils.c | 2 -
> src/acpica/source/components/dispatcher/dswexec.c | 2 -
> src/acpica/source/components/dispatcher/dswload.c | 2 -
> src/acpica/source/components/dispatcher/dswload2.c | 2 -
> src/acpica/source/components/dispatcher/dswscope.c | 2 -
> src/acpica/source/components/dispatcher/dswstate.c | 2 -
> src/acpica/source/components/events/evhandler.c | 2 -
> src/acpica/source/components/events/evregion.c | 2 -
> src/acpica/source/components/events/evrgnini.c | 2 -
> src/acpica/source/components/events/evxface.c | 1 -
> src/acpica/source/components/events/evxfevnt.c | 1 -
> src/acpica/source/components/events/evxfgpe.c | 1 -
> src/acpica/source/components/events/evxfregn.c | 1 -
> src/acpica/source/components/executer/exconfig.c | 2 -
> src/acpica/source/components/executer/exconvrt.c | 2 -
> src/acpica/source/components/executer/excreate.c | 2 -
> src/acpica/source/components/executer/exdebug.c | 2 -
> src/acpica/source/components/executer/exdump.c | 2 -
> src/acpica/source/components/executer/exfield.c | 2 -
> src/acpica/source/components/executer/exfldio.c | 2 -
> src/acpica/source/components/executer/exmisc.c | 2 -
> src/acpica/source/components/executer/exmutex.c | 2 -
> src/acpica/source/components/executer/exnames.c | 2 -
> src/acpica/source/components/executer/exoparg1.c | 2 -
> src/acpica/source/components/executer/exoparg2.c | 2 -
> src/acpica/source/components/executer/exoparg3.c | 2 -
> src/acpica/source/components/executer/exoparg6.c | 2 -
> src/acpica/source/components/executer/exprep.c | 2 -
> src/acpica/source/components/executer/exregion.c | 2 -
> src/acpica/source/components/executer/exresnte.c | 2 -
> src/acpica/source/components/executer/exresolv.c | 2 -
> src/acpica/source/components/executer/exresop.c | 2 -
> src/acpica/source/components/executer/exstore.c | 2 -
> src/acpica/source/components/executer/exstoren.c | 2 -
> src/acpica/source/components/executer/exstorob.c | 2 -
> src/acpica/source/components/executer/exsystem.c | 2 -
> src/acpica/source/components/executer/exutils.c | 2 -
> src/acpica/source/components/hardware/hwacpi.c | 2 -
> src/acpica/source/components/hardware/hwpci.c | 2 -
> src/acpica/source/components/hardware/hwregs.c | 2 -
> src/acpica/source/components/hardware/hwvalid.c | 2 -
> src/acpica/source/components/namespace/nsaccess.c | 2 -
> src/acpica/source/components/namespace/nsalloc.c | 2 -
> src/acpica/source/components/namespace/nsconvert.c | 2 -
> src/acpica/source/components/namespace/nsdump.c | 2 -
> src/acpica/source/components/namespace/nsdumpdv.c | 2 -
> src/acpica/source/components/namespace/nseval.c | 2 -
> src/acpica/source/components/namespace/nsinit.c | 2 -
> src/acpica/source/components/namespace/nsload.c | 2 -
> src/acpica/source/components/namespace/nsnames.c | 2 -
> src/acpica/source/components/namespace/nsobject.c | 2 -
> src/acpica/source/components/namespace/nsparse.c | 2 -
> src/acpica/source/components/namespace/nsrepair.c | 2 -
> src/acpica/source/components/namespace/nsrepair2.c | 2 -
> src/acpica/source/components/namespace/nssearch.c | 2 -
> src/acpica/source/components/namespace/nsutils.c | 2 -
> src/acpica/source/components/namespace/nswalk.c | 2 -
> src/acpica/source/components/namespace/nsxfeval.c | 1 -
> src/acpica/source/components/namespace/nsxfname.c | 1 -
> src/acpica/source/components/namespace/nsxfobj.c | 1 -
> src/acpica/source/components/parser/psargs.c | 2 -
> src/acpica/source/components/parser/pstree.c | 2 -
> src/acpica/source/components/parser/psxface.c | 2 -
> src/acpica/source/components/resources/rsaddr.c | 2 -
> src/acpica/source/components/resources/rscalc.c | 2 -
> src/acpica/source/components/resources/rscreate.c | 2 -
> src/acpica/source/components/resources/rsdump.c | 2 -
> .../source/components/resources/rsdumpinfo.c | 2 -
> src/acpica/source/components/resources/rsinfo.c | 2 -
> src/acpica/source/components/resources/rsio.c | 2 -
> src/acpica/source/components/resources/rsirq.c | 2 -
> src/acpica/source/components/resources/rslist.c | 2 -
> src/acpica/source/components/resources/rsmemory.c | 2 -
> src/acpica/source/components/resources/rsmisc.c | 2 -
> src/acpica/source/components/resources/rsserial.c | 2 -
> src/acpica/source/components/resources/rsutils.c | 2 -
> src/acpica/source/components/resources/rsxface.c | 1 -
> src/acpica/source/components/tables/tbdata.c | 2 -
> src/acpica/source/components/tables/tbfadt.c | 2 -
> src/acpica/source/components/tables/tbfind.c | 2 -
> src/acpica/source/components/tables/tbinstal.c | 2 -
> src/acpica/source/components/tables/tbprint.c | 2 -
> src/acpica/source/components/tables/tbutils.c | 2 -
> src/acpica/source/components/tables/tbxface.c | 1 -
> src/acpica/source/components/tables/tbxfload.c | 1 -
> src/acpica/source/components/tables/tbxfroot.c | 2 -
> src/acpica/source/components/utilities/utaddress.c | 2 -
> src/acpica/source/components/utilities/utalloc.c | 2 -
> src/acpica/source/components/utilities/utbuffer.c | 2 -
> src/acpica/source/components/utilities/utcache.c | 2 -
> src/acpica/source/components/utilities/utcopy.c | 2 -
> src/acpica/source/components/utilities/utdebug.c | 1 -
> src/acpica/source/components/utilities/utdecode.c | 2 -
> src/acpica/source/components/utilities/utdelete.c | 2 -
> src/acpica/source/components/utilities/uterror.c | 2 -
> src/acpica/source/components/utilities/uteval.c | 2 -
> src/acpica/source/components/utilities/utexcep.c | 1 -
> src/acpica/source/components/utilities/utglobal.c | 1 -
> src/acpica/source/components/utilities/uthex.c | 2 -
> src/acpica/source/components/utilities/utids.c | 2 -
> src/acpica/source/components/utilities/utinit.c | 2 -
> src/acpica/source/components/utilities/utlock.c | 2 -
> src/acpica/source/components/utilities/utmath.c | 2 -
> src/acpica/source/components/utilities/utmisc.c | 2 -
> src/acpica/source/components/utilities/utmutex.c | 2 -
> src/acpica/source/components/utilities/utobject.c | 2 -
> src/acpica/source/components/utilities/utosi.c | 2 -
> src/acpica/source/components/utilities/utownerid.c | 2 -
> src/acpica/source/components/utilities/utpredef.c | 2 -
> src/acpica/source/components/utilities/utresrc.c | 4 +-
> src/acpica/source/components/utilities/utstate.c | 2 -
> src/acpica/source/components/utilities/utstring.c | 2 -
> src/acpica/source/components/utilities/uttrack.c | 2 -
> src/acpica/source/components/utilities/utuuid.c | 2 -
> src/acpica/source/components/utilities/utxface.c | 5 +-
> src/acpica/source/components/utilities/utxferror.c | 1 -
> src/acpica/source/components/utilities/utxfinit.c | 14 +-
> src/acpica/source/include/acbuffer.h | 14 +-
> src/acpica/source/include/acdisasm.h | 14 +-
> src/acpica/source/include/acglobal.h | 1 +
> src/acpica/source/include/aclocal.h | 3 +
> src/acpica/source/include/acpixf.h | 2 +-
> src/acpica/source/tools/acpiexec/aecommon.h | 11 +
> src/acpica/source/tools/acpiexec/aeinitfile.c | 298 ++
> 171 files changed, 8259 insertions(+), 423 deletions(-)
> create mode 100644 src/acpica/source/compiler/aslparser.y
> create mode 100644 src/acpica/source/compiler/aslprintf.c
> create mode 100644 src/acpica/source/compiler/aslprune.c
> create mode 100644 src/acpica/source/compiler/aslrules.y
> create mode 100644 src/acpica/source/compiler/aslsupport.y
> create mode 100644 src/acpica/source/compiler/asltokens.y
> create mode 100644 src/acpica/source/compiler/asltypes.y
> create mode 100644 src/acpica/source/components/disassembler/dmcstyle.c
> create mode 100644 src/acpica/source/tools/acpiexec/aeinitfile.c
>
> diff --git a/src/acpica/Makefile.am b/src/acpica/Makefile.am
> index 1889a3f..26cecfc 100644
> --- a/src/acpica/Makefile.am
> +++ b/src/acpica/Makefile.am
> @@ -82,6 +82,7 @@ libfwtsacpica_la_SOURCES = \
> source/components/debugger/dbconvert.c \
> source/components/debugger/dbtest.c \
> source/components/disassembler/dmbuffer.c \
> + source/components/disassembler/dmcstyle.c \
> source/components/disassembler/dmnames.c \
> source/components/disassembler/dmobject.c \
> source/components/disassembler/dmopcode.c \
> @@ -246,6 +247,7 @@ libfwtsacpica_la_SOURCES = \
> source/common/ahids.c \
> source/common/cmfsize.c \
> source/common/ahuuids.c \
> + source/tools/acpiexec/aeinitfile.c \
> source/tools/acpiexec/aehandlers.c \
> source/tools/acpiexec/aeregion.c
>
> diff --git a/src/acpica/source/common/adisasm.c b/src/acpica/source/common/adisasm.c
> index fe4e94e..85ae3d0 100644
> --- a/src/acpica/source/common/adisasm.c
> +++ b/src/acpica/source/common/adisasm.c
> @@ -616,12 +616,26 @@ AdDisassemblerHeader (
> {
> time_t Timer;
>
> +
> time (&Timer);
>
> /* Header and input table info */
>
> AcpiOsPrintf ("/*\n");
> - AcpiOsPrintf (ACPI_COMMON_HEADER ("AML Disassembler", " * "));
> + AcpiOsPrintf (ACPI_COMMON_HEADER (AML_DISASSEMBLER_NAME, " * "));
> +
> + if (AcpiGbl_CstyleDisassembly)
> + {
> + AcpiOsPrintf (
> + " * Disassembling to symbolic ASL+ operators\n"
> + " *\n");
> + }
> + else
> + {
> + AcpiOsPrintf (
> + " * Disassembling to non-symbolic legacy ASL operators\n"
> + " *\n");
> + }
>
> AcpiOsPrintf (" * Disassembly of %s, %s", Filename, ctime (&Timer));
> AcpiOsPrintf (" *\n");
> diff --git a/src/acpica/source/compiler/Makefile.am b/src/acpica/source/compiler/Makefile.am
> index dfec647..0812652 100644
> --- a/src/acpica/source/compiler/Makefile.am
> +++ b/src/acpica/source/compiler/Makefile.am
> @@ -14,25 +14,26 @@ AM_YFLAGS = -v -d -y
> #
> AM_LFLAGS = -i
>
> -aslcompilerparse.c: $(srcdir)/aslcompiler.y
> - ${YACC} ${AM_YFLAGS} -baslcompiler -pAslCompiler $^
> - mv aslcompiler.tab.c aslcompilerparse.c
> +aslcompiler.c: $(srcdir)/aslparser.y
> + m4 -P -I$(srcdir) $^ > aslcompiler.y
> + ${YACC} ${AM_YFLAGS} -baslcompiler -pAslCompiler aslcompiler.y
> + mv aslcompiler.tab.c aslcompiler.c
> mv aslcompiler.tab.h aslcompiler.y.h
>
> aslcompilerlex.c: $(srcdir)/aslcompiler.l
> ${LEX} ${AM_LFLAGS} -PAslCompiler -oaslcompilerlex.c $^
>
> -dtparserparse.c: $(srcdir)/dtparser.y
> +dtparser.c: $(srcdir)/dtparser.y
> ${YACC} ${AM_YFLAGS} -bdtparser -pDtParser $^
> - mv dtparser.tab.c dtparserparse.c
> + mv dtparser.tab.c dtparser.c
> mv dtparser.tab.h dtparser.y.h
>
> dtparserlex.c: $(srcdir)/dtparser.l
> ${LEX} ${AM_LFLAGS} -PDtParser -odtparserlex.c $^
>
> -prparserparse.c: $(srcdir)/prparser.y
> +prparser.c: $(srcdir)/prparser.y
> ${YACC} ${AM_YFLAGS} -bprparser -pPrParser $^
> - mv prparser.tab.c prparserparse.c
> + mv prparser.tab.c prparser.c
> mv prparser.tab.h prparser.y.h
>
> prparserlex.c: $(srcdir)/prparser.l
> @@ -40,11 +41,11 @@ prparserlex.c: $(srcdir)/prparser.l
>
> pkglib_LTLIBRARIES = libfwtsiasl.la
>
> -BUILT_SOURCES = aslcompilerparse.c \
> +BUILT_SOURCES = aslcompiler.c \
> aslcompilerlex.c \
> - dtparserparse.c \
> + dtparser.c \
> dtparserlex.c \
> - prparserparse.c \
> + prparser.c \
> prparserlex.c
>
> #
> @@ -52,9 +53,7 @@ BUILT_SOURCES = aslcompilerparse.c \
> #
> libfwtsiasl_la_LDFLAGS = -export-symbols-regex "fwts_.*" -lpthread -version-info 1:0:0
>
> -CLEANFILES = y.output y.tab.c y.tab.h aslcompiler.y.h \
> - aslcompilerparse.c aslcompilerlex.c \
> - dtparserparse.c dtparserlex.c
> +CLEANFILES = y.output y.tab.c y.tab.h aslcompiler.y.h $(BUILT_SOURCES)
>
> libfwtsiasl_la_CPPFLAGS = $(AM_CPPFLAGS)
> libfwtsiasl_la_SOURCES = \
> @@ -62,7 +61,7 @@ libfwtsiasl_la_SOURCES = \
> aslascii.c \
> aslcompile.c \
> aslcompilerlex.c \
> - aslcompilerparse.c \
> + aslcompiler.c \
> aslanalyze.c \
> aslcodegen.c \
> aslerror.c \
> @@ -104,6 +103,8 @@ libfwtsiasl_la_SOURCES = \
> asloffset.c \
> aslxref.c \
> aslprepkg.c \
> + aslprintf.c \
> + aslprune.c \
> dtfield.c \
> dtio.c \
> dtsubtable.c \
> @@ -112,9 +113,9 @@ libfwtsiasl_la_SOURCES = \
> dtutils.c \
> dtexpress.c \
> dtcompile.c \
> - dtparserparse.c \
> + dtparser.c \
> dtparserlex.c \
> - prparserparse.c \
> + prparser.c \
> prparserlex.c \
> prscan.c \
> aslrestype2s.c \
> @@ -145,6 +146,7 @@ libfwtsiasl_la_SOURCES = \
> ../components/utilities/utownerid.c \
> ../components/utilities/utexcep.c \
> ../components/utilities/utuuid.c \
> + ../components/utilities/utxfinit.c \
> ../components/namespace/nsaccess.c \
> ../components/namespace/nsalloc.c \
> ../components/namespace/nsdump.c \
> @@ -209,6 +211,7 @@ libfwtsiasl_la_SOURCES = \
> ../common/dmtbdump.c \
> ../components/debugger/dbfileio.c \
> ../components/disassembler/dmbuffer.c \
> + ../components/disassembler/dmcstyle.c \
> ../components/disassembler/dmnames.c \
> ../components/disassembler/dmopcode.c \
> ../components/disassembler/dmobject.c \
> @@ -224,5 +227,6 @@ libfwtsiasl_la_SOURCES = \
> ../components/tables/tbinstal.c \
> ../components/tables/tbutils.c \
> ../components/tables/tbxface.c \
> + ../tools/acpiexec/aeinitfile.c \
> ../os_specific/service_layers/osunixxf.c
>
> diff --git a/src/acpica/source/compiler/aslbtypes.c b/src/acpica/source/compiler/aslbtypes.c
> index bb80368..b7c5fbf 100644
> --- a/src/acpica/source/compiler/aslbtypes.c
> +++ b/src/acpica/source/compiler/aslbtypes.c
> @@ -446,6 +446,12 @@ AnGetBtype (
> UINT32 ThisNodeBtype = 0;
>
>
> + if (!Op)
> + {
> + AcpiOsPrintf ("Null Op in AnGetBtype\n");
> + return (ACPI_UINT32_MAX);
> + }
> +
> if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) ||
> (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) ||
> (Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
> diff --git a/src/acpica/source/compiler/aslcodegen.c b/src/acpica/source/compiler/aslcodegen.c
> index 77fc315..7c37abd 100644
> --- a/src/acpica/source/compiler/aslcodegen.c
> +++ b/src/acpica/source/compiler/aslcodegen.c
> @@ -179,6 +179,12 @@ CgGenerateAmlOutput (
>
> TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
> CgAmlWriteWalk, NULL, NULL);
> +
> + DbgPrint (ASL_TREE_OUTPUT,
> + "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr"
> + " Parent Child Next Flags AcTyp Final Col L\n",
> + 76, " ");
> +
> CgCloseTable ();
> }
>
> @@ -210,7 +216,8 @@ CgAmlWriteWalk (
> DbgPrint (ASL_TREE_OUTPUT,
> "Final parse tree used for AML output:\n");
> DbgPrint (ASL_TREE_OUTPUT,
> - "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr Child Parent Flags AcTyp Final Col L\n",
> + "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr"
> + " Parent Child Next Flags AcTyp Final Col L\n",
> 76, " ");
> }
>
> @@ -233,7 +240,8 @@ CgAmlWriteWalk (
> }
>
> DbgPrint (ASL_TREE_OUTPUT,
> - "%08X %04X %04X %01X %04X %04X %04X %04X %08X %08X %08X %08X %08X %04X %02d %02d\n",
> + "%08X %04X %04X %01X %04X %04X %04X %04X "
> + "%08X %08X %08X %08X %08X %08X %04X %02d %02d\n",
> /* 1 */ (UINT32) Op->Asl.Value.Integer,
> /* 2 */ Op->Asl.ParseOpcode,
> /* 3 */ Op->Asl.AmlOpcode,
> @@ -243,13 +251,14 @@ CgAmlWriteWalk (
> /* 7 */ Op->Asl.AmlSubtreeLength,
> /* 8 */ Op->Asl.Parent ? Op->Asl.Parent->Asl.AmlSubtreeLength : 0,
> /* 9 */ Op,
> - /* 10 */ Op->Asl.Child,
> - /* 11 */ Op->Asl.Parent,
> - /* 12 */ Op->Asl.CompileFlags,
> - /* 13 */ Op->Asl.AcpiBtype,
> - /* 14 */ Op->Asl.FinalAmlLength,
> - /* 15 */ Op->Asl.Column,
> - /* 16 */ Op->Asl.LineNumber);
> + /* 10 */ Op->Asl.Parent,
> + /* 11 */ Op->Asl.Child,
> + /* 12 */ Op->Asl.Next,
> + /* 13 */ Op->Asl.CompileFlags,
> + /* 14 */ Op->Asl.AcpiBtype,
> + /* 15 */ Op->Asl.FinalAmlLength,
> + /* 16 */ Op->Asl.Column,
> + /* 17 */ Op->Asl.LineNumber);
>
> /* Generate the AML for this node */
>
> diff --git a/src/acpica/source/compiler/aslcompile.c b/src/acpica/source/compiler/aslcompile.c
> index d6707fc..4dc0195 100644
> --- a/src/acpica/source/compiler/aslcompile.c
> +++ b/src/acpica/source/compiler/aslcompile.c
> @@ -219,6 +219,13 @@ CmDoCompile (
> Event = UtBeginEvent ("Flush source input");
> CmFlushSourceCode ();
>
> + /* Prune the parse tree if requested (debug purposes only) */
> +
> + if (Gbl_PruneParseTree)
> + {
> + AslPruneParseTree (Gbl_PruneDepth, Gbl_PruneType);
> + }
> +
> /* Optional parse tree dump, compiler debug output only */
>
> LsDumpParseTree ();
> diff --git a/src/acpica/source/compiler/aslcompiler.h b/src/acpica/source/compiler/aslcompiler.h
> index 0ad44d3..beb22d0 100644
> --- a/src/acpica/source/compiler/aslcompiler.h
> +++ b/src/acpica/source/compiler/aslcompiler.h
> @@ -615,6 +615,27 @@ OptOptimizeNamePath (
>
>
> /*
> + * aslprintf - Printf/Fprintf macros
> + */
> +void
> +OpcDoPrintf (
> + ACPI_PARSE_OBJECT *Op);
> +
> +void
> +OpcDoFprintf (
> + ACPI_PARSE_OBJECT *Op);
> +
> +
> +/*
> + * aslprune - parse tree pruner
> + */
> +void
> +AslPruneParseTree (
> + UINT32 PruneDepth,
> + UINT32 Type);
> +
> +
> +/*
> * aslcodegen - code generation
> */
> void
> @@ -756,6 +777,16 @@ TrCreateLeafNode (
> UINT32 ParseOpcode);
>
> ACPI_PARSE_OBJECT *
> +TrCreateAssignmentNode (
> + ACPI_PARSE_OBJECT *Target,
> + ACPI_PARSE_OBJECT *Source);
> +
> +ACPI_PARSE_OBJECT *
> +TrCreateTargetOperand (
> + ACPI_PARSE_OBJECT *OriginalOp,
> + ACPI_PARSE_OBJECT *ParentOp);
> +
> +ACPI_PARSE_OBJECT *
> TrCreateValuedLeafNode (
> UINT32 ParseOpcode,
> UINT64 Value);
> diff --git a/src/acpica/source/compiler/aslcompiler.l b/src/acpica/source/compiler/aslcompiler.l
> index 8171f13..cd07ef7 100644
> --- a/src/acpica/source/compiler/aslcompiler.l
> +++ b/src/acpica/source/compiler/aslcompiler.l
> @@ -189,7 +189,49 @@ NamePathTail [.]{NameSeg}
> else {yyterminate ();} }
> ";" { count (0); return(';'); }
>
> -
> + /* ASL Extension: Standard C operators */
> +
> +"~" { count (3); return (PARSEOP_EXP_NOT); }
> +"!" { count (3); return (PARSEOP_EXP_LOGICAL_NOT); }
> +"*" { count (3); return (PARSEOP_EXP_MULTIPLY); }
> +"/" { count (3); return (PARSEOP_EXP_DIVIDE); }
> +"%" { count (3); return (PARSEOP_EXP_MODULO); }
> +"+" { count (3); return (PARSEOP_EXP_ADD); }
> +"-" { count (3); return (PARSEOP_EXP_SUBTRACT); }
> +">>" { count (3); return (PARSEOP_EXP_SHIFT_RIGHT); }
> +"<<" { count (3); return (PARSEOP_EXP_SHIFT_LEFT); }
> +"<" { count (3); return (PARSEOP_EXP_LESS); }
> +">" { count (3); return (PARSEOP_EXP_GREATER); }
> +"&" { count (3); return (PARSEOP_EXP_AND); }
> +"<=" { count (3); return (PARSEOP_EXP_LESS_EQUAL); }
> +">=" { count (3); return (PARSEOP_EXP_GREATER_EQUAL); }
> +"==" { count (3); return (PARSEOP_EXP_EQUAL); }
> +"!=" { count (3); return (PARSEOP_EXP_NOT_EQUAL); }
> +"|" { count (3); return (PARSEOP_EXP_OR); }
> +"&&" { count (3); return (PARSEOP_EXP_LOGICAL_AND); }
> +"||" { count (3); return (PARSEOP_EXP_LOGICAL_OR); }
> +"++" { count (3); return (PARSEOP_EXP_INCREMENT); }
> +"--" { count (3); return (PARSEOP_EXP_DECREMENT); }
> +"^ " { count (3); return (PARSEOP_EXP_XOR); }
> +
> + /* ASL Extension: Standard C assignment operators */
> +
> +"=" { count (3); return (PARSEOP_EXP_EQUALS); }
> +"+=" { count (3); return (PARSEOP_EXP_ADD_EQ); }
> +"-=" { count (3); return (PARSEOP_EXP_SUB_EQ); }
> +"*=" { count (3); return (PARSEOP_EXP_MUL_EQ); }
> +"/=" { count (3); return (PARSEOP_EXP_DIV_EQ); }
> +"%=" { count (3); return (PARSEOP_EXP_MOD_EQ); }
> +"<<=" { count (3); return (PARSEOP_EXP_SHL_EQ); }
> +">>=" { count (3); return (PARSEOP_EXP_SHR_EQ); }
> +"&=" { count (3); return (PARSEOP_EXP_AND_EQ); }
> +"^=" { count (3); return (PARSEOP_EXP_XOR_EQ); }
> +"|=" { count (3); return (PARSEOP_EXP_OR_EQ); }
> +
> +
> + /*
> + * Begin standard ASL grammar
> + */
> 0[xX]{HexDigitChar}+ |
> {DigitChar}+ { AslCompilerlval.i = UtDoConstant ((char *) AslCompilertext);
> count (1); return (PARSEOP_INTEGER); }
> @@ -664,6 +706,44 @@ NamePathTail [.]{NameSeg}
> "Transfer8_16" { count (0); return (PARSEOP_XFERTYPE_8_16); }
> "Transfer16" { count (0); return (PARSEOP_XFERTYPE_16); }
>
> + /* ToPld macro */
> +
> +"ToPLD" { count (0); return (PARSEOP_TOPLD); }
> +
> +"PLD_Revision" { count (0); return (PARSEOP_PLD_REVISION); }
> +"PLD_IgnoreColor" { count (0); return (PARSEOP_PLD_IGNORECOLOR); }
> +"PLD_Red" { count (0); return (PARSEOP_PLD_RED); }
> +"PLD_Green" { count (0); return (PARSEOP_PLD_GREEN); }
> +"PLD_Blue" { count (0); return (PARSEOP_PLD_BLUE); }
> +"PLD_Width" { count (0); return (PARSEOP_PLD_WIDTH); }
> +"PLD_Height" { count (0); return (PARSEOP_PLD_HEIGHT); }
> +"PLD_UserVisible" { count (0); return (PARSEOP_PLD_USERVISIBLE); }
> +"PLD_Dock" { count (0); return (PARSEOP_PLD_DOCK); }
> +"PLD_Lid" { count (0); return (PARSEOP_PLD_LID); }
> +"PLD_Panel" { count (0); return (PARSEOP_PLD_PANEL); }
> +"PLD_VerticalPosition" { count (0); return (PARSEOP_PLD_VERTICALPOSITION); }
> +"PLD_HorizontalPosition" { count (0); return (PARSEOP_PLD_HORIZONTALPOSITION); }
> +"PLD_Shape" { count (0); return (PARSEOP_PLD_SHAPE); }
> +"PLD_GroupOrientation" { count (0); return (PARSEOP_PLD_GROUPORIENTATION); }
> +"PLD_GroupToken" { count (0); return (PARSEOP_PLD_GROUPTOKEN); }
> +"PLD_GroupPosition" { count (0); return (PARSEOP_PLD_GROUPPOSITION); }
> +"PLD_Bay" { count (0); return (PARSEOP_PLD_BAY); }
> +"PLD_Ejectable" { count (0); return (PARSEOP_PLD_EJECTABLE); }
> +"PLD_EjectRequired" { count (0); return (PARSEOP_PLD_EJECTREQUIRED); }
> +"PLD_CabinetNumber" { count (0); return (PARSEOP_PLD_CABINETNUMBER); }
> +"PLD_CardCageNumber" { count (0); return (PARSEOP_PLD_CARDCAGENUMBER); }
> +"PLD_Reference" { count (0); return (PARSEOP_PLD_REFERENCE); }
> +"PLD_Rotation" { count (0); return (PARSEOP_PLD_ROTATION); }
> +"PLD_Order" { count (0); return (PARSEOP_PLD_ORDER); }
> +"PLD_Reserved" { count (0); return (PARSEOP_PLD_RESERVED); }
> +"PLD_VerticalOffset" { count (0); return (PARSEOP_PLD_VERTICALOFFSET); }
> +"PLD_HorizontalOffset" { count (0); return (PARSEOP_PLD_HORIZONTALOFFSET); }
> +
> +
> + /* printf debug macros */
> +"printf" { count (0); return (PARSEOP_PRINTF); }
> +"fprintf" { count (0); return (PARSEOP_FPRINTF); }
> +
> /* Predefined compiler names */
>
> "__DATE__" { count (0); return (PARSEOP___DATE__); }
> @@ -700,10 +780,6 @@ NamePathTail [.]{NameSeg}
> DbgPrint (ASL_PARSE_OUTPUT, "NameString: %s\n", s);
> return (PARSEOP_NAMESTRING); }
>
> -"*" |
> -"/" { count (1);
> - AslCompilererror ("Parse error, expecting ASL keyword or name");}
> -
> . { count (1);
> sprintf (MsgBuffer,
> "Invalid character (0x%2.2X), expecting ASL keyword or name",
> diff --git a/src/acpica/source/compiler/aslcompiler.y b/src/acpica/source/compiler/aslcompiler.y
> index 25130bf..6472e1d 100644
> --- a/src/acpica/source/compiler/aslcompiler.y
> +++ b/src/acpica/source/compiler/aslcompiler.y
> @@ -1,7 +1,7 @@
> %{
> /******************************************************************************
> *
> - * Module Name: aslcompiler.y - Bison/Yacc input file (ASL grammar and actions)
> + * Module Name: aslparser.y - Master Bison/Yacc input file for iASL
> *
> *****************************************************************************/
>
> @@ -115,9 +115,6 @@
> *****************************************************************************/
>
> #include "aslcompiler.h"
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
> #include "acpi.h"
> #include "accommon.h"
>
> @@ -137,11 +134,15 @@
> * ResourceMacroList, and FieldUnitList
> */
>
> -void * AslLocalAllocate (unsigned int Size);
> +void *
> +AslLocalAllocate (
> + unsigned int Size);
>
> /* Bison/yacc configuration */
>
> #define static
> +#undef malloc
> +#define malloc AslLocalAllocate
> #undef alloca
> #define alloca AslLocalAllocate
> #define yytname AslCompilername
> @@ -149,22 +150,12 @@ void * AslLocalAllocate (unsigned int Size);
> #define YYINITDEPTH 600 /* State stack depth */
> #define YYDEBUG 1 /* Enable debug output */
> #define YYERROR_VERBOSE 1 /* Verbose error messages */
> +#define YYFLAG -32768
>
> /* Define YYMALLOC/YYFREE to prevent redefinition errors */
>
> -#define YYMALLOC malloc
> -#define YYFREE free
> -
> -/*
> - * The windows version of bison defines this incorrectly as "32768" (Not negative).
> - * We use a custom (edited binary) version of bison that defines YYFLAG as YYFBAD
> - * instead (#define YYFBAD 32768), so we can define it correctly here.
> - *
> - * The problem is that if YYFLAG is positive, the extended syntax error messages
> - * are disabled.
> - */
> -#define YYFLAG -32768
> -
> +#define YYMALLOC AslLocalAllocate
> +#define YYFREE ACPI_FREE
> %}
>
> /*
> @@ -176,13 +167,24 @@ void * AslLocalAllocate (unsigned int Size);
> ACPI_PARSE_OBJECT *n;
> }
>
> -/*! [Begin] no source code translation */
> -
> /*
> * These shift/reduce conflicts are expected. There should be zero
> * reduce/reduce conflicts.
> */
> -%expect 86
> +%expect 89
> +
> +/*! [Begin] no source code translation */
> +
> +/*
> + * The M4 macro processor is used to bring in the parser items,
> + * in order to keep this master file smaller, and to break up
> + * the various parser items.
> + */
> +
> +
> +/* Token types */
> +
> +
>
> /******************************************************************************
> *
> @@ -516,6 +518,88 @@ void * AslLocalAllocate (unsigned int Size);
> %token <i> PARSEOP_XOR
> %token <i> PARSEOP_ZERO
>
> +/* ToPld macro */
> +
> +%token <i> PARSEOP_TOPLD
> +%token <i> PARSEOP_PLD_REVISION
> +%token <i> PARSEOP_PLD_IGNORECOLOR
> +%token <i> PARSEOP_PLD_RED
> +%token <i> PARSEOP_PLD_GREEN
> +%token <i> PARSEOP_PLD_BLUE
> +%token <i> PARSEOP_PLD_WIDTH
> +%token <i> PARSEOP_PLD_HEIGHT
> +%token <i> PARSEOP_PLD_USERVISIBLE
> +%token <i> PARSEOP_PLD_DOCK
> +%token <i> PARSEOP_PLD_LID
> +%token <i> PARSEOP_PLD_PANEL
> +%token <i> PARSEOP_PLD_VERTICALPOSITION
> +%token <i> PARSEOP_PLD_HORIZONTALPOSITION
> +%token <i> PARSEOP_PLD_SHAPE
> +%token <i> PARSEOP_PLD_GROUPORIENTATION
> +%token <i> PARSEOP_PLD_GROUPTOKEN
> +%token <i> PARSEOP_PLD_GROUPPOSITION
> +%token <i> PARSEOP_PLD_BAY
> +%token <i> PARSEOP_PLD_EJECTABLE
> +%token <i> PARSEOP_PLD_EJECTREQUIRED
> +%token <i> PARSEOP_PLD_CABINETNUMBER
> +%token <i> PARSEOP_PLD_CARDCAGENUMBER
> +%token <i> PARSEOP_PLD_REFERENCE
> +%token <i> PARSEOP_PLD_ROTATION
> +%token <i> PARSEOP_PLD_ORDER
> +%token <i> PARSEOP_PLD_RESERVED
> +%token <i> PARSEOP_PLD_VERTICALOFFSET
> +%token <i> PARSEOP_PLD_HORIZONTALOFFSET
> +
> +/*
> + * C-style expression parser. These must appear after all of the
> + * standard ASL operators and keywords.
> + *
> + * Note: The order of these tokens implements the precedence rules
> + * (low precedence to high). See aslrules.y for an exhaustive list.
> + */
> +%right <i> PARSEOP_EXP_EQUALS
> + PARSEOP_EXP_ADD_EQ
> + PARSEOP_EXP_SUB_EQ
> + PARSEOP_EXP_MUL_EQ
> + PARSEOP_EXP_DIV_EQ
> + PARSEOP_EXP_MOD_EQ
> + PARSEOP_EXP_SHL_EQ
> + PARSEOP_EXP_SHR_EQ
> + PARSEOP_EXP_AND_EQ
> + PARSEOP_EXP_XOR_EQ
> + PARSEOP_EXP_OR_EQ
> +
> +%left <i> PARSEOP_EXP_LOGICAL_OR
> +%left <i> PARSEOP_EXP_LOGICAL_AND
> +%left <i> PARSEOP_EXP_OR
> +%left <i> PARSEOP_EXP_XOR
> +%left <i> PARSEOP_EXP_AND
> +%left <i> PARSEOP_EXP_EQUAL
> + PARSEOP_EXP_NOT_EQUAL
> +%left <i> PARSEOP_EXP_GREATER
> + PARSEOP_EXP_LESS
> + PARSEOP_EXP_GREATER_EQUAL
> + PARSEOP_EXP_LESS_EQUAL
> +%left <i> PARSEOP_EXP_SHIFT_RIGHT
> + PARSEOP_EXP_SHIFT_LEFT
> +%left <i> PARSEOP_EXP_ADD
> + PARSEOP_EXP_SUBTRACT
> +%left <i> PARSEOP_EXP_MULTIPLY
> + PARSEOP_EXP_DIVIDE
> + PARSEOP_EXP_MODULO
> +
> +%right <i> PARSEOP_EXP_NOT
> + PARSEOP_EXP_LOGICAL_NOT
> +
> +%left <i> PARSEOP_EXP_INCREMENT
> + PARSEOP_EXP_DECREMENT
> +
> +%token <i> PARSEOP_PRINTF
> +%token <i> PARSEOP_FPRINTF
> +/* Specific parentheses tokens are not used at this time */
> + /* PARSEOP_EXP_PAREN_OPEN */
> + /* PARSEOP_EXP_PAREN_CLOSE */
> +
> /*
> * Special functions. These should probably stay at the end of this
> * table.
> @@ -526,6 +610,10 @@ void * AslLocalAllocate (unsigned int Size);
> %token <i> PARSEOP___PATH__
>
>
> +/* Production types/names */
> +
> +
> +
> /******************************************************************************
> *
> * Production names
> @@ -767,8 +855,14 @@ void * AslLocalAllocate (unsigned int Size);
> %type <n> ResourceMacroList
> %type <n> ResourceMacroTerm
> %type <n> ResourceTemplateTerm
> +%type <n> PldKeyword
> +%type <n> PldKeywordList
> +%type <n> ToPLDTerm
> %type <n> ToUUIDTerm
> %type <n> UnicodeTerm
> +%type <n> PrintfArgList
> +%type <n> PrintfTerm
> +%type <n> FprintfTerm
>
> /* Resource Descriptors */
>
> @@ -862,7 +956,18 @@ void * AslLocalAllocate (unsigned int Size);
> %type <n> OptionalWordConstExpr
> %type <n> OptionalXferSize
>
> +/*
> + * C-style expression parser
> + */
> +%type <n> Expression
> +%type <n> EqualsTerm
> +
> %%
> +
> +/* Production rules */
> +
> +
> +
> /*******************************************************************************
> *
> * Production rules start here
> @@ -871,10 +976,7 @@ void * AslLocalAllocate (unsigned int Size);
>
> /*
> * ASL Names
> - */
> -
> -
> -/*
> + *
> * Root rule. Allow multiple #line directives before the definition block
> * to handle output from preprocessors
> */
> @@ -914,6 +1016,149 @@ DefinitionBlockTerm
> '{' TermList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$6,$8,$10,$12,$14,$18);}
> ;
>
> + /*
> + * ASL Extensions: C-style math/logical operators and expressions.
> + * The implementation transforms these operators into the standard
> + * AML opcodes and syntax.
> + *
> + * Supported operators and precedence rules (high-to-low)
> + *
> + * NOTE: The operator precedence and associativity rules are
> + * implemented by the tokens in asltokens.y
> + *
> + * (left-to-right):
> + * 1) ( ) expr++ expr--
> + *
> + * (right-to-left):
> + * 2) ! ~
> + *
> + * (left-to-right):
> + * 3) * / %
> + * 4) + -
> + * 5) >> <<
> + * 6) < > <= >=
> + * 7) == !=
> + * 8) &
> + * 9) ^
> + * 10) |
> + * 11) &&
> + * 12) ||
> + *
> + * (right-to-left):
> + * 13) = += -= *= /= %= <<= >>= &= ^= |=
> + */
> +Expression
> +
> + /* Unary operators */
> +
> + : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);}
> + TermArg {$$ = TrLinkChildren ($<n>2,1,$3);}
> + | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);}
> + TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateLeafNode (PARSEOP_ZERO));}
> +
> + | SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);}
> + {$$ = TrLinkChildren ($<n>3,1,$1);}
> + | SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);}
> + {$$ = TrLinkChildren ($<n>3,1,$1);}
> +
> + /* Binary operators: math and logical */
> +
> + | TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> + | TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
> + TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateLeafNode (PARSEOP_ZERO),
> + TrCreateLeafNode (PARSEOP_ZERO));}
> + | TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> + | TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> + | TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> + | TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> + | TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> +
> + | TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> + | TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> + | TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> +
> + | TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);}
> + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
> + | TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);}
> + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
> + | TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);}
> + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
> + | TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);}
> + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
> +
> + | TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);}
> + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
> + | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);}
> + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
> +
> + | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);}
> + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
> + | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);}
> + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
> +
> + /* Parentheses */
> +
> + | '(' TermArg ')' { $$ = $2;}
> + ;
> +
> +EqualsTerm
> +
> + /* All assignment-type operations */
> +
> + : SuperName PARSEOP_EXP_EQUALS
> + TermArg {$$ = TrCreateAssignmentNode ($1, $3);}
> +
> + | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
> + TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateLeafNode (PARSEOP_ZERO),
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> + ;
> +
> +
> /* ACPI 3.0 -- allow semicolons between terms */
>
> TermList
> @@ -926,6 +1171,7 @@ TermList
>
> Term
> : Object {}
> + | Expression {}
> | Type1Opcode {}
> | Type2Opcode {}
> | Type2IntegerOpcode {}
> @@ -1033,7 +1279,8 @@ Removed from TermArg due to reduce/reduce conflicts
> */
>
> TermArg
> - : Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
> + : Expression {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
> + | Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
> | DataObject {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
> | NameString {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
> | ArgTerm {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
> @@ -1127,6 +1374,7 @@ Type2Opcode
> | RefOfTerm {}
> | SizeOfTerm {}
> | StoreTerm {}
> + | EqualsTerm {}
> | TimerTerm {}
> | WaitTerm {}
> | UserTerm {}
> @@ -1184,6 +1432,8 @@ Type2BufferOpcode /* "Type5" Opcodes */
>
> Type2BufferOrStringOpcode
> : ConcatTerm {}
> + | PrintfTerm {}
> + | FprintfTerm {}
> | MidTerm {}
> ;
>
> @@ -1209,6 +1459,7 @@ Type4Opcode
> Type5Opcode
> : ResourceTemplateTerm {}
> | UnicodeTerm {}
> + | ToPLDTerm {}
> | ToUUIDTerm {}
> ;
>
> @@ -2192,6 +2443,86 @@ ToIntegerTerm
> error ')' {$$ = AslDoError(); yyclearin;}
> ;
>
> +PldKeyword
> + : PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);}
> + | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);}
> + | PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);}
> + | PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);}
> + | PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);}
> + | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);}
> + | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);}
> + | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);}
> + | PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);}
> + | PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);}
> + | PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);}
> + | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);}
> + | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);}
> + | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);}
> + | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);}
> + | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);}
> + | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);}
> + | PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);}
> + | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);}
> + | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);}
> + | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);}
> + | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);}
> + | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);}
> + | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);}
> + | PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);}
> + | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);}
> + | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);}
> + | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);}
> + ;
> +
> +PldKeywordList
> + : {$$ = NULL;}
> + | PldKeyword
> + PARSEOP_EXP_EQUALS Integer {$$ = TrLinkChildren ($1,1,$3);}
> + | PldKeyword
> + PARSEOP_EXP_EQUALS String {$$ = TrLinkChildren ($1,1,$3);}
> + | PldKeywordList ',' /* Allows a trailing comma at list end */
> + | PldKeywordList ','
> + PldKeyword
> + PARSEOP_EXP_EQUALS Integer {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));}
> + | PldKeywordList ','
> + PldKeyword
> + PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));}
> + ;
> +
> +ToPLDTerm
> + : PARSEOP_TOPLD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);}
> + PldKeywordList
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_TOPLD '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +PrintfArgList
> + : {$$ = NULL;}
> + | TermArg {$$ = $1;}
> + | PrintfArgList ','
> + TermArg {$$ = TrLinkPeerNode ($1, $3);}
> + ;
> +
> +PrintfTerm
> + : PARSEOP_PRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);}
> + StringData
> + PrintfArgList
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_PRINTF '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +FprintfTerm
> + : PARSEOP_FPRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);}
> + TermArg ','
> + StringData
> + PrintfArgList
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);}
> + | PARSEOP_FPRINTF '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> ToStringTerm
> : PARSEOP_TOSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);}
> TermArg
> @@ -3585,35 +3916,45 @@ OptionalXferSize
> ;
>
> %%
> +
> +/*! [End] no source code translation !*/
> +
> +/* Local support functions in C */
> +
> +
> +
> /******************************************************************************
> *
> * Local support functions
> *
> *****************************************************************************/
>
> +/*! [Begin] no source code translation */
> int
> AslCompilerwrap(void)
> {
> return (1);
> }
> -
> /*! [End] no source code translation !*/
>
> +
> void *
> -AslLocalAllocate (unsigned int Size)
> +AslLocalAllocate (
> + unsigned int Size)
> {
> void *Mem;
>
>
> - DbgPrint (ASL_PARSE_OUTPUT, "\nAslLocalAllocate: Expanding Stack to %u\n\n", Size);
> + DbgPrint (ASL_PARSE_OUTPUT,
> + "\nAslLocalAllocate: Expanding Stack to %u\n\n", Size);
>
> Mem = ACPI_ALLOCATE_ZEROED (Size);
> if (!Mem)
> {
> AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
> - Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
> - Gbl_InputByteCount, Gbl_CurrentColumn,
> - Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
> + Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
> + Gbl_InputByteCount, Gbl_CurrentColumn,
> + Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
> exit (1);
> }
>
> @@ -3621,12 +3962,11 @@ AslLocalAllocate (unsigned int Size)
> }
>
> ACPI_PARSE_OBJECT *
> -AslDoError (void)
> +AslDoError (
> + void)
> {
>
> -
> return (TrCreateLeafNode (PARSEOP_ERRORNODE));
> -
> }
>
>
> @@ -3657,3 +3997,4 @@ UtGetOpName (
> return ("[Unknown parser generator]");
> #endif
> }
> +
> diff --git a/src/acpica/source/compiler/asldefine.h b/src/acpica/source/compiler/asldefine.h
> index 8dfcd36..ae64af2 100644
> --- a/src/acpica/source/compiler/asldefine.h
> +++ b/src/acpica/source/compiler/asldefine.h
> @@ -121,8 +121,8 @@
> * Compiler versions and names
> */
> #define ASL_REVISION ACPI_CA_VERSION
> -#define ASL_COMPILER_NAME "ASL Optimizing Compiler"
> -#define AML_DISASSEMBLER_NAME "AML Disassembler"
> +#define ASL_COMPILER_NAME "ASL+ Optimizing Compiler"
> +#define AML_DISASSEMBLER_NAME "AML/ASL+ Disassembler"
> #define ASL_INVOCATION_NAME "iasl"
> #define ASL_CREATOR_ID "INTL"
>
> diff --git a/src/acpica/source/compiler/aslglobal.h b/src/acpica/source/compiler/aslglobal.h
> index 41c2ece..7c42e69 100644
> --- a/src/acpica/source/compiler/aslglobal.h
> +++ b/src/acpica/source/compiler/aslglobal.h
> @@ -245,6 +245,7 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseTemplates, FALSE
> 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);
>
>
> #define HEX_OUTPUT_NONE 0
> @@ -323,6 +324,8 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_NumNamespaceObjects, 0)
> ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ReservedMethods, 0);
> ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableSignature, "NO_SIG");
> ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableId, "NO_ID");
> +ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_PruneDepth, 0);
> +ASL_EXTERN UINT16 ASL_INIT_GLOBAL (Gbl_PruneType, 0);
>
>
> /* Static structures */
> diff --git a/src/acpica/source/compiler/aslload.c b/src/acpica/source/compiler/aslload.c
> index d88e94e..303fc4c 100644
> --- a/src/acpica/source/compiler/aslload.c
> +++ b/src/acpica/source/compiler/aslload.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __ASLLOAD_C__
> -
> #include "aslcompiler.h"
> #include "amlcode.h"
> #include "acdispat.h"
> diff --git a/src/acpica/source/compiler/aslmain.c b/src/acpica/source/compiler/aslmain.c
> index 120a21a..6097721 100644
> --- a/src/acpica/source/compiler/aslmain.c
> +++ b/src/acpica/source/compiler/aslmain.c
> @@ -259,13 +259,17 @@ Usage (
> ACPI_OPTION ("-db", "Do not translate Buffers to Resource Templates");
> ACPI_OPTION ("-dc <f1 f2 ...>", "Disassemble AML and immediately compile it");
> ACPI_OPTION ("", " (Obtain DSDT from current system if no input file)");
> + ACPI_OPTION ("-dl", "Emit legacy ASL code only (no C-style operators)");
> ACPI_OPTION ("-e <f1 f2 ...>", "Include ACPI table(s) for external symbol resolution");
> ACPI_OPTION ("-fe <file>", "Specify external symbol declaration file");
> ACPI_OPTION ("-in", "Ignore NoOp opcodes");
> ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file");
>
> printf ("\nDebug Options:\n");
> - ACPI_OPTION ("-bf -bt", "Create debug file (full or parse tree only) (*.txt)");
> + ACPI_OPTION ("-bf", "Create debug file (full output) (*.txt)");
> + ACPI_OPTION ("-bs", "Create debug file (parse tree only) (*.txt)");
> + ACPI_OPTION ("-bp <depth>", "Prune ASL parse tree");
> + ACPI_OPTION ("-bt <type>", "Object type to be pruned from the parse tree");
> ACPI_OPTION ("-f", "Ignore errors, force creation of AML output file(s)");
> ACPI_OPTION ("-m <size>", "Set internal line buffer size (in Kbytes)");
> ACPI_OPTION ("-n", "Parse only, no output generation");
> diff --git a/src/acpica/source/compiler/aslmap.c b/src/acpica/source/compiler/aslmap.c
> index f03a8cf..eebaeb3 100644
> --- a/src/acpica/source/compiler/aslmap.c
> +++ b/src/acpica/source/compiler/aslmap.c
> @@ -518,7 +518,38 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
> /* XFERTYPE_16 */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0),
> /* XOR */ OP_TABLE_ENTRY (AML_BIT_XOR_OP, 0, 0, ACPI_BTYPE_INTEGER),
> /* ZERO */ OP_TABLE_ENTRY (AML_ZERO_OP, 0, 0, ACPI_BTYPE_INTEGER),
> -
> +/* TOPLD */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_INTEGER),
> +/* XFERSIZE_128 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* REVISION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* IGNORECOLOR */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* RED */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* GREEN */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* BLUE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* WIDTH */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* HEIGHT */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* USERVISIBLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* DOCK */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* LID */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* PANEL */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* VERTICALPOSITION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* HORIZONTALPOSITION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* SHAPE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* GROUPORIENTATION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* GROUPTOKEN */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* GROUPPOSITION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* BAY */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* EJECTABLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* EJECTREQUIRED */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* CABINETNUMBER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* CARDCAGENUMBER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* REFERENCE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* ROTATION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* ORDER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* RESERVED */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* VERTICALOFFSET */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* HORIZONTALOFFSET */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
> +/* PRINTF */ OP_TABLE_ENTRY (AML_STORE_OP, 0, 0, ACPI_BTYPE_DATA_REFERENCE),
> +/* FPRINTF */ OP_TABLE_ENTRY (AML_STORE_OP, 0, 0, ACPI_BTYPE_DATA_REFERENCE),
> /*! [End] no source code translation !*/
>
> };
> diff --git a/src/acpica/source/compiler/aslopcodes.c b/src/acpica/source/compiler/aslopcodes.c
> index dbb7d33..b476b06 100644
> --- a/src/acpica/source/compiler/aslopcodes.c
> +++ b/src/acpica/source/compiler/aslopcodes.c
> @@ -140,9 +140,62 @@ OpcDoEisaId (
> ACPI_PARSE_OBJECT *Op);
>
> static void
> +OpcDoPld (
> + ACPI_PARSE_OBJECT *Op);
> +
> +static void
> OpcDoUuId (
> ACPI_PARSE_OBJECT *Op);
>
> +static UINT8 *
> +OpcEncodePldBuffer (
> + ACPI_PLD_INFO *PldInfo);
> +
> +
> +/* ToPld strings */
> +
> +static char *AslPldPanelList[] =
> +{
> + "TOP",
> + "BOTTOM",
> + "LEFT",
> + "RIGHT",
> + "FRONT",
> + "BACK",
> + "UNKNOWN",
> + NULL
> +};
> +
> +static char *AslPldVerticalPositionList[] =
> +{
> + "UPPER",
> + "CENTER",
> + "LOWER",
> + NULL
> +};
> +
> +static char *AslPldHorizontalPositionList[] =
> +{
> + "LEFT",
> + "CENTER",
> + "RIGHT",
> + NULL
> +};
> +
> +static char *AslPldShapeList[] =
> +{
> + "ROUND",
> + "OVAL",
> + "SQUARE",
> + "VERTICALRECTANGLE",
> + "HORIZONTALRECTANGLE",
> + "VERTICALTRAPEZOID",
> + "HORIZONTALTRAPEZOID",
> + "UNKNOWN",
> + "CHAMFERED",
> + NULL
> +};
> +
>
> /*******************************************************************************
> *
> @@ -725,9 +778,698 @@ OpcDoEisaId (
>
> /*******************************************************************************
> *
> + * FUNCTION: OpcEncodePldBuffer
> + *
> + * PARAMETERS: PldInfo - _PLD buffer struct (Using local struct)
> + *
> + * RETURN: Encode _PLD buffer suitable for return value from _PLD
> + *
> + * DESCRIPTION: Bit-packs a _PLD buffer struct.
> + *
> + ******************************************************************************/
> +
> +static UINT8 *
> +OpcEncodePldBuffer (
> + ACPI_PLD_INFO *PldInfo)
> +{
> + UINT32 *Buffer;
> + UINT32 Dword;
> +
> +
> + Buffer = ACPI_ALLOCATE_ZEROED (ACPI_PLD_BUFFER_SIZE);
> + if (!Buffer)
> + {
> + return (NULL);
> + }
> +
> + /* First 32 bits */
> +
> + Dword = 0;
> + ACPI_PLD_SET_REVISION (&Dword, PldInfo->Revision);
> + ACPI_PLD_SET_IGNORE_COLOR (&Dword, PldInfo->IgnoreColor);
> + ACPI_PLD_SET_RED (&Dword, PldInfo->Red);
> + ACPI_PLD_SET_GREEN (&Dword, PldInfo->Green);
> + ACPI_PLD_SET_BLUE (&Dword, PldInfo->Blue);
> + ACPI_MOVE_32_TO_32 (&Buffer[0], &Dword);
> +
> + /* Second 32 bits */
> +
> + Dword = 0;
> + ACPI_PLD_SET_WIDTH (&Dword, PldInfo->Width);
> + ACPI_PLD_SET_HEIGHT (&Dword, PldInfo->Height);
> + ACPI_MOVE_32_TO_32 (&Buffer[1], &Dword);
> +
> + /* Third 32 bits */
> +
> + Dword = 0;
> + ACPI_PLD_SET_USER_VISIBLE (&Dword, PldInfo->UserVisible);
> + ACPI_PLD_SET_DOCK (&Dword, PldInfo->Dock);
> + ACPI_PLD_SET_LID (&Dword, PldInfo->Lid);
> + ACPI_PLD_SET_PANEL (&Dword, PldInfo->Panel);
> + ACPI_PLD_SET_VERTICAL (&Dword, PldInfo->VerticalPosition);
> + ACPI_PLD_SET_HORIZONTAL (&Dword, PldInfo->HorizontalPosition);
> + ACPI_PLD_SET_SHAPE (&Dword, PldInfo->Shape);
> + ACPI_PLD_SET_ORIENTATION (&Dword, PldInfo->GroupOrientation);
> + ACPI_PLD_SET_TOKEN (&Dword, PldInfo->GroupToken);
> + ACPI_PLD_SET_POSITION (&Dword, PldInfo->GroupPosition);
> + ACPI_PLD_SET_BAY (&Dword, PldInfo->Bay);
> + ACPI_MOVE_32_TO_32 (&Buffer[2], &Dword);
> +
> + /* Fourth 32 bits */
> +
> + Dword = 0;
> + ACPI_PLD_SET_EJECTABLE (&Dword, PldInfo->Ejectable);
> + ACPI_PLD_SET_OSPM_EJECT (&Dword, PldInfo->OspmEjectRequired);
> + ACPI_PLD_SET_CABINET (&Dword, PldInfo->CabinetNumber);
> + ACPI_PLD_SET_CARD_CAGE (&Dword, PldInfo->CardCageNumber);
> + ACPI_PLD_SET_REFERENCE (&Dword, PldInfo->Reference);
> + ACPI_PLD_SET_ROTATION (&Dword, PldInfo->Rotation);
> + ACPI_PLD_SET_ORDER (&Dword, PldInfo->Order);
> + ACPI_MOVE_32_TO_32 (&Buffer[3], &Dword);
> +
> + if (PldInfo->Revision >= 2)
> + {
> + /* Fifth 32 bits */
> +
> + Dword = 0;
> + ACPI_PLD_SET_VERT_OFFSET (&Dword, PldInfo->VerticalOffset);
> + ACPI_PLD_SET_HORIZ_OFFSET (&Dword, PldInfo->HorizontalOffset);
> + ACPI_MOVE_32_TO_32 (&Buffer[4], &Dword);
> + }
> +
> + return (ACPI_CAST_PTR (UINT8, Buffer));
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: OpcStrupr (strupr)
> + *
> + * PARAMETERS: SrcString - The source string to convert
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Convert string to uppercase
> + *
> + * NOTE: This is not a POSIX function, so it appears here, not in utclib.c
> + *
> + ******************************************************************************/
> +
> +static void
> +OpcStrupr (
> + char *SrcString)
> +{
> + char *String;
> +
> +
> + if (!SrcString)
> + {
> + return;
> + }
> +
> + /* Walk entire string, uppercasing the letters */
> +
> + for (String = SrcString; *String; String++)
> + {
> + *String = (char) toupper ((int) *String);
> + }
> +
> + return;
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: OpcFindName
> + *
> + * PARAMETERS: List - Array of char strings to be searched
> + * Name - Char string to string for
> + * Index - Index value to set if found
> + *
> + * RETURN: TRUE if any names matched, FALSE otherwise
> + *
> + * DESCRIPTION: Match PLD name to value in lookup table. Sets Value to
> + * equivalent parameter value.
> + *
> + ******************************************************************************/
> +
> +static BOOLEAN
> +OpcFindName (
> + char **List,
> + char *Name,
> + UINT64 *Index)
> +{
> + char *Str;
> + UINT32 i;
> +
> +
> + OpcStrupr (Name);
> +
> + for (i = 0, Str = List[0]; Str; i++, Str = List[i])
> + {
> + if (!(ACPI_STRNCMP (Str, Name, ACPI_STRLEN (Name))))
> + {
> + *Index = i;
> + return (TRUE);
> + }
> + }
> +
> + return (FALSE);
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: OpcDoPld
> + *
> + * PARAMETERS: Op - Parse node
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Convert ToPLD macro to 20-byte buffer
> + *
> + ******************************************************************************/
> +
> +static void
> +OpcDoPld (
> + ACPI_PARSE_OBJECT *Op)
> +{
> + UINT8 *Buffer;
> + ACPI_PARSE_OBJECT *Node;
> + ACPI_PLD_INFO PldInfo;
> + ACPI_PARSE_OBJECT *NewOp;
> +
> +
> + if (!Op)
> + {
> + AslError(ASL_ERROR, ASL_MSG_NOT_EXIST, Op, NULL);
> + return;
> + }
> +
> + if (Op->Asl.ParseOpcode != PARSEOP_TOPLD)
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Op, NULL);
> + return;
> + }
> +
> + Buffer = UtLocalCalloc (ACPI_PLD_BUFFER_SIZE);
> + if (!Buffer)
> + {
> + AslError(ASL_ERROR, ASL_MSG_BUFFER_ALLOCATION, Op, NULL);
> + return;
> + }
> +
> + ACPI_MEMSET (&PldInfo, 0, sizeof (ACPI_PLD_INFO));
> +
> + Node = Op->Asl.Child;
> + while (Node)
> + {
> + switch (Node->Asl.ParseOpcode)
> + {
> + case PARSEOP_PLD_REVISION:
> +
> + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.Child->Asl.Value.Integer > 127)
> + {
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> +
> + PldInfo.Revision = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + break;
> +
> + case PARSEOP_PLD_IGNORECOLOR:
> +
> + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.Child->Asl.Value.Integer > 1)
> + {
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> +
> + PldInfo.IgnoreColor = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + break;
> +
> + case PARSEOP_PLD_RED:
> + case PARSEOP_PLD_GREEN:
> + case PARSEOP_PLD_BLUE:
> +
> + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
> + {
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.Child->Asl.Value.Integer > 255)
> + {
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.ParseOpcode == PARSEOP_PLD_RED)
> + {
> + PldInfo.Red = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + }
> + else if (Node->Asl.ParseOpcode == PARSEOP_PLD_GREEN)
> + {
> + PldInfo.Green = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + }
> + else /* PARSEOP_PLD_BLUE */
> + {
> + PldInfo.Blue = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + }
> + break;
> +
> + case PARSEOP_PLD_WIDTH:
> + case PARSEOP_PLD_HEIGHT:
> +
> + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.Child->Asl.Value.Integer > 65535)
> + {
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.ParseOpcode == PARSEOP_PLD_WIDTH)
> + {
> + PldInfo.Width = (UINT16) Node->Asl.Child->Asl.Value.Integer;
> + }
> + else /* PARSEOP_PLD_HEIGHT */
> + {
> + PldInfo.Height = (UINT16) Node->Asl.Child->Asl.Value.Integer;
> + }
> +
> + break;
> +
> + case PARSEOP_PLD_USERVISIBLE:
> + case PARSEOP_PLD_DOCK:
> + case PARSEOP_PLD_LID:
> +
> + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.Child->Asl.Value.Integer > 1)
> + {
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.ParseOpcode == PARSEOP_PLD_USERVISIBLE)
> + {
> + PldInfo.UserVisible = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + }
> + else if (Node->Asl.ParseOpcode == PARSEOP_PLD_DOCK)
> + {
> + PldInfo.Dock = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + }
> + else
> + {
> + PldInfo.Lid = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + }
> +
> + break;
> +
> + case PARSEOP_PLD_PANEL:
> +
> + if (Node->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER)
> + {
> + if (Node->Asl.Child->Asl.Value.Integer > 6)
> + {
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> + }
> + else /* PARSEOP_STRING */
> + {
> + if (!OpcFindName(AslPldPanelList,
> + Node->Asl.Child->Asl.Value.String,
> + &Node->Asl.Child->Asl.Value.Integer))
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Node, NULL);
> + break;
> + }
> + }
> +
> + PldInfo.Panel = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + break;
> +
> + case PARSEOP_PLD_VERTICALPOSITION:
> +
> + if (Node->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER)
> + {
> + if (Node->Asl.Child->Asl.Value.Integer > 2)
> + {
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> + }
> + else /* PARSEOP_STRING */
> + {
> + if (!OpcFindName(AslPldVerticalPositionList,
> + Node->Asl.Child->Asl.Value.String,
> + &Node->Asl.Child->Asl.Value.Integer))
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Node, NULL);
> + break;
> + }
> + }
> +
> + PldInfo.VerticalPosition = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + break;
> +
> + case PARSEOP_PLD_HORIZONTALPOSITION:
> +
> + if (Node->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER)
> + {
> + if (Node->Asl.Child->Asl.Value.Integer > 2)
> + {
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> + }
> + else /* PARSEOP_STRING */
> + {
> + if (!OpcFindName(AslPldHorizontalPositionList,
> + Node->Asl.Child->Asl.Value.String,
> + &Node->Asl.Child->Asl.Value.Integer))
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Node, NULL);
> + break;
> + }
> + }
> +
> + PldInfo.HorizontalPosition = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + break;
> +
> + case PARSEOP_PLD_SHAPE:
> +
> + if (Node->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER)
> + {
> + if (Node->Asl.Child->Asl.Value.Integer > 8)
> + {
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> + }
> + else /* PARSEOP_STRING */
> + {
> + if (!OpcFindName(AslPldShapeList,
> + Node->Asl.Child->Asl.Value.String,
> + &Node->Asl.Child->Asl.Value.Integer))
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Node, NULL);
> + break;
> + }
> + }
> +
> + PldInfo.Shape = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + break;
> +
> + case PARSEOP_PLD_GROUPORIENTATION:
> +
> + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.Child->Asl.Value.Integer > 1)
> + {
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> +
> + PldInfo.GroupOrientation = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + break;
> +
> + case PARSEOP_PLD_GROUPTOKEN:
> + case PARSEOP_PLD_GROUPPOSITION:
> +
> + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.Child->Asl.Value.Integer > 255)
> + {
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> +
> +
> + if (Node->Asl.ParseOpcode == PARSEOP_PLD_GROUPTOKEN)
> + {
> + PldInfo.GroupToken = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + }
> + else /* PARSEOP_PLD_GROUPPOSITION */
> + {
> + PldInfo.GroupPosition = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + }
> +
> + break;
> +
> + case PARSEOP_PLD_BAY:
> + case PARSEOP_PLD_EJECTABLE:
> + case PARSEOP_PLD_EJECTREQUIRED:
> +
> + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.Child->Asl.Value.Integer > 1)
> + {
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.ParseOpcode == PARSEOP_PLD_BAY)
> + {
> + PldInfo.Bay = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + }
> + else if (Node->Asl.ParseOpcode == PARSEOP_PLD_EJECTABLE)
> + {
> + PldInfo.Ejectable = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + }
> + else /* PARSEOP_PLD_EJECTREQUIRED */
> + {
> + PldInfo.OspmEjectRequired = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + }
> +
> + break;
> +
> + case PARSEOP_PLD_CABINETNUMBER:
> + case PARSEOP_PLD_CARDCAGENUMBER:
> +
> + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.Child->Asl.Value.Integer > 255)
> + {
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.ParseOpcode == PARSEOP_PLD_CABINETNUMBER)
> + {
> + PldInfo.CabinetNumber = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + }
> + else /* PARSEOP_PLD_CARDCAGENUMBER */
> + {
> + PldInfo.CardCageNumber = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + }
> +
> + break;
> +
> + case PARSEOP_PLD_REFERENCE:
> +
> + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.Child->Asl.Value.Integer > 1)
> + {
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> +
> + PldInfo.Reference = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + break;
> +
> + case PARSEOP_PLD_ROTATION:
> +
> + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.Child->Asl.Value.Integer > 7)
> + {
> + switch (Node->Asl.Child->Asl.Value.Integer)
> + {
> + case 45:
> +
> + Node->Asl.Child->Asl.Value.Integer = 1;
> + break;
> +
> + case 90:
> +
> + Node->Asl.Child->Asl.Value.Integer = 2;
> + break;
> +
> + case 135:
> +
> + Node->Asl.Child->Asl.Value.Integer = 3;
> + break;
> +
> + case 180:
> +
> + Node->Asl.Child->Asl.Value.Integer = 4;
> + break;
> +
> + case 225:
> +
> + Node->Asl.Child->Asl.Value.Integer = 5;
> + break;
> +
> + case 270:
> +
> + Node->Asl.Child->Asl.Value.Integer = 6;
> + break;
> +
> + case 315:
> +
> + Node->Asl.Child->Asl.Value.Integer = 7;
> + break;
> +
> + default:
> +
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> + }
> +
> + PldInfo.Rotation = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + break;
> +
> + case PARSEOP_PLD_ORDER:
> +
> + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.Child->Asl.Value.Integer > 31)
> + {
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> +
> + PldInfo.Order = (UINT8) Node->Asl.Child->Asl.Value.Integer;
> + break;
> +
> + case PARSEOP_PLD_VERTICALOFFSET:
> + case PARSEOP_PLD_HORIZONTALOFFSET:
> +
> + if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.Child->Asl.Value.Integer > 65535)
> + {
> + AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
> + break;
> + }
> +
> + if (Node->Asl.ParseOpcode == PARSEOP_PLD_VERTICALOFFSET)
> + {
> + PldInfo.VerticalOffset = (UINT16) Node->Asl.Child->Asl.Value.Integer;
> + }
> + else /* PARSEOP_PLD_HORIZONTALOFFSET */
> + {
> + PldInfo.HorizontalOffset = (UINT16) Node->Asl.Child->Asl.Value.Integer;
> + }
> +
> + break;
> +
> + default:
> +
> + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
> + break;
> + }
> +
> + Node = Node->Asl.Next;
> + }
> +
> + Buffer = OpcEncodePldBuffer(&PldInfo);
> +
> + /* Change Op to a Buffer */
> +
> + Op->Asl.ParseOpcode = PARSEOP_BUFFER;
> + Op->Common.AmlOpcode = AML_BUFFER_OP;
> +
> + /* Disable further optimization */
> +
> + Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
> + UtSetParseOpName (Op);
> +
> + /* Child node is the buffer length */
> +
> + NewOp = TrAllocateNode (PARSEOP_INTEGER);
> +
> + NewOp->Asl.AmlOpcode = AML_BYTE_OP;
> + NewOp->Asl.Value.Integer = 20;
> + NewOp->Asl.Parent = Op;
> +
> + Op->Asl.Child = NewOp;
> + Op = NewOp;
> +
> + /* Peer to the child is the raw buffer data */
> +
> + NewOp = TrAllocateNode (PARSEOP_RAW_DATA);
> + NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
> + NewOp->Asl.AmlLength = 20;
> + NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
> + NewOp->Asl.Parent = Op->Asl.Parent;
> +
> + Op->Asl.Next = NewOp;
> +}
> +
> +
> +/*******************************************************************************
> + *
> * FUNCTION: OpcDoUuId
> *
> - * PARAMETERS: Op - Parse node
> + * PARAMETERS: Op - Parse node
> *
> * RETURN: None
> *
> @@ -745,7 +1487,7 @@ OpcDoUuId (
> ACPI_PARSE_OBJECT *NewOp;
>
>
> - InString = (char *) Op->Asl.Value.String;
> + InString = ACPI_CAST_PTR (char, Op->Asl.Value.String);
> Buffer = UtLocalCalloc (16);
>
> Status = AuValidateUuid (InString);
> @@ -784,7 +1526,7 @@ OpcDoUuId (
> NewOp = TrAllocateNode (PARSEOP_RAW_DATA);
> NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
> NewOp->Asl.AmlLength = 16;
> - NewOp->Asl.Value.String = (char *) Buffer;
> + NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
> NewOp->Asl.Parent = Op->Asl.Parent;
>
> Op->Asl.Next = NewOp;
> @@ -795,7 +1537,7 @@ OpcDoUuId (
> *
> * FUNCTION: OpcGenerateAmlOpcode
> *
> - * PARAMETERS: Op - Parse node
> + * PARAMETERS: Op - Parse node
> *
> * RETURN: None
> *
> @@ -809,7 +1551,6 @@ void
> OpcGenerateAmlOpcode (
> ACPI_PARSE_OBJECT *Op)
> {
> -
> UINT16 Index;
>
>
> @@ -855,6 +1596,21 @@ OpcGenerateAmlOpcode (
> OpcDoEisaId (Op);
> break;
>
> + case PARSEOP_PRINTF:
> +
> + OpcDoPrintf (Op);
> + break;
> +
> + case PARSEOP_FPRINTF:
> +
> + OpcDoFprintf (Op);
> + break;
> +
> + case PARSEOP_TOPLD:
> +
> + OpcDoPld (Op);
> + break;
> +
> case PARSEOP_TOUUID:
>
> OpcDoUuId (Op);
> diff --git a/src/acpica/source/compiler/aslparser.y b/src/acpica/source/compiler/aslparser.y
> new file mode 100644
> index 0000000..f850672
> --- /dev/null
> +++ b/src/acpica/source/compiler/aslparser.y
> @@ -0,0 +1,203 @@
> +%{
> +/******************************************************************************
> + *
> + * Module Name: aslparser.y - Master Bison/Yacc input file for iASL
> + *
> + *****************************************************************************/
> +
> +/******************************************************************************
> + *
> + * 1. Copyright Notice
> + *
> + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
> + * All rights reserved.
> + *
> + * 2. License
> + *
> + * 2.1. This is your license from Intel Corp. under its intellectual property
> + * rights. You may have additional license terms from the party that provided
> + * you this software, covering your right to use that party's intellectual
> + * property rights.
> + *
> + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
> + * copy of the source code appearing in this file ("Covered Code") an
> + * irrevocable, perpetual, worldwide license under Intel's copyrights in the
> + * base code distributed originally by Intel ("Original Intel Code") to copy,
> + * make derivatives, distribute, use and display any portion of the Covered
> + * Code in any form, with the right to sublicense such rights; and
> + *
> + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
> + * license (with the right to sublicense), under only those claims of Intel
> + * patents that are infringed by the Original Intel Code, to make, use, sell,
> + * offer to sell, and import the Covered Code and derivative works thereof
> + * solely to the minimum extent necessary to exercise the above copyright
> + * license, and in no event shall the patent license extend to any additions
> + * to or modifications of the Original Intel Code. No other license or right
> + * is granted directly or by implication, estoppel or otherwise;
> + *
> + * The above copyright and patent license is granted only if the following
> + * conditions are met:
> + *
> + * 3. Conditions
> + *
> + * 3.1. Redistribution of Source with Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification with rights to further distribute source must include
> + * the above Copyright Notice, the above License, this list of Conditions,
> + * and the following Disclaimer and Export Compliance provision. In addition,
> + * Licensee must cause all Covered Code to which Licensee contributes to
> + * contain a file documenting the changes Licensee made to create that Covered
> + * Code and the date of any change. Licensee must include in that file the
> + * documentation of any changes made by any predecessor Licensee. Licensee
> + * must include a prominent statement that the modification is derived,
> + * directly or indirectly, from Original Intel Code.
> + *
> + * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification without rights to further distribute source must
> + * include the following Disclaimer and Export Compliance provision in the
> + * documentation and/or other materials provided with distribution. In
> + * addition, Licensee may not authorize further sublicense of source of any
> + * portion of the Covered Code, and must include terms to the effect that the
> + * license from Licensee to its licensee is limited to the intellectual
> + * property embodied in the software Licensee provides to its licensee, and
> + * not to intellectual property embodied in modifications its licensee may
> + * make.
> + *
> + * 3.3. Redistribution of Executable. Redistribution in executable form of any
> + * substantial portion of the Covered Code or modification must reproduce the
> + * above Copyright Notice, and the following Disclaimer and Export Compliance
> + * provision in the documentation and/or other materials provided with the
> + * distribution.
> + *
> + * 3.4. Intel retains all right, title, and interest in and to the Original
> + * Intel Code.
> + *
> + * 3.5. Neither the name Intel nor any other trademark owned or controlled by
> + * Intel shall be used in advertising or otherwise to promote the sale, use or
> + * other dealings in products derived from or relating to the Covered Code
> + * without prior written authorization from Intel.
> + *
> + * 4. Disclaimer and Export Compliance
> + *
> + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
> + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
> + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
> + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
> + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
> + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
> + * PARTICULAR PURPOSE.
> + *
> + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
> + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
> + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
> + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
> + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
> + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
> + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
> + * LIMITED REMEDY.
> + *
> + * 4.3. Licensee shall not export, either directly or indirectly, any of this
> + * software or system incorporating such software without first obtaining any
> + * required license or other approval from the U. S. Department of Commerce or
> + * any other agency or department of the United States Government. In the
> + * event Licensee exports any such software from the United States or
> + * re-exports any such software from a foreign destination, Licensee shall
> + * ensure that the distribution and export/re-export of the software is in
> + * compliance with all laws, regulations, orders, or other restrictions of the
> + * U.S. Export Administration Regulations. Licensee agrees that neither it nor
> + * any of its subsidiaries will export/re-export any technical data, process,
> + * software, or service, directly or indirectly, to any country for which the
> + * United States government or any agency thereof requires an export license,
> + * other governmental approval, or letter of assurance, without first obtaining
> + * such license, approval or letter.
> + *
> + *****************************************************************************/
> +
> +#include "aslcompiler.h"
> +#include "acpi.h"
> +#include "accommon.h"
> +
> +#define _COMPONENT ACPI_COMPILER
> + ACPI_MODULE_NAME ("aslparse")
> +
> +/*
> + * Global Notes:
> + *
> + * October 2005: The following list terms have been optimized (from the
> + * original ASL grammar in the ACPI specification) to force the immediate
> + * reduction of each list item so that the parse stack use doesn't increase on
> + * each list element and possibly overflow on very large lists (>4000 items).
> + * This dramatically reduces use of the parse stack overall.
> + *
> + * ArgList, TermList, Objectlist, ByteList, DWordList, PackageList,
> + * ResourceMacroList, and FieldUnitList
> + */
> +
> +void *
> +AslLocalAllocate (
> + unsigned int Size);
> +
> +/* Bison/yacc configuration */
> +
> +#define static
> +#undef malloc
> +#define malloc AslLocalAllocate
> +#undef alloca
> +#define alloca AslLocalAllocate
> +#define yytname AslCompilername
> +
> +#define YYINITDEPTH 600 /* State stack depth */
> +#define YYDEBUG 1 /* Enable debug output */
> +#define YYERROR_VERBOSE 1 /* Verbose error messages */
> +#define YYFLAG -32768
> +
> +/* Define YYMALLOC/YYFREE to prevent redefinition errors */
> +
> +#define YYMALLOC AslLocalAllocate
> +#define YYFREE ACPI_FREE
> +%}
> +
> +/*
> + * Declare the type of values in the grammar
> + */
> +%union {
> + UINT64 i;
> + char *s;
> + ACPI_PARSE_OBJECT *n;
> +}
> +
> +/*
> + * These shift/reduce conflicts are expected. There should be zero
> + * reduce/reduce conflicts.
> + */
> +%expect 89
> +
> +/*! [Begin] no source code translation */
> +
> +/*
> + * The M4 macro processor is used to bring in the parser items,
> + * in order to keep this master file smaller, and to break up
> + * the various parser items.
> + */
> +m4_define(NoEcho)
> +
> +/* Token types */
> +
> +m4_include(asltokens.y)
> +
> +/* Production types/names */
> +
> +m4_include(asltypes.y)
> +%%
> +
> +/* Production rules */
> +
> +m4_include(aslrules.y)
> +%%
> +
> +/*! [End] no source code translation !*/
> +
> +/* Local support functions in C */
> +
> +m4_include(aslsupport.y)
> diff --git a/src/acpica/source/compiler/aslprintf.c b/src/acpica/source/compiler/aslprintf.c
> new file mode 100644
> index 0000000..811bc92
> --- /dev/null
> +++ b/src/acpica/source/compiler/aslprintf.c
> @@ -0,0 +1,452 @@
> +/******************************************************************************
> + *
> + * Module Name: aslprintf - ASL Printf/Fprintf macro support
> + *
> + *****************************************************************************/
> +
> +/******************************************************************************
> + *
> + * 1. Copyright Notice
> + *
> + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
> + * All rights reserved.
> + *
> + * 2. License
> + *
> + * 2.1. This is your license from Intel Corp. under its intellectual property
> + * rights. You may have additional license terms from the party that provided
> + * you this software, covering your right to use that party's intellectual
> + * property rights.
> + *
> + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
> + * copy of the source code appearing in this file ("Covered Code") an
> + * irrevocable, perpetual, worldwide license under Intel's copyrights in the
> + * base code distributed originally by Intel ("Original Intel Code") to copy,
> + * make derivatives, distribute, use and display any portion of the Covered
> + * Code in any form, with the right to sublicense such rights; and
> + *
> + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
> + * license (with the right to sublicense), under only those claims of Intel
> + * patents that are infringed by the Original Intel Code, to make, use, sell,
> + * offer to sell, and import the Covered Code and derivative works thereof
> + * solely to the minimum extent necessary to exercise the above copyright
> + * license, and in no event shall the patent license extend to any additions
> + * to or modifications of the Original Intel Code. No other license or right
> + * is granted directly or by implication, estoppel or otherwise;
> + *
> + * The above copyright and patent license is granted only if the following
> + * conditions are met:
> + *
> + * 3. Conditions
> + *
> + * 3.1. Redistribution of Source with Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification with rights to further distribute source must include
> + * the above Copyright Notice, the above License, this list of Conditions,
> + * and the following Disclaimer and Export Compliance provision. In addition,
> + * Licensee must cause all Covered Code to which Licensee contributes to
> + * contain a file documenting the changes Licensee made to create that Covered
> + * Code and the date of any change. Licensee must include in that file the
> + * documentation of any changes made by any predecessor Licensee. Licensee
> + * must include a prominent statement that the modification is derived,
> + * directly or indirectly, from Original Intel Code.
> + *
> + * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification without rights to further distribute source must
> + * include the following Disclaimer and Export Compliance provision in the
> + * documentation and/or other materials provided with distribution. In
> + * addition, Licensee may not authorize further sublicense of source of any
> + * portion of the Covered Code, and must include terms to the effect that the
> + * license from Licensee to its licensee is limited to the intellectual
> + * property embodied in the software Licensee provides to its licensee, and
> + * not to intellectual property embodied in modifications its licensee may
> + * make.
> + *
> + * 3.3. Redistribution of Executable. Redistribution in executable form of any
> + * substantial portion of the Covered Code or modification must reproduce the
> + * above Copyright Notice, and the following Disclaimer and Export Compliance
> + * provision in the documentation and/or other materials provided with the
> + * distribution.
> + *
> + * 3.4. Intel retains all right, title, and interest in and to the Original
> + * Intel Code.
> + *
> + * 3.5. Neither the name Intel nor any other trademark owned or controlled by
> + * Intel shall be used in advertising or otherwise to promote the sale, use or
> + * other dealings in products derived from or relating to the Covered Code
> + * without prior written authorization from Intel.
> + *
> + * 4. Disclaimer and Export Compliance
> + *
> + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
> + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
> + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
> + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
> + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
> + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
> + * PARTICULAR PURPOSE.
> + *
> + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
> + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
> + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
> + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
> + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
> + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
> + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
> + * LIMITED REMEDY.
> + *
> + * 4.3. Licensee shall not export, either directly or indirectly, any of this
> + * software or system incorporating such software without first obtaining any
> + * required license or other approval from the U. S. Department of Commerce or
> + * any other agency or department of the United States Government. In the
> + * event Licensee exports any such software from the United States or
> + * re-exports any such software from a foreign destination, Licensee shall
> + * ensure that the distribution and export/re-export of the software is in
> + * compliance with all laws, regulations, orders, or other restrictions of the
> + * U.S. Export Administration Regulations. Licensee agrees that neither it nor
> + * any of its subsidiaries will export/re-export any technical data, process,
> + * software, or service, directly or indirectly, to any country for which the
> + * United States government or any agency thereof requires an export license,
> + * other governmental approval, or letter of assurance, without first obtaining
> + * such license, approval or letter.
> + *
> + *****************************************************************************/
> +
> +#include "aslcompiler.h"
> +#include "aslcompiler.y.h"
> +#include "amlcode.h"
> +
> +#define _COMPONENT ACPI_COMPILER
> + ACPI_MODULE_NAME ("aslprintf")
> +
> +
> +/* Local prototypes */
> +
> +static void
> +OpcCreateConcatenateNode (
> + ACPI_PARSE_OBJECT *Op,
> + ACPI_PARSE_OBJECT *Node);
> +
> +static void
> +OpcParsePrintf (
> + ACPI_PARSE_OBJECT *Op,
> + ACPI_PARSE_OBJECT *DestOp);
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: OpcDoPrintf
> + *
> + * PARAMETERS: Op - printf parse node
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Convert printf macro to a Store(..., Debug) AML operation.
> + *
> + ******************************************************************************/
> +
> +void
> +OpcDoPrintf (
> + ACPI_PARSE_OBJECT *Op)
> +{
> + ACPI_PARSE_OBJECT *DestOp;
> +
> +
> + /* Store destination is the Debug op */
> +
> + DestOp = TrAllocateNode (PARSEOP_DEBUG);
> + DestOp->Asl.AmlOpcode = AML_DEBUG_OP;
> + DestOp->Asl.Parent = Op;
> + DestOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
> +
> + OpcParsePrintf (Op, DestOp);
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: OpcDoFprintf
> + *
> + * PARAMETERS: Op - fprintf parse node
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Convert fprintf macro to a Store AML operation.
> + *
> + ******************************************************************************/
> +
> +void
> +OpcDoFprintf (
> + ACPI_PARSE_OBJECT *Op)
> +{
> + ACPI_PARSE_OBJECT *DestOp;
> +
> +
> + /* Store destination is the first argument of fprintf */
> +
> + DestOp = Op->Asl.Child;
> + Op->Asl.Child = DestOp->Asl.Next;
> + DestOp->Asl.Next = NULL;
> +
> + OpcParsePrintf (Op, DestOp);
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: OpcParsePrintf
> + *
> + * PARAMETERS: Op - Printf parse node
> + * DestOp - Destination of Store operation
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Convert printf macro to a Store AML operation. The printf
> + * macro parse tree is layed out as follows:
> + *
> + * Op - printf parse op
> + * Op->Child - Format string
> + * Op->Next - Format string arguments
> + *
> + ******************************************************************************/
> +
> +static void
> +OpcParsePrintf (
> + ACPI_PARSE_OBJECT *Op,
> + ACPI_PARSE_OBJECT *DestOp)
> +{
> + char *Format;
> + char *StartPosition = NULL;
> + ACPI_PARSE_OBJECT *ArgNode;
> + ACPI_PARSE_OBJECT *NextNode;
> + UINT32 StringLength = 0;
> + char *NewString;
> + BOOLEAN StringToProcess = FALSE;
> + ACPI_PARSE_OBJECT *NewOp;
> +
> +
> + /* Get format string */
> +
> + Format = ACPI_CAST_PTR (char, Op->Asl.Child->Asl.Value.String);
> + ArgNode = Op->Asl.Child->Asl.Next;
> +
> + /*
> + * Detach argument list so that we can use a NULL check to distinguish
> + * the first concatenation operation we need to make
> + */
> + Op->Asl.Child = NULL;
> +
> + for (; *Format; ++Format)
> + {
> + if (*Format != '%')
> + {
> + if (!StringToProcess)
> + {
> + /* Mark the beginning of a string */
> +
> + StartPosition = Format;
> + StringToProcess = TRUE;
> + }
> +
> + ++StringLength;
> + continue;
> + }
> +
> + /* Save string, if any, to new string object and concat it */
> +
> + if (StringToProcess)
> + {
> + NewString = UtStringCacheCalloc (StringLength + 1);
> + ACPI_STRNCPY (NewString, StartPosition, StringLength);
> +
> + NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
> + NewOp->Asl.Value.String = NewString;
> + NewOp->Asl.AmlOpcode = AML_STRING_OP;
> + NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
> + NewOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
> +
> + OpcCreateConcatenateNode(Op, NewOp);
> +
> + StringLength = 0;
> + StringToProcess = FALSE;
> + }
> +
> + ++Format;
> +
> + /*
> + * We have a format parameter and will need an argument to go
> + * with it
> + */
> + if (!ArgNode ||
> + ArgNode->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
> + {
> + AslError(ASL_ERROR, ASL_MSG_ARG_COUNT_LO, Op, NULL);
> + return;
> + }
> +
> + /*
> + * We do not support sub-specifiers of printf (flags, width,
> + * precision, length). For specifiers we only support %x/%X for
> + * hex or %s for strings. Also, %o for generic "acpi object".
> + */
> + switch (*Format)
> + {
> + case 's':
> +
> + if (ArgNode->Asl.ParseOpcode != PARSEOP_STRING_LITERAL)
> + {
> + AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgNode,
> + "String required");
> + return;
> + }
> +
> + NextNode = ArgNode->Asl.Next;
> + ArgNode->Asl.Next = NULL;
> + OpcCreateConcatenateNode(Op, ArgNode);
> + ArgNode = NextNode;
> + continue;
> +
> + case 'X':
> + case 'x':
> + case 'o':
> +
> + NextNode = ArgNode->Asl.Next;
> + ArgNode->Asl.Next = NULL;
> +
> + /*
> + * Append an empty string if the first argument is
> + * not a string. This will implicitly conver the 2nd
> + * concat source to a string per the ACPI specification.
> + */
> + if (!Op->Asl.Child)
> + {
> + NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
> + NewOp->Asl.Value.String = "";
> + NewOp->Asl.AmlOpcode = AML_STRING_OP;
> + NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
> + NewOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
> +
> + OpcCreateConcatenateNode(Op, NewOp);
> + }
> +
> + OpcCreateConcatenateNode(Op, ArgNode);
> + ArgNode = NextNode;
> + break;
> +
> + default:
> +
> + AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Op,
> + "Unrecognized format specifier");
> + continue;
> + }
> + }
> +
> + /* Process any remaining string */
> +
> + if (StringToProcess)
> + {
> + NewString = UtStringCacheCalloc (StringLength + 1);
> + ACPI_STRNCPY (NewString, StartPosition, StringLength);
> +
> + NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
> + NewOp->Asl.Value.String = NewString;
> + NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
> + NewOp->Asl.AmlOpcode = AML_STRING_OP;
> + NewOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
> +
> + OpcCreateConcatenateNode(Op, NewOp);
> + }
> +
> + /*
> + * If we get here and there's no child node then Format
> + * was an empty string. Just make a no op.
> + */
> + if (!Op->Asl.Child)
> + {
> + Op->Asl.ParseOpcode = PARSEOP_NOOP;
> + AslError(ASL_WARNING, ASL_MSG_NULL_STRING, Op,
> + "Converted to NOOP");
> + return;
> + }
> +
> + /* Check for erroneous extra arguments */
> +
> + if (ArgNode &&
> + ArgNode->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
> + {
> + AslError(ASL_WARNING, ASL_MSG_ARG_COUNT_HI, ArgNode,
> + "Extra arguments ignored");
> + }
> +
> + /* Change Op to a Store */
> +
> + Op->Asl.ParseOpcode = PARSEOP_STORE;
> + Op->Common.AmlOpcode = AML_STORE_OP;
> + Op->Asl.CompileFlags = 0;
> +
> + /* Disable further optimization */
> +
> + Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
> + UtSetParseOpName (Op);
> +
> + /* Set Store destination */
> +
> + Op->Asl.Child->Asl.Next = DestOp;
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: OpcCreateConcatenateNode
> + *
> + * PARAMETERS: Op - Parse node
> + * Node - Parse node to be concatenated
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Make Node the child of Op. If child node already exists, then
> + * concat child with Node and makes concat node the child of Op.
> + *
> + ******************************************************************************/
> +
> +static void
> +OpcCreateConcatenateNode (
> + ACPI_PARSE_OBJECT *Op,
> + ACPI_PARSE_OBJECT *Node)
> +{
> + ACPI_PARSE_OBJECT *NewConcatOp;
> +
> +
> + if (!Op->Asl.Child)
> + {
> + Op->Asl.Child = Node;
> + Node->Asl.Parent = Op;
> + return;
> + }
> +
> + NewConcatOp = TrAllocateNode (PARSEOP_CONCATENATE);
> + NewConcatOp->Asl.AmlOpcode = AML_CONCAT_OP;
> + NewConcatOp->Asl.AcpiBtype = 0x7;
> + NewConcatOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
> +
> + /* First arg is child of Op*/
> +
> + NewConcatOp->Asl.Child = Op->Asl.Child;
> + Op->Asl.Child->Asl.Parent = NewConcatOp;
> +
> + /* Second arg is Node */
> +
> + NewConcatOp->Asl.Child->Asl.Next = Node;
> + Node->Asl.Parent = NewConcatOp;
> +
> + /* Third arg is Zero (not used) */
> +
> + NewConcatOp->Asl.Child->Asl.Next->Asl.Next =
> + TrAllocateNode (PARSEOP_ZERO);
> + NewConcatOp->Asl.Child->Asl.Next->Asl.Next->Asl.Parent =
> + NewConcatOp;
> +
> + Op->Asl.Child = NewConcatOp;
> + NewConcatOp->Asl.Parent = Op;
> +}
> diff --git a/src/acpica/source/compiler/aslprune.c b/src/acpica/source/compiler/aslprune.c
> new file mode 100644
> index 0000000..163183b
> --- /dev/null
> +++ b/src/acpica/source/compiler/aslprune.c
> @@ -0,0 +1,311 @@
> +/******************************************************************************
> + *
> + * Module Name: aslprune - Parse tree prune utility
> + *
> + *****************************************************************************/
> +
> +/******************************************************************************
> + *
> + * 1. Copyright Notice
> + *
> + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
> + * All rights reserved.
> + *
> + * 2. License
> + *
> + * 2.1. This is your license from Intel Corp. under its intellectual property
> + * rights. You may have additional license terms from the party that provided
> + * you this software, covering your right to use that party's intellectual
> + * property rights.
> + *
> + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
> + * copy of the source code appearing in this file ("Covered Code") an
> + * irrevocable, perpetual, worldwide license under Intel's copyrights in the
> + * base code distributed originally by Intel ("Original Intel Code") to copy,
> + * make derivatives, distribute, use and display any portion of the Covered
> + * Code in any form, with the right to sublicense such rights; and
> + *
> + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
> + * license (with the right to sublicense), under only those claims of Intel
> + * patents that are infringed by the Original Intel Code, to make, use, sell,
> + * offer to sell, and import the Covered Code and derivative works thereof
> + * solely to the minimum extent necessary to exercise the above copyright
> + * license, and in no event shall the patent license extend to any additions
> + * to or modifications of the Original Intel Code. No other license or right
> + * is granted directly or by implication, estoppel or otherwise;
> + *
> + * The above copyright and patent license is granted only if the following
> + * conditions are met:
> + *
> + * 3. Conditions
> + *
> + * 3.1. Redistribution of Source with Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification with rights to further distribute source must include
> + * the above Copyright Notice, the above License, this list of Conditions,
> + * and the following Disclaimer and Export Compliance provision. In addition,
> + * Licensee must cause all Covered Code to which Licensee contributes to
> + * contain a file documenting the changes Licensee made to create that Covered
> + * Code and the date of any change. Licensee must include in that file the
> + * documentation of any changes made by any predecessor Licensee. Licensee
> + * must include a prominent statement that the modification is derived,
> + * directly or indirectly, from Original Intel Code.
> + *
> + * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification without rights to further distribute source must
> + * include the following Disclaimer and Export Compliance provision in the
> + * documentation and/or other materials provided with distribution. In
> + * addition, Licensee may not authorize further sublicense of source of any
> + * portion of the Covered Code, and must include terms to the effect that the
> + * license from Licensee to its licensee is limited to the intellectual
> + * property embodied in the software Licensee provides to its licensee, and
> + * not to intellectual property embodied in modifications its licensee may
> + * make.
> + *
> + * 3.3. Redistribution of Executable. Redistribution in executable form of any
> + * substantial portion of the Covered Code or modification must reproduce the
> + * above Copyright Notice, and the following Disclaimer and Export Compliance
> + * provision in the documentation and/or other materials provided with the
> + * distribution.
> + *
> + * 3.4. Intel retains all right, title, and interest in and to the Original
> + * Intel Code.
> + *
> + * 3.5. Neither the name Intel nor any other trademark owned or controlled by
> + * Intel shall be used in advertising or otherwise to promote the sale, use or
> + * other dealings in products derived from or relating to the Covered Code
> + * without prior written authorization from Intel.
> + *
> + * 4. Disclaimer and Export Compliance
> + *
> + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
> + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
> + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
> + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
> + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
> + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
> + * PARTICULAR PURPOSE.
> + *
> + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
> + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
> + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
> + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
> + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
> + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
> + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
> + * LIMITED REMEDY.
> + *
> + * 4.3. Licensee shall not export, either directly or indirectly, any of this
> + * software or system incorporating such software without first obtaining any
> + * required license or other approval from the U. S. Department of Commerce or
> + * any other agency or department of the United States Government. In the
> + * event Licensee exports any such software from the United States or
> + * re-exports any such software from a foreign destination, Licensee shall
> + * ensure that the distribution and export/re-export of the software is in
> + * compliance with all laws, regulations, orders, or other restrictions of the
> + * U.S. Export Administration Regulations. Licensee agrees that neither it nor
> + * any of its subsidiaries will export/re-export any technical data, process,
> + * software, or service, directly or indirectly, to any country for which the
> + * United States government or any agency thereof requires an export license,
> + * other governmental approval, or letter of assurance, without first obtaining
> + * such license, approval or letter.
> + *
> + *****************************************************************************/
> +
> +#include "aslcompiler.h"
> +#include "aslcompiler.y.h"
> +#include "acapps.h"
> +
> +#define _COMPONENT ACPI_COMPILER
> + ACPI_MODULE_NAME ("aslprune")
> +
> +
> +/* Local prototypes */
> +
> +static ACPI_STATUS
> +PrTreePruneWalk (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context);
> +
> +static void
> +PrPrintObjectAtLevel (
> + UINT32 Level,
> + const char *ObjectName);
> +
> +
> +typedef struct acpi_prune_info
> +{
> + UINT32 PruneLevel;
> + UINT16 ParseOpcode;
> + UINT16 Count;
> +
> +} ACPI_PRUNE_INFO;
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: AslPruneParseTree
> + *
> + * PARAMETERS: PruneDepth - Number of levels to prune
> + * Type - Prune type (Device, Method, etc.)
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Prune off one or more levels of the ASL parse tree
> + *
> + ******************************************************************************/
> +
> +void
> +AslPruneParseTree (
> + UINT32 PruneDepth,
> + UINT32 Type)
> +{
> + ACPI_PRUNE_INFO PruneObj;
> +
> +
> + PruneObj.PruneLevel = PruneDepth;
> + PruneObj.Count = 0;
> +
> + switch (Type)
> + {
> + case 0:
> + PruneObj.ParseOpcode = (UINT16) PARSEOP_DEVICE;
> + break;
> +
> + case 1:
> + PruneObj.ParseOpcode = (UINT16) PARSEOP_METHOD;
> + break;
> +
> + case 2:
> + PruneObj.ParseOpcode = (UINT16) PARSEOP_IF;
> + break;
> +
> + default:
> + AcpiOsPrintf ("Unsupported type: %u\n", Type);
> + return;
> + }
> +
> + AcpiOsPrintf ("Pruning parse tree, from depth %u\n",
> + PruneDepth);
> +
> + AcpiOsPrintf ("\nRemoving Objects:\n");
> +
> + TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
> + PrTreePruneWalk, NULL, ACPI_CAST_PTR (void, &PruneObj));
> +
> + AcpiOsPrintf ("\n%u Total Objects Removed\n", PruneObj.Count);
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: PrPrintObjectAtLevel
> + *
> + * PARAMETERS: Level - Current nesting level
> + * ObjectName - ACPI name for the object
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Print object name with indent
> + *
> + ******************************************************************************/
> +
> +static void
> +PrPrintObjectAtLevel (
> + UINT32 Level,
> + const char *ObjectName)
> +{
> + UINT32 i;
> +
> +
> + for (i = 0; i < Level; i++)
> + {
> + AcpiOsPrintf (" ");
> + }
> +
> + AcpiOsPrintf ("[%s] at Level [%u]\n", ObjectName, Level);
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: PrTreePruneWalk
> + *
> + * PARAMETERS: Parse tree walk callback
> + *
> + * RETURN: Status
> + *
> + * DESCRIPTION: Prune off one or more levels of the ASL parse tree
> + *
> + * Current objects that can be pruned are: Devices, Methods, and If/Else
> + * blocks.
> + *
> + ******************************************************************************/
> +
> +static ACPI_STATUS
> +PrTreePruneWalk (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context)
> +{
> + ACPI_PRUNE_INFO *PruneObj = (ACPI_PRUNE_INFO *) Context;
> +
> +
> + /* We only care about objects below the Prune Level threshold */
> +
> + if (Level <= PruneObj->PruneLevel)
> + {
> + return (AE_OK);
> + }
> +
> + if ((Op->Asl.ParseOpcode != PruneObj->ParseOpcode) &&
> + !(Op->Asl.ParseOpcode == PARSEOP_ELSE &&
> + PruneObj->ParseOpcode == PARSEOP_IF))
> + {
> + return (AE_OK);
> + }
> +
> + switch (Op->Asl.ParseOpcode)
> + {
> + case PARSEOP_METHOD:
> +
> + AcpiOsPrintf ("Method");
> + PrPrintObjectAtLevel (Level, Op->Asl.Child->Asl.Value.Name);
> + Op->Asl.Child->Asl.Next->Asl.Next->Asl.Next->Asl.Next->Asl.Next->Asl.Next = NULL;
> + PruneObj->Count++;
> + break;
> +
> + case PARSEOP_DEVICE:
> +
> + AcpiOsPrintf ("Device");
> + PrPrintObjectAtLevel (Level, Op->Asl.Child->Asl.Value.Name);
> + Op->Asl.Child->Asl.Next = NULL;
> + PruneObj->Count++;
> + break;
> +
> + case PARSEOP_IF:
> + case PARSEOP_ELSE:
> +
> + if (Op->Asl.ParseOpcode == PARSEOP_ELSE)
> + {
> + PrPrintObjectAtLevel(Level, "Else");
> + Op->Asl.Child = NULL;
> + }
> + else
> + {
> + PrPrintObjectAtLevel(Level, "If");
> + Op->Asl.Child->Asl.Next = NULL;
> + }
> +
> + PruneObj->Count++;
> + break;
> +
> + default:
> +
> + break;
> + }
> +
> + return (AE_OK);
> +}
> diff --git a/src/acpica/source/compiler/aslrules.y b/src/acpica/source/compiler/aslrules.y
> new file mode 100644
> index 0000000..3e794ab
> --- /dev/null
> +++ b/src/acpica/source/compiler/aslrules.y
> @@ -0,0 +1,3064 @@
> +NoEcho('
> +/******************************************************************************
> + *
> + * Module Name: aslrules.y - Bison/Yacc production rules
> + *
> + *****************************************************************************/
> +
> +/******************************************************************************
> + *
> + * 1. Copyright Notice
> + *
> + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
> + * All rights reserved.
> + *
> + * 2. License
> + *
> + * 2.1. This is your license from Intel Corp. under its intellectual property
> + * rights. You may have additional license terms from the party that provided
> + * you this software, covering your right to use that party's intellectual
> + * property rights.
> + *
> + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
> + * copy of the source code appearing in this file ("Covered Code") an
> + * irrevocable, perpetual, worldwide license under Intel's copyrights in the
> + * base code distributed originally by Intel ("Original Intel Code") to copy,
> + * make derivatives, distribute, use and display any portion of the Covered
> + * Code in any form, with the right to sublicense such rights; and
> + *
> + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
> + * license (with the right to sublicense), under only those claims of Intel
> + * patents that are infringed by the Original Intel Code, to make, use, sell,
> + * offer to sell, and import the Covered Code and derivative works thereof
> + * solely to the minimum extent necessary to exercise the above copyright
> + * license, and in no event shall the patent license extend to any additions
> + * to or modifications of the Original Intel Code. No other license or right
> + * is granted directly or by implication, estoppel or otherwise;
> + *
> + * The above copyright and patent license is granted only if the following
> + * conditions are met:
> + *
> + * 3. Conditions
> + *
> + * 3.1. Redistribution of Source with Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification with rights to further distribute source must include
> + * the above Copyright Notice, the above License, this list of Conditions,
> + * and the following Disclaimer and Export Compliance provision. In addition,
> + * Licensee must cause all Covered Code to which Licensee contributes to
> + * contain a file documenting the changes Licensee made to create that Covered
> + * Code and the date of any change. Licensee must include in that file the
> + * documentation of any changes made by any predecessor Licensee. Licensee
> + * must include a prominent statement that the modification is derived,
> + * directly or indirectly, from Original Intel Code.
> + *
> + * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification without rights to further distribute source must
> + * include the following Disclaimer and Export Compliance provision in the
> + * documentation and/or other materials provided with distribution. In
> + * addition, Licensee may not authorize further sublicense of source of any
> + * portion of the Covered Code, and must include terms to the effect that the
> + * license from Licensee to its licensee is limited to the intellectual
> + * property embodied in the software Licensee provides to its licensee, and
> + * not to intellectual property embodied in modifications its licensee may
> + * make.
> + *
> + * 3.3. Redistribution of Executable. Redistribution in executable form of any
> + * substantial portion of the Covered Code or modification must reproduce the
> + * above Copyright Notice, and the following Disclaimer and Export Compliance
> + * provision in the documentation and/or other materials provided with the
> + * distribution.
> + *
> + * 3.4. Intel retains all right, title, and interest in and to the Original
> + * Intel Code.
> + *
> + * 3.5. Neither the name Intel nor any other trademark owned or controlled by
> + * Intel shall be used in advertising or otherwise to promote the sale, use or
> + * other dealings in products derived from or relating to the Covered Code
> + * without prior written authorization from Intel.
> + *
> + * 4. Disclaimer and Export Compliance
> + *
> + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
> + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
> + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
> + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
> + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
> + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
> + * PARTICULAR PURPOSE.
> + *
> + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
> + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
> + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
> + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
> + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
> + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
> + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
> + * LIMITED REMEDY.
> + *
> + * 4.3. Licensee shall not export, either directly or indirectly, any of this
> + * software or system incorporating such software without first obtaining any
> + * required license or other approval from the U. S. Department of Commerce or
> + * any other agency or department of the United States Government. In the
> + * event Licensee exports any such software from the United States or
> + * re-exports any such software from a foreign destination, Licensee shall
> + * ensure that the distribution and export/re-export of the software is in
> + * compliance with all laws, regulations, orders, or other restrictions of the
> + * U.S. Export Administration Regulations. Licensee agrees that neither it nor
> + * any of its subsidiaries will export/re-export any technical data, process,
> + * software, or service, directly or indirectly, to any country for which the
> + * United States government or any agency thereof requires an export license,
> + * other governmental approval, or letter of assurance, without first obtaining
> + * such license, approval or letter.
> + *
> + *****************************************************************************/
> +
> +')
> +
> +/*******************************************************************************
> + *
> + * Production rules start here
> + *
> + ******************************************************************************/
> +
> +/*
> + * ASL Names
> + *
> + * Root rule. Allow multiple #line directives before the definition block
> + * to handle output from preprocessors
> + */
> +ASLCode
> + : DefinitionBlockTerm
> + | error {YYABORT; $$ = NULL;}
> + ;
> +
> +/*
> + * Blocks, Data, and Opcodes
> + */
> +
> +/*
> + * Note concerning support for "module-level code".
> + *
> + * ACPI 1.0 allowed Type1 and Type2 executable opcodes outside of control
> + * methods (the so-called module-level code.) This support was explicitly
> + * removed in ACPI 2.0, but this type of code continues to be created by
> + * BIOS vendors. In order to support the disassembly and recompilation of
> + * such code (and the porting of ASL code to iASL), iASL supports this
> + * code in violation of the current ACPI specification.
> + *
> + * The grammar change to support module-level code is to revert the
> + * {ObjectList} portion of the DefinitionBlockTerm in ACPI 2.0 to the
> + * original use of {TermList} instead (see below.) This allows the use
> + * of Type1 and Type2 opcodes at module level.
> + */
> +DefinitionBlockTerm
> + : PARSEOP_DEFINITIONBLOCK '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITIONBLOCK);}
> + String ','
> + String ','
> + ByteConst ','
> + String ','
> + String ','
> + DWordConst
> + ')' {TrSetEndLineNumber ($<n>3);}
> + '{' TermList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$6,$8,$10,$12,$14,$18);}
> + ;
> +
> + /*
> + * ASL Extensions: C-style math/logical operators and expressions.
> + * The implementation transforms these operators into the standard
> + * AML opcodes and syntax.
> + *
> + * Supported operators and precedence rules (high-to-low)
> + *
> + * NOTE: The operator precedence and associativity rules are
> + * implemented by the tokens in asltokens.y
> + *
> + * (left-to-right):
> + * 1) ( ) expr++ expr--
> + *
> + * (right-to-left):
> + * 2) ! ~
> + *
> + * (left-to-right):
> + * 3) * / %
> + * 4) + -
> + * 5) >> <<
> + * 6) < > <= >=
> + * 7) == !=
> + * 8) &
> + * 9) ^
> + * 10) |
> + * 11) &&
> + * 12) ||
> + *
> + * (right-to-left):
> + * 13) = += -= *= /= %= <<= >>= &= ^= |=
> + */
> +Expression
> +
> + /* Unary operators */
> +
> + : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);}
> + TermArg {$$ = TrLinkChildren ($<n>2,1,$3);}
> + | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);}
> + TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateLeafNode (PARSEOP_ZERO));}
> +
> + | SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);}
> + {$$ = TrLinkChildren ($<n>3,1,$1);}
> + | SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);}
> + {$$ = TrLinkChildren ($<n>3,1,$1);}
> +
> + /* Binary operators: math and logical */
> +
> + | TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> + | TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
> + TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateLeafNode (PARSEOP_ZERO),
> + TrCreateLeafNode (PARSEOP_ZERO));}
> + | TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> + | TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> + | TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> + | TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> + | TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> +
> + | TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> + | TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> + | TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
> +
> + | TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);}
> + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
> + | TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);}
> + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
> + | TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);}
> + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
> + | TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);}
> + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
> +
> + | TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);}
> + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
> + | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);}
> + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
> +
> + | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);}
> + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
> + | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);}
> + TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
> +
> + /* Parentheses */
> +
> + | '(' TermArg ')' { $$ = $2;}
> + ;
> +
> +EqualsTerm
> +
> + /* All assignment-type operations */
> +
> + : SuperName PARSEOP_EXP_EQUALS
> + TermArg {$$ = TrCreateAssignmentNode ($1, $3);}
> +
> + | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
> + TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateLeafNode (PARSEOP_ZERO),
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> +
> + | TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
> + TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
> + TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
> + ;
> +
> +
> +/* ACPI 3.0 -- allow semicolons between terms */
> +
> +TermList
> + : {$$ = NULL;}
> + | TermList Term {$$ = TrLinkPeerNode (TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$2);}
> + | TermList Term ';' {$$ = TrLinkPeerNode (TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$2);}
> + | TermList ';' Term {$$ = TrLinkPeerNode (TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$3);}
> + | TermList ';' Term ';' {$$ = TrLinkPeerNode (TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$3);}
> + ;
> +
> +Term
> + : Object {}
> + | Expression {}
> + | Type1Opcode {}
> + | Type2Opcode {}
> + | Type2IntegerOpcode {}
> + | Type2StringOpcode {}
> + | Type2BufferOpcode {}
> + | Type2BufferOrStringOpcode {}
> + | error {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +CompilerDirective
> + : IncludeTerm {}
> + | ExternalTerm {}
> + ;
> +
> +ObjectList
> + : {$$ = NULL;}
> + | ObjectList Object {$$ = TrLinkPeerNode ($1,$2);}
> + | error {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +Object
> + : CompilerDirective {}
> + | NamedObject {}
> + | NameSpaceModifier {}
> + ;
> +
> +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 {}
> + ;
> +
> +NamedObject
> + : BankFieldTerm {}
> + | CreateBitFieldTerm {}
> + | CreateByteFieldTerm {}
> + | CreateDWordFieldTerm {}
> + | CreateFieldTerm {}
> + | CreateQWordFieldTerm {}
> + | CreateWordFieldTerm {}
> + | DataRegionTerm {}
> + | DeviceTerm {}
> + | EventTerm {}
> + | FieldTerm {}
> + | FunctionTerm {}
> + | IndexFieldTerm {}
> + | MethodTerm {}
> + | MutexTerm {}
> + | OpRegionTerm {}
> + | PowerResTerm {}
> + | ProcessorTerm {}
> + | ThermalZoneTerm {}
> + ;
> +
> +NameSpaceModifier
> + : AliasTerm {}
> + | NameTerm {}
> + | ScopeTerm {}
> + ;
> +
> +UserTerm
> + : NameString '(' {TrUpdateNode (PARSEOP_METHODCALL, $1);}
> + ArgList ')' {$$ = TrLinkChildNode ($1,$4);}
> + ;
> +
> +ArgList
> + : {$$ = NULL;}
> + | TermArg
> + | ArgList ',' /* Allows a trailing comma at list end */
> + | ArgList ','
> + TermArg {$$ = TrLinkPeerNode ($1,$3);}
> + ;
> +
> +/*
> +Removed from TermArg due to reduce/reduce conflicts
> + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
> + | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
> + | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
> + | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
> +
> +*/
> +
> +TermArg
> + : Expression {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
> + | Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
> + | DataObject {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
> + | NameString {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
> + | ArgTerm {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
> + | LocalTerm {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
> + ;
> +
> +Target
> + : {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_TARGET | NODE_COMPILE_TIME_CONST);} /* Placeholder is a ZeroOp object */
> + | ',' {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_TARGET | NODE_COMPILE_TIME_CONST);} /* Placeholder is a ZeroOp object */
> + | ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);}
> + ;
> +
> +RequiredTarget
> + : ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);}
> + ;
> +
> +SimpleTarget
> + : NameString {}
> + | LocalTerm {}
> + | ArgTerm {}
> + ;
> +
> +/* Rules for specifying the type of one method argument or return value */
> +
> +ParameterTypePackage
> + : {$$ = NULL;}
> + | ObjectTypeKeyword {$$ = $1;}
> + | ParameterTypePackage ','
> + ObjectTypeKeyword {$$ = TrLinkPeerNodes (2,$1,$3);}
> + ;
> +
> +ParameterTypePackageList
> + : {$$ = NULL;}
> + | ObjectTypeKeyword {$$ = $1;}
> + | '{' ParameterTypePackage '}' {$$ = $2;}
> + ;
> +
> +OptionalParameterTypePackage
> + : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);}
> + | ',' ParameterTypePackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);}
> + ;
> +
> +/* Rules for specifying the types for method arguments */
> +
> +ParameterTypesPackage
> + : ParameterTypePackageList {$$ = $1;}
> + | ParameterTypesPackage ','
> + ParameterTypePackageList {$$ = TrLinkPeerNodes (2,$1,$3);}
> + ;
> +
> +ParameterTypesPackageList
> + : {$$ = NULL;}
> + | ObjectTypeKeyword {$$ = $1;}
> + | '{' ParameterTypesPackage '}' {$$ = $2;}
> + ;
> +
> +OptionalParameterTypesPackage
> + : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);}
> + | ',' ParameterTypesPackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);}
> + ;
> +
> +
> +/* Opcode types */
> +
> +Type1Opcode
> + : BreakTerm {}
> + | BreakPointTerm {}
> + | ContinueTerm {}
> + | FatalTerm {}
> + | IfElseTerm {}
> + | LoadTerm {}
> + | NoOpTerm {}
> + | NotifyTerm {}
> + | ReleaseTerm {}
> + | ResetTerm {}
> + | ReturnTerm {}
> + | SignalTerm {}
> + | SleepTerm {}
> + | StallTerm {}
> + | SwitchTerm {}
> + | UnloadTerm {}
> + | WhileTerm {}
> + ;
> +
> +Type2Opcode
> + : AcquireTerm {}
> + | CondRefOfTerm {}
> + | CopyObjectTerm {}
> + | DerefOfTerm {}
> + | ObjectTypeTerm {}
> + | RefOfTerm {}
> + | SizeOfTerm {}
> + | StoreTerm {}
> + | EqualsTerm {}
> + | TimerTerm {}
> + | WaitTerm {}
> + | UserTerm {}
> + ;
> +
> +/*
> + * Type 3/4/5 opcodes
> + */
> +
> +Type2IntegerOpcode /* "Type3" opcodes */
> + : AddTerm {}
> + | AndTerm {}
> + | DecTerm {}
> + | DivideTerm {}
> + | FindSetLeftBitTerm {}
> + | FindSetRightBitTerm {}
> + | FromBCDTerm {}
> + | IncTerm {}
> + | IndexTerm {}
> + | LAndTerm {}
> + | LEqualTerm {}
> + | LGreaterTerm {}
> + | LGreaterEqualTerm {}
> + | LLessTerm {}
> + | LLessEqualTerm {}
> + | LNotTerm {}
> + | LNotEqualTerm {}
> + | LoadTableTerm {}
> + | LOrTerm {}
> + | MatchTerm {}
> + | ModTerm {}
> + | MultiplyTerm {}
> + | NAndTerm {}
> + | NOrTerm {}
> + | NotTerm {}
> + | OrTerm {}
> + | ShiftLeftTerm {}
> + | ShiftRightTerm {}
> + | SubtractTerm {}
> + | ToBCDTerm {}
> + | ToIntegerTerm {}
> + | XOrTerm {}
> + ;
> +
> +Type2StringOpcode /* "Type4" Opcodes */
> + : ToDecimalStringTerm {}
> + | ToHexStringTerm {}
> + | ToStringTerm {}
> + ;
> +
> +Type2BufferOpcode /* "Type5" Opcodes */
> + : ToBufferTerm {}
> + | ConcatResTerm {}
> + ;
> +
> +Type2BufferOrStringOpcode
> + : ConcatTerm {}
> + | PrintfTerm {}
> + | FprintfTerm {}
> + | MidTerm {}
> + ;
> +
> +/*
> + * A type 3 opcode evaluates to an Integer and cannot have a destination operand
> + */
> +
> +Type3Opcode
> + : EISAIDTerm {}
> + ;
> +
> +/* Obsolete
> +Type4Opcode
> + : ConcatTerm {}
> + | ToDecimalStringTerm {}
> + | ToHexStringTerm {}
> + | MidTerm {}
> + | ToStringTerm {}
> + ;
> +*/
> +
> +
> +Type5Opcode
> + : ResourceTemplateTerm {}
> + | UnicodeTerm {}
> + | ToPLDTerm {}
> + | ToUUIDTerm {}
> + ;
> +
> +Type6Opcode
> + : RefOfTerm {}
> + | DerefOfTerm {}
> + | IndexTerm {}
> + | UserTerm {}
> + ;
> +
> +IncludeTerm
> + : PARSEOP_INCLUDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCLUDE);}
> + String ')' {TrLinkChildren ($<n>3,1,$4);FlOpenIncludeFile ($4);}
> + TermList
> + IncludeEndTerm {$$ = TrLinkPeerNodes (3,$<n>3,$7,$8);}
> + ;
> +
> +IncludeEndTerm
> + : PARSEOP_INCLUDE_END {$$ = TrCreateLeafNode (PARSEOP_INCLUDE_END);}
> + ;
> +
> +ExternalTerm
> + : PARSEOP_EXTERNAL '('
> + NameString
> + OptionalObjectTypeKeyword
> + OptionalParameterTypePackage
> + OptionalParameterTypesPackage
> + ')' {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);}
> + | PARSEOP_EXTERNAL '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +
> +/******* Named Objects *******************************************************/
> +
> +
> +BankFieldTerm
> + : PARSEOP_BANKFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BANKFIELD);}
> + NameString
> + NameStringItem
> + TermArgItem
> + ',' AccessTypeKeyword
> + ',' LockRuleKeyword
> + ',' UpdateRuleKeyword
> + ')' '{'
> + FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$5,$6,$8,$10,$12,$15);}
> + | PARSEOP_BANKFIELD '('
> + error ')' '{' error '}' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +FieldUnitList
> + : {$$ = NULL;}
> + | FieldUnit
> + | FieldUnitList ',' /* Allows a trailing comma at list end */
> + | FieldUnitList ','
> + FieldUnit {$$ = TrLinkPeerNode ($1,$3);}
> + ;
> +
> +FieldUnit
> + : FieldUnitEntry {}
> + | OffsetTerm {}
> + | AccessAsTerm {}
> + | ConnectionTerm {}
> + ;
> +
> +FieldUnitEntry
> + : ',' AmlPackageLengthTerm {$$ = TrCreateNode (PARSEOP_RESERVED_BYTES,1,$2);}
> + | NameSeg ','
> + AmlPackageLengthTerm {$$ = TrLinkChildNode ($1,$3);}
> + ;
> +
> +OffsetTerm
> + : PARSEOP_OFFSET '('
> + AmlPackageLengthTerm
> + ')' {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);}
> + | PARSEOP_OFFSET '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +AccessAsTerm
> + : PARSEOP_ACCESSAS '('
> + AccessTypeKeyword
> + OptionalAccessAttribTerm
> + ')' {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);}
> + | PARSEOP_ACCESSAS '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ConnectionTerm
> + : PARSEOP_CONNECTION '('
> + NameString
> + ')' {$$ = TrCreateNode (PARSEOP_CONNECTION,1,$3);}
> + | PARSEOP_CONNECTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONNECTION);}
> + ResourceMacroTerm
> + ')' {$$ = TrLinkChildren ($<n>3, 1,
> + TrLinkChildren (TrCreateLeafNode (PARSEOP_RESOURCETEMPLATE), 3,
> + TrCreateLeafNode (PARSEOP_DEFAULT_ARG),
> + TrCreateLeafNode (PARSEOP_DEFAULT_ARG),
> + $4));}
> + | PARSEOP_CONNECTION '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +CreateBitFieldTerm
> + : PARSEOP_CREATEBITFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);}
> + TermArg
> + TermArgItem
> + NameStringItem
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
> + | PARSEOP_CREATEBITFIELD '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +CreateByteFieldTerm
> + : PARSEOP_CREATEBYTEFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBYTEFIELD);}
> + TermArg
> + TermArgItem
> + NameStringItem
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
> + | PARSEOP_CREATEBYTEFIELD '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +CreateDWordFieldTerm
> + : PARSEOP_CREATEDWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEDWORDFIELD);}
> + TermArg
> + TermArgItem
> + NameStringItem
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
> + | PARSEOP_CREATEDWORDFIELD '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +CreateFieldTerm
> + : PARSEOP_CREATEFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEFIELD);}
> + TermArg
> + TermArgItem
> + TermArgItem
> + NameStringItem
> + ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,TrSetNodeFlags ($7, NODE_IS_NAME_DECLARATION));}
> + | PARSEOP_CREATEFIELD '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +CreateQWordFieldTerm
> + : PARSEOP_CREATEQWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEQWORDFIELD);}
> + TermArg
> + TermArgItem
> + NameStringItem
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
> + | PARSEOP_CREATEQWORDFIELD '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +CreateWordFieldTerm
> + : PARSEOP_CREATEWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEWORDFIELD);}
> + TermArg
> + TermArgItem
> + NameStringItem
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
> + | PARSEOP_CREATEWORDFIELD '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +DataRegionTerm
> + : PARSEOP_DATATABLEREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATATABLEREGION);}
> + NameString
> + TermArgItem
> + TermArgItem
> + TermArgItem
> + ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$6,$7);}
> + | PARSEOP_DATATABLEREGION '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +DeviceTerm
> + : PARSEOP_DEVICE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);}
> + NameString
> + ')' '{'
> + ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
> + | PARSEOP_DEVICE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +EventTerm
> + : PARSEOP_EVENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EVENT);}
> + NameString
> + ')' {$$ = TrLinkChildren ($<n>3,1,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION));}
> + | PARSEOP_EVENT '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +FieldTerm
> + : PARSEOP_FIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIELD);}
> + NameString
> + ',' AccessTypeKeyword
> + ',' LockRuleKeyword
> + ',' UpdateRuleKeyword
> + ')' '{'
> + FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$8,$10,$13);}
> + | PARSEOP_FIELD '('
> + error ')' '{' error '}' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +FunctionTerm
> + : PARSEOP_FUNCTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);}
> + NameString
> + OptionalParameterTypePackage
> + OptionalParameterTypesPackage
> + ')' '{'
> + TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),
> + TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0),
> + TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL),
> + TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0),$5,$6,$9);}
> + | PARSEOP_FUNCTION '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +IndexFieldTerm
> + : PARSEOP_INDEXFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);}
> + NameString
> + NameStringItem
> + ',' AccessTypeKeyword
> + ',' LockRuleKeyword
> + ',' UpdateRuleKeyword
> + ')' '{'
> + FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$7,$9,$11,$14);}
> + | PARSEOP_INDEXFIELD '('
> + error ')' '{' error '}' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +MethodTerm
> + : PARSEOP_METHOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);}
> + NameString
> + OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);}
> + OptionalSerializeRuleKeyword
> + OptionalByteConstExpr
> + OptionalParameterTypePackage
> + OptionalParameterTypesPackage
> + ')' '{'
> + TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$7,$8,$9,$10,$13);}
> + | PARSEOP_METHOD '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +MutexTerm
> + : PARSEOP_MUTEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);}
> + NameString
> + ',' ByteConstExpr
> + ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);}
> + | PARSEOP_MUTEX '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +OpRegionTerm
> + : PARSEOP_OPERATIONREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);}
> + NameString
> + ',' OpRegionSpaceIdTerm
> + TermArgItem
> + TermArgItem
> + ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8);}
> + | PARSEOP_OPERATIONREGION '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +OpRegionSpaceIdTerm
> + : RegionSpaceKeyword {}
> + | ByteConst {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);}
> + ;
> +
> +PowerResTerm
> + : PARSEOP_POWERRESOURCE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);}
> + NameString
> + ',' ByteConstExpr
> + ',' WordConstExpr
> + ')' '{'
> + ObjectList '}' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);}
> + | PARSEOP_POWERRESOURCE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ProcessorTerm
> + : PARSEOP_PROCESSOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);}
> + NameString
> + ',' ByteConstExpr
> + OptionalDWordConstExpr
> + OptionalByteConstExpr
> + ')' '{'
> + ObjectList '}' {$$ = TrLinkChildren ($<n>3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);}
> + | PARSEOP_PROCESSOR '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ThermalZoneTerm
> + : PARSEOP_THERMALZONE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);}
> + NameString
> + ')' '{'
> + ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
> + | PARSEOP_THERMALZONE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +
> +/******* Namespace modifiers *************************************************/
> +
> +
> +AliasTerm
> + : PARSEOP_ALIAS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);}
> + NameString
> + NameStringItem
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));}
> + | PARSEOP_ALIAS '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +NameTerm
> + : PARSEOP_NAME '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);}
> + NameString
> + ',' DataObject
> + ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);}
> + | PARSEOP_NAME '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ScopeTerm
> + : PARSEOP_SCOPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);}
> + NameString
> + ')' '{'
> + ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
> + | PARSEOP_SCOPE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +
> +/******* Type 1 opcodes *******************************************************/
> +
> +
> +BreakTerm
> + : PARSEOP_BREAK {$$ = TrCreateNode (PARSEOP_BREAK, 0);}
> + ;
> +
> +BreakPointTerm
> + : PARSEOP_BREAKPOINT {$$ = TrCreateNode (PARSEOP_BREAKPOINT, 0);}
> + ;
> +
> +ContinueTerm
> + : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);}
> + ;
> +
> +FatalTerm
> + : PARSEOP_FATAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);}
> + ByteConstExpr
> + ',' DWordConstExpr
> + TermArgItem
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);}
> + | PARSEOP_FATAL '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +IfElseTerm
> + : IfTerm ElseTerm {$$ = TrLinkPeerNode ($1,$2);}
> + ;
> +
> +IfTerm
> + : PARSEOP_IF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IF);}
> + TermArg
> + ')' '{'
> + TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
> +
> + | PARSEOP_IF '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ElseTerm
> + : {$$ = NULL;}
> + | PARSEOP_ELSE '{' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);}
> + TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);}
> +
> + | PARSEOP_ELSE '{'
> + error '}' {$$ = AslDoError(); yyclearin;}
> +
> + | PARSEOP_ELSE
> + error {$$ = AslDoError(); yyclearin;}
> +
> + | PARSEOP_ELSEIF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);}
> + TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);}
> + ')' '{'
> + TermList '}' {TrLinkChildren ($<n>5,2,$4,$8);}
> + ElseTerm {TrLinkPeerNode ($<n>5,$11);}
> + {$$ = TrLinkChildren ($<n>3,1,$<n>5);}
> +
> + | PARSEOP_ELSEIF '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> +
> + | PARSEOP_ELSEIF
> + error {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +LoadTerm
> + : PARSEOP_LOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOAD);}
> + NameString
> + RequiredTarget
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_LOAD '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +NoOpTerm
> + : PARSEOP_NOOP {$$ = TrCreateNode (PARSEOP_NOOP, 0);}
> + ;
> +
> +NotifyTerm
> + : PARSEOP_NOTIFY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);}
> + SuperName
> + TermArgItem
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_NOTIFY '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ReleaseTerm
> + : PARSEOP_RELEASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);}
> + SuperName
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_RELEASE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ResetTerm
> + : PARSEOP_RESET '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);}
> + SuperName
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_RESET '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ReturnTerm
> + : PARSEOP_RETURN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);}
> + OptionalReturnArg
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_RETURN {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_RETURN),1,TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN));}
> + | PARSEOP_RETURN '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +SignalTerm
> + : PARSEOP_SIGNAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);}
> + SuperName
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_SIGNAL '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +SleepTerm
> + : PARSEOP_SLEEP '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);}
> + TermArg
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_SLEEP '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +StallTerm
> + : PARSEOP_STALL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);}
> + TermArg
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_STALL '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +SwitchTerm
> + : PARSEOP_SWITCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);}
> + TermArg
> + ')' '{'
> + CaseDefaultTermList '}'
> + {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
> + | PARSEOP_SWITCH '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +/*
> + * Case-Default list; allow only one Default term and unlimited Case terms
> + */
> +
> +CaseDefaultTermList
> + : {$$ = NULL;}
> + | CaseTerm {}
> + | DefaultTerm {}
> + | CaseDefaultTermList
> + CaseTerm {$$ = TrLinkPeerNode ($1,$2);}
> + | CaseDefaultTermList
> + DefaultTerm {$$ = TrLinkPeerNode ($1,$2);}
> +
> +/* Original - attempts to force zero or one default term within the switch */
> +
> +/*
> +CaseDefaultTermList
> + : {$$ = NULL;}
> + | CaseTermList
> + DefaultTerm
> + CaseTermList {$$ = TrLinkPeerNode ($1,TrLinkPeerNode ($2, $3));}
> + | CaseTermList
> + CaseTerm {$$ = TrLinkPeerNode ($1,$2);}
> + ;
> +
> +CaseTermList
> + : {$$ = NULL;}
> + | CaseTerm {}
> + | CaseTermList
> + CaseTerm {$$ = TrLinkPeerNode ($1,$2);}
> + ;
> +*/
> +
> +CaseTerm
> + : PARSEOP_CASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);}
> + DataObject
> + ')' '{'
> + TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
> + | PARSEOP_CASE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +DefaultTerm
> + : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFAULT);}
> + TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_DEFAULT '{'
> + error '}' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +UnloadTerm
> + : PARSEOP_UNLOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);}
> + SuperName
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_UNLOAD '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +WhileTerm
> + : PARSEOP_WHILE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);}
> + TermArg
> + ')' '{' TermList '}'
> + {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
> + | PARSEOP_WHILE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +
> +/******* Type 2 opcodes *******************************************************/
> +
> +AcquireTerm
> + : PARSEOP_ACQUIRE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);}
> + SuperName
> + ',' WordConstExpr
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$6);}
> + | PARSEOP_ACQUIRE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +AddTerm
> + : PARSEOP_ADD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
> + TermArg
> + TermArgItem
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
> + | PARSEOP_ADD '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +AndTerm
> + : PARSEOP_AND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
> + TermArg
> + TermArgItem
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
> + | PARSEOP_AND '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ConcatTerm
> + : PARSEOP_CONCATENATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);}
> + TermArg
> + TermArgItem
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
> + | PARSEOP_CONCATENATE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ConcatResTerm
> + : PARSEOP_CONCATENATERESTEMPLATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);}
> + TermArg
> + TermArgItem
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
> + | PARSEOP_CONCATENATERESTEMPLATE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +CondRefOfTerm
> + : PARSEOP_CONDREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);}
> + SuperName
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_CONDREFOF '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +CopyObjectTerm
> + : PARSEOP_COPYOBJECT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);}
> + TermArg
> + ',' SimpleTarget
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));}
> + | PARSEOP_COPYOBJECT '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +DecTerm
> + : PARSEOP_DECREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);}
> + SuperName
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_DECREMENT '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +DerefOfTerm
> + : PARSEOP_DEREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);}
> + TermArg
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_DEREFOF '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +DivideTerm
> + : PARSEOP_DIVIDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
> + TermArg
> + TermArgItem
> + Target
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);}
> + | PARSEOP_DIVIDE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +FindSetLeftBitTerm
> + : PARSEOP_FINDSETLEFTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);}
> + TermArg
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_FINDSETLEFTBIT '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +FindSetRightBitTerm
> + : PARSEOP_FINDSETRIGHTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);}
> + TermArg
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_FINDSETRIGHTBIT '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +FromBCDTerm
> + : PARSEOP_FROMBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);}
> + TermArg
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_FROMBCD '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +IncTerm
> + : PARSEOP_INCREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);}
> + SuperName
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_INCREMENT '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +IndexTerm
> + : PARSEOP_INDEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);}
> + TermArg
> + TermArgItem
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
> + | PARSEOP_INDEX '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +LAndTerm
> + : PARSEOP_LAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);}
> + TermArg
> + TermArgItem
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_LAND '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +LEqualTerm
> + : PARSEOP_LEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);}
> + TermArg
> + TermArgItem
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_LEQUAL '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +LGreaterTerm
> + : PARSEOP_LGREATER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);}
> + TermArg
> + TermArgItem
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_LGREATER '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +LGreaterEqualTerm
> + : PARSEOP_LGREATEREQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);}
> + TermArg
> + TermArgItem
> + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));}
> + | PARSEOP_LGREATEREQUAL '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +LLessTerm
> + : PARSEOP_LLESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);}
> + TermArg
> + TermArgItem
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_LLESS '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +LLessEqualTerm
> + : PARSEOP_LLESSEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);}
> + TermArg
> + TermArgItem
> + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));}
> + | PARSEOP_LLESSEQUAL '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +LNotTerm
> + : PARSEOP_LNOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);}
> + TermArg
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_LNOT '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +LNotEqualTerm
> + : PARSEOP_LNOTEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);}
> + TermArg
> + TermArgItem
> + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));}
> + | PARSEOP_LNOTEQUAL '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +LoadTableTerm
> + : PARSEOP_LOADTABLE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOADTABLE);}
> + TermArg
> + TermArgItem
> + TermArgItem
> + OptionalListString
> + OptionalListString
> + OptionalReference
> + ')' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$6,$7,$8,$9);}
> + | PARSEOP_LOADTABLE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +LOrTerm
> + : PARSEOP_LOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);}
> + TermArg
> + TermArgItem
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_LOR '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +MatchTerm
> + : PARSEOP_MATCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MATCH);}
> + TermArg
> + ',' MatchOpKeyword
> + TermArgItem
> + ',' MatchOpKeyword
> + TermArgItem
> + TermArgItem
> + ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);}
> + | PARSEOP_MATCH '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +MidTerm
> + : PARSEOP_MID '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MID);}
> + TermArg
> + TermArgItem
> + TermArgItem
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);}
> + | PARSEOP_MID '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ModTerm
> + : PARSEOP_MOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
> + TermArg
> + TermArgItem
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
> + | PARSEOP_MOD '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +MultiplyTerm
> + : PARSEOP_MULTIPLY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
> + TermArg
> + TermArgItem
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
> + | PARSEOP_MULTIPLY '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +NAndTerm
> + : PARSEOP_NAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);}
> + TermArg
> + TermArgItem
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
> + | PARSEOP_NAND '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +NOrTerm
> + : PARSEOP_NOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);}
> + TermArg
> + TermArgItem
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
> + | PARSEOP_NOR '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +NotTerm
> + : PARSEOP_NOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);}
> + TermArg
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_NOT '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ObjectTypeTerm
> + : PARSEOP_OBJECTTYPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);}
> + ObjectTypeName
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_OBJECTTYPE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +OrTerm
> + : PARSEOP_OR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
> + TermArg
> + TermArgItem
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
> + | PARSEOP_OR '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +/*
> + * In RefOf, the node isn't really a target, but we can't keep track of it after
> + * we've taken a pointer to it. (hard to tell if a local becomes initialized this way.)
> + */
> +RefOfTerm
> + : PARSEOP_REFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REFOF);}
> + SuperName
> + ')' {$$ = TrLinkChildren ($<n>3,1,TrSetNodeFlags ($4, NODE_IS_TARGET));}
> + | PARSEOP_REFOF '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ShiftLeftTerm
> + : PARSEOP_SHIFTLEFT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
> + TermArg
> + TermArgItem
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
> + | PARSEOP_SHIFTLEFT '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ShiftRightTerm
> + : PARSEOP_SHIFTRIGHT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
> + TermArg
> + TermArgItem
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
> + | PARSEOP_SHIFTRIGHT '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +SizeOfTerm
> + : PARSEOP_SIZEOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);}
> + SuperName
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_SIZEOF '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +StoreTerm
> + : PARSEOP_STORE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STORE);}
> + TermArg
> + ',' SuperName
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));}
> + | PARSEOP_STORE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +SubtractTerm
> + : PARSEOP_SUBTRACT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
> + TermArg
> + TermArgItem
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
> + | PARSEOP_SUBTRACT '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +TimerTerm
> + : PARSEOP_TIMER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);}
> + ')' {$$ = TrLinkChildren ($<n>3,0);}
> + | PARSEOP_TIMER {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_TIMER),0);}
> + | PARSEOP_TIMER '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ToBCDTerm
> + : PARSEOP_TOBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBCD);}
> + TermArg
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_TOBCD '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ToBufferTerm
> + : PARSEOP_TOBUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBUFFER);}
> + TermArg
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_TOBUFFER '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ToDecimalStringTerm
> + : PARSEOP_TODECIMALSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);}
> + TermArg
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_TODECIMALSTRING '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ToHexStringTerm
> + : PARSEOP_TOHEXSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);}
> + TermArg
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_TOHEXSTRING '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ToIntegerTerm
> + : PARSEOP_TOINTEGER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOINTEGER);}
> + TermArg
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_TOINTEGER '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +PldKeyword
> + : PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);}
> + | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);}
> + | PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);}
> + | PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);}
> + | PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);}
> + | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);}
> + | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);}
> + | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);}
> + | PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);}
> + | PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);}
> + | PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);}
> + | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);}
> + | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);}
> + | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);}
> + | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);}
> + | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);}
> + | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);}
> + | PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);}
> + | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);}
> + | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);}
> + | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);}
> + | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);}
> + | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);}
> + | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);}
> + | PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);}
> + | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);}
> + | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);}
> + | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);}
> + ;
> +
> +PldKeywordList
> + : {$$ = NULL;}
> + | PldKeyword
> + PARSEOP_EXP_EQUALS Integer {$$ = TrLinkChildren ($1,1,$3);}
> + | PldKeyword
> + PARSEOP_EXP_EQUALS String {$$ = TrLinkChildren ($1,1,$3);}
> + | PldKeywordList ',' /* Allows a trailing comma at list end */
> + | PldKeywordList ','
> + PldKeyword
> + PARSEOP_EXP_EQUALS Integer {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));}
> + | PldKeywordList ','
> + PldKeyword
> + PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));}
> + ;
> +
> +ToPLDTerm
> + : PARSEOP_TOPLD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);}
> + PldKeywordList
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_TOPLD '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +PrintfArgList
> + : {$$ = NULL;}
> + | TermArg {$$ = $1;}
> + | PrintfArgList ','
> + TermArg {$$ = TrLinkPeerNode ($1, $3);}
> + ;
> +
> +PrintfTerm
> + : PARSEOP_PRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);}
> + StringData
> + PrintfArgList
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_PRINTF '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +FprintfTerm
> + : PARSEOP_FPRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);}
> + TermArg ','
> + StringData
> + PrintfArgList
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);}
> + | PARSEOP_FPRINTF '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ToStringTerm
> + : PARSEOP_TOSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);}
> + TermArg
> + OptionalCount
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
> + | PARSEOP_TOSTRING '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ToUUIDTerm
> + : PARSEOP_TOUUID '('
> + StringData ')' {$$ = TrUpdateNode (PARSEOP_TOUUID, $3);}
> + | PARSEOP_TOUUID '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +WaitTerm
> + : PARSEOP_WAIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);}
> + SuperName
> + TermArgItem
> + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
> + | PARSEOP_WAIT '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +XOrTerm
> + : PARSEOP_XOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
> + TermArg
> + TermArgItem
> + Target
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
> + | PARSEOP_XOR '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +
> +/******* Keywords *************************************************************/
> +
> +
> +AccessAttribKeyword
> + : PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK);}
> + | PARSEOP_ACCESSATTRIB_BLOCK_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK_CALL);}
> + | PARSEOP_ACCESSATTRIB_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BYTE);}
> + | PARSEOP_ACCESSATTRIB_QUICK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_QUICK );}
> + | PARSEOP_ACCESSATTRIB_SND_RCV {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_SND_RCV);}
> + | PARSEOP_ACCESSATTRIB_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD);}
> + | PARSEOP_ACCESSATTRIB_WORD_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD_CALL);}
> + | PARSEOP_ACCESSATTRIB_MULTIBYTE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);}
> + ByteConst
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_ACCESSATTRIB_RAW_BYTES '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);}
> + ByteConst
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + | PARSEOP_ACCESSATTRIB_RAW_PROCESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);}
> + ByteConst
> + ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
> + ;
> +
> +AccessTypeKeyword
> + : PARSEOP_ACCESSTYPE_ANY {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_ANY);}
> + | PARSEOP_ACCESSTYPE_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BYTE);}
> + | PARSEOP_ACCESSTYPE_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_WORD);}
> + | PARSEOP_ACCESSTYPE_DWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_DWORD);}
> + | PARSEOP_ACCESSTYPE_QWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_QWORD);}
> + | PARSEOP_ACCESSTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BUF);}
> + ;
> +
> +AddressingModeKeyword
> + : PARSEOP_ADDRESSINGMODE_7BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_7BIT);}
> + | PARSEOP_ADDRESSINGMODE_10BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_10BIT);}
> + ;
> +
> +AddressKeyword
> + : PARSEOP_ADDRESSTYPE_MEMORY {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_MEMORY);}
> + | PARSEOP_ADDRESSTYPE_RESERVED {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_RESERVED);}
> + | PARSEOP_ADDRESSTYPE_NVS {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_NVS);}
> + | PARSEOP_ADDRESSTYPE_ACPI {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_ACPI);}
> + ;
> +
> +AddressSpaceKeyword
> + : ByteConst {$$ = UtCheckIntegerRange ($1, 0x0A, 0xFF);}
> + | RegionSpaceKeyword {}
> + ;
> +
> +BitsPerByteKeyword
> + : PARSEOP_BITSPERBYTE_FIVE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_FIVE);}
> + | PARSEOP_BITSPERBYTE_SIX {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SIX);}
> + | PARSEOP_BITSPERBYTE_SEVEN {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SEVEN);}
> + | PARSEOP_BITSPERBYTE_EIGHT {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_EIGHT);}
> + | PARSEOP_BITSPERBYTE_NINE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_NINE);}
> + ;
> +
> +ClockPhaseKeyword
> + : PARSEOP_CLOCKPHASE_FIRST {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_FIRST);}
> + | PARSEOP_CLOCKPHASE_SECOND {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_SECOND);}
> + ;
> +
> +ClockPolarityKeyword
> + : PARSEOP_CLOCKPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_LOW);}
> + | PARSEOP_CLOCKPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_HIGH);}
> + ;
> +
> +DecodeKeyword
> + : PARSEOP_DECODETYPE_POS {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_POS);}
> + | PARSEOP_DECODETYPE_SUB {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_SUB);}
> + ;
> +
> +DevicePolarityKeyword
> + : PARSEOP_DEVICEPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_LOW);}
> + | PARSEOP_DEVICEPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_HIGH);}
> + ;
> +
> +DMATypeKeyword
> + : PARSEOP_DMATYPE_A {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_A);}
> + | PARSEOP_DMATYPE_COMPATIBILITY {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_COMPATIBILITY);}
> + | PARSEOP_DMATYPE_B {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_B);}
> + | PARSEOP_DMATYPE_F {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_F);}
> + ;
> +
> +EndianKeyword
> + : PARSEOP_ENDIAN_LITTLE {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_LITTLE);}
> + | PARSEOP_ENDIAN_BIG {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_BIG);}
> + ;
> +
> +FlowControlKeyword
> + : PARSEOP_FLOWCONTROL_HW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_HW);}
> + | PARSEOP_FLOWCONTROL_NONE {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_NONE);}
> + | PARSEOP_FLOWCONTROL_SW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_SW);}
> + ;
> +
> +InterruptLevel
> + : PARSEOP_INTLEVEL_ACTIVEBOTH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEBOTH);}
> + | PARSEOP_INTLEVEL_ACTIVEHIGH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEHIGH);}
> + | PARSEOP_INTLEVEL_ACTIVELOW {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVELOW);}
> + ;
> +
> +InterruptTypeKeyword
> + : PARSEOP_INTTYPE_EDGE {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_EDGE);}
> + | PARSEOP_INTTYPE_LEVEL {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_LEVEL);}
> + ;
> +
> +IODecodeKeyword
> + : PARSEOP_IODECODETYPE_16 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_16);}
> + | PARSEOP_IODECODETYPE_10 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_10);}
> + ;
> +
> +IoRestrictionKeyword
> + : PARSEOP_IORESTRICT_IN {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_IN);}
> + | PARSEOP_IORESTRICT_OUT {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_OUT);}
> + | PARSEOP_IORESTRICT_NONE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_NONE);}
> + | PARSEOP_IORESTRICT_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_PRESERVE);}
> + ;
> +
> +LockRuleKeyword
> + : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);}
> + | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_NOLOCK);}
> + ;
> +
> +MatchOpKeyword
> + : PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);}
> + | PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);}
> + | PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLE);}
> + | PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLT);}
> + | PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGE);}
> + | PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGT);}
> + ;
> +
> +MaxKeyword
> + : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);}
> + | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);}
> + ;
> +
> +MemTypeKeyword
> + : PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_CACHEABLE);}
> + | PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_WRITECOMBINING);}
> + | PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_PREFETCHABLE);}
> + | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_NONCACHEABLE);}
> + ;
> +
> +MinKeyword
> + : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);}
> + | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);}
> + ;
> +
> +ObjectTypeKeyword
> + : PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);}
> + | PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_INT);}
> + | PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_STR);}
> + | PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BUF);}
> + | PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PKG);}
> + | PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_FLD);}
> + | PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DEV);}
> + | PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_EVT);}
> + | PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTH);}
> + | PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTX);}
> + | PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_OPR);}
> + | PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_POW);}
> + | PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PRO);}
> + | PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_THZ);}
> + | PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BFF);}
> + | PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DDB);}
> + ;
> +
> +ParityTypeKeyword
> + : PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_SPACE);}
> + | PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_MARK);}
> + | PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_ODD);}
> + | PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_EVEN);}
> + | PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_NONE);}
> + ;
> +
> +PinConfigByte
> + : PinConfigKeyword {$$ = $1;}
> + | ByteConstExpr {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);}
> + ;
> +
> +PinConfigKeyword
> + : PARSEOP_PIN_NOPULL {$$ = TrCreateLeafNode (PARSEOP_PIN_NOPULL);}
> + | PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDOWN);}
> + | PARSEOP_PIN_PULLUP {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLUP);}
> + | PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDEFAULT);}
> + ;
> +
> +RangeTypeKeyword
> + : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);}
> + | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);}
> + | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ENTIRE);}
> + ;
> +
> +RegionSpaceKeyword
> + : PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IO);}
> + | PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_MEM);}
> + | PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCI);}
> + | PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_EC);}
> + | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);}
> + | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);}
> + | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);}
> + | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);}
> + | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);}
> + | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);}
> + | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);}
> + | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);}
> + ;
> +
> +ResourceTypeKeyword
> + : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);}
> + | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);}
> + ;
> +
> +SerializeRuleKeyword
> + : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);}
> + | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL);}
> + ;
> +
> +ShareTypeKeyword
> + : PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHARED);}
> + | PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVE);}
> + | PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHAREDWAKE);}
> + | PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);}
> + ;
> +
> +SlaveModeKeyword
> + : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_CONTROLLERINIT);}
> + | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_DEVICEINIT);}
> + ;
> +
> +StopBitsKeyword
> + : PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_TWO);}
> + | PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONEPLUSHALF);}
> + | PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONE);}
> + | PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ZERO);}
> + ;
> +
> +TranslationKeyword
> + : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);}
> + | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);}
> + ;
> +
> +TypeKeyword
> + : PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafNode (PARSEOP_TYPE_TRANSLATION);}
> + | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafNode (PARSEOP_TYPE_STATIC);}
> + ;
> +
> +UpdateRuleKeyword
> + : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);}
> + | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);}
> + | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);}
> + ;
> +
> +WireModeKeyword
> + : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_FOUR);}
> + | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_THREE);}
> + ;
> +
> +XferSizeKeyword
> + : PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_8, 0);}
> + | PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_16, 1);}
> + | PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);}
> + | PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_64, 3);}
> + | PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_128, 4);}
> + | PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_256, 5);}
> + ;
> +
> +XferTypeKeyword
> + : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);}
> + | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);}
> + | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);}
> + ;
> +
> +
> +/******* Miscellaneous Types **************************************************/
> +
> +
> +SuperName
> + : NameString {}
> + | ArgTerm {}
> + | LocalTerm {}
> + | DebugTerm {}
> + | Type6Opcode {}
> +
> +/* For ObjectType: SuperName except for UserTerm (method invocation) */
> +
> +ObjectTypeName
> + : NameString {}
> + | ArgTerm {}
> + | LocalTerm {}
> + | DebugTerm {}
> + | RefOfTerm {}
> + | DerefOfTerm {}
> + | IndexTerm {}
> +
> +/* | UserTerm {} */ /* Caused reduce/reduce with Type6Opcode->UserTerm */
> + ;
> +
> +ArgTerm
> + : PARSEOP_ARG0 {$$ = TrCreateLeafNode (PARSEOP_ARG0);}
> + | PARSEOP_ARG1 {$$ = TrCreateLeafNode (PARSEOP_ARG1);}
> + | PARSEOP_ARG2 {$$ = TrCreateLeafNode (PARSEOP_ARG2);}
> + | PARSEOP_ARG3 {$$ = TrCreateLeafNode (PARSEOP_ARG3);}
> + | PARSEOP_ARG4 {$$ = TrCreateLeafNode (PARSEOP_ARG4);}
> + | PARSEOP_ARG5 {$$ = TrCreateLeafNode (PARSEOP_ARG5);}
> + | PARSEOP_ARG6 {$$ = TrCreateLeafNode (PARSEOP_ARG6);}
> + ;
> +
> +LocalTerm
> + : PARSEOP_LOCAL0 {$$ = TrCreateLeafNode (PARSEOP_LOCAL0);}
> + | PARSEOP_LOCAL1 {$$ = TrCreateLeafNode (PARSEOP_LOCAL1);}
> + | PARSEOP_LOCAL2 {$$ = TrCreateLeafNode (PARSEOP_LOCAL2);}
> + | PARSEOP_LOCAL3 {$$ = TrCreateLeafNode (PARSEOP_LOCAL3);}
> + | PARSEOP_LOCAL4 {$$ = TrCreateLeafNode (PARSEOP_LOCAL4);}
> + | PARSEOP_LOCAL5 {$$ = TrCreateLeafNode (PARSEOP_LOCAL5);}
> + | PARSEOP_LOCAL6 {$$ = TrCreateLeafNode (PARSEOP_LOCAL6);}
> + | PARSEOP_LOCAL7 {$$ = TrCreateLeafNode (PARSEOP_LOCAL7);}
> + ;
> +
> +DebugTerm
> + : PARSEOP_DEBUG {$$ = TrCreateLeafNode (PARSEOP_DEBUG);}
> + ;
> +
> +
> +ByteConst
> + : Integer {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
> + ;
> +
> +WordConst
> + : Integer {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
> + ;
> +
> +DWordConst
> + : Integer {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
> + ;
> +
> +QWordConst
> + : Integer {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
> + ;
> +
> +Integer
> + : PARSEOP_INTEGER {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, AslCompilerlval.i);}
> + ;
> +
> +String
> + : PARSEOP_STRING_LITERAL {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, (ACPI_NATIVE_INT) AslCompilerlval.s);}
> + ;
> +
> +ConstTerm
> + : ConstExprTerm {}
> + | PARSEOP_REVISION {$$ = TrCreateLeafNode (PARSEOP_REVISION);}
> + ;
> +
> +ConstExprTerm
> + : PARSEOP_ZERO {$$ = TrCreateValuedLeafNode (PARSEOP_ZERO, 0);}
> + | PARSEOP_ONE {$$ = TrCreateValuedLeafNode (PARSEOP_ONE, 1);}
> + | PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_UINT64_MAX);}
> + | PARSEOP___DATE__ {$$ = TrCreateConstantLeafNode (PARSEOP___DATE__);}
> + | PARSEOP___FILE__ {$$ = TrCreateConstantLeafNode (PARSEOP___FILE__);}
> + | PARSEOP___LINE__ {$$ = TrCreateConstantLeafNode (PARSEOP___LINE__);}
> + | PARSEOP___PATH__ {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);}
> + ;
> +
> +/*
> + * The NODE_COMPILE_TIME_CONST flag in the following constant expressions
> + * enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes
> + * to simple integers. It is an error if these types of expressions cannot be
> + * reduced, since the AML grammar for ****ConstExpr requires a simple constant.
> + * Note: The required byte length of the constant is passed through to the
> + * constant folding code in the node AmlLength field.
> + */
> +ByteConstExpr
> + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);}
> + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);}
> + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
> + | ByteConst {}
> + ;
> +
> +WordConstExpr
> + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);}
> + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);}
> + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
> + | WordConst {}
> + ;
> +
> +DWordConstExpr
> + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);}
> + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);}
> + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
> + | DWordConst {}
> + ;
> +
> +QWordConstExpr
> + : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);}
> + | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);}
> + | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
> + | QWordConst {}
> + ;
> +
> +/* OptionalCount must appear before ByteList or an incorrect reduction will result */
> +
> +OptionalCount
> + : {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */
> + | ',' {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */
> + | ',' TermArg {$$ = $2;}
> + ;
> +
> +BufferTerm
> + : PARSEOP_BUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER);}
> + OptionalTermArg
> + ')' '{'
> + BufferTermData '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
> + | PARSEOP_BUFFER '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +BufferTermData
> + : ByteList {}
> + | StringData {}
> + ;
> +
> +ByteList
> + : {$$ = NULL;}
> + | ByteConstExpr
> + | ByteList ',' /* Allows a trailing comma at list end */
> + | ByteList ','
> + ByteConstExpr {$$ = TrLinkPeerNode ($1,$3);}
> + ;
> +
> +DataBufferTerm
> + : PARSEOP_DATABUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);}
> + OptionalWordConst
> + ')' '{'
> + ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
> + | PARSEOP_DATABUFFER '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +DWordList
> + : {$$ = NULL;}
> + | DWordConstExpr
> + | DWordList ',' /* Allows a trailing comma at list end */
> + | DWordList ','
> + DWordConstExpr {$$ = TrLinkPeerNode ($1,$3);}
> + ;
> +
> +PackageTerm
> + : PARSEOP_PACKAGE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);}
> + VarPackageLengthTerm
> + ')' '{'
> + PackageList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
> + | PARSEOP_PACKAGE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +PackageList
> + : {$$ = NULL;}
> + | PackageElement
> + | PackageList ',' /* Allows a trailing comma at list end */
> + | PackageList ','
> + PackageElement {$$ = TrLinkPeerNode ($1,$3);}
> + ;
> +
> +PackageElement
> + : DataObject {}
> + | NameString {}
> + ;
> +
> +VarPackageLengthTerm
> + : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);}
> + | TermArg {$$ = $1;}
> + ;
> +
> +
> +/******* Macros ***********************************************/
> +
> +
> +EISAIDTerm
> + : PARSEOP_EISAID '('
> + StringData ')' {$$ = TrUpdateNode (PARSEOP_EISAID, $3);}
> + | PARSEOP_EISAID '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +UnicodeTerm
> + : PARSEOP_UNICODE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);}
> + StringData
> + ')' {$$ = TrLinkChildren ($<n>3,2,0,$4);}
> + | PARSEOP_UNICODE '('
> + 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));}
> + ;
> +
> +ResourceMacroList
> + : {$$ = NULL;}
> + | ResourceMacroList
> + ResourceMacroTerm {$$ = TrLinkPeerNode ($1,$2);}
> + ;
> +
> +ResourceMacroTerm
> + : DMATerm {}
> + | DWordIOTerm {}
> + | DWordMemoryTerm {}
> + | DWordSpaceTerm {}
> + | EndDependentFnTerm {}
> + | ExtendedIOTerm {}
> + | ExtendedMemoryTerm {}
> + | ExtendedSpaceTerm {}
> + | FixedDmaTerm {}
> + | FixedIOTerm {}
> + | GpioIntTerm {}
> + | GpioIoTerm {}
> + | I2cSerialBusTerm {}
> + | InterruptTerm {}
> + | IOTerm {}
> + | IRQNoFlagsTerm {}
> + | IRQTerm {}
> + | Memory24Term {}
> + | Memory32FixedTerm {}
> + | Memory32Term {}
> + | QWordIOTerm {}
> + | QWordMemoryTerm {}
> + | QWordSpaceTerm {}
> + | RegisterTerm {}
> + | SpiSerialBusTerm {}
> + | StartDependentFnNoPriTerm {}
> + | StartDependentFnTerm {}
> + | UartSerialBusTerm {}
> + | VendorLongTerm {}
> + | VendorShortTerm {}
> + | WordBusNumberTerm {}
> + | WordIOTerm {}
> + | WordSpaceTerm {}
> + ;
> +
> +DMATerm
> + : PARSEOP_DMA '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DMA);}
> + DMATypeKeyword
> + OptionalBusMasterKeyword
> + ',' XferTypeKeyword
> + OptionalNameString_Last
> + ')' '{'
> + ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$5,$7,$8,$11);}
> + | PARSEOP_DMA '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +DWordIOTerm
> + : PARSEOP_DWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDIO);}
> + OptionalResourceType_First
> + OptionalMinType
> + OptionalMaxType
> + OptionalDecodeType
> + OptionalRangeType
> + ',' DWordConstExpr
> + ',' DWordConstExpr
> + ',' DWordConstExpr
> + ',' DWordConstExpr
> + ',' DWordConstExpr
> + OptionalByteConstExpr
> + OptionalStringData
> + OptionalNameString
> + OptionalType
> + OptionalTranslationType_Last
> + ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);}
> + | PARSEOP_DWORDIO '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +DWordMemoryTerm
> + : PARSEOP_DWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);}
> + OptionalResourceType_First
> + OptionalDecodeType
> + OptionalMinType
> + OptionalMaxType
> + OptionalMemType
> + ',' OptionalReadWriteKeyword
> + ',' DWordConstExpr
> + ',' DWordConstExpr
> + ',' DWordConstExpr
> + ',' DWordConstExpr
> + ',' DWordConstExpr
> + OptionalByteConstExpr
> + OptionalStringData
> + OptionalNameString
> + OptionalAddressRange
> + OptionalType_Last
> + ')' {$$ = TrLinkChildren ($<n>3,16,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);}
> + | PARSEOP_DWORDMEMORY '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +DWordSpaceTerm
> + : PARSEOP_DWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);}
> + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
> + OptionalResourceType
> + OptionalDecodeType
> + OptionalMinType
> + OptionalMaxType
> + ',' ByteConstExpr
> + ',' DWordConstExpr
> + ',' DWordConstExpr
> + ',' DWordConstExpr
> + ',' DWordConstExpr
> + ',' DWordConstExpr
> + OptionalByteConstExpr
> + OptionalStringData
> + OptionalNameString_Last
> + ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);}
> + | PARSEOP_DWORDSPACE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +
> +EndDependentFnTerm
> + : PARSEOP_ENDDEPENDENTFN '('
> + ')' {$$ = TrCreateLeafNode (PARSEOP_ENDDEPENDENTFN);}
> + | PARSEOP_ENDDEPENDENTFN '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ExtendedIOTerm
> + : PARSEOP_EXTENDEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);}
> + OptionalResourceType_First
> + OptionalMinType
> + OptionalMaxType
> + OptionalDecodeType
> + OptionalRangeType
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + OptionalQWordConstExpr
> + OptionalNameString
> + OptionalType
> + OptionalTranslationType_Last
> + ')' {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22);}
> + | PARSEOP_EXTENDEDIO '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ExtendedMemoryTerm
> + : PARSEOP_EXTENDEDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);}
> + OptionalResourceType_First
> + OptionalDecodeType
> + OptionalMinType
> + OptionalMaxType
> + OptionalMemType
> + ',' OptionalReadWriteKeyword
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + OptionalQWordConstExpr
> + OptionalNameString
> + OptionalAddressRange
> + OptionalType_Last
> + ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24);}
> + | PARSEOP_EXTENDEDMEMORY '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +ExtendedSpaceTerm
> + : PARSEOP_EXTENDEDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);}
> + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
> + OptionalResourceType
> + OptionalDecodeType
> + OptionalMinType
> + OptionalMaxType
> + ',' ByteConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + OptionalQWordConstExpr
> + OptionalNameString_Last
> + ')' {$$ = TrLinkChildren ($<n>3,13,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23);}
> + | PARSEOP_EXTENDEDSPACE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +FixedDmaTerm
> + : PARSEOP_FIXEDDMA '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDDMA);}
> + WordConstExpr /* 04: DMA RequestLines */
> + ',' WordConstExpr /* 06: DMA Channels */
> + OptionalXferSize /* 07: DMA TransferSize */
> + OptionalNameString /* 08: DescriptorName */
> + ')' {$$ = TrLinkChildren ($<n>3,4,$4,$6,$7,$8);}
> + | PARSEOP_FIXEDDMA '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +FixedIOTerm
> + : PARSEOP_FIXEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDIO);}
> + WordConstExpr
> + ',' ByteConstExpr
> + OptionalNameString_Last
> + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);}
> + | PARSEOP_FIXEDIO '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +GpioIntTerm
> + : PARSEOP_GPIO_INT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);}
> + InterruptTypeKeyword /* 04: InterruptType */
> + ',' InterruptLevel /* 06: InterruptLevel */
> + OptionalShareType /* 07: SharedType */
> + ',' PinConfigByte /* 09: PinConfig */
> + OptionalWordConstExpr /* 10: DebounceTimeout */
> + ',' StringData /* 12: ResourceSource */
> + OptionalByteConstExpr /* 13: ResourceSourceIndex */
> + OptionalResourceType /* 14: ResourceType */
> + OptionalNameString /* 15: DescriptorName */
> + OptionalBuffer_Last /* 16: VendorData */
> + ')' '{'
> + DWordConstExpr '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);}
> + | PARSEOP_GPIO_INT '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +GpioIoTerm
> + : PARSEOP_GPIO_IO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);}
> + OptionalShareType_First /* 04: SharedType */
> + ',' PinConfigByte /* 06: PinConfig */
> + OptionalWordConstExpr /* 07: DebounceTimeout */
> + OptionalWordConstExpr /* 08: DriveStrength */
> + OptionalIoRestriction /* 09: IoRestriction */
> + ',' StringData /* 11: ResourceSource */
> + OptionalByteConstExpr /* 12: ResourceSourceIndex */
> + OptionalResourceType /* 13: ResourceType */
> + OptionalNameString /* 14: DescriptorName */
> + OptionalBuffer_Last /* 15: VendorData */
> + ')' '{'
> + DWordList '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);}
> + | PARSEOP_GPIO_IO '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +I2cSerialBusTerm
> + : PARSEOP_I2C_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);}
> + WordConstExpr /* 04: SlaveAddress */
> + OptionalSlaveMode /* 05: SlaveMode */
> + ',' DWordConstExpr /* 07: ConnectionSpeed */
> + OptionalAddressingMode /* 08: AddressingMode */
> + ',' StringData /* 10: ResourceSource */
> + OptionalByteConstExpr /* 11: ResourceSourceIndex */
> + OptionalResourceType /* 12: ResourceType */
> + OptionalNameString /* 13: DescriptorName */
> + OptionalBuffer_Last /* 14: VendorData */
> + ')' {$$ = TrLinkChildren ($<n>3,9,$4,$5,$7,$8,$10,$11,$12,$13,$14);}
> + | PARSEOP_I2C_SERIALBUS '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +InterruptTerm
> + : PARSEOP_INTERRUPT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INTERRUPT);}
> + OptionalResourceType_First
> + ',' InterruptTypeKeyword
> + ',' InterruptLevel
> + OptionalShareType
> + OptionalByteConstExpr
> + OptionalStringData
> + OptionalNameString_Last
> + ')' '{'
> + DWordList '}' {$$ = TrLinkChildren ($<n>3,8,$4,$6,$8,$9,$10,$11,$12,$15);}
> + | PARSEOP_INTERRUPT '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +IOTerm
> + : PARSEOP_IO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IO);}
> + IODecodeKeyword
> + ',' WordConstExpr
> + ',' WordConstExpr
> + ',' ByteConstExpr
> + ',' ByteConstExpr
> + OptionalNameString_Last
> + ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
> + | PARSEOP_IO '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +IRQNoFlagsTerm
> + : PARSEOP_IRQNOFLAGS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);}
> + OptionalNameString_First
> + ')' '{'
> + ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
> + | PARSEOP_IRQNOFLAGS '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +IRQTerm
> + : PARSEOP_IRQ '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQ);}
> + InterruptTypeKeyword
> + ',' InterruptLevel
> + OptionalShareType
> + OptionalNameString_Last
> + ')' '{'
> + ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$7,$8,$11);}
> + | PARSEOP_IRQ '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +Memory24Term
> + : PARSEOP_MEMORY24 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY24);}
> + OptionalReadWriteKeyword
> + ',' WordConstExpr
> + ',' WordConstExpr
> + ',' WordConstExpr
> + ',' WordConstExpr
> + OptionalNameString_Last
> + ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
> + | PARSEOP_MEMORY24 '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +Memory32FixedTerm
> + : PARSEOP_MEMORY32FIXED '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);}
> + OptionalReadWriteKeyword
> + ',' DWordConstExpr
> + ',' DWordConstExpr
> + OptionalNameString_Last
> + ')' {$$ = TrLinkChildren ($<n>3,4,$4,$6,$8,$9);}
> + | PARSEOP_MEMORY32FIXED '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +Memory32Term
> + : PARSEOP_MEMORY32 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32);}
> + OptionalReadWriteKeyword
> + ',' DWordConstExpr
> + ',' DWordConstExpr
> + ',' DWordConstExpr
> + ',' DWordConstExpr
> + OptionalNameString_Last
> + ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
> + | PARSEOP_MEMORY32 '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +QWordIOTerm
> + : PARSEOP_QWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDIO);}
> + OptionalResourceType_First
> + OptionalMinType
> + OptionalMaxType
> + OptionalDecodeType
> + OptionalRangeType
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + OptionalByteConstExpr
> + OptionalStringData
> + OptionalNameString
> + OptionalType
> + OptionalTranslationType_Last
> + ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);}
> + | PARSEOP_QWORDIO '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +QWordMemoryTerm
> + : PARSEOP_QWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);}
> + OptionalResourceType_First
> + OptionalDecodeType
> + OptionalMinType
> + OptionalMaxType
> + OptionalMemType
> + ',' OptionalReadWriteKeyword
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + OptionalByteConstExpr
> + OptionalStringData
> + OptionalNameString
> + OptionalAddressRange
> + OptionalType_Last
> + ')' {$$ = TrLinkChildren ($<n>3,16,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);}
> + | PARSEOP_QWORDMEMORY '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +QWordSpaceTerm
> + : PARSEOP_QWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);}
> + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
> + OptionalResourceType
> + OptionalDecodeType
> + OptionalMinType
> + OptionalMaxType
> + ',' ByteConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + ',' QWordConstExpr
> + OptionalByteConstExpr
> + OptionalStringData
> + OptionalNameString_Last
> + ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);}
> + | PARSEOP_QWORDSPACE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +RegisterTerm
> + : PARSEOP_REGISTER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REGISTER);}
> + AddressSpaceKeyword
> + ',' ByteConstExpr
> + ',' ByteConstExpr
> + ',' QWordConstExpr
> + OptionalAccessSize
> + OptionalNameString_Last
> + ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$11,$12);}
> + | PARSEOP_REGISTER '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +SpiSerialBusTerm
> + : PARSEOP_SPI_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);}
> + WordConstExpr /* 04: DeviceSelection */
> + OptionalDevicePolarity /* 05: DevicePolarity */
> + OptionalWireMode /* 06: WireMode */
> + ',' ByteConstExpr /* 08: DataBitLength */
> + OptionalSlaveMode /* 09: SlaveMode */
> + ',' DWordConstExpr /* 11: ConnectionSpeed */
> + ',' ClockPolarityKeyword /* 13: ClockPolarity */
> + ',' ClockPhaseKeyword /* 15: ClockPhase */
> + ',' StringData /* 17: ResourceSource */
> + OptionalByteConstExpr /* 18: ResourceSourceIndex */
> + OptionalResourceType /* 19: ResourceType */
> + OptionalNameString /* 20: DescriptorName */
> + OptionalBuffer_Last /* 21: VendorData */
> + ')' {$$ = TrLinkChildren ($<n>3,13,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21);}
> + | PARSEOP_SPI_SERIALBUS '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +StartDependentFnNoPriTerm
> + : PARSEOP_STARTDEPENDENTFN_NOPRI '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);}
> + ')' '{'
> + ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,1,$6);}
> + | PARSEOP_STARTDEPENDENTFN_NOPRI '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +StartDependentFnTerm
> + : PARSEOP_STARTDEPENDENTFN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);}
> + ByteConstExpr
> + ',' ByteConstExpr
> + ')' '{'
> + ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$9);}
> + | PARSEOP_STARTDEPENDENTFN '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +UartSerialBusTerm
> + : PARSEOP_UART_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);}
> + DWordConstExpr /* 04: ConnectionSpeed */
> + OptionalBitsPerByte /* 05: BitsPerByte */
> + OptionalStopBits /* 06: StopBits */
> + ',' ByteConstExpr /* 08: LinesInUse */
> + OptionalEndian /* 09: Endianess */
> + OptionalParityType /* 10: Parity */
> + OptionalFlowControl /* 11: FlowControl */
> + ',' WordConstExpr /* 13: Rx BufferSize */
> + ',' WordConstExpr /* 15: Tx BufferSize */
> + ',' StringData /* 17: ResourceSource */
> + OptionalByteConstExpr /* 18: ResourceSourceIndex */
> + OptionalResourceType /* 19: ResourceType */
> + OptionalNameString /* 20: DescriptorName */
> + OptionalBuffer_Last /* 21: VendorData */
> + ')' {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21);}
> + | PARSEOP_UART_SERIALBUS '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +VendorLongTerm
> + : PARSEOP_VENDORLONG '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORLONG);}
> + OptionalNameString_First
> + ')' '{'
> + ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
> + | PARSEOP_VENDORLONG '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +VendorShortTerm
> + : PARSEOP_VENDORSHORT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);}
> + OptionalNameString_First
> + ')' '{'
> + ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
> + | PARSEOP_VENDORSHORT '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +WordBusNumberTerm
> + : PARSEOP_WORDBUSNUMBER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);}
> + OptionalResourceType_First
> + OptionalMinType
> + OptionalMaxType
> + OptionalDecodeType
> + ',' WordConstExpr
> + ',' WordConstExpr
> + ',' WordConstExpr
> + ',' WordConstExpr
> + ',' WordConstExpr
> + OptionalByteConstExpr
> + OptionalStringData
> + OptionalNameString_Last
> + ')' {$$ = TrLinkChildren ($<n>3,12,$4,$5,$6,$7,$9,$11,$13,$15,$17,$18,$19,$20);}
> + | PARSEOP_WORDBUSNUMBER '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +WordIOTerm
> + : PARSEOP_WORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDIO);}
> + OptionalResourceType_First
> + OptionalMinType
> + OptionalMaxType
> + OptionalDecodeType
> + OptionalRangeType
> + ',' WordConstExpr
> + ',' WordConstExpr
> + ',' WordConstExpr
> + ',' WordConstExpr
> + ',' WordConstExpr
> + OptionalByteConstExpr
> + OptionalStringData
> + OptionalNameString
> + OptionalType
> + OptionalTranslationType_Last
> + ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);}
> + | PARSEOP_WORDIO '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +WordSpaceTerm
> + : PARSEOP_WORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDSPACE);}
> + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
> + OptionalResourceType
> + OptionalDecodeType
> + OptionalMinType
> + OptionalMaxType
> + ',' ByteConstExpr
> + ',' WordConstExpr
> + ',' WordConstExpr
> + ',' WordConstExpr
> + ',' WordConstExpr
> + ',' WordConstExpr
> + OptionalByteConstExpr
> + OptionalStringData
> + OptionalNameString_Last
> + ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);}
> + | PARSEOP_WORDSPACE '('
> + error ')' {$$ = AslDoError(); yyclearin;}
> + ;
> +
> +
> +/******* Object References ***********************************************/
> +
> +/* Allow IO, DMA, IRQ Resource macro names to also be used as identifiers */
> +
> +NameString
> + : NameSeg {}
> + | PARSEOP_NAMESTRING {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) AslCompilerlval.s);}
> + | PARSEOP_IO {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IO");}
> + | PARSEOP_DMA {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "DMA");}
> + | PARSEOP_IRQ {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IRQ");}
> + ;
> +
> +NameSeg
> + : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, (ACPI_NATIVE_INT) AslCompilerlval.s);}
> + ;
> +
> +
> +/******* Helper rules ****************************************************/
> +
> +
> +AmlPackageLengthTerm
> + : Integer {$$ = TrUpdateNode (PARSEOP_PACKAGE_LENGTH,(ACPI_PARSE_OBJECT *) $1);}
> + ;
> +
> +NameStringItem
> + : ',' NameString {$$ = $2;}
> + | ',' error {$$ = AslDoError (); yyclearin;}
> + ;
> +
> +TermArgItem
> + : ',' TermArg {$$ = $2;}
> + | ',' error {$$ = AslDoError (); yyclearin;}
> + ;
> +
> +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;}
> + | ',' DataBufferTerm {$$ = $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);}
> + ;
> +
> +OptionalReference
> + : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */
> + | ',' {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */
> + | ',' TermArg {$$ = $2;}
> + ;
> +
> +OptionalResourceType_First
> + : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);}
> + | ResourceTypeKeyword {$$ = $1;}
> + ;
> +
> +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;}
> + ;
> +
> +OptionalSerializeRuleKeyword
> + : {$$ = NULL;}
> + | ',' {$$ = NULL;}
> + | ',' SerializeRuleKeyword {$$ = $2;}
> + ;
> +
> +OptionalSlaveMode
> + : ',' {$$ = NULL;}
> + | ',' SlaveModeKeyword {$$ = $2;}
> + ;
> +
> +OptionalShareType
> + : {$$ = NULL;}
> + | ',' {$$ = NULL;}
> + | ',' ShareTypeKeyword {$$ = $2;}
> + ;
> +
> +OptionalShareType_First
> + : {$$ = NULL;}
> + | ShareTypeKeyword {$$ = $1;}
> + ;
> +
> +OptionalStopBits
> + : ',' {$$ = NULL;}
> + | ',' StopBitsKeyword {$$ = $2;}
> + ;
> +
> +OptionalStringData
> + : {$$ = NULL;}
> + | ',' {$$ = NULL;}
> + | ',' StringData {$$ = $2;}
> + ;
> +
> +OptionalTermArg
> + : {$$ = NULL;}
> + | TermArg {$$ = $1;}
> + ;
> +
> +OptionalType
> + : {$$ = NULL;}
> + | ',' {$$ = NULL;}
> + | ',' TypeKeyword {$$ = $2;}
> + ;
> +
> +OptionalType_Last
> + : {$$ = NULL;}
> + | ',' {$$ = NULL;}
> + | ',' TypeKeyword {$$ = $2;}
> + ;
> +
> +OptionalTranslationType_Last
> + : {$$ = NULL;}
> + | ',' {$$ = NULL;}
> + | ',' TranslationKeyword {$$ = $2;}
> + ;
> +
> +OptionalWireMode
> + : ',' {$$ = NULL;}
> + | ',' WireModeKeyword {$$ = $2;}
> + ;
> +
> +OptionalWordConst
> + : {$$ = NULL;}
> + | WordConst {$$ = $1;}
> + ;
> +
> +OptionalWordConstExpr
> + : ',' {$$ = NULL;}
> + | ',' WordConstExpr {$$ = $2;}
> + ;
> +
> +OptionalXferSize
> + : {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);}
> + | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);}
> + | ',' XferSizeKeyword {$$ = $2;}
> + ;
> diff --git a/src/acpica/source/compiler/aslsupport.y b/src/acpica/source/compiler/aslsupport.y
> new file mode 100644
> index 0000000..f5168d3
> --- /dev/null
> +++ b/src/acpica/source/compiler/aslsupport.y
> @@ -0,0 +1,192 @@
> +NoEcho('
> +/******************************************************************************
> + *
> + * Module Name: aslsupport.y - Bison/Yacc C support functions
> + *
> + *****************************************************************************/
> +
> +/******************************************************************************
> + *
> + * 1. Copyright Notice
> + *
> + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
> + * All rights reserved.
> + *
> + * 2. License
> + *
> + * 2.1. This is your license from Intel Corp. under its intellectual property
> + * rights. You may have additional license terms from the party that provided
> + * you this software, covering your right to use that party's intellectual
> + * property rights.
> + *
> + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
> + * copy of the source code appearing in this file ("Covered Code") an
> + * irrevocable, perpetual, worldwide license under Intel's copyrights in the
> + * base code distributed originally by Intel ("Original Intel Code") to copy,
> + * make derivatives, distribute, use and display any portion of the Covered
> + * Code in any form, with the right to sublicense such rights; and
> + *
> + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
> + * license (with the right to sublicense), under only those claims of Intel
> + * patents that are infringed by the Original Intel Code, to make, use, sell,
> + * offer to sell, and import the Covered Code and derivative works thereof
> + * solely to the minimum extent necessary to exercise the above copyright
> + * license, and in no event shall the patent license extend to any additions
> + * to or modifications of the Original Intel Code. No other license or right
> + * is granted directly or by implication, estoppel or otherwise;
> + *
> + * The above copyright and patent license is granted only if the following
> + * conditions are met:
> + *
> + * 3. Conditions
> + *
> + * 3.1. Redistribution of Source with Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification with rights to further distribute source must include
> + * the above Copyright Notice, the above License, this list of Conditions,
> + * and the following Disclaimer and Export Compliance provision. In addition,
> + * Licensee must cause all Covered Code to which Licensee contributes to
> + * contain a file documenting the changes Licensee made to create that Covered
> + * Code and the date of any change. Licensee must include in that file the
> + * documentation of any changes made by any predecessor Licensee. Licensee
> + * must include a prominent statement that the modification is derived,
> + * directly or indirectly, from Original Intel Code.
> + *
> + * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification without rights to further distribute source must
> + * include the following Disclaimer and Export Compliance provision in the
> + * documentation and/or other materials provided with distribution. In
> + * addition, Licensee may not authorize further sublicense of source of any
> + * portion of the Covered Code, and must include terms to the effect that the
> + * license from Licensee to its licensee is limited to the intellectual
> + * property embodied in the software Licensee provides to its licensee, and
> + * not to intellectual property embodied in modifications its licensee may
> + * make.
> + *
> + * 3.3. Redistribution of Executable. Redistribution in executable form of any
> + * substantial portion of the Covered Code or modification must reproduce the
> + * above Copyright Notice, and the following Disclaimer and Export Compliance
> + * provision in the documentation and/or other materials provided with the
> + * distribution.
> + *
> + * 3.4. Intel retains all right, title, and interest in and to the Original
> + * Intel Code.
> + *
> + * 3.5. Neither the name Intel nor any other trademark owned or controlled by
> + * Intel shall be used in advertising or otherwise to promote the sale, use or
> + * other dealings in products derived from or relating to the Covered Code
> + * without prior written authorization from Intel.
> + *
> + * 4. Disclaimer and Export Compliance
> + *
> + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
> + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
> + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
> + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
> + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
> + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
> + * PARTICULAR PURPOSE.
> + *
> + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
> + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
> + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
> + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
> + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
> + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
> + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
> + * LIMITED REMEDY.
> + *
> + * 4.3. Licensee shall not export, either directly or indirectly, any of this
> + * software or system incorporating such software without first obtaining any
> + * required license or other approval from the U. S. Department of Commerce or
> + * any other agency or department of the United States Government. In the
> + * event Licensee exports any such software from the United States or
> + * re-exports any such software from a foreign destination, Licensee shall
> + * ensure that the distribution and export/re-export of the software is in
> + * compliance with all laws, regulations, orders, or other restrictions of the
> + * U.S. Export Administration Regulations. Licensee agrees that neither it nor
> + * any of its subsidiaries will export/re-export any technical data, process,
> + * software, or service, directly or indirectly, to any country for which the
> + * United States government or any agency thereof requires an export license,
> + * other governmental approval, or letter of assurance, without first obtaining
> + * such license, approval or letter.
> + *
> + *****************************************************************************/
> +
> +')
> +
> +/******************************************************************************
> + *
> + * Local support functions
> + *
> + *****************************************************************************/
> +
> +/*! [Begin] no source code translation */
> +int
> +AslCompilerwrap(void)
> +{
> + return (1);
> +}
> +/*! [End] no source code translation !*/
> +
> +
> +void *
> +AslLocalAllocate (
> + unsigned int Size)
> +{
> + void *Mem;
> +
> +
> + DbgPrint (ASL_PARSE_OUTPUT,
> + "\nAslLocalAllocate: Expanding Stack to %u\n\n", Size);
> +
> + Mem = ACPI_ALLOCATE_ZEROED (Size);
> + if (!Mem)
> + {
> + AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
> + Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
> + Gbl_InputByteCount, Gbl_CurrentColumn,
> + Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
> + exit (1);
> + }
> +
> + return (Mem);
> +}
> +
> +ACPI_PARSE_OBJECT *
> +AslDoError (
> + void)
> +{
> +
> + return (TrCreateLeafNode (PARSEOP_ERRORNODE));
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: UtGetOpName
> + *
> + * PARAMETERS: ParseOpcode - Parser keyword ID
> + *
> + * RETURN: Pointer to the opcode name
> + *
> + * DESCRIPTION: Get the ascii name of the parse opcode
> + *
> + ******************************************************************************/
> +
> +char *
> +UtGetOpName (
> + UINT32 ParseOpcode)
> +{
> +#ifdef ASL_YYTNAME_START
> + /*
> + * First entries (ASL_YYTNAME_START) in yytname are special reserved names.
> + * Ignore first 8 characters of the name
> + */
> + return ((char *) yytname
> + [(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
> +#else
> + return ("[Unknown parser generator]");
> +#endif
> +}
> diff --git a/src/acpica/source/compiler/asltokens.y b/src/acpica/source/compiler/asltokens.y
> new file mode 100644
> index 0000000..d58c7e1
> --- /dev/null
> +++ b/src/acpica/source/compiler/asltokens.y
> @@ -0,0 +1,540 @@
> +NoEcho('
> +/******************************************************************************
> + *
> + * Module Name: asltokens.y - Bison/Yacc token types
> + *
> + *****************************************************************************/
> +
> +/******************************************************************************
> + *
> + * 1. Copyright Notice
> + *
> + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
> + * All rights reserved.
> + *
> + * 2. License
> + *
> + * 2.1. This is your license from Intel Corp. under its intellectual property
> + * rights. You may have additional license terms from the party that provided
> + * you this software, covering your right to use that party's intellectual
> + * property rights.
> + *
> + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
> + * copy of the source code appearing in this file ("Covered Code") an
> + * irrevocable, perpetual, worldwide license under Intel's copyrights in the
> + * base code distributed originally by Intel ("Original Intel Code") to copy,
> + * make derivatives, distribute, use and display any portion of the Covered
> + * Code in any form, with the right to sublicense such rights; and
> + *
> + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
> + * license (with the right to sublicense), under only those claims of Intel
> + * patents that are infringed by the Original Intel Code, to make, use, sell,
> + * offer to sell, and import the Covered Code and derivative works thereof
> + * solely to the minimum extent necessary to exercise the above copyright
> + * license, and in no event shall the patent license extend to any additions
> + * to or modifications of the Original Intel Code. No other license or right
> + * is granted directly or by implication, estoppel or otherwise;
> + *
> + * The above copyright and patent license is granted only if the following
> + * conditions are met:
> + *
> + * 3. Conditions
> + *
> + * 3.1. Redistribution of Source with Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification with rights to further distribute source must include
> + * the above Copyright Notice, the above License, this list of Conditions,
> + * and the following Disclaimer and Export Compliance provision. In addition,
> + * Licensee must cause all Covered Code to which Licensee contributes to
> + * contain a file documenting the changes Licensee made to create that Covered
> + * Code and the date of any change. Licensee must include in that file the
> + * documentation of any changes made by any predecessor Licensee. Licensee
> + * must include a prominent statement that the modification is derived,
> + * directly or indirectly, from Original Intel Code.
> + *
> + * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification without rights to further distribute source must
> + * include the following Disclaimer and Export Compliance provision in the
> + * documentation and/or other materials provided with distribution. In
> + * addition, Licensee may not authorize further sublicense of source of any
> + * portion of the Covered Code, and must include terms to the effect that the
> + * license from Licensee to its licensee is limited to the intellectual
> + * property embodied in the software Licensee provides to its licensee, and
> + * not to intellectual property embodied in modifications its licensee may
> + * make.
> + *
> + * 3.3. Redistribution of Executable. Redistribution in executable form of any
> + * substantial portion of the Covered Code or modification must reproduce the
> + * above Copyright Notice, and the following Disclaimer and Export Compliance
> + * provision in the documentation and/or other materials provided with the
> + * distribution.
> + *
> + * 3.4. Intel retains all right, title, and interest in and to the Original
> + * Intel Code.
> + *
> + * 3.5. Neither the name Intel nor any other trademark owned or controlled by
> + * Intel shall be used in advertising or otherwise to promote the sale, use or
> + * other dealings in products derived from or relating to the Covered Code
> + * without prior written authorization from Intel.
> + *
> + * 4. Disclaimer and Export Compliance
> + *
> + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
> + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
> + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
> + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
> + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
> + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
> + * PARTICULAR PURPOSE.
> + *
> + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
> + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
> + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
> + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
> + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
> + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
> + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
> + * LIMITED REMEDY.
> + *
> + * 4.3. Licensee shall not export, either directly or indirectly, any of this
> + * software or system incorporating such software without first obtaining any
> + * required license or other approval from the U. S. Department of Commerce or
> + * any other agency or department of the United States Government. In the
> + * event Licensee exports any such software from the United States or
> + * re-exports any such software from a foreign destination, Licensee shall
> + * ensure that the distribution and export/re-export of the software is in
> + * compliance with all laws, regulations, orders, or other restrictions of the
> + * U.S. Export Administration Regulations. Licensee agrees that neither it nor
> + * any of its subsidiaries will export/re-export any technical data, process,
> + * software, or service, directly or indirectly, to any country for which the
> + * United States government or any agency thereof requires an export license,
> + * other governmental approval, or letter of assurance, without first obtaining
> + * such license, approval or letter.
> + *
> + *****************************************************************************/
> +
> +')
> +
> +/******************************************************************************
> + *
> + * Token types: These are returned by the lexer
> + *
> + * NOTE: This list MUST match the AslKeywordMapping table found
> + * in aslmap.c EXACTLY! Double check any changes!
> + *
> + *****************************************************************************/
> +
> +%token <i> PARSEOP_ACCESSAS
> +%token <i> PARSEOP_ACCESSATTRIB_BLOCK
> +%token <i> PARSEOP_ACCESSATTRIB_BLOCK_CALL
> +%token <i> PARSEOP_ACCESSATTRIB_BYTE
> +%token <i> PARSEOP_ACCESSATTRIB_MULTIBYTE
> +%token <i> PARSEOP_ACCESSATTRIB_QUICK
> +%token <i> PARSEOP_ACCESSATTRIB_RAW_BYTES
> +%token <i> PARSEOP_ACCESSATTRIB_RAW_PROCESS
> +%token <i> PARSEOP_ACCESSATTRIB_SND_RCV
> +%token <i> PARSEOP_ACCESSATTRIB_WORD
> +%token <i> PARSEOP_ACCESSATTRIB_WORD_CALL
> +%token <i> PARSEOP_ACCESSTYPE_ANY
> +%token <i> PARSEOP_ACCESSTYPE_BUF
> +%token <i> PARSEOP_ACCESSTYPE_BYTE
> +%token <i> PARSEOP_ACCESSTYPE_DWORD
> +%token <i> PARSEOP_ACCESSTYPE_QWORD
> +%token <i> PARSEOP_ACCESSTYPE_WORD
> +%token <i> PARSEOP_ACQUIRE
> +%token <i> PARSEOP_ADD
> +%token <i> PARSEOP_ADDRESSINGMODE_7BIT
> +%token <i> PARSEOP_ADDRESSINGMODE_10BIT
> +%token <i> PARSEOP_ADDRESSTYPE_ACPI
> +%token <i> PARSEOP_ADDRESSTYPE_MEMORY
> +%token <i> PARSEOP_ADDRESSTYPE_NVS
> +%token <i> PARSEOP_ADDRESSTYPE_RESERVED
> +%token <i> PARSEOP_ALIAS
> +%token <i> PARSEOP_AND
> +%token <i> PARSEOP_ARG0
> +%token <i> PARSEOP_ARG1
> +%token <i> PARSEOP_ARG2
> +%token <i> PARSEOP_ARG3
> +%token <i> PARSEOP_ARG4
> +%token <i> PARSEOP_ARG5
> +%token <i> PARSEOP_ARG6
> +%token <i> PARSEOP_BANKFIELD
> +%token <i> PARSEOP_BITSPERBYTE_EIGHT
> +%token <i> PARSEOP_BITSPERBYTE_FIVE
> +%token <i> PARSEOP_BITSPERBYTE_NINE
> +%token <i> PARSEOP_BITSPERBYTE_SEVEN
> +%token <i> PARSEOP_BITSPERBYTE_SIX
> +%token <i> PARSEOP_BREAK
> +%token <i> PARSEOP_BREAKPOINT
> +%token <i> PARSEOP_BUFFER
> +%token <i> PARSEOP_BUSMASTERTYPE_MASTER
> +%token <i> PARSEOP_BUSMASTERTYPE_NOTMASTER
> +%token <i> PARSEOP_BYTECONST
> +%token <i> PARSEOP_CASE
> +%token <i> PARSEOP_CLOCKPHASE_FIRST
> +%token <i> PARSEOP_CLOCKPHASE_SECOND
> +%token <i> PARSEOP_CLOCKPOLARITY_HIGH
> +%token <i> PARSEOP_CLOCKPOLARITY_LOW
> +%token <i> PARSEOP_CONCATENATE
> +%token <i> PARSEOP_CONCATENATERESTEMPLATE
> +%token <i> PARSEOP_CONDREFOF
> +%token <i> PARSEOP_CONNECTION
> +%token <i> PARSEOP_CONTINUE
> +%token <i> PARSEOP_COPYOBJECT
> +%token <i> PARSEOP_CREATEBITFIELD
> +%token <i> PARSEOP_CREATEBYTEFIELD
> +%token <i> PARSEOP_CREATEDWORDFIELD
> +%token <i> PARSEOP_CREATEFIELD
> +%token <i> PARSEOP_CREATEQWORDFIELD
> +%token <i> PARSEOP_CREATEWORDFIELD
> +%token <i> PARSEOP_DATABUFFER
> +%token <i> PARSEOP_DATATABLEREGION
> +%token <i> PARSEOP_DEBUG
> +%token <i> PARSEOP_DECODETYPE_POS
> +%token <i> PARSEOP_DECODETYPE_SUB
> +%token <i> PARSEOP_DECREMENT
> +%token <i> PARSEOP_DEFAULT
> +%token <i> PARSEOP_DEFAULT_ARG
> +%token <i> PARSEOP_DEFINITIONBLOCK
> +%token <i> PARSEOP_DEREFOF
> +%token <i> PARSEOP_DEVICE
> +%token <i> PARSEOP_DEVICEPOLARITY_HIGH
> +%token <i> PARSEOP_DEVICEPOLARITY_LOW
> +%token <i> PARSEOP_DIVIDE
> +%token <i> PARSEOP_DMA
> +%token <i> PARSEOP_DMATYPE_A
> +%token <i> PARSEOP_DMATYPE_COMPATIBILITY
> +%token <i> PARSEOP_DMATYPE_B
> +%token <i> PARSEOP_DMATYPE_F
> +%token <i> PARSEOP_DWORDCONST
> +%token <i> PARSEOP_DWORDIO
> +%token <i> PARSEOP_DWORDMEMORY
> +%token <i> PARSEOP_DWORDSPACE
> +%token <i> PARSEOP_EISAID
> +%token <i> PARSEOP_ELSE
> +%token <i> PARSEOP_ELSEIF
> +%token <i> PARSEOP_ENDDEPENDENTFN
> +%token <i> PARSEOP_ENDIAN_BIG
> +%token <i> PARSEOP_ENDIAN_LITTLE
> +%token <i> PARSEOP_ENDTAG
> +%token <i> PARSEOP_ERRORNODE
> +%token <i> PARSEOP_EVENT
> +%token <i> PARSEOP_EXTENDEDIO
> +%token <i> PARSEOP_EXTENDEDMEMORY
> +%token <i> PARSEOP_EXTENDEDSPACE
> +%token <i> PARSEOP_EXTERNAL
> +%token <i> PARSEOP_FATAL
> +%token <i> PARSEOP_FIELD
> +%token <i> PARSEOP_FINDSETLEFTBIT
> +%token <i> PARSEOP_FINDSETRIGHTBIT
> +%token <i> PARSEOP_FIXEDDMA
> +%token <i> PARSEOP_FIXEDIO
> +%token <i> PARSEOP_FLOWCONTROL_HW
> +%token <i> PARSEOP_FLOWCONTROL_NONE
> +%token <i> PARSEOP_FLOWCONTROL_SW
> +%token <i> PARSEOP_FROMBCD
> +%token <i> PARSEOP_FUNCTION
> +%token <i> PARSEOP_GPIO_INT
> +%token <i> PARSEOP_GPIO_IO
> +%token <i> PARSEOP_I2C_SERIALBUS
> +%token <i> PARSEOP_IF
> +%token <i> PARSEOP_INCLUDE
> +%token <i> PARSEOP_INCLUDE_END
> +%token <i> PARSEOP_INCREMENT
> +%token <i> PARSEOP_INDEX
> +%token <i> PARSEOP_INDEXFIELD
> +%token <i> PARSEOP_INTEGER
> +%token <i> PARSEOP_INTERRUPT
> +%token <i> PARSEOP_INTLEVEL_ACTIVEBOTH
> +%token <i> PARSEOP_INTLEVEL_ACTIVEHIGH
> +%token <i> PARSEOP_INTLEVEL_ACTIVELOW
> +%token <i> PARSEOP_INTTYPE_EDGE
> +%token <i> PARSEOP_INTTYPE_LEVEL
> +%token <i> PARSEOP_IO
> +%token <i> PARSEOP_IODECODETYPE_10
> +%token <i> PARSEOP_IODECODETYPE_16
> +%token <i> PARSEOP_IORESTRICT_IN
> +%token <i> PARSEOP_IORESTRICT_NONE
> +%token <i> PARSEOP_IORESTRICT_OUT
> +%token <i> PARSEOP_IORESTRICT_PRESERVE
> +%token <i> PARSEOP_IRQ
> +%token <i> PARSEOP_IRQNOFLAGS
> +%token <i> PARSEOP_LAND
> +%token <i> PARSEOP_LEQUAL
> +%token <i> PARSEOP_LGREATER
> +%token <i> PARSEOP_LGREATEREQUAL
> +%token <i> PARSEOP_LLESS
> +%token <i> PARSEOP_LLESSEQUAL
> +%token <i> PARSEOP_LNOT
> +%token <i> PARSEOP_LNOTEQUAL
> +%token <i> PARSEOP_LOAD
> +%token <i> PARSEOP_LOADTABLE
> +%token <i> PARSEOP_LOCAL0
> +%token <i> PARSEOP_LOCAL1
> +%token <i> PARSEOP_LOCAL2
> +%token <i> PARSEOP_LOCAL3
> +%token <i> PARSEOP_LOCAL4
> +%token <i> PARSEOP_LOCAL5
> +%token <i> PARSEOP_LOCAL6
> +%token <i> PARSEOP_LOCAL7
> +%token <i> PARSEOP_LOCKRULE_LOCK
> +%token <i> PARSEOP_LOCKRULE_NOLOCK
> +%token <i> PARSEOP_LOR
> +%token <i> PARSEOP_MATCH
> +%token <i> PARSEOP_MATCHTYPE_MEQ
> +%token <i> PARSEOP_MATCHTYPE_MGE
> +%token <i> PARSEOP_MATCHTYPE_MGT
> +%token <i> PARSEOP_MATCHTYPE_MLE
> +%token <i> PARSEOP_MATCHTYPE_MLT
> +%token <i> PARSEOP_MATCHTYPE_MTR
> +%token <i> PARSEOP_MAXTYPE_FIXED
> +%token <i> PARSEOP_MAXTYPE_NOTFIXED
> +%token <i> PARSEOP_MEMORY24
> +%token <i> PARSEOP_MEMORY32
> +%token <i> PARSEOP_MEMORY32FIXED
> +%token <i> PARSEOP_MEMTYPE_CACHEABLE
> +%token <i> PARSEOP_MEMTYPE_NONCACHEABLE
> +%token <i> PARSEOP_MEMTYPE_PREFETCHABLE
> +%token <i> PARSEOP_MEMTYPE_WRITECOMBINING
> +%token <i> PARSEOP_METHOD
> +%token <i> PARSEOP_METHODCALL
> +%token <i> PARSEOP_MID
> +%token <i> PARSEOP_MINTYPE_FIXED
> +%token <i> PARSEOP_MINTYPE_NOTFIXED
> +%token <i> PARSEOP_MOD
> +%token <i> PARSEOP_MULTIPLY
> +%token <i> PARSEOP_MUTEX
> +%token <i> PARSEOP_NAME
> +%token <s> PARSEOP_NAMESEG
> +%token <s> PARSEOP_NAMESTRING
> +%token <i> PARSEOP_NAND
> +%token <i> PARSEOP_NOOP
> +%token <i> PARSEOP_NOR
> +%token <i> PARSEOP_NOT
> +%token <i> PARSEOP_NOTIFY
> +%token <i> PARSEOP_OBJECTTYPE
> +%token <i> PARSEOP_OBJECTTYPE_BFF
> +%token <i> PARSEOP_OBJECTTYPE_BUF
> +%token <i> PARSEOP_OBJECTTYPE_DDB
> +%token <i> PARSEOP_OBJECTTYPE_DEV
> +%token <i> PARSEOP_OBJECTTYPE_EVT
> +%token <i> PARSEOP_OBJECTTYPE_FLD
> +%token <i> PARSEOP_OBJECTTYPE_INT
> +%token <i> PARSEOP_OBJECTTYPE_MTH
> +%token <i> PARSEOP_OBJECTTYPE_MTX
> +%token <i> PARSEOP_OBJECTTYPE_OPR
> +%token <i> PARSEOP_OBJECTTYPE_PKG
> +%token <i> PARSEOP_OBJECTTYPE_POW
> +%token <i> PARSEOP_OBJECTTYPE_PRO
> +%token <i> PARSEOP_OBJECTTYPE_STR
> +%token <i> PARSEOP_OBJECTTYPE_THZ
> +%token <i> PARSEOP_OBJECTTYPE_UNK
> +%token <i> PARSEOP_OFFSET
> +%token <i> PARSEOP_ONE
> +%token <i> PARSEOP_ONES
> +%token <i> PARSEOP_OPERATIONREGION
> +%token <i> PARSEOP_OR
> +%token <i> PARSEOP_PACKAGE
> +%token <i> PARSEOP_PACKAGE_LENGTH
> +%token <i> PARSEOP_PARITYTYPE_EVEN
> +%token <i> PARSEOP_PARITYTYPE_MARK
> +%token <i> PARSEOP_PARITYTYPE_NONE
> +%token <i> PARSEOP_PARITYTYPE_ODD
> +%token <i> PARSEOP_PARITYTYPE_SPACE
> +%token <i> PARSEOP_PIN_NOPULL
> +%token <i> PARSEOP_PIN_PULLDEFAULT
> +%token <i> PARSEOP_PIN_PULLDOWN
> +%token <i> PARSEOP_PIN_PULLUP
> +%token <i> PARSEOP_POWERRESOURCE
> +%token <i> PARSEOP_PROCESSOR
> +%token <i> PARSEOP_QWORDCONST
> +%token <i> PARSEOP_QWORDIO
> +%token <i> PARSEOP_QWORDMEMORY
> +%token <i> PARSEOP_QWORDSPACE
> +%token <i> PARSEOP_RANGETYPE_ENTIRE
> +%token <i> PARSEOP_RANGETYPE_ISAONLY
> +%token <i> PARSEOP_RANGETYPE_NONISAONLY
> +%token <i> PARSEOP_RAW_DATA
> +%token <i> PARSEOP_READWRITETYPE_BOTH
> +%token <i> PARSEOP_READWRITETYPE_READONLY
> +%token <i> PARSEOP_REFOF
> +%token <i> PARSEOP_REGIONSPACE_CMOS
> +%token <i> PARSEOP_REGIONSPACE_EC
> +%token <i> PARSEOP_REGIONSPACE_FFIXEDHW
> +%token <i> PARSEOP_REGIONSPACE_GPIO
> +%token <i> PARSEOP_REGIONSPACE_GSBUS
> +%token <i> PARSEOP_REGIONSPACE_IO
> +%token <i> PARSEOP_REGIONSPACE_IPMI
> +%token <i> PARSEOP_REGIONSPACE_MEM
> +%token <i> PARSEOP_REGIONSPACE_PCC
> +%token <i> PARSEOP_REGIONSPACE_PCI
> +%token <i> PARSEOP_REGIONSPACE_PCIBAR
> +%token <i> PARSEOP_REGIONSPACE_SMBUS
> +%token <i> PARSEOP_REGISTER
> +%token <i> PARSEOP_RELEASE
> +%token <i> PARSEOP_RESERVED_BYTES
> +%token <i> PARSEOP_RESET
> +%token <i> PARSEOP_RESOURCETEMPLATE
> +%token <i> PARSEOP_RESOURCETYPE_CONSUMER
> +%token <i> PARSEOP_RESOURCETYPE_PRODUCER
> +%token <i> PARSEOP_RETURN
> +%token <i> PARSEOP_REVISION
> +%token <i> PARSEOP_SCOPE
> +%token <i> PARSEOP_SERIALIZERULE_NOTSERIAL
> +%token <i> PARSEOP_SERIALIZERULE_SERIAL
> +%token <i> PARSEOP_SHARETYPE_EXCLUSIVE
> +%token <i> PARSEOP_SHARETYPE_EXCLUSIVEWAKE
> +%token <i> PARSEOP_SHARETYPE_SHARED
> +%token <i> PARSEOP_SHARETYPE_SHAREDWAKE
> +%token <i> PARSEOP_SHIFTLEFT
> +%token <i> PARSEOP_SHIFTRIGHT
> +%token <i> PARSEOP_SIGNAL
> +%token <i> PARSEOP_SIZEOF
> +%token <i> PARSEOP_SLAVEMODE_CONTROLLERINIT
> +%token <i> PARSEOP_SLAVEMODE_DEVICEINIT
> +%token <i> PARSEOP_SLEEP
> +%token <i> PARSEOP_SPI_SERIALBUS
> +%token <i> PARSEOP_STALL
> +%token <i> PARSEOP_STARTDEPENDENTFN
> +%token <i> PARSEOP_STARTDEPENDENTFN_NOPRI
> +%token <i> PARSEOP_STOPBITS_ONE
> +%token <i> PARSEOP_STOPBITS_ONEPLUSHALF
> +%token <i> PARSEOP_STOPBITS_TWO
> +%token <i> PARSEOP_STOPBITS_ZERO
> +%token <i> PARSEOP_STORE
> +%token <s> PARSEOP_STRING_LITERAL
> +%token <i> PARSEOP_SUBTRACT
> +%token <i> PARSEOP_SWITCH
> +%token <i> PARSEOP_THERMALZONE
> +%token <i> PARSEOP_TIMER
> +%token <i> PARSEOP_TOBCD
> +%token <i> PARSEOP_TOBUFFER
> +%token <i> PARSEOP_TODECIMALSTRING
> +%token <i> PARSEOP_TOHEXSTRING
> +%token <i> PARSEOP_TOINTEGER
> +%token <i> PARSEOP_TOSTRING
> +%token <i> PARSEOP_TOUUID
> +%token <i> PARSEOP_TRANSLATIONTYPE_DENSE
> +%token <i> PARSEOP_TRANSLATIONTYPE_SPARSE
> +%token <i> PARSEOP_TYPE_STATIC
> +%token <i> PARSEOP_TYPE_TRANSLATION
> +%token <i> PARSEOP_UART_SERIALBUS
> +%token <i> PARSEOP_UNICODE
> +%token <i> PARSEOP_UNLOAD
> +%token <i> PARSEOP_UPDATERULE_ONES
> +%token <i> PARSEOP_UPDATERULE_PRESERVE
> +%token <i> PARSEOP_UPDATERULE_ZEROS
> +%token <i> PARSEOP_VAR_PACKAGE
> +%token <i> PARSEOP_VENDORLONG
> +%token <i> PARSEOP_VENDORSHORT
> +%token <i> PARSEOP_WAIT
> +%token <i> PARSEOP_WHILE
> +%token <i> PARSEOP_WIREMODE_FOUR
> +%token <i> PARSEOP_WIREMODE_THREE
> +%token <i> PARSEOP_WORDBUSNUMBER
> +%token <i> PARSEOP_WORDCONST
> +%token <i> PARSEOP_WORDIO
> +%token <i> PARSEOP_WORDSPACE
> +%token <i> PARSEOP_XFERSIZE_8
> +%token <i> PARSEOP_XFERSIZE_16
> +%token <i> PARSEOP_XFERSIZE_32
> +%token <i> PARSEOP_XFERSIZE_64
> +%token <i> PARSEOP_XFERSIZE_128
> +%token <i> PARSEOP_XFERSIZE_256
> +%token <i> PARSEOP_XFERTYPE_8
> +%token <i> PARSEOP_XFERTYPE_8_16
> +%token <i> PARSEOP_XFERTYPE_16
> +%token <i> PARSEOP_XOR
> +%token <i> PARSEOP_ZERO
> +
> +/* ToPld macro */
> +
> +%token <i> PARSEOP_TOPLD
> +%token <i> PARSEOP_PLD_REVISION
> +%token <i> PARSEOP_PLD_IGNORECOLOR
> +%token <i> PARSEOP_PLD_RED
> +%token <i> PARSEOP_PLD_GREEN
> +%token <i> PARSEOP_PLD_BLUE
> +%token <i> PARSEOP_PLD_WIDTH
> +%token <i> PARSEOP_PLD_HEIGHT
> +%token <i> PARSEOP_PLD_USERVISIBLE
> +%token <i> PARSEOP_PLD_DOCK
> +%token <i> PARSEOP_PLD_LID
> +%token <i> PARSEOP_PLD_PANEL
> +%token <i> PARSEOP_PLD_VERTICALPOSITION
> +%token <i> PARSEOP_PLD_HORIZONTALPOSITION
> +%token <i> PARSEOP_PLD_SHAPE
> +%token <i> PARSEOP_PLD_GROUPORIENTATION
> +%token <i> PARSEOP_PLD_GROUPTOKEN
> +%token <i> PARSEOP_PLD_GROUPPOSITION
> +%token <i> PARSEOP_PLD_BAY
> +%token <i> PARSEOP_PLD_EJECTABLE
> +%token <i> PARSEOP_PLD_EJECTREQUIRED
> +%token <i> PARSEOP_PLD_CABINETNUMBER
> +%token <i> PARSEOP_PLD_CARDCAGENUMBER
> +%token <i> PARSEOP_PLD_REFERENCE
> +%token <i> PARSEOP_PLD_ROTATION
> +%token <i> PARSEOP_PLD_ORDER
> +%token <i> PARSEOP_PLD_RESERVED
> +%token <i> PARSEOP_PLD_VERTICALOFFSET
> +%token <i> PARSEOP_PLD_HORIZONTALOFFSET
> +
> +/*
> + * C-style expression parser. These must appear after all of the
> + * standard ASL operators and keywords.
> + *
> + * Note: The order of these tokens implements the precedence rules
> + * (low precedence to high). See aslrules.y for an exhaustive list.
> + */
> +%right <i> PARSEOP_EXP_EQUALS
> + PARSEOP_EXP_ADD_EQ
> + PARSEOP_EXP_SUB_EQ
> + PARSEOP_EXP_MUL_EQ
> + PARSEOP_EXP_DIV_EQ
> + PARSEOP_EXP_MOD_EQ
> + PARSEOP_EXP_SHL_EQ
> + PARSEOP_EXP_SHR_EQ
> + PARSEOP_EXP_AND_EQ
> + PARSEOP_EXP_XOR_EQ
> + PARSEOP_EXP_OR_EQ
> +
> +%left <i> PARSEOP_EXP_LOGICAL_OR
> +%left <i> PARSEOP_EXP_LOGICAL_AND
> +%left <i> PARSEOP_EXP_OR
> +%left <i> PARSEOP_EXP_XOR
> +%left <i> PARSEOP_EXP_AND
> +%left <i> PARSEOP_EXP_EQUAL
> + PARSEOP_EXP_NOT_EQUAL
> +%left <i> PARSEOP_EXP_GREATER
> + PARSEOP_EXP_LESS
> + PARSEOP_EXP_GREATER_EQUAL
> + PARSEOP_EXP_LESS_EQUAL
> +%left <i> PARSEOP_EXP_SHIFT_RIGHT
> + PARSEOP_EXP_SHIFT_LEFT
> +%left <i> PARSEOP_EXP_ADD
> + PARSEOP_EXP_SUBTRACT
> +%left <i> PARSEOP_EXP_MULTIPLY
> + PARSEOP_EXP_DIVIDE
> + PARSEOP_EXP_MODULO
> +
> +%right <i> PARSEOP_EXP_NOT
> + PARSEOP_EXP_LOGICAL_NOT
> +
> +%left <i> PARSEOP_EXP_INCREMENT
> + PARSEOP_EXP_DECREMENT
> +
> +%token <i> PARSEOP_PRINTF
> +%token <i> PARSEOP_FPRINTF
> +/* Specific parentheses tokens are not used at this time */
> + /* PARSEOP_EXP_PAREN_OPEN */
> + /* PARSEOP_EXP_PAREN_CLOSE */
> +
> +/*
> + * Special functions. These should probably stay at the end of this
> + * table.
> + */
> +%token <i> PARSEOP___DATE__
> +%token <i> PARSEOP___FILE__
> +%token <i> PARSEOP___LINE__
> +%token <i> PARSEOP___PATH__
> diff --git a/src/acpica/source/compiler/asltree.c b/src/acpica/source/compiler/asltree.c
> index 58f495d..2e0daef 100644
> --- a/src/acpica/source/compiler/asltree.c
> +++ b/src/acpica/source/compiler/asltree.c
> @@ -520,6 +520,124 @@ TrSetEndLineNumber (
>
> /*******************************************************************************
> *
> + * FUNCTION: TrCreateAssignmentNode
> + *
> + * PARAMETERS: Target - Assignment target
> + * Source - Assignment source
> + *
> + * RETURN: Pointer to the new node. Aborts on allocation failure
> + *
> + * DESCRIPTION: Implements the C-style '=' operator. It changes the parse
> + * tree if possible to utilize the last argument of the math
> + * operators which is a target operand -- thus saving invocation
> + * of and additional Store() operator. An optimization.
> + *
> + ******************************************************************************/
> +
> +ACPI_PARSE_OBJECT *
> +TrCreateAssignmentNode (
> + ACPI_PARSE_OBJECT *Target,
> + ACPI_PARSE_OBJECT *Source)
> +{
> + ACPI_PARSE_OBJECT *TargetOp;
> + ACPI_PARSE_OBJECT *SourceOp1;
> + ACPI_PARSE_OBJECT *SourceOp2;
> + ACPI_PARSE_OBJECT *Operator;
> +
> +
> + DbgPrint (ASL_PARSE_OUTPUT,
> + "\nTrCreateAssignmentNode Line [%u to %u] Source %s Target %s\n",
> + Source->Asl.LineNumber, Source->Asl.EndLine,
> + UtGetOpName (Source->Asl.ParseOpcode),
> + UtGetOpName (Target->Asl.ParseOpcode));
> +
> + TrSetNodeFlags (Target, NODE_IS_TARGET);
> +
> + switch (Source->Asl.ParseOpcode)
> + {
> + /*
> + * Only these operators can be optimized because they have
> + * a target operand
> + */
> + case PARSEOP_ADD:
> + case PARSEOP_AND:
> + case PARSEOP_DIVIDE:
> + case PARSEOP_MOD:
> + case PARSEOP_MULTIPLY:
> + case PARSEOP_NOT:
> + case PARSEOP_OR:
> + case PARSEOP_SHIFTLEFT:
> + case PARSEOP_SHIFTRIGHT:
> + case PARSEOP_SUBTRACT:
> + case PARSEOP_XOR:
> +
> + break;
> +
> + /* Otherwise, just create a normal Store operator */
> +
> + default:
> +
> + goto CannotOptimize;
> + }
> +
> + /*
> + * Transform the parse tree such that the target is moved to the
> + * last operand of the operator
> + */
> + SourceOp1 = Source->Asl.Child;
> + SourceOp2 = SourceOp1->Asl.Next;
> +
> + /* NOT only has one operand, but has a target */
> +
> + if (Source->Asl.ParseOpcode == PARSEOP_NOT)
> + {
> + SourceOp2 = SourceOp1;
> + }
> +
> + /* DIVIDE has an extra target operand (remainder) */
> +
> + if (Source->Asl.ParseOpcode == PARSEOP_DIVIDE)
> + {
> + SourceOp2 = SourceOp2->Asl.Next;
> + }
> +
> + TargetOp = SourceOp2->Asl.Next;
> +
> + /*
> + * Can't perform this optimization if there already is a target
> + * for the operator (ZERO is a "no target" placeholder).
> + */
> + if (TargetOp->Asl.ParseOpcode != PARSEOP_ZERO)
> + {
> + goto CannotOptimize;
> + }
> +
> + /* Link in the target as the final operand */
> +
> + SourceOp2->Asl.Next = Target;
> + Target->Asl.Parent = Source;
> +
> + return (Source);
> +
> +
> +CannotOptimize:
> +
> + Operator = TrAllocateNode (PARSEOP_STORE);
> + TrLinkChildren (Operator, 2, Source, Target);
> +
> + /* Set the appropriate line numbers for the new node */
> +
> + Operator->Asl.LineNumber = Target->Asl.LineNumber;
> + Operator->Asl.LogicalLineNumber = Target->Asl.LogicalLineNumber;
> + Operator->Asl.LogicalByteOffset = Target->Asl.LogicalByteOffset;
> + Operator->Asl.Column = Target->Asl.Column;
> +
> + return (Operator);
> +}
> +
> +
> +/*******************************************************************************
> + *
> * FUNCTION: TrCreateLeafNode
> *
> * PARAMETERS: ParseOpcode - New opcode to be assigned to the node
> @@ -635,6 +753,81 @@ TrCreateConstantLeafNode (
>
> /*******************************************************************************
> *
> + * FUNCTION: TrCreateTargetOperand
> + *
> + * PARAMETERS: OriginalOp - Op to be copied
> + *
> + * RETURN: Pointer to the new node. Aborts on allocation failure
> + *
> + * DESCRIPTION: Copy an existing node (and subtree). Used in ASL+ (C-style)
> + * expressions where the target is the same as one of the
> + * operands. A new node and subtree must be created from the
> + * original so that the parse tree can be linked properly.
> + *
> + * NOTE: This code is specific to target operands that are the last
> + * operand in an ASL/AML operator. Meaning that the top-level
> + * parse Op in a possible subtree has a NULL Next pointer.
> + * This simplifies the recursion.
> + *
> + * Subtree example:
> + * DeRefOf (Local1) += 32
> + *
> + * This gets converted to:
> + * Add (DeRefOf (Local1), 32, DeRefOf (Local1))
> + *
> + * Each DeRefOf has a single child, Local1. Even more complex
> + * subtrees can be created via the Index and DeRefOf operators.
> + *
> + ******************************************************************************/
> +
> +ACPI_PARSE_OBJECT *
> +TrCreateTargetOperand (
> + ACPI_PARSE_OBJECT *OriginalOp,
> + ACPI_PARSE_OBJECT *ParentOp)
> +{
> + ACPI_PARSE_OBJECT *Op;
> +
> +
> + if (!OriginalOp)
> + {
> + return (NULL);
> + }
> +
> + Op = TrGetNextNode ();
> +
> + /* Copy the pertinent values (omit link pointer fields) */
> +
> + Op->Asl.Value = OriginalOp->Asl.Value;
> + Op->Asl.Filename = OriginalOp->Asl.Filename;
> + Op->Asl.LineNumber = OriginalOp->Asl.LineNumber;
> + Op->Asl.LogicalLineNumber = OriginalOp->Asl.LogicalLineNumber;
> + Op->Asl.LogicalByteOffset = OriginalOp->Asl.LogicalByteOffset;
> + Op->Asl.Column = OriginalOp->Asl.Column;
> + Op->Asl.Flags = OriginalOp->Asl.Flags;
> + Op->Asl.CompileFlags = OriginalOp->Asl.CompileFlags;
> + Op->Asl.AmlOpcode = OriginalOp->Asl.AmlOpcode;
> + Op->Asl.ParseOpcode = OriginalOp->Asl.ParseOpcode;
> + Op->Asl.Parent = ParentOp;
> + UtSetParseOpName (Op);
> +
> + /* Copy a possible subtree below this node */
> +
> + if (OriginalOp->Asl.Child)
> + {
> + Op->Asl.Child = TrCreateTargetOperand (OriginalOp->Asl.Child, Op);
> + }
> +
> + if (OriginalOp->Asl.Next) /* Null for top-level node */
> + {
> + Op->Asl.Next = TrCreateTargetOperand (OriginalOp->Asl.Next, ParentOp);
> + }
> +
> + return (Op);
> +}
> +
> +
> +/*******************************************************************************
> + *
> * FUNCTION: TrCreateValuedLeafNode
> *
> * PARAMETERS: ParseOpcode - New opcode to be assigned to the node
> diff --git a/src/acpica/source/compiler/asltypes.y b/src/acpica/source/compiler/asltypes.y
> new file mode 100644
> index 0000000..a3699d6
> --- /dev/null
> +++ b/src/acpica/source/compiler/asltypes.y
> @@ -0,0 +1,465 @@
> +NoEcho('
> +/******************************************************************************
> + *
> + * Module Name: asltypes.y - Bison/Yacc production types/names
> + *
> + *****************************************************************************/
> +
> +/******************************************************************************
> + *
> + * 1. Copyright Notice
> + *
> + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
> + * All rights reserved.
> + *
> + * 2. License
> + *
> + * 2.1. This is your license from Intel Corp. under its intellectual property
> + * rights. You may have additional license terms from the party that provided
> + * you this software, covering your right to use that party's intellectual
> + * property rights.
> + *
> + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
> + * copy of the source code appearing in this file ("Covered Code") an
> + * irrevocable, perpetual, worldwide license under Intel's copyrights in the
> + * base code distributed originally by Intel ("Original Intel Code") to copy,
> + * make derivatives, distribute, use and display any portion of the Covered
> + * Code in any form, with the right to sublicense such rights; and
> + *
> + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
> + * license (with the right to sublicense), under only those claims of Intel
> + * patents that are infringed by the Original Intel Code, to make, use, sell,
> + * offer to sell, and import the Covered Code and derivative works thereof
> + * solely to the minimum extent necessary to exercise the above copyright
> + * license, and in no event shall the patent license extend to any additions
> + * to or modifications of the Original Intel Code. No other license or right
> + * is granted directly or by implication, estoppel or otherwise;
> + *
> + * The above copyright and patent license is granted only if the following
> + * conditions are met:
> + *
> + * 3. Conditions
> + *
> + * 3.1. Redistribution of Source with Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification with rights to further distribute source must include
> + * the above Copyright Notice, the above License, this list of Conditions,
> + * and the following Disclaimer and Export Compliance provision. In addition,
> + * Licensee must cause all Covered Code to which Licensee contributes to
> + * contain a file documenting the changes Licensee made to create that Covered
> + * Code and the date of any change. Licensee must include in that file the
> + * documentation of any changes made by any predecessor Licensee. Licensee
> + * must include a prominent statement that the modification is derived,
> + * directly or indirectly, from Original Intel Code.
> + *
> + * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification without rights to further distribute source must
> + * include the following Disclaimer and Export Compliance provision in the
> + * documentation and/or other materials provided with distribution. In
> + * addition, Licensee may not authorize further sublicense of source of any
> + * portion of the Covered Code, and must include terms to the effect that the
> + * license from Licensee to its licensee is limited to the intellectual
> + * property embodied in the software Licensee provides to its licensee, and
> + * not to intellectual property embodied in modifications its licensee may
> + * make.
> + *
> + * 3.3. Redistribution of Executable. Redistribution in executable form of any
> + * substantial portion of the Covered Code or modification must reproduce the
> + * above Copyright Notice, and the following Disclaimer and Export Compliance
> + * provision in the documentation and/or other materials provided with the
> + * distribution.
> + *
> + * 3.4. Intel retains all right, title, and interest in and to the Original
> + * Intel Code.
> + *
> + * 3.5. Neither the name Intel nor any other trademark owned or controlled by
> + * Intel shall be used in advertising or otherwise to promote the sale, use or
> + * other dealings in products derived from or relating to the Covered Code
> + * without prior written authorization from Intel.
> + *
> + * 4. Disclaimer and Export Compliance
> + *
> + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
> + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
> + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
> + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
> + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
> + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
> + * PARTICULAR PURPOSE.
> + *
> + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
> + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
> + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
> + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
> + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
> + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
> + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
> + * LIMITED REMEDY.
> + *
> + * 4.3. Licensee shall not export, either directly or indirectly, any of this
> + * software or system incorporating such software without first obtaining any
> + * required license or other approval from the U. S. Department of Commerce or
> + * any other agency or department of the United States Government. In the
> + * event Licensee exports any such software from the United States or
> + * re-exports any such software from a foreign destination, Licensee shall
> + * ensure that the distribution and export/re-export of the software is in
> + * compliance with all laws, regulations, orders, or other restrictions of the
> + * U.S. Export Administration Regulations. Licensee agrees that neither it nor
> + * any of its subsidiaries will export/re-export any technical data, process,
> + * software, or service, directly or indirectly, to any country for which the
> + * United States government or any agency thereof requires an export license,
> + * other governmental approval, or letter of assurance, without first obtaining
> + * such license, approval or letter.
> + *
> + *****************************************************************************/
> +
> +')
> +
> +/******************************************************************************
> + *
> + * Production names
> + *
> + *****************************************************************************/
> +
> +%type <n> ArgList
> +%type <n> ASLCode
> +%type <n> BufferData
> +%type <n> BufferTermData
> +%type <n> CompilerDirective
> +%type <n> DataObject
> +%type <n> DefinitionBlockTerm
> +%type <n> IntegerData
> +%type <n> NamedObject
> +%type <n> NameSpaceModifier
> +%type <n> Object
> +%type <n> ObjectList
> +%type <n> PackageData
> +%type <n> ParameterTypePackage
> +%type <n> ParameterTypePackageList
> +%type <n> ParameterTypesPackage
> +%type <n> ParameterTypesPackageList
> +%type <n> RequiredTarget
> +%type <n> SimpleTarget
> +%type <n> StringData
> +%type <n> Target
> +%type <n> Term
> +%type <n> TermArg
> +%type <n> TermList
> +%type <n> UserTerm
> +
> +/* Type4Opcode is obsolete */
> +
> +%type <n> Type1Opcode
> +%type <n> Type2BufferOpcode
> +%type <n> Type2BufferOrStringOpcode
> +%type <n> Type2IntegerOpcode
> +%type <n> Type2Opcode
> +%type <n> Type2StringOpcode
> +%type <n> Type3Opcode
> +%type <n> Type5Opcode
> +%type <n> Type6Opcode
> +
> +%type <n> AccessAsTerm
> +%type <n> ExternalTerm
> +%type <n> FieldUnit
> +%type <n> FieldUnitEntry
> +%type <n> FieldUnitList
> +%type <n> IncludeTerm
> +%type <n> OffsetTerm
> +%type <n> OptionalAccessAttribTerm
> +
> +/* Named Objects */
> +
> +%type <n> BankFieldTerm
> +%type <n> CreateBitFieldTerm
> +%type <n> CreateByteFieldTerm
> +%type <n> CreateDWordFieldTerm
> +%type <n> CreateFieldTerm
> +%type <n> CreateQWordFieldTerm
> +%type <n> CreateWordFieldTerm
> +%type <n> DataRegionTerm
> +%type <n> DeviceTerm
> +%type <n> EventTerm
> +%type <n> FieldTerm
> +%type <n> FunctionTerm
> +%type <n> IndexFieldTerm
> +%type <n> MethodTerm
> +%type <n> MutexTerm
> +%type <n> OpRegionTerm
> +%type <n> OpRegionSpaceIdTerm
> +%type <n> PowerResTerm
> +%type <n> ProcessorTerm
> +%type <n> ThermalZoneTerm
> +
> +/* Namespace modifiers */
> +
> +%type <n> AliasTerm
> +%type <n> NameTerm
> +%type <n> ScopeTerm
> +
> +/* Type 1 opcodes */
> +
> +%type <n> BreakPointTerm
> +%type <n> BreakTerm
> +%type <n> CaseDefaultTermList
> +%type <n> CaseTerm
> +%type <n> ContinueTerm
> +%type <n> DefaultTerm
> +%type <n> ElseTerm
> +%type <n> FatalTerm
> +%type <n> IfElseTerm
> +%type <n> IfTerm
> +%type <n> LoadTerm
> +%type <n> NoOpTerm
> +%type <n> NotifyTerm
> +%type <n> ReleaseTerm
> +%type <n> ResetTerm
> +%type <n> ReturnTerm
> +%type <n> SignalTerm
> +%type <n> SleepTerm
> +%type <n> StallTerm
> +%type <n> SwitchTerm
> +%type <n> UnloadTerm
> +%type <n> WhileTerm
> +/* %type <n> CaseTermList */
> +
> +/* Type 2 opcodes */
> +
> +%type <n> AcquireTerm
> +%type <n> AddTerm
> +%type <n> AndTerm
> +%type <n> ConcatResTerm
> +%type <n> ConcatTerm
> +%type <n> CondRefOfTerm
> +%type <n> CopyObjectTerm
> +%type <n> DecTerm
> +%type <n> DerefOfTerm
> +%type <n> DivideTerm
> +%type <n> FindSetLeftBitTerm
> +%type <n> FindSetRightBitTerm
> +%type <n> FromBCDTerm
> +%type <n> IncTerm
> +%type <n> IndexTerm
> +%type <n> LAndTerm
> +%type <n> LEqualTerm
> +%type <n> LGreaterEqualTerm
> +%type <n> LGreaterTerm
> +%type <n> LLessEqualTerm
> +%type <n> LLessTerm
> +%type <n> LNotEqualTerm
> +%type <n> LNotTerm
> +%type <n> LoadTableTerm
> +%type <n> LOrTerm
> +%type <n> MatchTerm
> +%type <n> MidTerm
> +%type <n> ModTerm
> +%type <n> MultiplyTerm
> +%type <n> NAndTerm
> +%type <n> NOrTerm
> +%type <n> NotTerm
> +%type <n> ObjectTypeTerm
> +%type <n> OrTerm
> +%type <n> RefOfTerm
> +%type <n> ShiftLeftTerm
> +%type <n> ShiftRightTerm
> +%type <n> SizeOfTerm
> +%type <n> StoreTerm
> +%type <n> SubtractTerm
> +%type <n> TimerTerm
> +%type <n> ToBCDTerm
> +%type <n> ToBufferTerm
> +%type <n> ToDecimalStringTerm
> +%type <n> ToHexStringTerm
> +%type <n> ToIntegerTerm
> +%type <n> ToStringTerm
> +%type <n> WaitTerm
> +%type <n> XOrTerm
> +
> +/* Keywords */
> +
> +%type <n> AccessAttribKeyword
> +%type <n> AccessTypeKeyword
> +%type <n> AddressingModeKeyword
> +%type <n> AddressKeyword
> +%type <n> AddressSpaceKeyword
> +%type <n> BitsPerByteKeyword
> +%type <n> ClockPhaseKeyword
> +%type <n> ClockPolarityKeyword
> +%type <n> DecodeKeyword
> +%type <n> DevicePolarityKeyword
> +%type <n> DMATypeKeyword
> +%type <n> EndianKeyword
> +%type <n> FlowControlKeyword
> +%type <n> InterruptLevel
> +%type <n> InterruptTypeKeyword
> +%type <n> IODecodeKeyword
> +%type <n> IoRestrictionKeyword
> +%type <n> LockRuleKeyword
> +%type <n> MatchOpKeyword
> +%type <n> MaxKeyword
> +%type <n> MemTypeKeyword
> +%type <n> MinKeyword
> +%type <n> ObjectTypeKeyword
> +%type <n> OptionalBusMasterKeyword
> +%type <n> OptionalReadWriteKeyword
> +%type <n> ParityTypeKeyword
> +%type <n> PinConfigByte
> +%type <n> PinConfigKeyword
> +%type <n> RangeTypeKeyword
> +%type <n> RegionSpaceKeyword
> +%type <n> ResourceTypeKeyword
> +%type <n> SerializeRuleKeyword
> +%type <n> ShareTypeKeyword
> +%type <n> SlaveModeKeyword
> +%type <n> StopBitsKeyword
> +%type <n> TranslationKeyword
> +%type <n> TypeKeyword
> +%type <n> UpdateRuleKeyword
> +%type <n> WireModeKeyword
> +%type <n> XferSizeKeyword
> +%type <n> XferTypeKeyword
> +
> +/* Types */
> +
> +%type <n> SuperName
> +%type <n> ObjectTypeName
> +%type <n> ArgTerm
> +%type <n> LocalTerm
> +%type <n> DebugTerm
> +
> +%type <n> Integer
> +%type <n> ByteConst
> +%type <n> WordConst
> +%type <n> DWordConst
> +%type <n> QWordConst
> +%type <n> String
> +
> +%type <n> ConstTerm
> +%type <n> ConstExprTerm
> +%type <n> ByteConstExpr
> +%type <n> WordConstExpr
> +%type <n> DWordConstExpr
> +%type <n> QWordConstExpr
> +
> +%type <n> DWordList
> +%type <n> BufferTerm
> +%type <n> ByteList
> +
> +%type <n> PackageElement
> +%type <n> PackageList
> +%type <n> PackageTerm
> +%type <n> VarPackageLengthTerm
> +
> +/* Macros */
> +
> +%type <n> EISAIDTerm
> +%type <n> ResourceMacroList
> +%type <n> ResourceMacroTerm
> +%type <n> ResourceTemplateTerm
> +%type <n> PldKeyword
> +%type <n> PldKeywordList
> +%type <n> ToPLDTerm
> +%type <n> ToUUIDTerm
> +%type <n> UnicodeTerm
> +%type <n> PrintfArgList
> +%type <n> PrintfTerm
> +%type <n> FprintfTerm
> +
> +/* Resource Descriptors */
> +
> +%type <n> ConnectionTerm
> +%type <n> DataBufferTerm
> +%type <n> DMATerm
> +%type <n> DWordIOTerm
> +%type <n> DWordMemoryTerm
> +%type <n> DWordSpaceTerm
> +%type <n> EndDependentFnTerm
> +%type <n> ExtendedIOTerm
> +%type <n> ExtendedMemoryTerm
> +%type <n> ExtendedSpaceTerm
> +%type <n> FixedDmaTerm
> +%type <n> FixedIOTerm
> +%type <n> GpioIntTerm
> +%type <n> GpioIoTerm
> +%type <n> I2cSerialBusTerm
> +%type <n> InterruptTerm
> +%type <n> IOTerm
> +%type <n> IRQNoFlagsTerm
> +%type <n> IRQTerm
> +%type <n> Memory24Term
> +%type <n> Memory32FixedTerm
> +%type <n> Memory32Term
> +%type <n> NameSeg
> +%type <n> NameString
> +%type <n> QWordIOTerm
> +%type <n> QWordMemoryTerm
> +%type <n> QWordSpaceTerm
> +%type <n> RegisterTerm
> +%type <n> SpiSerialBusTerm
> +%type <n> StartDependentFnNoPriTerm
> +%type <n> StartDependentFnTerm
> +%type <n> UartSerialBusTerm
> +%type <n> VendorLongTerm
> +%type <n> VendorShortTerm
> +%type <n> WordBusNumberTerm
> +%type <n> WordIOTerm
> +%type <n> WordSpaceTerm
> +
> +/* Local types that help construct the AML, not in ACPI spec */
> +
> +%type <n> AmlPackageLengthTerm
> +%type <n> IncludeEndTerm
> +%type <n> NameStringItem
> +%type <n> TermArgItem
> +
> +%type <n> OptionalAccessSize
> +%type <n> OptionalAddressingMode
> +%type <n> OptionalAddressRange
> +%type <n> OptionalBitsPerByte
> +%type <n> OptionalBuffer_Last
> +%type <n> OptionalByteConstExpr
> +%type <n> OptionalCount
> +%type <n> OptionalDecodeType
> +%type <n> OptionalDevicePolarity
> +%type <n> OptionalDWordConstExpr
> +%type <n> OptionalEndian
> +%type <n> OptionalFlowControl
> +%type <n> OptionalIoRestriction
> +%type <n> OptionalListString
> +%type <n> OptionalMaxType
> +%type <n> OptionalMemType
> +%type <n> OptionalMinType
> +%type <n> OptionalNameString
> +%type <n> OptionalNameString_First
> +%type <n> OptionalNameString_Last
> +%type <n> OptionalObjectTypeKeyword
> +%type <n> OptionalParameterTypePackage
> +%type <n> OptionalParameterTypesPackage
> +%type <n> OptionalParityType
> +%type <n> OptionalQWordConstExpr
> +%type <n> OptionalRangeType
> +%type <n> OptionalReference
> +%type <n> OptionalResourceType
> +%type <n> OptionalResourceType_First
> +%type <n> OptionalReturnArg
> +%type <n> OptionalSerializeRuleKeyword
> +%type <n> OptionalShareType
> +%type <n> OptionalShareType_First
> +%type <n> OptionalSlaveMode
> +%type <n> OptionalStopBits
> +%type <n> OptionalStringData
> +%type <n> OptionalTermArg
> +%type <n> OptionalTranslationType_Last
> +%type <n> OptionalType
> +%type <n> OptionalType_Last
> +%type <n> OptionalWireMode
> +%type <n> OptionalWordConst
> +%type <n> OptionalWordConstExpr
> +%type <n> OptionalXferSize
> +
> +/*
> + * C-style expression parser
> + */
> +%type <n> Expression
> +%type <n> EqualsTerm
> diff --git a/src/acpica/source/compiler/aslwalks.c b/src/acpica/source/compiler/aslwalks.c
> index 835769b..be7ef48 100644
> --- a/src/acpica/source/compiler/aslwalks.c
> +++ b/src/acpica/source/compiler/aslwalks.c
> @@ -366,6 +366,13 @@ AnOperandTypecheckWalkEnd (
> {
> RequiredBtypes = AnMapArgTypeToBtype (ArgType);
>
> + if (!ArgOp)
> + {
> + AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, Op,
> + "Null ArgOp in argument loop");
> + AslAbort ();
> + }
> +
> ThisNodeBtype = AnGetBtype (ArgOp);
> if (ThisNodeBtype == ACPI_UINT32_MAX)
> {
> diff --git a/src/acpica/source/compiler/aslxref.c b/src/acpica/source/compiler/aslxref.c
> index 9726b05..5387cbe 100644
> --- a/src/acpica/source/compiler/aslxref.c
> +++ b/src/acpica/source/compiler/aslxref.c
> @@ -904,6 +904,8 @@ XfNamespaceLocateBegin (
> if ((Op->Asl.Parent) &&
> ((Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_REFOF) ||
> (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_DEREFOF) ||
> + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_PACKAGE) ||
> + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_VAR_PACKAGE)||
> (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_OBJECTTYPE)))
> {
> return_ACPI_STATUS (AE_OK);
> diff --git a/src/acpica/source/compiler/dtcompile.c b/src/acpica/source/compiler/dtcompile.c
> index bd7dcf7..10f963c 100644
> --- a/src/acpica/source/compiler/dtcompile.c
> +++ b/src/acpica/source/compiler/dtcompile.c
> @@ -113,7 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DTCOMPILE_C__
> #define _DECLARE_DT_GLOBALS
>
> #include "aslcompiler.h"
> diff --git a/src/acpica/source/compiler/dtexpress.c b/src/acpica/source/compiler/dtexpress.c
> index 705ffc3..a46c2eb 100644
> --- a/src/acpica/source/compiler/dtexpress.c
> +++ b/src/acpica/source/compiler/dtexpress.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DTEXPRESS_C__
> -
> #include "aslcompiler.h"
> #include "dtcompiler.h"
> #include "dtparser.y.h"
> diff --git a/src/acpica/source/compiler/dtfield.c b/src/acpica/source/compiler/dtfield.c
> index e03f891..e3908ba 100644
> --- a/src/acpica/source/compiler/dtfield.c
> +++ b/src/acpica/source/compiler/dtfield.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DTFIELD_C__
> -
> #include "aslcompiler.h"
> #include "dtcompiler.h"
>
> diff --git a/src/acpica/source/compiler/dtio.c b/src/acpica/source/compiler/dtio.c
> index 7c93afe..77bbc5d 100644
> --- a/src/acpica/source/compiler/dtio.c
> +++ b/src/acpica/source/compiler/dtio.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DTIO_C__
> -
> #include "aslcompiler.h"
> #include "dtcompiler.h"
> #include "acapps.h"
> diff --git a/src/acpica/source/compiler/dtsubtable.c b/src/acpica/source/compiler/dtsubtable.c
> index 47b0b5b..13c2a05 100644
> --- a/src/acpica/source/compiler/dtsubtable.c
> +++ b/src/acpica/source/compiler/dtsubtable.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DTSUBTABLE_C__
> -
> #include "aslcompiler.h"
> #include "dtcompiler.h"
>
> diff --git a/src/acpica/source/compiler/dttable.c b/src/acpica/source/compiler/dttable.c
> index 2b86c0e..b80f870 100644
> --- a/src/acpica/source/compiler/dttable.c
> +++ b/src/acpica/source/compiler/dttable.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DTTABLE_C__
> -
> /* Compile all complex data tables */
>
> #include "aslcompiler.h"
> diff --git a/src/acpica/source/compiler/dtutils.c b/src/acpica/source/compiler/dtutils.c
> index 2eac7fa..941fe76 100644
> --- a/src/acpica/source/compiler/dtutils.c
> +++ b/src/acpica/source/compiler/dtutils.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DTUTILS_C__
> -
> #include "aslcompiler.h"
> #include "dtcompiler.h"
> #include "actables.h"
> diff --git a/src/acpica/source/compiler/fwts_iasl_interface.c b/src/acpica/source/compiler/fwts_iasl_interface.c
> index 564cfcb..56dc76e 100644
> --- a/src/acpica/source/compiler/fwts_iasl_interface.c
> +++ b/src/acpica/source/compiler/fwts_iasl_interface.c
> @@ -88,6 +88,7 @@ int fwts_iasl_disassemble_aml(
> Gbl_DoCompile = FALSE;
> Gbl_OutputFilenamePrefix = (char*)outputfile;
> Gbl_UseDefaultAmlFilename = FALSE;
> + AcpiGbl_CstyleDisassembly = FALSE;
> UtConvertBackslashes (Gbl_OutputFilenamePrefix);
>
> /*
> diff --git a/src/acpica/source/components/debugger/dbconvert.c b/src/acpica/source/components/debugger/dbconvert.c
> index cb882a3..61d5418 100644
> --- a/src/acpica/source/components/debugger/dbconvert.c
> +++ b/src/acpica/source/components/debugger/dbconvert.c
> @@ -433,7 +433,9 @@ AcpiDbEncodePldBuffer (
> Dword = 0;
> ACPI_PLD_SET_REVISION (&Dword, PldInfo->Revision);
> ACPI_PLD_SET_IGNORE_COLOR (&Dword, PldInfo->IgnoreColor);
> - ACPI_PLD_SET_COLOR (&Dword, PldInfo->Color);
> + ACPI_PLD_SET_RED (&Dword, PldInfo->Red);
> + ACPI_PLD_SET_GREEN (&Dword, PldInfo->Green);
> + ACPI_PLD_SET_BLUE (&Dword, PldInfo->Blue);
> ACPI_MOVE_32_TO_32 (&Buffer[0], &Dword);
>
> /* Second 32 bits */
> @@ -552,45 +554,47 @@ AcpiDbDumpPldBuffer (
>
> /* First 32-bit dword */
>
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Revision", PldInfo->Revision);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "IgnoreColor", PldInfo->IgnoreColor);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Color", PldInfo->Color);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Revision", PldInfo->Revision);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_IgnoreColor", PldInfo->IgnoreColor);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Red", PldInfo->Red);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Green", PldInfo->Green);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Blue", PldInfo->Blue);
>
> /* Second 32-bit dword */
>
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Width", PldInfo->Width);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Height", PldInfo->Height);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Width", PldInfo->Width);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Height", PldInfo->Height);
>
> /* Third 32-bit dword */
>
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "UserVisible", PldInfo->UserVisible);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Dock", PldInfo->Dock);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Lid", PldInfo->Lid);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Panel", PldInfo->Panel);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "VerticalPosition", PldInfo->VerticalPosition);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "HorizontalPosition", PldInfo->HorizontalPosition);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Shape", PldInfo->Shape);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupOrientation", PldInfo->GroupOrientation);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupToken", PldInfo->GroupToken);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupPosition", PldInfo->GroupPosition);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Bay", PldInfo->Bay);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_UserVisible", PldInfo->UserVisible);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Dock", PldInfo->Dock);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Lid", PldInfo->Lid);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Panel", PldInfo->Panel);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_VerticalPosition", PldInfo->VerticalPosition);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_HorizontalPosition", PldInfo->HorizontalPosition);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Shape", PldInfo->Shape);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_GroupOrientation", PldInfo->GroupOrientation);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_GroupToken", PldInfo->GroupToken);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_GroupPosition", PldInfo->GroupPosition);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Bay", PldInfo->Bay);
>
> /* Fourth 32-bit dword */
>
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Ejectable", PldInfo->Ejectable);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "OspmEjectRequired", PldInfo->OspmEjectRequired);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "CabinetNumber", PldInfo->CabinetNumber);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "CardCageNumber", PldInfo->CardCageNumber);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Reference", PldInfo->Reference);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Rotation", PldInfo->Rotation);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Order", PldInfo->Order);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Ejectable", PldInfo->Ejectable);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_EjectRequired", PldInfo->OspmEjectRequired);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_CabinetNumber", PldInfo->CabinetNumber);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_CardCageNumber", PldInfo->CardCageNumber);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Reference", PldInfo->Reference);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Rotation", PldInfo->Rotation);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Order", PldInfo->Order);
>
> /* Fifth 32-bit dword */
>
> if (BufferDesc->Buffer.Length > 16)
> {
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "VerticalOffset", PldInfo->VerticalOffset);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT, "HorizontalOffset", PldInfo->HorizontalOffset);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_VerticalOffset", PldInfo->VerticalOffset);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_HorizontalOffset", PldInfo->HorizontalOffset);
> }
>
> ACPI_FREE (PldInfo);
> diff --git a/src/acpica/source/components/disassembler/dmbuffer.c b/src/acpica/source/components/disassembler/dmbuffer.c
> index 755c5d4..7275eca 100644
> --- a/src/acpica/source/components/disassembler/dmbuffer.c
> +++ b/src/acpica/source/components/disassembler/dmbuffer.c
> @@ -151,6 +151,51 @@ AcpiDmPldBuffer (
> #define ACPI_BUFFER_BYTES_PER_LINE 8
>
>
> +/* Strings for ToPld */
> +
> +static char *DmPanelList[] =
> +{
> + "TOP",
> + "BOTTOM",
> + "LEFT",
> + "RIGHT",
> + "FRONT",
> + "BACK",
> + "UNKNOWN",
> + NULL
> +};
> +
> +static char *DmVerticalPositionList[] =
> +{
> + "UPPER",
> + "CENTER",
> + "LOWER",
> + NULL
> +};
> +
> +static char *DmHorizontalPositionList[] =
> +{
> + "LEFT",
> + "CENTER",
> + "RIGHT",
> + NULL
> +};
> +
> +static char *DmShapeList[] =
> +{
> + "ROUND",
> + "OVAL",
> + "SQUARE",
> + "VERTICALRECTANGLE",
> + "HORIZONTALRECTANGLE",
> + "VERTICALTRAPEZOID",
> + "HORIZONTALTRAPEZOID",
> + "UNKNOWN",
> + "CHAMFERED",
> + NULL
> +};
> +
> +
> /*******************************************************************************
> *
> * FUNCTION: AcpiDmDisasmByteList
> @@ -304,8 +349,9 @@ AcpiDmByteList (
> break;
>
> case ACPI_DASM_PLD_METHOD:
> -
> +#if 0
> AcpiDmDisasmByteList (Info->Level, ByteData, ByteCount);
> +#endif
> AcpiDmPldBuffer (Info->Level, ByteData, ByteCount);
> break;
>
> @@ -506,11 +552,12 @@ AcpiDmIsUnicodeBuffer (
> return (FALSE);
> }
>
> - /* For each word, 1st byte must be ascii, 2nd byte must be zero */
> + /* For each word, 1st byte must be ascii (1-0x7F), 2nd byte must be zero */
>
> for (i = 0; i < (ByteCount - 2); i += 2)
> {
> - if ((!ACPI_IS_PRINT (ByteData[i])) ||
> + if ((ByteData[i] == 0) ||
> + (ByteData[i] > 0x7F) ||
> (ByteData[(ACPI_SIZE) i + 1] != 0))
> {
> return (FALSE);
> @@ -606,9 +653,14 @@ AcpiDmIsPldBuffer (
> ACPI_PARSE_OBJECT *Op)
> {
> ACPI_NAMESPACE_NODE *Node;
> + ACPI_PARSE_OBJECT *SizeOp;
> ACPI_PARSE_OBJECT *ParentOp;
>
>
> + /* Buffer size is the buffer argument */
> +
> + SizeOp = Op->Common.Value.Arg;
> +
> ParentOp = Op->Common.Parent;
> if (!ParentOp)
> {
> @@ -623,6 +675,9 @@ AcpiDmIsPldBuffer (
>
> if (ACPI_COMPARE_NAME (Node->Name.Ascii, METHOD_NAME__PLD))
> {
> + /* Ignore the Size argument in the disassembly of this buffer op */
> +
> + SizeOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
> return (TRUE);
> }
>
> @@ -645,6 +700,9 @@ AcpiDmIsPldBuffer (
>
> if (ACPI_COMPARE_NAME (Node->Name.Ascii, METHOD_NAME__PLD))
> {
> + /* Ignore the Size argument in the disassembly of this buffer op */
> +
> + SizeOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
> return (TRUE);
> }
> }
> @@ -656,6 +714,51 @@ AcpiDmIsPldBuffer (
>
> /*******************************************************************************
> *
> + * FUNCTION: AcpiDmFindNameByIndex
> + *
> + * PARAMETERS: Index - Index of array to check
> + * List - Array to reference
> + *
> + * RETURN: String from List or empty string
> + *
> + * DESCRIPTION: Finds and returns the char string located at the given index
> + * position in List.
> + *
> + ******************************************************************************/
> +
> +static char *
> +AcpiDmFindNameByIndex (
> + UINT64 Index,
> + char **List)
> +{
> + char *Str;
> + UINT32 i;
> +
> +
> + /* Bounds check */
> +
> + Str = List[0];
> + i = 0;
> +
> + while(Str)
> + {
> + i++;
> + Str = List[i];
> + }
> +
> + if (Index >= i)
> + {
> + /* TBD: Add error msg */
> +
> + return ("");
> + }
> +
> + return (List[Index]);
> +}
> +
> +
> +/*******************************************************************************
> + *
> * FUNCTION: AcpiDmPldBuffer
> *
> * PARAMETERS: Level - Current source code indentation level
> @@ -668,9 +771,12 @@ AcpiDmIsPldBuffer (
> *
> ******************************************************************************/
>
> -#define ACPI_PLD_OUTPUT08 "%*.s/* %18s : %-6.2X */\n", ACPI_MUL_4 (Level), " "
> -#define ACPI_PLD_OUTPUT16 "%*.s/* %18s : %-6.4X */\n", ACPI_MUL_4 (Level), " "
> -#define ACPI_PLD_OUTPUT24 "%*.s/* %18s : %-6.6X */\n", ACPI_MUL_4 (Level), " "
> +#define ACPI_PLD_OUTPUT08 "%*.s%-18s = 0x%X,\n", ACPI_MUL_4 (Level), " "
> +#define ACPI_PLD_OUTPUT08P "%*.s%-18s = 0x%X)\n", ACPI_MUL_4 (Level), " "
> +#define ACPI_PLD_OUTPUT16 "%*.s%-18s = 0x%X,\n", ACPI_MUL_4 (Level), " "
> +#define ACPI_PLD_OUTPUT16P "%*.s%-18s = 0x%X)\n", ACPI_MUL_4 (Level), " "
> +#define ACPI_PLD_OUTPUT24 "%*.s%-18s = 0x%X,\n", ACPI_MUL_4 (Level), " "
> +#define ACPI_PLD_OUTPUTSTR "%*.s%-18s = \"%s\",\n", ACPI_MUL_4 (Level), " "
>
> static void
> AcpiDmPldBuffer (
> @@ -697,47 +803,63 @@ AcpiDmPldBuffer (
> return;
> }
>
> + AcpiOsPrintf ("\n");
> +
> /* First 32-bit dword */
>
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Revision", PldInfo->Revision);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "IgnoreColor", PldInfo->IgnoreColor);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT24,"Color", PldInfo->Color);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Revision", PldInfo->Revision);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_IgnoreColor", PldInfo->IgnoreColor);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Red", PldInfo->Red);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Green", PldInfo->Green);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Blue", PldInfo->Blue);
>
> /* Second 32-bit dword */
>
> - AcpiOsPrintf (ACPI_PLD_OUTPUT16,"Width", PldInfo->Width);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT16,"Height", PldInfo->Height);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT16, "PLD_Width", PldInfo->Width);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT16, "PLD_Height", PldInfo->Height);
>
> /* Third 32-bit dword */
>
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "UserVisible", PldInfo->UserVisible);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Dock", PldInfo->Dock);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Lid", PldInfo->Lid);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Panel", PldInfo->Panel);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "VerticalPosition", PldInfo->VerticalPosition);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "HorizontalPosition", PldInfo->HorizontalPosition);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Shape", PldInfo->Shape);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "GroupOrientation", PldInfo->GroupOrientation);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "GroupToken", PldInfo->GroupToken);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "GroupPosition", PldInfo->GroupPosition);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Bay", PldInfo->Bay);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_UserVisible", PldInfo->UserVisible);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Dock", PldInfo->Dock);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Lid", PldInfo->Lid);
> + AcpiOsPrintf (ACPI_PLD_OUTPUTSTR, "PLD_Panel",
> + AcpiDmFindNameByIndex(PldInfo->Panel, DmPanelList));
> + AcpiOsPrintf (ACPI_PLD_OUTPUTSTR, "PLD_VerticalPosition",
> + AcpiDmFindNameByIndex(PldInfo->VerticalPosition, DmVerticalPositionList));
> + AcpiOsPrintf (ACPI_PLD_OUTPUTSTR, "PLD_HorizontalPosition",
> + AcpiDmFindNameByIndex(PldInfo->HorizontalPosition, DmHorizontalPositionList));
> + AcpiOsPrintf (ACPI_PLD_OUTPUTSTR, "PLD_Shape",
> + AcpiDmFindNameByIndex(PldInfo->Shape, DmShapeList));
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_GroupOrientation", PldInfo->GroupOrientation);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_GroupToken", PldInfo->GroupToken);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_GroupPosition", PldInfo->GroupPosition);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Bay", PldInfo->Bay);
>
> /* Fourth 32-bit dword */
>
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Ejectable", PldInfo->Ejectable);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "OspmEjectRequired", PldInfo->OspmEjectRequired);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "CabinetNumber", PldInfo->CabinetNumber);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "CardCageNumber", PldInfo->CardCageNumber);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Reference", PldInfo->Reference);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Rotation", PldInfo->Rotation);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Order", PldInfo->Order);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Ejectable", PldInfo->Ejectable);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_EjectRequired", PldInfo->OspmEjectRequired);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_CabinetNumber", PldInfo->CabinetNumber);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_CardCageNumber", PldInfo->CardCageNumber);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Reference", PldInfo->Reference);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Rotation", PldInfo->Rotation);
> +
> + if (ByteCount < ACPI_PLD_REV1_BUFFER_SIZE)
> + {
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08P, "PLD_Order", PldInfo->Order);
> + }
> + else
> + {
> + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Order", PldInfo->Order);
> + }
>
> /* Fifth 32-bit dword */
>
> if (ByteCount >= ACPI_PLD_REV1_BUFFER_SIZE)
> {
> - AcpiOsPrintf (ACPI_PLD_OUTPUT16,"VerticalOffset", PldInfo->VerticalOffset);
> - AcpiOsPrintf (ACPI_PLD_OUTPUT16,"HorizontalOffset", PldInfo->HorizontalOffset);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT16, "PLD_VerticalOffset", PldInfo->VerticalOffset);
> + AcpiOsPrintf (ACPI_PLD_OUTPUT16P, "PLD_HorizontalOffset", PldInfo->HorizontalOffset);
> }
>
> ACPI_FREE (PldInfo);
> @@ -764,6 +886,7 @@ AcpiDmUnicode (
> UINT16 *WordData;
> UINT32 WordCount;
> UINT32 i;
> + int OutputValue;
>
>
> /* Extract the buffer info as a WORD buffer */
> @@ -776,7 +899,23 @@ AcpiDmUnicode (
> AcpiOsPrintf ("\"");
> for (i = 0; i < (WordCount - 1); i++)
> {
> - AcpiOsPrintf ("%c", (int) WordData[i]);
> + OutputValue = (int) WordData[i];
> +
> + /* Handle values that must be escaped */
> +
> + if ((OutputValue == '\"') ||
> + (OutputValue == '\\'))
> + {
> + AcpiOsPrintf ("\\%c", OutputValue);
> + }
> + else if (!ACPI_IS_PRINT (OutputValue))
> + {
> + AcpiOsPrintf ("\\x%2.2X", OutputValue);
> + }
> + else
> + {
> + AcpiOsPrintf ("%c", OutputValue);
> + }
> }
>
> AcpiOsPrintf ("\")");
> diff --git a/src/acpica/source/components/disassembler/dmcstyle.c b/src/acpica/source/components/disassembler/dmcstyle.c
> new file mode 100644
> index 0000000..73d7de2
> --- /dev/null
> +++ b/src/acpica/source/components/disassembler/dmcstyle.c
> @@ -0,0 +1,845 @@
> +/*******************************************************************************
> + *
> + * Module Name: dmcstyle - Support for C-style operator disassembly
> + *
> + ******************************************************************************/
> +
> +/******************************************************************************
> + *
> + * 1. Copyright Notice
> + *
> + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
> + * All rights reserved.
> + *
> + * 2. License
> + *
> + * 2.1. This is your license from Intel Corp. under its intellectual property
> + * rights. You may have additional license terms from the party that provided
> + * you this software, covering your right to use that party's intellectual
> + * property rights.
> + *
> + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
> + * copy of the source code appearing in this file ("Covered Code") an
> + * irrevocable, perpetual, worldwide license under Intel's copyrights in the
> + * base code distributed originally by Intel ("Original Intel Code") to copy,
> + * make derivatives, distribute, use and display any portion of the Covered
> + * Code in any form, with the right to sublicense such rights; and
> + *
> + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
> + * license (with the right to sublicense), under only those claims of Intel
> + * patents that are infringed by the Original Intel Code, to make, use, sell,
> + * offer to sell, and import the Covered Code and derivative works thereof
> + * solely to the minimum extent necessary to exercise the above copyright
> + * license, and in no event shall the patent license extend to any additions
> + * to or modifications of the Original Intel Code. No other license or right
> + * is granted directly or by implication, estoppel or otherwise;
> + *
> + * The above copyright and patent license is granted only if the following
> + * conditions are met:
> + *
> + * 3. Conditions
> + *
> + * 3.1. Redistribution of Source with Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification with rights to further distribute source must include
> + * the above Copyright Notice, the above License, this list of Conditions,
> + * and the following Disclaimer and Export Compliance provision. In addition,
> + * Licensee must cause all Covered Code to which Licensee contributes to
> + * contain a file documenting the changes Licensee made to create that Covered
> + * Code and the date of any change. Licensee must include in that file the
> + * documentation of any changes made by any predecessor Licensee. Licensee
> + * must include a prominent statement that the modification is derived,
> + * directly or indirectly, from Original Intel Code.
> + *
> + * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification without rights to further distribute source must
> + * include the following Disclaimer and Export Compliance provision in the
> + * documentation and/or other materials provided with distribution. In
> + * addition, Licensee may not authorize further sublicense of source of any
> + * portion of the Covered Code, and must include terms to the effect that the
> + * license from Licensee to its licensee is limited to the intellectual
> + * property embodied in the software Licensee provides to its licensee, and
> + * not to intellectual property embodied in modifications its licensee may
> + * make.
> + *
> + * 3.3. Redistribution of Executable. Redistribution in executable form of any
> + * substantial portion of the Covered Code or modification must reproduce the
> + * above Copyright Notice, and the following Disclaimer and Export Compliance
> + * provision in the documentation and/or other materials provided with the
> + * distribution.
> + *
> + * 3.4. Intel retains all right, title, and interest in and to the Original
> + * Intel Code.
> + *
> + * 3.5. Neither the name Intel nor any other trademark owned or controlled by
> + * Intel shall be used in advertising or otherwise to promote the sale, use or
> + * other dealings in products derived from or relating to the Covered Code
> + * without prior written authorization from Intel.
> + *
> + * 4. Disclaimer and Export Compliance
> + *
> + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
> + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
> + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
> + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
> + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
> + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
> + * PARTICULAR PURPOSE.
> + *
> + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
> + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
> + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
> + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
> + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
> + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
> + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
> + * LIMITED REMEDY.
> + *
> + * 4.3. Licensee shall not export, either directly or indirectly, any of this
> + * software or system incorporating such software without first obtaining any
> + * required license or other approval from the U. S. Department of Commerce or
> + * any other agency or department of the United States Government. In the
> + * event Licensee exports any such software from the United States or
> + * re-exports any such software from a foreign destination, Licensee shall
> + * ensure that the distribution and export/re-export of the software is in
> + * compliance with all laws, regulations, orders, or other restrictions of the
> + * U.S. Export Administration Regulations. Licensee agrees that neither it nor
> + * any of its subsidiaries will export/re-export any technical data, process,
> + * software, or service, directly or indirectly, to any country for which the
> + * United States government or any agency thereof requires an export license,
> + * other governmental approval, or letter of assurance, without first obtaining
> + * such license, approval or letter.
> + *
> + *****************************************************************************/
> +
> +#include "acpi.h"
> +#include "accommon.h"
> +#include "acparser.h"
> +#include "amlcode.h"
> +#include "acdisasm.h"
> +#include "acdebug.h"
> +
> +#ifdef ACPI_DISASSEMBLER
> +
> +#define _COMPONENT ACPI_CA_DEBUGGER
> + ACPI_MODULE_NAME ("dmcstyle")
> +
> +
> +/* Local prototypes */
> +
> +static char *
> +AcpiDmGetCompoundSymbol (
> + UINT16 AslOpcode);
> +
> +static void
> +AcpiDmPromoteTarget (
> + ACPI_PARSE_OBJECT *Op,
> + ACPI_PARSE_OBJECT *Target);
> +
> +static BOOLEAN
> +AcpiDmIsValidTarget (
> + ACPI_PARSE_OBJECT *Op);
> +
> +static BOOLEAN
> +AcpiDmIsTargetAnOperand (
> + ACPI_PARSE_OBJECT *Target,
> + ACPI_PARSE_OBJECT *Operand,
> + BOOLEAN TopLevel);
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: AcpiDmCheckForSymbolicOpcode
> + *
> + * PARAMETERS: Op - Current parse object
> + * Walk - Current parse tree walk info
> + *
> + * RETURN: TRUE if opcode can be converted to symbolic, FALSE otherwise
> + *
> + * DESCRIPTION: This is the main code that implements disassembly of AML code
> + * to C-style operators. Called during descending phase of the
> + * parse tree walk.
> + *
> + ******************************************************************************/
> +
> +BOOLEAN
> +AcpiDmCheckForSymbolicOpcode (
> + ACPI_PARSE_OBJECT *Op,
> + ACPI_OP_WALK_INFO *Info)
> +{
> + char *OperatorSymbol = NULL;
> + ACPI_PARSE_OBJECT *Child1;
> + ACPI_PARSE_OBJECT *Child2;
> + ACPI_PARSE_OBJECT *Target;
> +
> +
> + /* Exit immediately if ASL+ not enabled */
> +
> + if (!AcpiGbl_CstyleDisassembly)
> + {
> + return (FALSE);
> + }
> +
> + /* Get the first operand */
> +
> + Child1 = AcpiPsGetArg (Op, 0);
> + if (!Child1)
> + {
> + return (FALSE);
> + }
> +
> + /* Get the second operand */
> +
> + Child2 = Child1->Common.Next;
> +
> + /* Setup the operator string for this opcode */
> +
> + switch (Op->Common.AmlOpcode)
> + {
> + case AML_ADD_OP:
> + OperatorSymbol = " + ";
> + break;
> +
> + case AML_SUBTRACT_OP:
> + OperatorSymbol = " - ";
> + break;
> +
> + case AML_MULTIPLY_OP:
> + OperatorSymbol = " * ";
> + break;
> +
> + case AML_DIVIDE_OP:
> + OperatorSymbol = " / ";
> + break;
> +
> + case AML_MOD_OP:
> + OperatorSymbol = " % ";
> + break;
> +
> + case AML_SHIFT_LEFT_OP:
> + OperatorSymbol = " << ";
> + break;
> +
> + case AML_SHIFT_RIGHT_OP:
> + OperatorSymbol = " >> ";
> + break;
> +
> + case AML_BIT_AND_OP:
> + OperatorSymbol = " & ";
> + break;
> +
> + case AML_BIT_OR_OP:
> + OperatorSymbol = " | ";
> + break;
> +
> + case AML_BIT_XOR_OP:
> + OperatorSymbol = " ^ ";
> + break;
> +
> + /* Logical operators, no target */
> +
> + case AML_LAND_OP:
> + OperatorSymbol = " && ";
> + break;
> +
> + case AML_LEQUAL_OP:
> + OperatorSymbol = " == ";
> + break;
> +
> + case AML_LGREATER_OP:
> + OperatorSymbol = " > ";
> + break;
> +
> + case AML_LLESS_OP:
> + OperatorSymbol = " < ";
> + break;
> +
> + case AML_LOR_OP:
> + OperatorSymbol = " || ";
> + break;
> +
> + case AML_LNOT_OP:
> + /*
> + * Check for the LNOT sub-opcodes. These correspond to
> + * LNotEqual, LLessEqual, and LGreaterEqual. There are
> + * no actual AML opcodes for these operators.
> + */
> + switch (Child1->Common.AmlOpcode)
> + {
> + case AML_LEQUAL_OP:
> + OperatorSymbol = " != ";
> + break;
> +
> + case AML_LGREATER_OP:
> + OperatorSymbol = " <= ";
> + break;
> +
> + case AML_LLESS_OP:
> + OperatorSymbol = " >= ";
> + break;
> +
> + default:
> +
> + /* Unary LNOT case, emit "!" immediately */
> +
> + AcpiOsPrintf ("!");
> + return (TRUE);
> + }
> +
> + Child1->Common.DisasmOpcode = ACPI_DASM_LNOT_SUFFIX;
> + Op->Common.DisasmOpcode = ACPI_DASM_LNOT_PREFIX;
> +
> + /* Save symbol string in the next child (not peer) */
> +
> + Child2 = AcpiPsGetArg (Child1, 0);
> + if (!Child2)
> + {
> + return (FALSE);
> + }
> +
> + Child2->Common.OperatorSymbol = OperatorSymbol;
> + return (TRUE);
> +
> +#ifdef INDEX_SUPPORT
> + case AML_INDEX_OP:
> + Child1->Common.OperatorSymbol = " [";
> + Child2->Common.OperatorSymbol = "]";
> + break;
> +#endif
> +
> + /* Unary operators */
> +
> + case AML_DECREMENT_OP:
> + OperatorSymbol = "--";
> + break;
> +
> + case AML_INCREMENT_OP:
> + OperatorSymbol = "++";
> + break;
> +
> + case AML_BIT_NOT_OP:
> + case AML_STORE_OP:
> + OperatorSymbol = NULL;
> + break;
> +
> + default:
> + return (FALSE);
> + }
> +
> + if (Child1->Common.DisasmOpcode == ACPI_DASM_LNOT_SUFFIX)
> + {
> + return (TRUE);
> + }
> +
> + /*
> + * This is the key to how the disassembly of the C-style operators
> + * works. We save the operator symbol in the first child, thus
> + * deferring symbol output until after the first operand has been
> + * emitted.
> + */
> + if (!Child1->Common.OperatorSymbol)
> + {
> + Child1->Common.OperatorSymbol = OperatorSymbol;
> + }
> +
> + /*
> + * Check for a valid target as the 3rd (or sometimes 2nd) operand
> + *
> + * Compound assignment operator support:
> + * Attempt to optimize constructs of the form:
> + * Add (Local1, 0xFF, Local1)
> + * to:
> + * Local1 += 0xFF
> + *
> + * Only the math operators and Store() have a target.
> + * Logicals have no target.
> + */
> + switch (Op->Common.AmlOpcode)
> + {
> + case AML_ADD_OP:
> + case AML_SUBTRACT_OP:
> + case AML_MULTIPLY_OP:
> + case AML_DIVIDE_OP:
> + case AML_MOD_OP:
> + case AML_SHIFT_LEFT_OP:
> + case AML_SHIFT_RIGHT_OP:
> + case AML_BIT_AND_OP:
> + case AML_BIT_OR_OP:
> + case AML_BIT_XOR_OP:
> +
> + /* Target is 3rd operand */
> +
> + Target = Child2->Common.Next;
> + if (Op->Common.AmlOpcode == AML_DIVIDE_OP)
> + {
> + /*
> + * Divide has an extra target operand (Remainder).
> + * If this extra target is specified, it cannot be converted
> + * to a C-style operator
> + */
> + if (AcpiDmIsValidTarget (Target))
> + {
> + Child1->Common.OperatorSymbol = NULL;
> + return (FALSE);
> + }
> +
> + Target->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
> + Target = Target->Common.Next;
> + }
> +
> + /* Parser should ensure there is at least a placeholder target */
> +
> + if (!Target)
> + {
> + return (FALSE);
> + }
> +
> + if (!AcpiDmIsValidTarget (Target))
> + {
> + /* Not a valid target (placeholder only, from parser) */
> + break;
> + }
> +
> + /*
> + * Promote the target up to the first child in the parse
> + * tree. This is done because the target will be output
> + * first, in the form:
> + * <Target> = Operands...
> + */
> + AcpiDmPromoteTarget (Op, Target);
> +
> + /*
> + * Check for possible conversion to a "Compound Assignment".
> + *
> + * Determine if either operand is the same as the target
> + * and display compound assignment operator and other operand.
> + */
> + if ((AcpiDmIsTargetAnOperand (Target, Child1, TRUE)) ||
> + (AcpiDmIsTargetAnOperand (Target, Child2, TRUE)))
> + {
> + Target->Common.OperatorSymbol =
> + AcpiDmGetCompoundSymbol (Op->Common.AmlOpcode);
> +
> + /* Convert operator to compound assignment */
> +
> + Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND;
> + Child1->Common.OperatorSymbol = NULL;
> + return (TRUE);
> + }
> +
> + /*
> + * If we are within a C-style expression, emit an extra open
> + * paren. Implemented by examining the parent op.
> + */
> + switch (Op->Common.Parent->Common.AmlOpcode)
> + {
> + case AML_ADD_OP:
> + case AML_SUBTRACT_OP:
> + case AML_MULTIPLY_OP:
> + case AML_DIVIDE_OP:
> + case AML_MOD_OP:
> + case AML_SHIFT_LEFT_OP:
> + case AML_SHIFT_RIGHT_OP:
> + case AML_BIT_AND_OP:
> + case AML_BIT_OR_OP:
> + case AML_BIT_XOR_OP:
> + case AML_LAND_OP:
> + case AML_LEQUAL_OP:
> + case AML_LGREATER_OP:
> + case AML_LLESS_OP:
> + case AML_LOR_OP:
> +
> + Op->Common.DisasmFlags |= ACPI_PARSEOP_ASSIGNMENT;
> + AcpiOsPrintf ("(");
> + break;
> +
> + default:
> + break;
> + }
> +
> + /* Normal output for ASL/AML operators with a target operand */
> +
> + Target->Common.OperatorSymbol = " = (";
> + return (TRUE);
> +
> + /* Binary operators, no parens */
> +
> + case AML_DECREMENT_OP:
> + case AML_INCREMENT_OP:
> + return (TRUE);
> +
> +#ifdef INDEX_SUPPORT
> + case AML_INDEX_OP:
> +
> + /* Target is optional, 3rd operand */
> +
> + Target = Child2->Common.Next;
> + if (AcpiDmIsValidTarget (Target))
> + {
> + AcpiDmPromoteTarget (Op, Target);
> +
> + if (!Target->Common.OperatorSymbol)
> + {
> + Target->Common.OperatorSymbol = " = ";
> + }
> + }
> + return (TRUE);
> +#endif
> +
> + case AML_STORE_OP:
> + /*
> + * Target is the 2nd operand.
> + * We know the target is valid, it is not optional.
> + * In the parse tree, simply swap the target with the
> + * source so that the target is processed first.
> + */
> + Target = Child1->Common.Next;
> + AcpiDmPromoteTarget (Op, Target);
> +
> + if (!Target->Common.OperatorSymbol)
> + {
> + Target->Common.OperatorSymbol = " = ";
> + }
> + return (TRUE);
> +
> + case AML_BIT_NOT_OP:
> +
> + /* Target is optional, 2nd operand */
> +
> + Target = Child1->Common.Next;
> + if (!Target)
> + {
> + return (FALSE);
> + }
> +
> + if (AcpiDmIsValidTarget (Target))
> + {
> + /* Valid target, not a placeholder */
> +
> + AcpiDmPromoteTarget (Op, Target);
> + Target->Common.OperatorSymbol = " = ~";
> + }
> + else
> + {
> + /* No target. Emit this prefix operator immediately */
> +
> + AcpiOsPrintf ("~");
> + }
> + return (TRUE);
> +
> + default:
> + break;
> + }
> +
> + /* All other operators, emit an open paren */
> +
> + AcpiOsPrintf ("(");
> + return (TRUE);
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: AcpiDmCloseOperator
> + *
> + * PARAMETERS: Op - Current parse object
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Closes an operator by adding a closing parentheses if and
> + * when necessary. Called during ascending phase of the
> + * parse tree walk.
> + *
> + ******************************************************************************/
> +
> +void
> +AcpiDmCloseOperator (
> + ACPI_PARSE_OBJECT *Op)
> +{
> +
> + /* Always emit paren if ASL+ disassembly disabled */
> +
> + if (!AcpiGbl_CstyleDisassembly)
> + {
> + AcpiOsPrintf (")");
> + return;
> + }
> +
> + /* Check if we need to add an additional closing paren */
> +
> + switch (Op->Common.AmlOpcode)
> + {
> + case AML_ADD_OP:
> + case AML_SUBTRACT_OP:
> + case AML_MULTIPLY_OP:
> + case AML_DIVIDE_OP:
> + case AML_MOD_OP:
> + case AML_SHIFT_LEFT_OP:
> + case AML_SHIFT_RIGHT_OP:
> + case AML_BIT_AND_OP:
> + case AML_BIT_OR_OP:
> + case AML_BIT_XOR_OP:
> + case AML_LAND_OP:
> + case AML_LEQUAL_OP:
> + case AML_LGREATER_OP:
> + case AML_LLESS_OP:
> + case AML_LOR_OP:
> +
> + /* Emit paren only if this is not a compound assignment */
> +
> + if (Op->Common.DisasmFlags & ACPI_PARSEOP_COMPOUND)
> + {
> + return;
> + }
> +
> + /* Emit extra close paren for assignment within an expression */
> +
> + if (Op->Common.DisasmFlags & ACPI_PARSEOP_ASSIGNMENT)
> + {
> + AcpiOsPrintf (")");
> + }
> + break;
> +
> +
> + /* 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:
> + case AML_BIT_NOT_OP:
> + case AML_STORE_OP:
> + return;
> +
> + default:
> +
> + /* Always emit paren for non-ASL+ operators */
> + break;
> + }
> +
> + AcpiOsPrintf (")");
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: AcpiDmGetCompoundSymbol
> + *
> + * PARAMETERS: AslOpcode
> + *
> + * RETURN: String containing the compound assignment symbol
> + *
> + * DESCRIPTION: Detect opcodes that can be converted to compound assignment,
> + * return the appropriate operator string.
> + *
> + ******************************************************************************/
> +
> +static char *
> +AcpiDmGetCompoundSymbol (
> + UINT16 AmlOpcode)
> +{
> + char *Symbol;
> +
> +
> + switch (AmlOpcode)
> + {
> + case AML_ADD_OP:
> + Symbol = " += ";
> + break;
> +
> + case AML_SUBTRACT_OP:
> + Symbol = " -= ";
> + break;
> +
> + case AML_MULTIPLY_OP:
> + Symbol = " *= ";
> + break;
> +
> + case AML_DIVIDE_OP:
> + Symbol = " /= ";
> + break;
> +
> + case AML_MOD_OP:
> + Symbol = " %= ";
> + break;
> +
> + case AML_SHIFT_LEFT_OP:
> + Symbol = " <<= ";
> + break;
> +
> + case AML_SHIFT_RIGHT_OP:
> + Symbol = " >>= ";
> + break;
> +
> + case AML_BIT_AND_OP:
> + Symbol = " &= ";
> + break;
> +
> + case AML_BIT_OR_OP:
> + Symbol = " |= ";
> + break;
> +
> + case AML_BIT_XOR_OP:
> + Symbol = " ^= ";
> + break;
> +
> + default:
> +
> + /* No operator string for all other opcodes */
> + return (NULL);
> + }
> +
> + return (Symbol);
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: AcpiDmPromoteTarget
> + *
> + * PARAMETERS: Op - Operator parse object
> + * Target - Target associate with the Op
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Transform the parse tree by moving the target up to the first
> + * child of the Op.
> + *
> + ******************************************************************************/
> +
> +static void
> +AcpiDmPromoteTarget (
> + ACPI_PARSE_OBJECT *Op,
> + ACPI_PARSE_OBJECT *Target)
> +{
> + ACPI_PARSE_OBJECT *Child;
> +
> +
> + /* Link target directly to the Op as first child */
> +
> + Child = Op->Common.Value.Arg;
> + Op->Common.Value.Arg = Target;
> + Target->Common.Next = Child;
> +
> + /* Find the last peer, it is linked to the target. Unlink it. */
> +
> + while (Child->Common.Next != Target)
> + {
> + Child = Child->Common.Next;
> + }
> +
> + Child->Common.Next = NULL;
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: AcpiDmIsValidTarget
> + *
> + * PARAMETERS: Target - Target Op from the parse tree
> + *
> + * RETURN: TRUE if the Target is real. FALSE if it is just a placeholder
> + * Op that was inserted by the parser.
> + *
> + * DESCRIPTION: Determine if a Target Op is a placeholder Op or a real Target.
> + * In other words, determine if the optional target is used or
> + * not.
> + *
> + ******************************************************************************/
> +
> +static BOOLEAN
> +AcpiDmIsValidTarget (
> + ACPI_PARSE_OBJECT *Target)
> +{
> +
> + if ((Target->Common.AmlOpcode == AML_INT_NAMEPATH_OP) &&
> + (Target->Common.Value.Arg == NULL))
> + {
> + return (FALSE);
> + }
> +
> + return (TRUE);
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: AcpiDmIsTargetAnOperand
> + *
> + * PARAMETERS: Target - Target associated with the expression
> + * Operand - An operand associated with expression
> + *
> + * RETURN: TRUE if expression can be converted to a compound assignment.
> + * FALSE otherwise.
> + *
> + * DESCRIPTION: Determine if the Target duplicates the operand, in order to
> + * detect if the expression can be converted to a compound
> + * assigment. (+=, *=, etc.)
> + *
> + ******************************************************************************/
> +
> +static BOOLEAN
> +AcpiDmIsTargetAnOperand (
> + ACPI_PARSE_OBJECT *Target,
> + ACPI_PARSE_OBJECT *Operand,
> + BOOLEAN TopLevel)
> +{
> + const ACPI_OPCODE_INFO *OpInfo;
> + BOOLEAN Same;
> +
> +
> + /*
> + * Opcodes must match. Note: ignoring the difference between nameseg
> + * and namepath for now. May be needed later.
> + */
> + if (Target->Common.AmlOpcode != Operand->Common.AmlOpcode)
> + {
> + return (FALSE);
> + }
> +
> + /* Nodes should match, even if they are NULL */
> +
> + if (Target->Common.Node != Operand->Common.Node)
> + {
> + return (FALSE);
> + }
> +
> + /* Determine if a child exists */
> +
> + OpInfo = AcpiPsGetOpcodeInfo (Operand->Common.AmlOpcode);
> + if (OpInfo->Flags & AML_HAS_ARGS)
> + {
> + Same = AcpiDmIsTargetAnOperand (Target->Common.Value.Arg,
> + Operand->Common.Value.Arg, FALSE);
> + if (!Same)
> + {
> + return (FALSE);
> + }
> + }
> +
> + /* Check the next peer, as long as we are not at the top level */
> +
> + if ((!TopLevel) &&
> + Target->Common.Next)
> + {
> + Same = AcpiDmIsTargetAnOperand (Target->Common.Next,
> + Operand->Common.Next, FALSE);
> + if (!Same)
> + {
> + return (FALSE);
> + }
> + }
> +
> + /* Supress the duplicate operand at the top-level */
> +
> + if (TopLevel)
> + {
> + Operand->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
> + }
> + return (TRUE);
> +}
> +
> +#endif
> diff --git a/src/acpica/source/components/disassembler/dmopcode.c b/src/acpica/source/components/disassembler/dmopcode.c
> index 2a1b1e6..f4f2cf6 100644
> --- a/src/acpica/source/components/disassembler/dmopcode.c
> +++ b/src/acpica/source/components/disassembler/dmopcode.c
> @@ -126,6 +126,7 @@
> #define _COMPONENT ACPI_CA_DEBUGGER
> ACPI_MODULE_NAME ("dmopcode")
>
> +
> /* Local prototypes */
>
> static void
> @@ -639,7 +640,6 @@ AcpiDmRegionFlags (
> ACPI_PARSE_OBJECT *Op)
> {
>
> -
> /* The next Op contains the SpaceId */
>
> Op = AcpiPsGetDepthNext (NULL, Op);
> @@ -709,7 +709,6 @@ AcpiDmMatchKeyword (
> ACPI_PARSE_OBJECT *Op)
> {
>
> -
> if (((UINT32) Op->Common.Value.Integer) > ACPI_MAX_MATCH_OPCODE)
> {
> AcpiOsPrintf ("/* Unknown Match Keyword encoding */");
> @@ -766,27 +765,27 @@ AcpiDmDisassembleOneOp (
>
> case ACPI_DASM_LNOT_SUFFIX:
>
> - switch (Op->Common.AmlOpcode)
> + if (!AcpiGbl_CstyleDisassembly)
> {
> - case AML_LEQUAL_OP:
> -
> - AcpiOsPrintf ("LNotEqual");
> - break;
> -
> - case AML_LGREATER_OP:
> -
> - AcpiOsPrintf ("LLessEqual");
> - break;
> -
> - case AML_LLESS_OP:
> + switch (Op->Common.AmlOpcode)
> + {
> + case AML_LEQUAL_OP:
> + AcpiOsPrintf ("LNotEqual");
> + break;
>
> - AcpiOsPrintf ("LGreaterEqual");
> - break;
> + case AML_LGREATER_OP:
> + AcpiOsPrintf ("LLessEqual");
> + break;
>
> - default:
> + case AML_LLESS_OP:
> + AcpiOsPrintf ("LGreaterEqual");
> + break;
>
> - break;
> + default:
> + break;
> + }
> }
> +
> Op->Common.DisasmOpcode = 0;
> Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
> return;
> @@ -795,7 +794,6 @@ AcpiDmDisassembleOneOp (
> break;
> }
>
> -
> OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
>
> /* The op and arguments */
> @@ -917,7 +915,7 @@ AcpiDmDisassembleOneOp (
> else if (AcpiDmIsPldBuffer (Op))
> {
> Op->Common.DisasmOpcode = ACPI_DASM_PLD_METHOD;
> - AcpiOsPrintf ("Buffer");
> + AcpiOsPrintf ("ToPLD (");
> }
> else
> {
> diff --git a/src/acpica/source/components/disassembler/dmutils.c b/src/acpica/source/components/disassembler/dmutils.c
> index 8464665..d48eed7 100644
> --- a/src/acpica/source/components/disassembler/dmutils.c
> +++ b/src/acpica/source/components/disassembler/dmutils.c
> @@ -328,6 +328,13 @@ AcpiDmCommaIfListMember (
>
> if (AcpiDmListType (Op->Common.Parent) & BLOCK_COMMA_LIST)
> {
> + /* Exit if Target has been marked IGNORE */
> +
> + if (Op->Common.Next->Common.DisasmFlags & ACPI_PARSEOP_IGNORE)
> + {
> + return (FALSE);
> + }
> +
> /* Check for a NULL target operand */
>
> if ((Op->Common.Next->Common.AmlOpcode == AML_INT_NAMEPATH_OP) &&
> @@ -351,7 +358,13 @@ AcpiDmCommaIfListMember (
> return (FALSE);
> }
>
> - AcpiOsPrintf (", ");
> + /* Emit comma only if this is not a C-style operator */
> +
> + if (!Op->Common.OperatorSymbol)
> + {
> + AcpiOsPrintf (", ");
> + }
> +
> return (TRUE);
> }
>
> diff --git a/src/acpica/source/components/disassembler/dmwalk.c b/src/acpica/source/components/disassembler/dmwalk.c
> index 8ebdde8..b89faf9 100644
> --- a/src/acpica/source/components/disassembler/dmwalk.c
> +++ b/src/acpica/source/components/disassembler/dmwalk.c
> @@ -357,7 +357,8 @@ AcpiDmBlockType (
> case AML_BUFFER_OP:
>
> if ((Op->Common.DisasmOpcode == ACPI_DASM_UNICODE) ||
> - (Op->Common.DisasmOpcode == ACPI_DASM_UUID))
> + (Op->Common.DisasmOpcode == ACPI_DASM_UUID) ||
> + (Op->Common.DisasmOpcode == ACPI_DASM_PLD_METHOD))
> {
> return (BLOCK_NONE);
> }
> @@ -373,6 +374,17 @@ AcpiDmBlockType (
>
> return (BLOCK_PAREN);
>
> + case AML_INT_METHODCALL_OP:
> +
> + if (Op->Common.Parent &&
> + ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
> + (Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP)))
> + {
> + /* This is a reference to a method, not an invocation */
> +
> + return (BLOCK_NONE);
> + }
> +
> default:
>
> OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
> @@ -549,13 +561,20 @@ AcpiDmDescendingOp (
> * keep track of the current column.
> */
> Info->Count++;
> - if (Info->Count /* +Info->LastLevel */ > 10)
> + if (Info->Count /* +Info->LastLevel */ > 12)
> {
> Info->Count = 0;
> AcpiOsPrintf ("\n");
> AcpiDmIndent (Info->LastLevel + 1);
> }
>
> + /* If ASL+ is enabled, check for a C-style operator */
> +
> + if (AcpiDmCheckForSymbolicOpcode (Op, Info))
> + {
> + return (AE_OK);
> + }
> +
> /* Print the opcode name */
>
> AcpiDmDisassembleOneOp (NULL, Info, Op);
> @@ -635,7 +654,6 @@ AcpiDmDescendingOp (
> AcpiDmPredefinedDescription (Op);
> break;
>
> -
> case AML_NAME_OP:
>
> /* Check for _HID and related EISAID() */
> @@ -644,13 +662,11 @@ AcpiDmDescendingOp (
> AcpiOsPrintf (", ");
> break;
>
> -
> case AML_REGION_OP:
>
> AcpiDmRegionFlags (Op);
> break;
>
> -
> case AML_POWER_RES_OP:
>
> /* Mark the next two Ops as part of the parameter list */
> @@ -663,7 +679,6 @@ AcpiDmDescendingOp (
> NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST;
> return (AE_OK);
>
> -
> case AML_PROCESSOR_OP:
>
> /* Mark the next three Ops as part of the parameter list */
> @@ -679,20 +694,17 @@ AcpiDmDescendingOp (
> NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST;
> return (AE_OK);
>
> -
> case AML_MUTEX_OP:
> case AML_DATA_REGION_OP:
>
> AcpiOsPrintf (", ");
> return (AE_OK);
>
> -
> case AML_EVENT_OP:
> case AML_ALIAS_OP:
>
> return (AE_OK);
>
> -
> case AML_SCOPE_OP:
> case AML_DEVICE_OP:
> case AML_THERMAL_ZONE_OP:
> @@ -700,7 +712,6 @@ AcpiDmDescendingOp (
> AcpiOsPrintf (")");
> break;
>
> -
> default:
>
> AcpiOsPrintf ("*** Unhandled named opcode %X\n",
> @@ -897,9 +908,9 @@ AcpiDmAscendingOp (
> {
> case BLOCK_PAREN:
>
> - /* Completed an op that has arguments, add closing paren */
> + /* Completed an op that has arguments, add closing paren if needed */
>
> - AcpiOsPrintf (")");
> + AcpiDmCloseOperator (Op);
>
> if (Op->Common.AmlOpcode == AML_NAME_OP)
> {
> @@ -1071,8 +1082,21 @@ AcpiDmAscendingOp (
> {
> Info->Level++;
> }
> +
> + /*
> + * For ASL+, check for and emit a C-style symbol. If valid, the
> + * symbol string has been deferred until after the first operand
> + */
> + if (AcpiGbl_CstyleDisassembly)
> + {
> + if (Op->Asl.OperatorSymbol)
> + {
> + AcpiOsPrintf ("%s", Op->Asl.OperatorSymbol);
> + Op->Asl.OperatorSymbol = NULL;
> + }
> + }
> +
> return (AE_OK);
> }
>
> -
> #endif /* ACPI_DISASSEMBLER */
> diff --git a/src/acpica/source/components/dispatcher/dsargs.c b/src/acpica/source/components/dispatcher/dsargs.c
> index 7801341..d70b6a9 100644
> --- a/src/acpica/source/components/dispatcher/dsargs.c
> +++ b/src/acpica/source/components/dispatcher/dsargs.c
> @@ -114,8 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __DSARGS_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acparser.h"
> diff --git a/src/acpica/source/components/dispatcher/dscontrol.c b/src/acpica/source/components/dispatcher/dscontrol.c
> index 6ed6010..85df0e3 100644
> --- a/src/acpica/source/components/dispatcher/dscontrol.c
> +++ b/src/acpica/source/components/dispatcher/dscontrol.c
> @@ -114,8 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __DSCONTROL_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "amlcode.h"
> diff --git a/src/acpica/source/components/dispatcher/dsfield.c b/src/acpica/source/components/dispatcher/dsfield.c
> index ccf786f..d14434b 100644
> --- a/src/acpica/source/components/dispatcher/dsfield.c
> +++ b/src/acpica/source/components/dispatcher/dsfield.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DSFIELD_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "amlcode.h"
> diff --git a/src/acpica/source/components/dispatcher/dsinit.c b/src/acpica/source/components/dispatcher/dsinit.c
> index 22ed601..f68c66e 100644
> --- a/src/acpica/source/components/dispatcher/dsinit.c
> +++ b/src/acpica/source/components/dispatcher/dsinit.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DSINIT_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acdispat.h"
> diff --git a/src/acpica/source/components/dispatcher/dsmethod.c b/src/acpica/source/components/dispatcher/dsmethod.c
> index 5d1985a..d8d8230 100644
> --- a/src/acpica/source/components/dispatcher/dsmethod.c
> +++ b/src/acpica/source/components/dispatcher/dsmethod.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DSMETHOD_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acdispat.h"
> diff --git a/src/acpica/source/components/dispatcher/dsmthdat.c b/src/acpica/source/components/dispatcher/dsmthdat.c
> index 9b664bc..7f94325 100644
> --- a/src/acpica/source/components/dispatcher/dsmthdat.c
> +++ b/src/acpica/source/components/dispatcher/dsmthdat.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DSMTHDAT_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acdispat.h"
> diff --git a/src/acpica/source/components/dispatcher/dsobject.c b/src/acpica/source/components/dispatcher/dsobject.c
> index d6260b5..59d4656 100644
> --- a/src/acpica/source/components/dispatcher/dsobject.c
> +++ b/src/acpica/source/components/dispatcher/dsobject.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DSOBJECT_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acparser.h"
> diff --git a/src/acpica/source/components/dispatcher/dsopcode.c b/src/acpica/source/components/dispatcher/dsopcode.c
> index 83d482d..c1f265d 100644
> --- a/src/acpica/source/components/dispatcher/dsopcode.c
> +++ b/src/acpica/source/components/dispatcher/dsopcode.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DSOPCODE_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acparser.h"
> diff --git a/src/acpica/source/components/dispatcher/dsutils.c b/src/acpica/source/components/dispatcher/dsutils.c
> index 2553ad2..81d73cb 100644
> --- a/src/acpica/source/components/dispatcher/dsutils.c
> +++ b/src/acpica/source/components/dispatcher/dsutils.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DSUTILS_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acparser.h"
> diff --git a/src/acpica/source/components/dispatcher/dswexec.c b/src/acpica/source/components/dispatcher/dswexec.c
> index afa707d..877d30f 100644
> --- a/src/acpica/source/components/dispatcher/dswexec.c
> +++ b/src/acpica/source/components/dispatcher/dswexec.c
> @@ -114,8 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __DSWEXEC_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acparser.h"
> diff --git a/src/acpica/source/components/dispatcher/dswload.c b/src/acpica/source/components/dispatcher/dswload.c
> index 7f811dd..de70dee 100644
> --- a/src/acpica/source/components/dispatcher/dswload.c
> +++ b/src/acpica/source/components/dispatcher/dswload.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DSWLOAD_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acparser.h"
> diff --git a/src/acpica/source/components/dispatcher/dswload2.c b/src/acpica/source/components/dispatcher/dswload2.c
> index bef85cb..4fc1485 100644
> --- a/src/acpica/source/components/dispatcher/dswload2.c
> +++ b/src/acpica/source/components/dispatcher/dswload2.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DSWLOAD2_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acparser.h"
> diff --git a/src/acpica/source/components/dispatcher/dswscope.c b/src/acpica/source/components/dispatcher/dswscope.c
> index 62f2596..7caa301 100644
> --- a/src/acpica/source/components/dispatcher/dswscope.c
> +++ b/src/acpica/source/components/dispatcher/dswscope.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DSWSCOPE_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acdispat.h"
> diff --git a/src/acpica/source/components/dispatcher/dswstate.c b/src/acpica/source/components/dispatcher/dswstate.c
> index 9c2f2ec..4d24d2c 100644
> --- a/src/acpica/source/components/dispatcher/dswstate.c
> +++ b/src/acpica/source/components/dispatcher/dswstate.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __DSWSTATE_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acparser.h"
> diff --git a/src/acpica/source/components/events/evhandler.c b/src/acpica/source/components/events/evhandler.c
> index 7df392b..b67ba3e 100644
> --- a/src/acpica/source/components/events/evhandler.c
> +++ b/src/acpica/source/components/events/evhandler.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EVHANDLER_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acevents.h"
> diff --git a/src/acpica/source/components/events/evregion.c b/src/acpica/source/components/events/evregion.c
> index 029a455..ec681da 100644
> --- a/src/acpica/source/components/events/evregion.c
> +++ b/src/acpica/source/components/events/evregion.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EVREGION_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acevents.h"
> diff --git a/src/acpica/source/components/events/evrgnini.c b/src/acpica/source/components/events/evrgnini.c
> index b35ddbc..d439c31 100644
> --- a/src/acpica/source/components/events/evrgnini.c
> +++ b/src/acpica/source/components/events/evrgnini.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EVRGNINI_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acevents.h"
> diff --git a/src/acpica/source/components/events/evxface.c b/src/acpica/source/components/events/evxface.c
> index 27fe6f2..9b8a1ce 100644
> --- a/src/acpica/source/components/events/evxface.c
> +++ b/src/acpica/source/components/events/evxface.c
> @@ -113,7 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EVXFACE_C__
> #define EXPORT_ACPI_INTERFACES
>
> #include "acpi.h"
> diff --git a/src/acpica/source/components/events/evxfevnt.c b/src/acpica/source/components/events/evxfevnt.c
> index 225ef58..caa3810 100644
> --- a/src/acpica/source/components/events/evxfevnt.c
> +++ b/src/acpica/source/components/events/evxfevnt.c
> @@ -113,7 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EVXFEVNT_C__
> #define EXPORT_ACPI_INTERFACES
>
> #include "acpi.h"
> diff --git a/src/acpica/source/components/events/evxfgpe.c b/src/acpica/source/components/events/evxfgpe.c
> index 98a797d..5da1775 100644
> --- a/src/acpica/source/components/events/evxfgpe.c
> +++ b/src/acpica/source/components/events/evxfgpe.c
> @@ -113,7 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EVXFGPE_C__
> #define EXPORT_ACPI_INTERFACES
>
> #include "acpi.h"
> diff --git a/src/acpica/source/components/events/evxfregn.c b/src/acpica/source/components/events/evxfregn.c
> index 014e375..a305e3f 100644
> --- a/src/acpica/source/components/events/evxfregn.c
> +++ b/src/acpica/source/components/events/evxfregn.c
> @@ -114,7 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __EVXFREGN_C__
> #define EXPORT_ACPI_INTERFACES
>
> #include "acpi.h"
> diff --git a/src/acpica/source/components/executer/exconfig.c b/src/acpica/source/components/executer/exconfig.c
> index 98caa14..2fd6e36 100644
> --- a/src/acpica/source/components/executer/exconfig.c
> +++ b/src/acpica/source/components/executer/exconfig.c
> @@ -114,8 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __EXCONFIG_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/executer/exconvrt.c b/src/acpica/source/components/executer/exconvrt.c
> index f674893..00f0310 100644
> --- a/src/acpica/source/components/executer/exconvrt.c
> +++ b/src/acpica/source/components/executer/exconvrt.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXCONVRT_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/executer/excreate.c b/src/acpica/source/components/executer/excreate.c
> index 8f7b9e7..90a389a 100644
> --- a/src/acpica/source/components/executer/excreate.c
> +++ b/src/acpica/source/components/executer/excreate.c
> @@ -114,8 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __EXCREATE_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/executer/exdebug.c b/src/acpica/source/components/executer/exdebug.c
> index 45fca31..eb1daad 100644
> --- a/src/acpica/source/components/executer/exdebug.c
> +++ b/src/acpica/source/components/executer/exdebug.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXDEBUG_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/executer/exdump.c b/src/acpica/source/components/executer/exdump.c
> index 68a0054..4d6a186 100644
> --- a/src/acpica/source/components/executer/exdump.c
> +++ b/src/acpica/source/components/executer/exdump.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXDUMP_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/executer/exfield.c b/src/acpica/source/components/executer/exfield.c
> index f0bfb11..e33f82c 100644
> --- a/src/acpica/source/components/executer/exfield.c
> +++ b/src/acpica/source/components/executer/exfield.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXFIELD_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acdispat.h"
> diff --git a/src/acpica/source/components/executer/exfldio.c b/src/acpica/source/components/executer/exfldio.c
> index 6db8f05..e29ae66 100644
> --- a/src/acpica/source/components/executer/exfldio.c
> +++ b/src/acpica/source/components/executer/exfldio.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXFLDIO_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/executer/exmisc.c b/src/acpica/source/components/executer/exmisc.c
> index b78425c..94053d5 100644
> --- a/src/acpica/source/components/executer/exmisc.c
> +++ b/src/acpica/source/components/executer/exmisc.c
> @@ -114,8 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __EXMISC_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/executer/exmutex.c b/src/acpica/source/components/executer/exmutex.c
> index a613c54..962b9c1 100644
> --- a/src/acpica/source/components/executer/exmutex.c
> +++ b/src/acpica/source/components/executer/exmutex.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXMUTEX_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/executer/exnames.c b/src/acpica/source/components/executer/exnames.c
> index e8dc00c..67f7930 100644
> --- a/src/acpica/source/components/executer/exnames.c
> +++ b/src/acpica/source/components/executer/exnames.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXNAMES_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/executer/exoparg1.c b/src/acpica/source/components/executer/exoparg1.c
> index 30fc504..8ce7610 100644
> --- a/src/acpica/source/components/executer/exoparg1.c
> +++ b/src/acpica/source/components/executer/exoparg1.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXOPARG1_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acparser.h"
> diff --git a/src/acpica/source/components/executer/exoparg2.c b/src/acpica/source/components/executer/exoparg2.c
> index 84c44f4..2519dca 100644
> --- a/src/acpica/source/components/executer/exoparg2.c
> +++ b/src/acpica/source/components/executer/exoparg2.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXOPARG2_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acparser.h"
> diff --git a/src/acpica/source/components/executer/exoparg3.c b/src/acpica/source/components/executer/exoparg3.c
> index 97df207..4e6842b 100644
> --- a/src/acpica/source/components/executer/exoparg3.c
> +++ b/src/acpica/source/components/executer/exoparg3.c
> @@ -114,8 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __EXOPARG3_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/executer/exoparg6.c b/src/acpica/source/components/executer/exoparg6.c
> index 515fc59..9cd26e0 100644
> --- a/src/acpica/source/components/executer/exoparg6.c
> +++ b/src/acpica/source/components/executer/exoparg6.c
> @@ -114,8 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __EXOPARG6_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/executer/exprep.c b/src/acpica/source/components/executer/exprep.c
> index 276a77a..dc764bb 100644
> --- a/src/acpica/source/components/executer/exprep.c
> +++ b/src/acpica/source/components/executer/exprep.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXPREP_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/executer/exregion.c b/src/acpica/source/components/executer/exregion.c
> index 4056f08..544412e 100644
> --- a/src/acpica/source/components/executer/exregion.c
> +++ b/src/acpica/source/components/executer/exregion.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXREGION_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/executer/exresnte.c b/src/acpica/source/components/executer/exresnte.c
> index 323f9db..7640a01 100644
> --- a/src/acpica/source/components/executer/exresnte.c
> +++ b/src/acpica/source/components/executer/exresnte.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXRESNTE_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acdispat.h"
> diff --git a/src/acpica/source/components/executer/exresolv.c b/src/acpica/source/components/executer/exresolv.c
> index e035918..35bb6bb 100644
> --- a/src/acpica/source/components/executer/exresolv.c
> +++ b/src/acpica/source/components/executer/exresolv.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXRESOLV_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "amlcode.h"
> diff --git a/src/acpica/source/components/executer/exresop.c b/src/acpica/source/components/executer/exresop.c
> index aafc1dc..6dc28aa 100644
> --- a/src/acpica/source/components/executer/exresop.c
> +++ b/src/acpica/source/components/executer/exresop.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXRESOP_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "amlcode.h"
> diff --git a/src/acpica/source/components/executer/exstore.c b/src/acpica/source/components/executer/exstore.c
> index 97b8be8..cf47621 100644
> --- a/src/acpica/source/components/executer/exstore.c
> +++ b/src/acpica/source/components/executer/exstore.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXSTORE_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acdispat.h"
> diff --git a/src/acpica/source/components/executer/exstoren.c b/src/acpica/source/components/executer/exstoren.c
> index d1fc09f..82944c5 100644
> --- a/src/acpica/source/components/executer/exstoren.c
> +++ b/src/acpica/source/components/executer/exstoren.c
> @@ -114,8 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __EXSTOREN_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/executer/exstorob.c b/src/acpica/source/components/executer/exstorob.c
> index dc64e92..f36e9fc 100644
> --- a/src/acpica/source/components/executer/exstorob.c
> +++ b/src/acpica/source/components/executer/exstorob.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXSTOROB_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/executer/exsystem.c b/src/acpica/source/components/executer/exsystem.c
> index fcf3a7f..0bce72a 100644
> --- a/src/acpica/source/components/executer/exsystem.c
> +++ b/src/acpica/source/components/executer/exsystem.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXSYSTEM_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/executer/exutils.c b/src/acpica/source/components/executer/exutils.c
> index 1a4a943..63bfb84 100644
> --- a/src/acpica/source/components/executer/exutils.c
> +++ b/src/acpica/source/components/executer/exutils.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __EXUTILS_C__
> -
> /*
> * DEFINE_AML_GLOBALS is tested in amlcode.h
> * to determine whether certain global names should be "defined" or only
> diff --git a/src/acpica/source/components/hardware/hwacpi.c b/src/acpica/source/components/hardware/hwacpi.c
> index 1facc20..0dff876 100644
> --- a/src/acpica/source/components/hardware/hwacpi.c
> +++ b/src/acpica/source/components/hardware/hwacpi.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __HWACPI_C__
> -
> #include "acpi.h"
> #include "accommon.h"
>
> diff --git a/src/acpica/source/components/hardware/hwpci.c b/src/acpica/source/components/hardware/hwpci.c
> index 24b7c01..4470b5c 100644
> --- a/src/acpica/source/components/hardware/hwpci.c
> +++ b/src/acpica/source/components/hardware/hwpci.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __HWPCI_C__
> -
> #include "acpi.h"
> #include "accommon.h"
>
> diff --git a/src/acpica/source/components/hardware/hwregs.c b/src/acpica/source/components/hardware/hwregs.c
> index 24b4cf4..7df29fd 100644
> --- a/src/acpica/source/components/hardware/hwregs.c
> +++ b/src/acpica/source/components/hardware/hwregs.c
> @@ -114,8 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __HWREGS_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acevents.h"
> diff --git a/src/acpica/source/components/hardware/hwvalid.c b/src/acpica/source/components/hardware/hwvalid.c
> index 511a631..dbbb3bb 100644
> --- a/src/acpica/source/components/hardware/hwvalid.c
> +++ b/src/acpica/source/components/hardware/hwvalid.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __HWVALID_C__
> -
> #include "acpi.h"
> #include "accommon.h"
>
> diff --git a/src/acpica/source/components/namespace/nsaccess.c b/src/acpica/source/components/namespace/nsaccess.c
> index 4c8bd30..37f6913 100644
> --- a/src/acpica/source/components/namespace/nsaccess.c
> +++ b/src/acpica/source/components/namespace/nsaccess.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __NSACCESS_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "amlcode.h"
> diff --git a/src/acpica/source/components/namespace/nsalloc.c b/src/acpica/source/components/namespace/nsalloc.c
> index ae855e9..c4a08cd 100644
> --- a/src/acpica/source/components/namespace/nsalloc.c
> +++ b/src/acpica/source/components/namespace/nsalloc.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __NSALLOC_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/namespace/nsconvert.c b/src/acpica/source/components/namespace/nsconvert.c
> index 5bd6868..7226917 100644
> --- a/src/acpica/source/components/namespace/nsconvert.c
> +++ b/src/acpica/source/components/namespace/nsconvert.c
> @@ -114,8 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __NSCONVERT_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/namespace/nsdump.c b/src/acpica/source/components/namespace/nsdump.c
> index 4823046..5631cab 100644
> --- a/src/acpica/source/components/namespace/nsdump.c
> +++ b/src/acpica/source/components/namespace/nsdump.c
> @@ -114,8 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __NSDUMP_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/namespace/nsdumpdv.c b/src/acpica/source/components/namespace/nsdumpdv.c
> index ed1b8a9..8510eb2 100644
> --- a/src/acpica/source/components/namespace/nsdumpdv.c
> +++ b/src/acpica/source/components/namespace/nsdumpdv.c
> @@ -114,8 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __NSDUMPDV_C__
> -
> #include "acpi.h"
>
>
> diff --git a/src/acpica/source/components/namespace/nseval.c b/src/acpica/source/components/namespace/nseval.c
> index 227a103..2f32e5e 100644
> --- a/src/acpica/source/components/namespace/nseval.c
> +++ b/src/acpica/source/components/namespace/nseval.c
> @@ -114,8 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __NSEVAL_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acparser.h"
> diff --git a/src/acpica/source/components/namespace/nsinit.c b/src/acpica/source/components/namespace/nsinit.c
> index b5be1f4..2c4db99 100644
> --- a/src/acpica/source/components/namespace/nsinit.c
> +++ b/src/acpica/source/components/namespace/nsinit.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __NSXFINIT_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/namespace/nsload.c b/src/acpica/source/components/namespace/nsload.c
> index 7d68af7..e15e6a4 100644
> --- a/src/acpica/source/components/namespace/nsload.c
> +++ b/src/acpica/source/components/namespace/nsload.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __NSLOAD_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/namespace/nsnames.c b/src/acpica/source/components/namespace/nsnames.c
> index f345d90..2dc5d7b 100644
> --- a/src/acpica/source/components/namespace/nsnames.c
> +++ b/src/acpica/source/components/namespace/nsnames.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __NSNAMES_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "amlcode.h"
> diff --git a/src/acpica/source/components/namespace/nsobject.c b/src/acpica/source/components/namespace/nsobject.c
> index c9b7b32..7a0d8ef 100644
> --- a/src/acpica/source/components/namespace/nsobject.c
> +++ b/src/acpica/source/components/namespace/nsobject.c
> @@ -114,8 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __NSOBJECT_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/namespace/nsparse.c b/src/acpica/source/components/namespace/nsparse.c
> index 847e61b..f880207 100644
> --- a/src/acpica/source/components/namespace/nsparse.c
> +++ b/src/acpica/source/components/namespace/nsparse.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __NSPARSE_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/namespace/nsrepair.c b/src/acpica/source/components/namespace/nsrepair.c
> index 11a43b1..cf3c411 100644
> --- a/src/acpica/source/components/namespace/nsrepair.c
> +++ b/src/acpica/source/components/namespace/nsrepair.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __NSREPAIR_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/namespace/nsrepair2.c b/src/acpica/source/components/namespace/nsrepair2.c
> index ea7c0be..ffba457 100644
> --- a/src/acpica/source/components/namespace/nsrepair2.c
> +++ b/src/acpica/source/components/namespace/nsrepair2.c
> @@ -114,8 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __NSREPAIR2_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/namespace/nssearch.c b/src/acpica/source/components/namespace/nssearch.c
> index 1632f2e..9169866 100644
> --- a/src/acpica/source/components/namespace/nssearch.c
> +++ b/src/acpica/source/components/namespace/nssearch.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __NSSEARCH_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/namespace/nsutils.c b/src/acpica/source/components/namespace/nsutils.c
> index cf4214e..b237390 100644
> --- a/src/acpica/source/components/namespace/nsutils.c
> +++ b/src/acpica/source/components/namespace/nsutils.c
> @@ -114,8 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __NSUTILS_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/namespace/nswalk.c b/src/acpica/source/components/namespace/nswalk.c
> index 23e5fd1..bcbed65 100644
> --- a/src/acpica/source/components/namespace/nswalk.c
> +++ b/src/acpica/source/components/namespace/nswalk.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __NSWALK_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/namespace/nsxfeval.c b/src/acpica/source/components/namespace/nsxfeval.c
> index 259a187..5425a54 100644
> --- a/src/acpica/source/components/namespace/nsxfeval.c
> +++ b/src/acpica/source/components/namespace/nsxfeval.c
> @@ -114,7 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __NSXFEVAL_C__
> #define EXPORT_ACPI_INTERFACES
>
> #include "acpi.h"
> diff --git a/src/acpica/source/components/namespace/nsxfname.c b/src/acpica/source/components/namespace/nsxfname.c
> index 475491c..f45a2bd 100644
> --- a/src/acpica/source/components/namespace/nsxfname.c
> +++ b/src/acpica/source/components/namespace/nsxfname.c
> @@ -114,7 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __NSXFNAME_C__
> #define EXPORT_ACPI_INTERFACES
>
> #include "acpi.h"
> diff --git a/src/acpica/source/components/namespace/nsxfobj.c b/src/acpica/source/components/namespace/nsxfobj.c
> index 409f233..763e044 100644
> --- a/src/acpica/source/components/namespace/nsxfobj.c
> +++ b/src/acpica/source/components/namespace/nsxfobj.c
> @@ -114,7 +114,6 @@
> *
> *****************************************************************************/
>
> -#define __NSXFOBJ_C__
> #define EXPORT_ACPI_INTERFACES
>
> #include "acpi.h"
> diff --git a/src/acpica/source/components/parser/psargs.c b/src/acpica/source/components/parser/psargs.c
> index 5e2e434..ad86a1f 100644
> --- a/src/acpica/source/components/parser/psargs.c
> +++ b/src/acpica/source/components/parser/psargs.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __PSARGS_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acparser.h"
> diff --git a/src/acpica/source/components/parser/pstree.c b/src/acpica/source/components/parser/pstree.c
> index 45c6fc2..fc2477b 100644
> --- a/src/acpica/source/components/parser/pstree.c
> +++ b/src/acpica/source/components/parser/pstree.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __PSTREE_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acparser.h"
> diff --git a/src/acpica/source/components/parser/psxface.c b/src/acpica/source/components/parser/psxface.c
> index 65758fc..8930af0 100644
> --- a/src/acpica/source/components/parser/psxface.c
> +++ b/src/acpica/source/components/parser/psxface.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __PSXFACE_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acparser.h"
> diff --git a/src/acpica/source/components/resources/rsaddr.c b/src/acpica/source/components/resources/rsaddr.c
> index d29307d..9c7f2aa 100644
> --- a/src/acpica/source/components/resources/rsaddr.c
> +++ b/src/acpica/source/components/resources/rsaddr.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __RSADDR_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acresrc.h"
> diff --git a/src/acpica/source/components/resources/rscalc.c b/src/acpica/source/components/resources/rscalc.c
> index b2742ae..2b6a4f9 100644
> --- a/src/acpica/source/components/resources/rscalc.c
> +++ b/src/acpica/source/components/resources/rscalc.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __RSCALC_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acresrc.h"
> diff --git a/src/acpica/source/components/resources/rscreate.c b/src/acpica/source/components/resources/rscreate.c
> index 03298f4..deaaba5 100644
> --- a/src/acpica/source/components/resources/rscreate.c
> +++ b/src/acpica/source/components/resources/rscreate.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __RSCREATE_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acresrc.h"
> diff --git a/src/acpica/source/components/resources/rsdump.c b/src/acpica/source/components/resources/rsdump.c
> index 4fc7d4a..34b4abf 100644
> --- a/src/acpica/source/components/resources/rsdump.c
> +++ b/src/acpica/source/components/resources/rsdump.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __RSDUMP_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acresrc.h"
> diff --git a/src/acpica/source/components/resources/rsdumpinfo.c b/src/acpica/source/components/resources/rsdumpinfo.c
> index 929043c..bb41c71 100644
> --- a/src/acpica/source/components/resources/rsdumpinfo.c
> +++ b/src/acpica/source/components/resources/rsdumpinfo.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __RSDUMPINFO_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acresrc.h"
> diff --git a/src/acpica/source/components/resources/rsinfo.c b/src/acpica/source/components/resources/rsinfo.c
> index 05f02a8..da2cb5d 100644
> --- a/src/acpica/source/components/resources/rsinfo.c
> +++ b/src/acpica/source/components/resources/rsinfo.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __RSINFO_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acresrc.h"
> diff --git a/src/acpica/source/components/resources/rsio.c b/src/acpica/source/components/resources/rsio.c
> index b0e6f1d..a641c0c 100644
> --- a/src/acpica/source/components/resources/rsio.c
> +++ b/src/acpica/source/components/resources/rsio.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __RSIO_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acresrc.h"
> diff --git a/src/acpica/source/components/resources/rsirq.c b/src/acpica/source/components/resources/rsirq.c
> index 1bd887b..33f400f 100644
> --- a/src/acpica/source/components/resources/rsirq.c
> +++ b/src/acpica/source/components/resources/rsirq.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __RSIRQ_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acresrc.h"
> diff --git a/src/acpica/source/components/resources/rslist.c b/src/acpica/source/components/resources/rslist.c
> index 71e3164..ea2d1d5 100644
> --- a/src/acpica/source/components/resources/rslist.c
> +++ b/src/acpica/source/components/resources/rslist.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __RSLIST_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acresrc.h"
> diff --git a/src/acpica/source/components/resources/rsmemory.c b/src/acpica/source/components/resources/rsmemory.c
> index 727d3ee..ae94a1f 100644
> --- a/src/acpica/source/components/resources/rsmemory.c
> +++ b/src/acpica/source/components/resources/rsmemory.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __RSMEMORY_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acresrc.h"
> diff --git a/src/acpica/source/components/resources/rsmisc.c b/src/acpica/source/components/resources/rsmisc.c
> index a697602..8de7ca5 100644
> --- a/src/acpica/source/components/resources/rsmisc.c
> +++ b/src/acpica/source/components/resources/rsmisc.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __RSMISC_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acresrc.h"
> diff --git a/src/acpica/source/components/resources/rsserial.c b/src/acpica/source/components/resources/rsserial.c
> index 2eee1a2..b71dcad 100644
> --- a/src/acpica/source/components/resources/rsserial.c
> +++ b/src/acpica/source/components/resources/rsserial.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __RSIRQ_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acresrc.h"
> diff --git a/src/acpica/source/components/resources/rsutils.c b/src/acpica/source/components/resources/rsutils.c
> index b05338c..42ff2a3 100644
> --- a/src/acpica/source/components/resources/rsutils.c
> +++ b/src/acpica/source/components/resources/rsutils.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __RSUTILS_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/resources/rsxface.c b/src/acpica/source/components/resources/rsxface.c
> index 8dbb301..9e9af3a 100644
> --- a/src/acpica/source/components/resources/rsxface.c
> +++ b/src/acpica/source/components/resources/rsxface.c
> @@ -113,7 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __RSXFACE_C__
> #define EXPORT_ACPI_INTERFACES
>
> #include "acpi.h"
> diff --git a/src/acpica/source/components/tables/tbdata.c b/src/acpica/source/components/tables/tbdata.c
> index 1e4cbcd..10924ab 100644
> --- a/src/acpica/source/components/tables/tbdata.c
> +++ b/src/acpica/source/components/tables/tbdata.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __TBDATA_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/tables/tbfadt.c b/src/acpica/source/components/tables/tbfadt.c
> index 8cb69a9..f3f27cd 100644
> --- a/src/acpica/source/components/tables/tbfadt.c
> +++ b/src/acpica/source/components/tables/tbfadt.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __TBFADT_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "actables.h"
> diff --git a/src/acpica/source/components/tables/tbfind.c b/src/acpica/source/components/tables/tbfind.c
> index 42ce181..56b4e8a 100644
> --- a/src/acpica/source/components/tables/tbfind.c
> +++ b/src/acpica/source/components/tables/tbfind.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __TBFIND_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "actables.h"
> diff --git a/src/acpica/source/components/tables/tbinstal.c b/src/acpica/source/components/tables/tbinstal.c
> index ab0e879..38de06c 100644
> --- a/src/acpica/source/components/tables/tbinstal.c
> +++ b/src/acpica/source/components/tables/tbinstal.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __TBINSTAL_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "actables.h"
> diff --git a/src/acpica/source/components/tables/tbprint.c b/src/acpica/source/components/tables/tbprint.c
> index 553daf9..d4bba45 100644
> --- a/src/acpica/source/components/tables/tbprint.c
> +++ b/src/acpica/source/components/tables/tbprint.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __TBPRINT_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "actables.h"
> diff --git a/src/acpica/source/components/tables/tbutils.c b/src/acpica/source/components/tables/tbutils.c
> index 438f92f..ec1843c 100644
> --- a/src/acpica/source/components/tables/tbutils.c
> +++ b/src/acpica/source/components/tables/tbutils.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __TBUTILS_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "actables.h"
> diff --git a/src/acpica/source/components/tables/tbxface.c b/src/acpica/source/components/tables/tbxface.c
> index cbdede5..df4e402 100644
> --- a/src/acpica/source/components/tables/tbxface.c
> +++ b/src/acpica/source/components/tables/tbxface.c
> @@ -113,7 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __TBXFACE_C__
> #define EXPORT_ACPI_INTERFACES
>
> #include "acpi.h"
> diff --git a/src/acpica/source/components/tables/tbxfload.c b/src/acpica/source/components/tables/tbxfload.c
> index 77c1be6..88834db 100644
> --- a/src/acpica/source/components/tables/tbxfload.c
> +++ b/src/acpica/source/components/tables/tbxfload.c
> @@ -113,7 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __TBXFLOAD_C__
> #define EXPORT_ACPI_INTERFACES
>
> #include "acpi.h"
> diff --git a/src/acpica/source/components/tables/tbxfroot.c b/src/acpica/source/components/tables/tbxfroot.c
> index 23ab821..8354e94 100644
> --- a/src/acpica/source/components/tables/tbxfroot.c
> +++ b/src/acpica/source/components/tables/tbxfroot.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __TBXFROOT_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "actables.h"
> diff --git a/src/acpica/source/components/utilities/utaddress.c b/src/acpica/source/components/utilities/utaddress.c
> index 750f47c..864c0c3 100644
> --- a/src/acpica/source/components/utilities/utaddress.c
> +++ b/src/acpica/source/components/utilities/utaddress.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTADDRESS_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/utilities/utalloc.c b/src/acpica/source/components/utilities/utalloc.c
> index 00345fc..dd7c8d6 100644
> --- a/src/acpica/source/components/utilities/utalloc.c
> +++ b/src/acpica/source/components/utilities/utalloc.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTALLOC_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acdebug.h"
> diff --git a/src/acpica/source/components/utilities/utbuffer.c b/src/acpica/source/components/utilities/utbuffer.c
> index 608e8d4..cc2d769 100644
> --- a/src/acpica/source/components/utilities/utbuffer.c
> +++ b/src/acpica/source/components/utilities/utbuffer.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTBUFFER_C__
> -
> #include "acpi.h"
> #include "accommon.h"
>
> diff --git a/src/acpica/source/components/utilities/utcache.c b/src/acpica/source/components/utilities/utcache.c
> index 1bd2c54..cb8116e 100644
> --- a/src/acpica/source/components/utilities/utcache.c
> +++ b/src/acpica/source/components/utilities/utcache.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTCACHE_C__
> -
> #include "acpi.h"
> #include "accommon.h"
>
> diff --git a/src/acpica/source/components/utilities/utcopy.c b/src/acpica/source/components/utilities/utcopy.c
> index e6a71a7..ea70d13 100644
> --- a/src/acpica/source/components/utilities/utcopy.c
> +++ b/src/acpica/source/components/utilities/utcopy.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTCOPY_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/utilities/utdebug.c b/src/acpica/source/components/utilities/utdebug.c
> index ddc0c38..5c86223 100644
> --- a/src/acpica/source/components/utilities/utdebug.c
> +++ b/src/acpica/source/components/utilities/utdebug.c
> @@ -113,7 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTDEBUG_C__
> #define EXPORT_ACPI_INTERFACES
>
> #include "acpi.h"
> diff --git a/src/acpica/source/components/utilities/utdecode.c b/src/acpica/source/components/utilities/utdecode.c
> index 61826fe..fcd6393 100644
> --- a/src/acpica/source/components/utilities/utdecode.c
> +++ b/src/acpica/source/components/utilities/utdecode.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTDECODE_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/utilities/utdelete.c b/src/acpica/source/components/utilities/utdelete.c
> index d42d8a7..e6825ca 100644
> --- a/src/acpica/source/components/utilities/utdelete.c
> +++ b/src/acpica/source/components/utilities/utdelete.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTDELETE_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/utilities/uterror.c b/src/acpica/source/components/utilities/uterror.c
> index b590af7..5d7dfca 100644
> --- a/src/acpica/source/components/utilities/uterror.c
> +++ b/src/acpica/source/components/utilities/uterror.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTERROR_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/utilities/uteval.c b/src/acpica/source/components/utilities/uteval.c
> index b3a7341..00f1483 100644
> --- a/src/acpica/source/components/utilities/uteval.c
> +++ b/src/acpica/source/components/utilities/uteval.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTEVAL_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/utilities/utexcep.c b/src/acpica/source/components/utilities/utexcep.c
> index 5455f87..2c046c4 100644
> --- a/src/acpica/source/components/utilities/utexcep.c
> +++ b/src/acpica/source/components/utilities/utexcep.c
> @@ -113,7 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTEXCEP_C__
> #define EXPORT_ACPI_INTERFACES
>
> #define ACPI_DEFINE_EXCEPTION_TABLE
> diff --git a/src/acpica/source/components/utilities/utglobal.c b/src/acpica/source/components/utilities/utglobal.c
> index be14ea2..34438c8 100644
> --- a/src/acpica/source/components/utilities/utglobal.c
> +++ b/src/acpica/source/components/utilities/utglobal.c
> @@ -113,7 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTGLOBAL_C__
> #define EXPORT_ACPI_INTERFACES
> #define DEFINE_ACPI_GLOBALS
>
> diff --git a/src/acpica/source/components/utilities/uthex.c b/src/acpica/source/components/utilities/uthex.c
> index ba2b259..80ad2ba 100644
> --- a/src/acpica/source/components/utilities/uthex.c
> +++ b/src/acpica/source/components/utilities/uthex.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTHEX_C__
> -
> #include "acpi.h"
> #include "accommon.h"
>
> diff --git a/src/acpica/source/components/utilities/utids.c b/src/acpica/source/components/utilities/utids.c
> index 4cf84e8..5f15f62 100644
> --- a/src/acpica/source/components/utilities/utids.c
> +++ b/src/acpica/source/components/utilities/utids.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTIDS_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acinterp.h"
> diff --git a/src/acpica/source/components/utilities/utinit.c b/src/acpica/source/components/utilities/utinit.c
> index af29d7a..7c0b67b 100644
> --- a/src/acpica/source/components/utilities/utinit.c
> +++ b/src/acpica/source/components/utilities/utinit.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTINIT_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/utilities/utlock.c b/src/acpica/source/components/utilities/utlock.c
> index b3e4cb4..1d7dadc 100644
> --- a/src/acpica/source/components/utilities/utlock.c
> +++ b/src/acpica/source/components/utilities/utlock.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTLOCK_C__
> -
> #include "acpi.h"
> #include "accommon.h"
>
> diff --git a/src/acpica/source/components/utilities/utmath.c b/src/acpica/source/components/utilities/utmath.c
> index 22f5a21..95a9d72 100644
> --- a/src/acpica/source/components/utilities/utmath.c
> +++ b/src/acpica/source/components/utilities/utmath.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTMATH_C__
> -
> #include "acpi.h"
> #include "accommon.h"
>
> diff --git a/src/acpica/source/components/utilities/utmisc.c b/src/acpica/source/components/utilities/utmisc.c
> index 68f85f4..5e86e0a 100644
> --- a/src/acpica/source/components/utilities/utmisc.c
> +++ b/src/acpica/source/components/utilities/utmisc.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTMISC_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/utilities/utmutex.c b/src/acpica/source/components/utilities/utmutex.c
> index fcca4a4..1537422 100644
> --- a/src/acpica/source/components/utilities/utmutex.c
> +++ b/src/acpica/source/components/utilities/utmutex.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTMUTEX_C__
> -
> #include "acpi.h"
> #include "accommon.h"
>
> diff --git a/src/acpica/source/components/utilities/utobject.c b/src/acpica/source/components/utilities/utobject.c
> index 0fdef14..4c64061 100644
> --- a/src/acpica/source/components/utilities/utobject.c
> +++ b/src/acpica/source/components/utilities/utobject.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTOBJECT_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/utilities/utosi.c b/src/acpica/source/components/utilities/utosi.c
> index a001d06..3b49ded 100644
> --- a/src/acpica/source/components/utilities/utosi.c
> +++ b/src/acpica/source/components/utilities/utosi.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTOSI_C__
> -
> #include "acpi.h"
> #include "accommon.h"
>
> diff --git a/src/acpica/source/components/utilities/utownerid.c b/src/acpica/source/components/utilities/utownerid.c
> index ba191fa..1ae1398 100644
> --- a/src/acpica/source/components/utilities/utownerid.c
> +++ b/src/acpica/source/components/utilities/utownerid.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTOWNERID_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/utilities/utpredef.c b/src/acpica/source/components/utilities/utpredef.c
> index d20e905..ab275ee 100644
> --- a/src/acpica/source/components/utilities/utpredef.c
> +++ b/src/acpica/source/components/utilities/utpredef.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTPREDEF_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acpredef.h"
> diff --git a/src/acpica/source/components/utilities/utresrc.c b/src/acpica/source/components/utilities/utresrc.c
> index 2c31f2a..3569fcf 100644
> --- a/src/acpica/source/components/utilities/utresrc.c
> +++ b/src/acpica/source/components/utilities/utresrc.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTRESRC_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acresrc.h"
> @@ -372,7 +370,7 @@ const char *AcpiGbl_BpbDecode[] =
>
> const char *AcpiGbl_SbDecode[] =
> {
> - "StopBitsNone",
> + "StopBitsZero",
> "StopBitsOne",
> "StopBitsOnePlusHalf",
> "StopBitsTwo"
> diff --git a/src/acpica/source/components/utilities/utstate.c b/src/acpica/source/components/utilities/utstate.c
> index 0d1f2bf..cf96d8e 100644
> --- a/src/acpica/source/components/utilities/utstate.c
> +++ b/src/acpica/source/components/utilities/utstate.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTSTATE_C__
> -
> #include "acpi.h"
> #include "accommon.h"
>
> diff --git a/src/acpica/source/components/utilities/utstring.c b/src/acpica/source/components/utilities/utstring.c
> index d4e5f45..2d218c3 100644
> --- a/src/acpica/source/components/utilities/utstring.c
> +++ b/src/acpica/source/components/utilities/utstring.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTSTRING_C__
> -
> #include "acpi.h"
> #include "accommon.h"
> #include "acnamesp.h"
> diff --git a/src/acpica/source/components/utilities/uttrack.c b/src/acpica/source/components/utilities/uttrack.c
> index df04aa3..43a993a 100644
> --- a/src/acpica/source/components/utilities/uttrack.c
> +++ b/src/acpica/source/components/utilities/uttrack.c
> @@ -124,8 +124,6 @@
> * occurs in the body of AcpiUtFree.
> */
>
> -#define __UTTRACK_C__
> -
> #include "acpi.h"
> #include "accommon.h"
>
> diff --git a/src/acpica/source/components/utilities/utuuid.c b/src/acpica/source/components/utilities/utuuid.c
> index f5c2e40..65338cc 100644
> --- a/src/acpica/source/components/utilities/utuuid.c
> +++ b/src/acpica/source/components/utilities/utuuid.c
> @@ -113,8 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTUUID_C__
> -
> #include "acpi.h"
> #include "accommon.h"
>
> diff --git a/src/acpica/source/components/utilities/utxface.c b/src/acpica/source/components/utilities/utxface.c
> index 068609b..7f2752c 100644
> --- a/src/acpica/source/components/utilities/utxface.c
> +++ b/src/acpica/source/components/utilities/utxface.c
> @@ -113,7 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTXFACE_C__
> #define EXPORT_ACPI_INTERFACES
>
> #include "acpi.h"
> @@ -693,7 +692,9 @@ AcpiDecodePldBuffer (
> ACPI_MOVE_32_TO_32 (&Dword, &Buffer[0]);
> PldInfo->Revision = ACPI_PLD_GET_REVISION (&Dword);
> PldInfo->IgnoreColor = ACPI_PLD_GET_IGNORE_COLOR (&Dword);
> - PldInfo->Color = ACPI_PLD_GET_COLOR (&Dword);
> + PldInfo->Red = ACPI_PLD_GET_RED (&Dword);
> + PldInfo->Green = ACPI_PLD_GET_GREEN (&Dword);
> + PldInfo->Blue = ACPI_PLD_GET_BLUE (&Dword);
>
> /* Second 32-bit DWord */
>
> diff --git a/src/acpica/source/components/utilities/utxferror.c b/src/acpica/source/components/utilities/utxferror.c
> index 081bfd9..7b11f4c 100644
> --- a/src/acpica/source/components/utilities/utxferror.c
> +++ b/src/acpica/source/components/utilities/utxferror.c
> @@ -113,7 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTXFERROR_C__
> #define EXPORT_ACPI_INTERFACES
>
> #include "acpi.h"
> diff --git a/src/acpica/source/components/utilities/utxfinit.c b/src/acpica/source/components/utilities/utxfinit.c
> index d29028c..a50cc55 100644
> --- a/src/acpica/source/components/utilities/utxfinit.c
> +++ b/src/acpica/source/components/utilities/utxfinit.c
> @@ -113,7 +113,6 @@
> *
> *****************************************************************************/
>
> -#define __UTXFINIT_C__
> #define EXPORT_ACPI_INTERFACES
>
> #include "acpi.h"
> @@ -126,6 +125,11 @@
> #define _COMPONENT ACPI_UTILITIES
> ACPI_MODULE_NAME ("utxfinit")
>
> +/* For AcpiExec only */
> +void
> +AeDoObjectOverrides (
> + void);
> +
>
> /*******************************************************************************
> *
> @@ -381,6 +385,14 @@ AcpiInitializeObjects (
> }
> }
>
> +#ifdef ACPI_EXEC_APP
> + /*
> + * This call implements the "initialization file" option for AcpiExec.
> + * This is the precise point that we want to perform the overrides.
> + */
> + AeDoObjectOverrides ();
> +#endif
> +
> /*
> * Execute any module-level code that was detected during the table load
> * phase. Although illegal since ACPI 2.0, there are many machines that
> diff --git a/src/acpica/source/include/acbuffer.h b/src/acpica/source/include/acbuffer.h
> index 3228bca..9ccb3ea 100644
> --- a/src/acpica/source/include/acbuffer.h
> +++ b/src/acpica/source/include/acbuffer.h
> @@ -191,7 +191,9 @@ typedef struct acpi_pld_info
> {
> UINT8 Revision;
> UINT8 IgnoreColor;
> - UINT32 Color;
> + UINT8 Red;
> + UINT8 Green;
> + UINT8 Blue;
> UINT16 Width;
> UINT16 Height;
> UINT8 UserVisible;
> @@ -237,8 +239,14 @@ typedef struct acpi_pld_info
> #define ACPI_PLD_GET_IGNORE_COLOR(dword) ACPI_GET_BITS (dword, 7, ACPI_1BIT_MASK)
> #define ACPI_PLD_SET_IGNORE_COLOR(dword,value) ACPI_SET_BITS (dword, 7, ACPI_1BIT_MASK, value) /* Offset 7, Len 1 */
>
> -#define ACPI_PLD_GET_COLOR(dword) ACPI_GET_BITS (dword, 8, ACPI_24BIT_MASK)
> -#define ACPI_PLD_SET_COLOR(dword,value) ACPI_SET_BITS (dword, 8, ACPI_24BIT_MASK, value) /* Offset 8, Len 24 */
> +#define ACPI_PLD_GET_RED(dword) ACPI_GET_BITS (dword, 8, ACPI_8BIT_MASK)
> +#define ACPI_PLD_SET_RED(dword,value) ACPI_SET_BITS (dword, 8, ACPI_8BIT_MASK, value) /* Offset 8, Len 8 */
> +
> +#define ACPI_PLD_GET_GREEN(dword) ACPI_GET_BITS (dword, 16, ACPI_8BIT_MASK)
> +#define ACPI_PLD_SET_GREEN(dword,value) ACPI_SET_BITS (dword, 16, ACPI_8BIT_MASK, value) /* Offset 16, Len 8 */
> +
> +#define ACPI_PLD_GET_BLUE(dword) ACPI_GET_BITS (dword, 24, ACPI_8BIT_MASK)
> +#define ACPI_PLD_SET_BLUE(dword,value) ACPI_SET_BITS (dword, 24, ACPI_8BIT_MASK, value) /* Offset 24, Len 8 */
>
> /* Second 32-bit dword, bits 33:63 */
>
> diff --git a/src/acpica/source/include/acdisasm.h b/src/acpica/source/include/acdisasm.h
> index 5189986..f0cadef 100644
> --- a/src/acpica/source/include/acdisasm.h
> +++ b/src/acpica/source/include/acdisasm.h
> @@ -1051,11 +1051,23 @@ AcpiDmCheckResourceReference (
>
>
> /*
> + * dmcstyle
> + */
> +BOOLEAN
> +AcpiDmCheckForSymbolicOpcode (
> + ACPI_PARSE_OBJECT *Op,
> + ACPI_OP_WALK_INFO *Info);
> +
> +void
> +AcpiDmCloseOperator (
> + ACPI_PARSE_OBJECT *Op);
> +
> +
> +/*
> * acdisasm
> */
> void
> AdDisassemblerHeader (
> char *Filename);
>
> -
> #endif /* __ACDISASM_H__ */
> diff --git a/src/acpica/source/include/acglobal.h b/src/acpica/source/include/acglobal.h
> index a3783a4..91712b4 100644
> --- a/src/acpica/source/include/acglobal.h
> +++ b/src/acpica/source/include/acglobal.h
> @@ -381,6 +381,7 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DbOutputFlags, ACPI_DB_CONSOLE_O
>
> ACPI_INIT_GLOBAL (UINT8, AcpiGbl_NoResourceDisassembly, FALSE);
> ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnoreNoopOperator, FALSE);
> +ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CstyleDisassembly, TRUE);
>
> ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_disasm);
> ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_verbose);
> diff --git a/src/acpica/source/include/aclocal.h b/src/acpica/source/include/aclocal.h
> index 2680834..f55c00a 100644
> --- a/src/acpica/source/include/aclocal.h
> +++ b/src/acpica/source/include/aclocal.h
> @@ -941,6 +941,7 @@ typedef union acpi_parse_value
> ACPI_DISASM_ONLY_MEMBERS (\
> UINT8 DisasmFlags; /* Used during AML disassembly */\
> UINT8 DisasmOpcode; /* Subtype used for disassembly */\
> + char *OperatorSymbol;/* Used for C-style operator name strings */\
> char AmlOpName[16]) /* Op name (debug only) */
>
>
> @@ -1063,6 +1064,8 @@ typedef struct acpi_parse_state
> #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
> #define ACPI_PARSEOP_PREDEF_CHECKED 0x08
> #define ACPI_PARSEOP_SPECIAL 0x10
> +#define ACPI_PARSEOP_COMPOUND 0x20
> +#define ACPI_PARSEOP_ASSIGNMENT 0x40
>
>
> /*****************************************************************************
> diff --git a/src/acpica/source/include/acpixf.h b/src/acpica/source/include/acpixf.h
> index 4bffe86..23f965f 100644
> --- a/src/acpica/source/include/acpixf.h
> +++ b/src/acpica/source/include/acpixf.h
> @@ -118,7 +118,7 @@
>
> /* Current ACPICA subsystem version in YYYYMMDD format */
>
> -#define ACPI_CA_VERSION 0x20140926
> +#define ACPI_CA_VERSION 0x20141107
>
> #include "acconfig.h"
> #include "actypes.h"
> diff --git a/src/acpica/source/tools/acpiexec/aecommon.h b/src/acpica/source/tools/acpiexec/aecommon.h
> index 75ca498..17b1cd0 100644
> --- a/src/acpica/source/tools/acpiexec/aecommon.h
> +++ b/src/acpica/source/tools/acpiexec/aecommon.h
> @@ -142,6 +142,7 @@ extern UINT8 AcpiGbl_UseHwReducedFadt;
> extern BOOLEAN AcpiGbl_DisplayRegionAccess;
> extern BOOLEAN AcpiGbl_DoInterfaceTests;
> extern BOOLEAN AcpiGbl_LoadTestTables;
> +extern FILE *AcpiGbl_NamespaceInitFile;
> extern ACPI_CONNECTION_INFO AeMyContext;
>
> /* Check for unexpected exceptions */
> @@ -285,4 +286,14 @@ AeOverrideRegionHandlers (
> void);
>
>
> +/* aeinitfile */
> +
> +int
> +AeOpenInitializationFile (
> + char *Filename);
> +
> +void
> +AeDoObjectOverrides (
> + void);
> +
> #endif /* _AECOMMON */
> diff --git a/src/acpica/source/tools/acpiexec/aeinitfile.c b/src/acpica/source/tools/acpiexec/aeinitfile.c
> new file mode 100644
> index 0000000..64b8a79
> --- /dev/null
> +++ b/src/acpica/source/tools/acpiexec/aeinitfile.c
> @@ -0,0 +1,298 @@
> +/******************************************************************************
> + *
> + * Module Name: aeinitfile - Support for optional initialization file
> + *
> + *****************************************************************************/
> +
> +/******************************************************************************
> + *
> + * 1. Copyright Notice
> + *
> + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
> + * All rights reserved.
> + *
> + * 2. License
> + *
> + * 2.1. This is your license from Intel Corp. under its intellectual property
> + * rights. You may have additional license terms from the party that provided
> + * you this software, covering your right to use that party's intellectual
> + * property rights.
> + *
> + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
> + * copy of the source code appearing in this file ("Covered Code") an
> + * irrevocable, perpetual, worldwide license under Intel's copyrights in the
> + * base code distributed originally by Intel ("Original Intel Code") to copy,
> + * make derivatives, distribute, use and display any portion of the Covered
> + * Code in any form, with the right to sublicense such rights; and
> + *
> + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
> + * license (with the right to sublicense), under only those claims of Intel
> + * patents that are infringed by the Original Intel Code, to make, use, sell,
> + * offer to sell, and import the Covered Code and derivative works thereof
> + * solely to the minimum extent necessary to exercise the above copyright
> + * license, and in no event shall the patent license extend to any additions
> + * to or modifications of the Original Intel Code. No other license or right
> + * is granted directly or by implication, estoppel or otherwise;
> + *
> + * The above copyright and patent license is granted only if the following
> + * conditions are met:
> + *
> + * 3. Conditions
> + *
> + * 3.1. Redistribution of Source with Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification with rights to further distribute source must include
> + * the above Copyright Notice, the above License, this list of Conditions,
> + * and the following Disclaimer and Export Compliance provision. In addition,
> + * Licensee must cause all Covered Code to which Licensee contributes to
> + * contain a file documenting the changes Licensee made to create that Covered
> + * Code and the date of any change. Licensee must include in that file the
> + * documentation of any changes made by any predecessor Licensee. Licensee
> + * must include a prominent statement that the modification is derived,
> + * directly or indirectly, from Original Intel Code.
> + *
> + * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification without rights to further distribute source must
> + * include the following Disclaimer and Export Compliance provision in the
> + * documentation and/or other materials provided with distribution. In
> + * addition, Licensee may not authorize further sublicense of source of any
> + * portion of the Covered Code, and must include terms to the effect that the
> + * license from Licensee to its licensee is limited to the intellectual
> + * property embodied in the software Licensee provides to its licensee, and
> + * not to intellectual property embodied in modifications its licensee may
> + * make.
> + *
> + * 3.3. Redistribution of Executable. Redistribution in executable form of any
> + * substantial portion of the Covered Code or modification must reproduce the
> + * above Copyright Notice, and the following Disclaimer and Export Compliance
> + * provision in the documentation and/or other materials provided with the
> + * distribution.
> + *
> + * 3.4. Intel retains all right, title, and interest in and to the Original
> + * Intel Code.
> + *
> + * 3.5. Neither the name Intel nor any other trademark owned or controlled by
> + * Intel shall be used in advertising or otherwise to promote the sale, use or
> + * other dealings in products derived from or relating to the Covered Code
> + * without prior written authorization from Intel.
> + *
> + * 4. Disclaimer and Export Compliance
> + *
> + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
> + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
> + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
> + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
> + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
> + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
> + * PARTICULAR PURPOSE.
> + *
> + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
> + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
> + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
> + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
> + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
> + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
> + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
> + * LIMITED REMEDY.
> + *
> + * 4.3. Licensee shall not export, either directly or indirectly, any of this
> + * software or system incorporating such software without first obtaining any
> + * required license or other approval from the U. S. Department of Commerce or
> + * any other agency or department of the United States Government. In the
> + * event Licensee exports any such software from the United States or
> + * re-exports any such software from a foreign destination, Licensee shall
> + * ensure that the distribution and export/re-export of the software is in
> + * compliance with all laws, regulations, orders, or other restrictions of the
> + * U.S. Export Administration Regulations. Licensee agrees that neither it nor
> + * any of its subsidiaries will export/re-export any technical data, process,
> + * software, or service, directly or indirectly, to any country for which the
> + * United States government or any agency thereof requires an export license,
> + * other governmental approval, or letter of assurance, without first obtaining
> + * such license, approval or letter.
> + *
> + *****************************************************************************/
> +
> +#include "aecommon.h"
> +#include "acdispat.h"
> +
> +#define _COMPONENT ACPI_TOOLS
> + ACPI_MODULE_NAME ("aeinitfile")
> +
> +
> +/* Local prototypes */
> +
> +static void
> +AeDoOneOverride (
> + char *Pathname,
> + char *ValueString,
> + ACPI_OPERAND_OBJECT *ObjDesc,
> + ACPI_WALK_STATE *WalkState);
> +
> +
> +#define AE_FILE_BUFFER_SIZE 512
> +
> +static char NameBuffer[AE_FILE_BUFFER_SIZE];
> +static char ValueBuffer[AE_FILE_BUFFER_SIZE];
> +static FILE *InitFile;
> +
> +
> +/******************************************************************************
> + *
> + * FUNCTION: AeOpenInitializationFile
> + *
> + * PARAMETERS: Filename - Path to the init file
> + *
> + * RETURN: Status
> + *
> + * DESCRIPTION: Open the initialization file for the -fi option
> + *
> + *****************************************************************************/
> +
> +int
> +AeOpenInitializationFile (
> + char *Filename)
> +{
> +
> + InitFile = fopen (Filename, "r");
> + if (!InitFile)
> + {
> + perror ("Could not open initialization file");
> + return (-1);
> + }
> +
> + AcpiOsPrintf ("Opened initialization file [%s]\n", Filename);
> + return (0);
> +}
> +
> +
> +/******************************************************************************
> + *
> + * FUNCTION: AeDoObjectOverrides
> + *
> + * PARAMETERS: None
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Read the initialization file and perform all overrides
> + *
> + * NOTE: The format of the file is multiple lines, each of format:
> + * <ACPI-pathname> <Integer Value>
> + *
> + *****************************************************************************/
> +
> +void
> +AeDoObjectOverrides (
> + void)
> +{
> + ACPI_OPERAND_OBJECT *ObjDesc;
> + ACPI_WALK_STATE *WalkState;
> + int i;
> +
> +
> + if (!InitFile)
> + {
> + return;
> + }
> +
> + /* Create needed objects to be reused for each init entry */
> +
> + ObjDesc = AcpiUtCreateIntegerObject (0);
> + WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
> +
> + NameBuffer[0] = '\\';
> +
> + /* Read the entire file line-by-line */
> +
> + while (fscanf (InitFile, "%s %s\n",
> + ACPI_CAST_PTR (char, &NameBuffer[1]),
> + ACPI_CAST_PTR (char, &ValueBuffer)) == 2)
> + {
> + /* Add a root prefix if not present in the string */
> +
> + i = 0;
> + if (NameBuffer[1] == '\\')
> + {
> + i = 1;
> + }
> +
> + AeDoOneOverride (&NameBuffer[i], ValueBuffer, ObjDesc, WalkState);
> + }
> +
> + /* Cleanup */
> +
> + fclose (InitFile);
> + AcpiDsDeleteWalkState (WalkState);
> + AcpiUtRemoveReference (ObjDesc);
> +}
> +
> +
> +/******************************************************************************
> + *
> + * FUNCTION: AeDoOneOverride
> + *
> + * PARAMETERS: Pathname - AML namepath
> + * ValueString - New integer value to be stored
> + * ObjDesc - Descriptor with integer override value
> + * WalkState - Used for the Store operation
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Perform an overrided for a single namespace object
> + *
> + *****************************************************************************/
> +
> +static void
> +AeDoOneOverride (
> + char *Pathname,
> + char *ValueString,
> + ACPI_OPERAND_OBJECT *ObjDesc,
> + ACPI_WALK_STATE *WalkState)
> +{
> + ACPI_HANDLE Handle;
> + ACPI_STATUS Status;
> + UINT64 Value;
> +
> +
> + AcpiOsPrintf ("Value Override: %s, ", Pathname);
> +
> + /*
> + * Get the namespace node associated with the override
> + * pathname from the init file.
> + */
> + Status = AcpiGetHandle (NULL, Pathname, &Handle);
> + if (ACPI_FAILURE (Status))
> + {
> + AcpiOsPrintf ("%s\n", AcpiFormatException (Status));
> + return;
> + }
> +
> + /* Extract the 64-bit integer */
> +
> + Status = AcpiUtStrtoul64 (ValueString, 0, &Value);
> + if (ACPI_FAILURE (Status))
> + {
> + AcpiOsPrintf ("%s\n", AcpiFormatException (Status));
> + return;
> + }
> +
> + ObjDesc->Integer.Value = Value;
> +
> + /*
> + * At the point this function is called, the namespace is fully
> + * built and initialized. We can simply store the new object to
> + * the target node.
> + */
> + AcpiExEnterInterpreter ();
> + Status = AcpiExStore (ObjDesc, Handle, WalkState);
> + AcpiExExitInterpreter ();
> +
> + if (ACPI_FAILURE (Status))
> + {
> + AcpiOsPrintf ("%s\n", AcpiFormatException (Status));
> + return;
> + }
> +
> + AcpiOsPrintf ("New value: 0x%8.8X%8.8X\n",
> + ACPI_FORMAT_UINT64 (Value));
> +}
>
Acked-by: Ivan Hu <ivan.hu at canonical.com>
More information about the fwts-devel
mailing list