svn commit: r274357 - in vendor-sys/acpica/dist: . generate/unix/acpiexec generate/unix/iasl source/common source/compiler source/components/debugger source/components/disassembler source/component...
Jung-uk Kim
jkim at FreeBSD.org
Mon Nov 10 21:30:09 UTC 2014
Author: jkim
Date: Mon Nov 10 21:30:04 2014
New Revision: 274357
URL: https://svnweb.freebsd.org/changeset/base/274357
Log:
Import ACPICA 20141107.
Added:
vendor-sys/acpica/dist/source/compiler/aslprintf.c (contents, props changed)
vendor-sys/acpica/dist/source/compiler/aslprune.c (contents, props changed)
vendor-sys/acpica/dist/source/components/disassembler/dmcstyle.c (contents, props changed)
vendor-sys/acpica/dist/source/tools/acpiexec/aeinitfile.c (contents, props changed)
Modified:
vendor-sys/acpica/dist/changes.txt
vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile
vendor-sys/acpica/dist/generate/unix/iasl/Makefile
vendor-sys/acpica/dist/source/common/adisasm.c
vendor-sys/acpica/dist/source/compiler/aslbtypes.c
vendor-sys/acpica/dist/source/compiler/aslcodegen.c
vendor-sys/acpica/dist/source/compiler/aslcompile.c
vendor-sys/acpica/dist/source/compiler/aslcompiler.h
vendor-sys/acpica/dist/source/compiler/aslcompiler.l
vendor-sys/acpica/dist/source/compiler/asldefine.h
vendor-sys/acpica/dist/source/compiler/aslglobal.h
vendor-sys/acpica/dist/source/compiler/aslload.c
vendor-sys/acpica/dist/source/compiler/aslmain.c
vendor-sys/acpica/dist/source/compiler/aslmap.c
vendor-sys/acpica/dist/source/compiler/aslopcodes.c
vendor-sys/acpica/dist/source/compiler/asloptions.c
vendor-sys/acpica/dist/source/compiler/aslparser.y
vendor-sys/acpica/dist/source/compiler/aslrules.y
vendor-sys/acpica/dist/source/compiler/asltokens.y
vendor-sys/acpica/dist/source/compiler/asltree.c
vendor-sys/acpica/dist/source/compiler/asltypes.y
vendor-sys/acpica/dist/source/compiler/aslwalks.c
vendor-sys/acpica/dist/source/compiler/aslxref.c
vendor-sys/acpica/dist/source/compiler/dtcompile.c
vendor-sys/acpica/dist/source/compiler/dtexpress.c
vendor-sys/acpica/dist/source/compiler/dtfield.c
vendor-sys/acpica/dist/source/compiler/dtio.c
vendor-sys/acpica/dist/source/compiler/dtsubtable.c
vendor-sys/acpica/dist/source/compiler/dttable.c
vendor-sys/acpica/dist/source/compiler/dtutils.c
vendor-sys/acpica/dist/source/components/debugger/dbconvert.c
vendor-sys/acpica/dist/source/components/disassembler/dmbuffer.c
vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c
vendor-sys/acpica/dist/source/components/disassembler/dmutils.c
vendor-sys/acpica/dist/source/components/disassembler/dmwalk.c
vendor-sys/acpica/dist/source/components/dispatcher/dsargs.c
vendor-sys/acpica/dist/source/components/dispatcher/dscontrol.c
vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c
vendor-sys/acpica/dist/source/components/dispatcher/dsinit.c
vendor-sys/acpica/dist/source/components/dispatcher/dsmethod.c
vendor-sys/acpica/dist/source/components/dispatcher/dsmthdat.c
vendor-sys/acpica/dist/source/components/dispatcher/dsobject.c
vendor-sys/acpica/dist/source/components/dispatcher/dsopcode.c
vendor-sys/acpica/dist/source/components/dispatcher/dsutils.c
vendor-sys/acpica/dist/source/components/dispatcher/dswexec.c
vendor-sys/acpica/dist/source/components/dispatcher/dswload.c
vendor-sys/acpica/dist/source/components/dispatcher/dswload2.c
vendor-sys/acpica/dist/source/components/dispatcher/dswscope.c
vendor-sys/acpica/dist/source/components/dispatcher/dswstate.c
vendor-sys/acpica/dist/source/components/events/evhandler.c
vendor-sys/acpica/dist/source/components/events/evregion.c
vendor-sys/acpica/dist/source/components/events/evrgnini.c
vendor-sys/acpica/dist/source/components/events/evxface.c
vendor-sys/acpica/dist/source/components/events/evxfevnt.c
vendor-sys/acpica/dist/source/components/events/evxfgpe.c
vendor-sys/acpica/dist/source/components/events/evxfregn.c
vendor-sys/acpica/dist/source/components/executer/exconfig.c
vendor-sys/acpica/dist/source/components/executer/exconvrt.c
vendor-sys/acpica/dist/source/components/executer/excreate.c
vendor-sys/acpica/dist/source/components/executer/exdebug.c
vendor-sys/acpica/dist/source/components/executer/exdump.c
vendor-sys/acpica/dist/source/components/executer/exfield.c
vendor-sys/acpica/dist/source/components/executer/exfldio.c
vendor-sys/acpica/dist/source/components/executer/exmisc.c
vendor-sys/acpica/dist/source/components/executer/exmutex.c
vendor-sys/acpica/dist/source/components/executer/exnames.c
vendor-sys/acpica/dist/source/components/executer/exoparg1.c
vendor-sys/acpica/dist/source/components/executer/exoparg2.c
vendor-sys/acpica/dist/source/components/executer/exoparg3.c
vendor-sys/acpica/dist/source/components/executer/exoparg6.c
vendor-sys/acpica/dist/source/components/executer/exprep.c
vendor-sys/acpica/dist/source/components/executer/exregion.c
vendor-sys/acpica/dist/source/components/executer/exresnte.c
vendor-sys/acpica/dist/source/components/executer/exresolv.c
vendor-sys/acpica/dist/source/components/executer/exresop.c
vendor-sys/acpica/dist/source/components/executer/exstore.c
vendor-sys/acpica/dist/source/components/executer/exstoren.c
vendor-sys/acpica/dist/source/components/executer/exstorob.c
vendor-sys/acpica/dist/source/components/executer/exsystem.c
vendor-sys/acpica/dist/source/components/executer/exutils.c
vendor-sys/acpica/dist/source/components/hardware/hwacpi.c
vendor-sys/acpica/dist/source/components/hardware/hwpci.c
vendor-sys/acpica/dist/source/components/hardware/hwregs.c
vendor-sys/acpica/dist/source/components/hardware/hwvalid.c
vendor-sys/acpica/dist/source/components/namespace/nsaccess.c
vendor-sys/acpica/dist/source/components/namespace/nsalloc.c
vendor-sys/acpica/dist/source/components/namespace/nsconvert.c
vendor-sys/acpica/dist/source/components/namespace/nsdump.c
vendor-sys/acpica/dist/source/components/namespace/nsdumpdv.c
vendor-sys/acpica/dist/source/components/namespace/nseval.c
vendor-sys/acpica/dist/source/components/namespace/nsinit.c
vendor-sys/acpica/dist/source/components/namespace/nsload.c
vendor-sys/acpica/dist/source/components/namespace/nsnames.c
vendor-sys/acpica/dist/source/components/namespace/nsobject.c
vendor-sys/acpica/dist/source/components/namespace/nsparse.c
vendor-sys/acpica/dist/source/components/namespace/nsrepair.c
vendor-sys/acpica/dist/source/components/namespace/nsrepair2.c
vendor-sys/acpica/dist/source/components/namespace/nssearch.c
vendor-sys/acpica/dist/source/components/namespace/nsutils.c
vendor-sys/acpica/dist/source/components/namespace/nswalk.c
vendor-sys/acpica/dist/source/components/namespace/nsxfeval.c
vendor-sys/acpica/dist/source/components/namespace/nsxfname.c
vendor-sys/acpica/dist/source/components/namespace/nsxfobj.c
vendor-sys/acpica/dist/source/components/parser/psargs.c
vendor-sys/acpica/dist/source/components/parser/pstree.c
vendor-sys/acpica/dist/source/components/parser/psxface.c
vendor-sys/acpica/dist/source/components/resources/rsaddr.c
vendor-sys/acpica/dist/source/components/resources/rscalc.c
vendor-sys/acpica/dist/source/components/resources/rscreate.c
vendor-sys/acpica/dist/source/components/resources/rsdump.c
vendor-sys/acpica/dist/source/components/resources/rsdumpinfo.c
vendor-sys/acpica/dist/source/components/resources/rsinfo.c
vendor-sys/acpica/dist/source/components/resources/rsio.c
vendor-sys/acpica/dist/source/components/resources/rsirq.c
vendor-sys/acpica/dist/source/components/resources/rslist.c
vendor-sys/acpica/dist/source/components/resources/rsmemory.c
vendor-sys/acpica/dist/source/components/resources/rsmisc.c
vendor-sys/acpica/dist/source/components/resources/rsserial.c
vendor-sys/acpica/dist/source/components/resources/rsutils.c
vendor-sys/acpica/dist/source/components/resources/rsxface.c
vendor-sys/acpica/dist/source/components/tables/tbdata.c
vendor-sys/acpica/dist/source/components/tables/tbfadt.c
vendor-sys/acpica/dist/source/components/tables/tbfind.c
vendor-sys/acpica/dist/source/components/tables/tbinstal.c
vendor-sys/acpica/dist/source/components/tables/tbprint.c
vendor-sys/acpica/dist/source/components/tables/tbutils.c
vendor-sys/acpica/dist/source/components/tables/tbxface.c
vendor-sys/acpica/dist/source/components/tables/tbxfload.c
vendor-sys/acpica/dist/source/components/tables/tbxfroot.c
vendor-sys/acpica/dist/source/components/utilities/utaddress.c
vendor-sys/acpica/dist/source/components/utilities/utalloc.c
vendor-sys/acpica/dist/source/components/utilities/utbuffer.c
vendor-sys/acpica/dist/source/components/utilities/utcache.c
vendor-sys/acpica/dist/source/components/utilities/utclib.c
vendor-sys/acpica/dist/source/components/utilities/utcopy.c
vendor-sys/acpica/dist/source/components/utilities/utdebug.c
vendor-sys/acpica/dist/source/components/utilities/utdecode.c
vendor-sys/acpica/dist/source/components/utilities/utdelete.c
vendor-sys/acpica/dist/source/components/utilities/uterror.c
vendor-sys/acpica/dist/source/components/utilities/uteval.c
vendor-sys/acpica/dist/source/components/utilities/utexcep.c
vendor-sys/acpica/dist/source/components/utilities/utglobal.c
vendor-sys/acpica/dist/source/components/utilities/uthex.c
vendor-sys/acpica/dist/source/components/utilities/utids.c
vendor-sys/acpica/dist/source/components/utilities/utinit.c
vendor-sys/acpica/dist/source/components/utilities/utlock.c
vendor-sys/acpica/dist/source/components/utilities/utmath.c
vendor-sys/acpica/dist/source/components/utilities/utmisc.c
vendor-sys/acpica/dist/source/components/utilities/utmutex.c
vendor-sys/acpica/dist/source/components/utilities/utobject.c
vendor-sys/acpica/dist/source/components/utilities/utosi.c
vendor-sys/acpica/dist/source/components/utilities/utownerid.c
vendor-sys/acpica/dist/source/components/utilities/utpredef.c
vendor-sys/acpica/dist/source/components/utilities/utresrc.c
vendor-sys/acpica/dist/source/components/utilities/utstate.c
vendor-sys/acpica/dist/source/components/utilities/utstring.c
vendor-sys/acpica/dist/source/components/utilities/uttrack.c
vendor-sys/acpica/dist/source/components/utilities/utuuid.c
vendor-sys/acpica/dist/source/components/utilities/utxface.c
vendor-sys/acpica/dist/source/components/utilities/utxferror.c
vendor-sys/acpica/dist/source/components/utilities/utxfinit.c
vendor-sys/acpica/dist/source/components/utilities/utxfmutex.c
vendor-sys/acpica/dist/source/include/acbuffer.h
vendor-sys/acpica/dist/source/include/acdisasm.h
vendor-sys/acpica/dist/source/include/acglobal.h
vendor-sys/acpica/dist/source/include/aclocal.h
vendor-sys/acpica/dist/source/include/acpixf.h
vendor-sys/acpica/dist/source/tools/acpiexec/aecommon.h
vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c
vendor-sys/acpica/dist/source/tools/examples/examples.c
vendor-sys/acpica/dist/source/tools/examples/extables.c
Modified: vendor-sys/acpica/dist/changes.txt
==============================================================================
--- vendor-sys/acpica/dist/changes.txt Mon Nov 10 21:10:50 2014 (r274356)
+++ vendor-sys/acpica/dist/changes.txt Mon Nov 10 21:30:04 2014 (r274357)
@@ -1,4 +1,183 @@
----------------------------------------
+07 November 2014. Summary of changes for version 20141107:
+
+This release is available at https://acpica.org/downloads
+
+This release introduces and implements language extensions to ASL that
+provide support for symbolic ("C-style") operators and expressions. These
+language extensions are known collectively as ASL+.
+
+
+1) iASL Compiler/Disassembler and Tools:
+
+Disassembler: Fixed a problem with disassembly of the UartSerialBus
+macro. Changed "StopBitsNone" to the correct "StopBitsZero". David E.
+Box.
+
+Disassembler: Fixed the Unicode macro support to add escape sequences.
+All non-printable ASCII values are emitted as escape sequences, as well
+as the standard escapes for quote and backslash. Ensures that the
+disassembled macro can be correctly recompiled.
+
+iASL: Added Printf/Fprintf macros for formatted output. These macros are
+translated to existing AML Concatenate and Store operations. Printf
+writes to the ASL Debug object. Fprintf allows the specification of an
+ASL name as the target. Only a single format specifier is required, %o,
+since the AML interpreter dynamically converts objects to the required
+type. David E. Box.
+
+ (old) Store (Concatenate (Concatenate (Concatenate (Concatenate
+ (Concatenate (Concatenate (Concatenate ("", Arg0),
+ ": Unexpected value for "), Arg1), ", "), Arg2),
+ " at line "), Arg3), Debug)
+
+ (new) Printf ("%o: Unexpected value for %o, %o at line %o",
+ Arg0, Arg1, Arg2, Arg3)
+
+ (old) Store (Concatenate (Concatenate (Concatenate (Concatenate
+ ("", Arg1), ": "), Arg0), " Successful"), STR1)
+
+ (new) Fprintf (STR1, "%o: %o Successful", Arg1, Arg0)
+
+iASL: Added debug options (-bp, -bt) to dynamically prune levels of the
+ASL parse tree before the AML code is generated. This allows blocks of
+ASL code to be removed in order to help locate and identify problem
+devices and/or code. David E. Box.
+
+AcpiExec: Added support (-fi) for an optional namespace object
+initialization file. This file specifies initial values for namespace
+objects as necessary for debugging and testing different ASL code paths
+that may be taken as a result of BIOS options.
+
+
+2) Overview of symbolic operator support for ASL (ASL+)
+-------------------------------------------------------
+
+As an extension to the ASL language, iASL implements support for symbolic
+(C-style) operators for math and logical expressions. This can greatly
+simplify ASL code as well as improve both readability and
+maintainability. These language extensions can exist concurrently with
+all legacy ASL code and expressions.
+
+The symbolic extensions are 100% compatible with existing AML
+interpreters, since no new AML opcodes are created. To implement the
+extensions, the iASL compiler transforms the symbolic expressions into
+the legacy ASL/AML equivalents at compile time.
+
+Full symbolic expressions are supported, along with the standard C
+precedence and associativity rules.
+
+Full disassembler support for the symbolic expressions is provided, and
+creates an automatic migration path for existing ASL code to ASL+ code
+via the disassembly process. By default, the disassembler now emits ASL+
+code with symbolic expressions. An option (-dl) is provided to force the
+disassembler to emit legacy ASL code if desired.
+
+Below is the complete list of the currently supported symbolic operators
+with examples. See the iASL User Guide for additional information.
+
+
+ASL+ Syntax Legacy ASL Equivalent
+----------- ---------------------
+
+ // Math operators
+
+Z = X + Y Add (X, Y, Z)
+Z = X - Y Subtract (X, Y, Z)
+Z = X * Y Multiply (X, Y, Z)
+Z = X / Y Divide (X, Y, , Z)
+Z = X % Y Mod (X, Y, Z)
+Z = X << Y ShiftLeft (X, Y, Z)
+Z = X >> Y ShiftRight (X, Y, Z)
+Z = X & Y And (X, Y, Z)
+Z = X | Y Or (X, Y, Z)
+Z = X ^ Y Xor (X, Y, Z)
+Z = ~X Not (X, Z)
+X++ Increment (X)
+X-- Decrement (X)
+
+ // Logical operators
+
+(X == Y) LEqual (X, Y)
+(X != Y) LNotEqual (X, Y)
+(X < Y) LLess (X, Y)
+(X > Y) LGreater (X, Y)
+(X <= Y) LLessEqual (X, Y)
+(X >= Y) LGreaterEqual (X, Y)
+(X && Y) LAnd (X, Y)
+(X || Y) LOr (X, Y)
+(!X) LNot (X)
+
+ // Assignment and compound assignment operations
+
+X = Y Store (Y, X)
+X += Y Add (X, Y, X)
+X -= Y Subtract (X, Y, X)
+X *= Y Multiply (X, Y, X)
+X /= Y Divide (X, Y, , X)
+X %= Y Mod (X, Y, X)
+X <<= Y ShiftLeft (X, Y, X)
+X >>= Y ShiftRight (X, Y, X)
+X &= Y And (X, Y, X)
+X |= Y Or (X, Y, X)
+X ^= Y Xor (X, Y, X)
+
+
+3) ASL+ Examples:
+-----------------
+
+Legacy ASL:
+ If (LOr (LOr (LEqual (And (R510, 0x03FB), 0x02E0), LEqual (
+ And (R520, 0x03FB), 0x02E0)), LOr (LEqual (And (R530,
+0x03FB),
+ 0x02E0), LEqual (And (R540, 0x03FB), 0x02E0))))
+ {
+ And (MEMB, 0xFFFFFFF0, SRMB)
+ Store (MEMB, Local2)
+ Store (PDBM, Local1)
+ And (PDBM, 0xFFFFFFFFFFFFFFF9, PDBM)
+ Store (SRMB, MEMB)
+ Or (PDBM, 0x02, PDBM)
+ }
+
+ASL+ version:
+ If (((R510 & 0x03FB) == 0x02E0) ||
+ ((R520 & 0x03FB) == 0x02E0) ||
+ ((R530 & 0x03FB) == 0x02E0) ||
+ ((R540 & 0x03FB) == 0x02E0))
+ {
+ SRMB = (MEMB & 0xFFFFFFF0)
+ Local2 = MEMB
+ Local1 = PDBM
+ PDBM &= 0xFFFFFFFFFFFFFFF9
+ MEMB = SRMB
+ PDBM |= 0x02
+ }
+
+Legacy ASL:
+ Store (0x1234, Local1)
+ Multiply (Add (Add (Local1, TEST), 0x20), Local2, Local3)
+ Multiply (Local2, Add (Add (Local1, TEST), 0x20), Local3)
+ Add (Local1, Add (TEST, Multiply (0x20, Local2)), Local3)
+ Store (Index (PKG1, 0x03), Local6)
+ Store (Add (Local3, Local2), Debug)
+ Add (Local1, 0x0F, Local2)
+ Add (Local1, Multiply (Local2, Local3), Local2)
+ Multiply (Add (Add (Local1, TEST), 0x20), ToBCD (Local1), Local3)
+
+ASL+ version:
+ Local1 = 0x1234
+ Local3 = (((Local1 + TEST) + 0x20) * Local2)
+ Local3 = (Local2 * ((Local1 + TEST) + 0x20))
+ Local3 = (Local1 + (TEST + (0x20 * Local2)))
+ Local6 = Index (PKG1, 0x03)
+ Debug = (Local3 + Local2)
+ Local2 = (Local1 + 0x0F)
+ Local2 = (Local1 + (Local2 * Local3))
+ Local3 = (((Local1 + TEST) + 0x20) * ToBCD (Local1))
+
+
+----------------------------------------
26 September 2014. Summary of changes for version 20140926:
1) ACPICA kernel-resident subsystem:
Modified: vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile
==============================================================================
--- vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Mon Nov 10 21:10:50 2014 (r274356)
+++ vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Mon Nov 10 21:30:04 2014 (r274357)
@@ -42,6 +42,7 @@ OBJECTS = \
$(OBJDIR)/acgetline.o\
$(OBJDIR)/aeexec.o\
$(OBJDIR)/aehandlers.o\
+ $(OBJDIR)/aeinitfile.o\
$(OBJDIR)/aemain.o\
$(OBJDIR)/aeregion.o\
$(OBJDIR)/aetables.o\
@@ -62,6 +63,7 @@ OBJECTS = \
$(OBJDIR)/dbutils.o\
$(OBJDIR)/dbxface.o\
$(OBJDIR)/dmbuffer.o\
+ $(OBJDIR)/dmcstyle.o\
$(OBJDIR)/dmdeferred.o\
$(OBJDIR)/dmnames.o\
$(OBJDIR)/dmobject.o\
Modified: vendor-sys/acpica/dist/generate/unix/iasl/Makefile
==============================================================================
--- vendor-sys/acpica/dist/generate/unix/iasl/Makefile Mon Nov 10 21:10:50 2014 (r274356)
+++ vendor-sys/acpica/dist/generate/unix/iasl/Makefile Mon Nov 10 21:30:04 2014 (r274357)
@@ -79,6 +79,8 @@ OBJECTS = \
$(OBJDIR)/asloptions.o\
$(OBJDIR)/aslpredef.o\
$(OBJDIR)/aslprepkg.o\
+ $(OBJDIR)/aslprintf.o\
+ $(OBJDIR)/aslprune.o\
$(OBJDIR)/aslresource.o\
$(OBJDIR)/aslrestype1.o\
$(OBJDIR)/aslrestype1i.o\
@@ -97,16 +99,9 @@ OBJECTS = \
$(OBJDIR)/aslwalks.o\
$(OBJDIR)/aslxref.o\
$(OBJDIR)/cmfsize.o\
- $(OBJDIR)/dtcompile.o\
- $(OBJDIR)/dtexpress.o\
- $(OBJDIR)/dtfield.o\
- $(OBJDIR)/dtio.o\
- $(OBJDIR)/dtsubtable.o\
- $(OBJDIR)/dttable.o\
- $(OBJDIR)/dttemplate.o\
- $(OBJDIR)/dtutils.o\
$(OBJDIR)/dbfileio.o\
$(OBJDIR)/dmbuffer.o\
+ $(OBJDIR)/dmcstyle.o\
$(OBJDIR)/dmdeferred.o\
$(OBJDIR)/dmextern.o\
$(OBJDIR)/dmnames.o\
@@ -133,6 +128,14 @@ OBJECTS = \
$(OBJDIR)/dswload2.o\
$(OBJDIR)/dswscope.o\
$(OBJDIR)/dswstate.o\
+ $(OBJDIR)/dtcompile.o\
+ $(OBJDIR)/dtexpress.o\
+ $(OBJDIR)/dtfield.o\
+ $(OBJDIR)/dtio.o\
+ $(OBJDIR)/dtsubtable.o\
+ $(OBJDIR)/dttable.o\
+ $(OBJDIR)/dttemplate.o\
+ $(OBJDIR)/dtutils.o\
$(OBJDIR)/exconvrt.o\
$(OBJDIR)/excreate.o\
$(OBJDIR)/exdump.o\
Modified: vendor-sys/acpica/dist/source/common/adisasm.c
==============================================================================
--- vendor-sys/acpica/dist/source/common/adisasm.c Mon Nov 10 21:10:50 2014 (r274356)
+++ vendor-sys/acpica/dist/source/common/adisasm.c Mon Nov 10 21:30:04 2014 (r274357)
@@ -544,12 +544,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");
Modified: vendor-sys/acpica/dist/source/compiler/aslbtypes.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslbtypes.c Mon Nov 10 21:10:50 2014 (r274356)
+++ vendor-sys/acpica/dist/source/compiler/aslbtypes.c Mon Nov 10 21:30:04 2014 (r274357)
@@ -374,6 +374,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))
Modified: vendor-sys/acpica/dist/source/compiler/aslcodegen.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslcodegen.c Mon Nov 10 21:10:50 2014 (r274356)
+++ vendor-sys/acpica/dist/source/compiler/aslcodegen.c Mon Nov 10 21:30:04 2014 (r274357)
@@ -107,6 +107,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 ();
}
@@ -138,7 +144,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, " ");
}
@@ -161,7 +168,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,
@@ -171,13 +179,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 */
Modified: vendor-sys/acpica/dist/source/compiler/aslcompile.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslcompile.c Mon Nov 10 21:10:50 2014 (r274356)
+++ vendor-sys/acpica/dist/source/compiler/aslcompile.c Mon Nov 10 21:30:04 2014 (r274357)
@@ -147,6 +147,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 ();
Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.h
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslcompiler.h Mon Nov 10 21:10:50 2014 (r274356)
+++ vendor-sys/acpica/dist/source/compiler/aslcompiler.h Mon Nov 10 21:30:04 2014 (r274357)
@@ -543,6 +543,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
@@ -684,6 +705,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);
Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.l
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslcompiler.l Mon Nov 10 21:10:50 2014 (r274356)
+++ vendor-sys/acpica/dist/source/compiler/aslcompiler.l Mon Nov 10 21:30:04 2014 (r274357)
@@ -117,7 +117,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); }
@@ -592,6 +634,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__); }
@@ -628,10 +708,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",
Modified: vendor-sys/acpica/dist/source/compiler/asldefine.h
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/asldefine.h Mon Nov 10 21:10:50 2014 (r274356)
+++ vendor-sys/acpica/dist/source/compiler/asldefine.h Mon Nov 10 21:30:04 2014 (r274357)
@@ -49,8 +49,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"
Modified: vendor-sys/acpica/dist/source/compiler/aslglobal.h
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslglobal.h Mon Nov 10 21:10:50 2014 (r274356)
+++ vendor-sys/acpica/dist/source/compiler/aslglobal.h Mon Nov 10 21:30:04 2014 (r274357)
@@ -173,6 +173,7 @@ ASL_EXTERN BOOLEAN ASL_
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
@@ -251,6 +252,8 @@ ASL_EXTERN UINT32 ASL_
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 */
Modified: vendor-sys/acpica/dist/source/compiler/aslload.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslload.c Mon Nov 10 21:10:50 2014 (r274356)
+++ vendor-sys/acpica/dist/source/compiler/aslload.c Mon Nov 10 21:30:04 2014 (r274357)
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __ASLLOAD_C__
-
#include "aslcompiler.h"
#include "amlcode.h"
#include "acdispat.h"
Modified: vendor-sys/acpica/dist/source/compiler/aslmain.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslmain.c Mon Nov 10 21:10:50 2014 (r274356)
+++ vendor-sys/acpica/dist/source/compiler/aslmain.c Mon Nov 10 21:30:04 2014 (r274357)
@@ -187,13 +187,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");
Modified: vendor-sys/acpica/dist/source/compiler/aslmap.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslmap.c Mon Nov 10 21:10:50 2014 (r274356)
+++ vendor-sys/acpica/dist/source/compiler/aslmap.c Mon Nov 10 21:30:04 2014 (r274357)
@@ -446,7 +446,38 @@ const ASL_MAPPING_ENTRY AslKeywordMa
/* 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 !*/
};
Modified: vendor-sys/acpica/dist/source/compiler/aslopcodes.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslopcodes.c Mon Nov 10 21:10:50 2014 (r274356)
+++ vendor-sys/acpica/dist/source/compiler/aslopcodes.c Mon Nov 10 21:30:04 2014 (r274357)
@@ -68,9 +68,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
+};
+
/*******************************************************************************
*
@@ -653,9 +706,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)
+ {
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-all
mailing list