Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Feb 2017 20:06:31 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r314405 - in vendor-sys/acpica/dist: . generate/unix/iasl source/common source/compiler source/components/debugger source/components/disassembler source/components/dispatcher source/com...
Message-ID:  <201702282006.v1SK6V1v015913@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Tue Feb 28 20:06:31 2017
New Revision: 314405
URL: https://svnweb.freebsd.org/changeset/base/314405

Log:
  Import ACPICA 20170224.

Added:
  vendor-sys/acpica/dist/source/compiler/cvcompiler.c   (contents, props changed)
  vendor-sys/acpica/dist/source/compiler/cvdisasm.c   (contents, props changed)
  vendor-sys/acpica/dist/source/compiler/cvparser.c   (contents, props changed)
  vendor-sys/acpica/dist/source/include/acconvert.h   (contents, props changed)
Modified:
  vendor-sys/acpica/dist/changes.txt
  vendor-sys/acpica/dist/generate/unix/iasl/Makefile
  vendor-sys/acpica/dist/source/common/adisasm.c
  vendor-sys/acpica/dist/source/common/adwalk.c
  vendor-sys/acpica/dist/source/common/dmextern.c
  vendor-sys/acpica/dist/source/common/dmtables.c
  vendor-sys/acpica/dist/source/common/dmtbinfo.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/asldebug.c
  vendor-sys/acpica/dist/source/compiler/asldefine.h
  vendor-sys/acpica/dist/source/compiler/aslfiles.c
  vendor-sys/acpica/dist/source/compiler/aslglobal.h
  vendor-sys/acpica/dist/source/compiler/aslhelp.c
  vendor-sys/acpica/dist/source/compiler/asllength.c
  vendor-sys/acpica/dist/source/compiler/aslmap.c
  vendor-sys/acpica/dist/source/compiler/asloffset.c
  vendor-sys/acpica/dist/source/compiler/asloperands.c
  vendor-sys/acpica/dist/source/compiler/asloptions.c
  vendor-sys/acpica/dist/source/compiler/aslprimaries.y
  vendor-sys/acpica/dist/source/compiler/aslprintf.c
  vendor-sys/acpica/dist/source/compiler/aslresources.y
  vendor-sys/acpica/dist/source/compiler/aslrules.y
  vendor-sys/acpica/dist/source/compiler/aslstartup.c
  vendor-sys/acpica/dist/source/compiler/aslsupport.l
  vendor-sys/acpica/dist/source/compiler/asltree.c
  vendor-sys/acpica/dist/source/compiler/asltypes.h
  vendor-sys/acpica/dist/source/compiler/aslwalks.c
  vendor-sys/acpica/dist/source/compiler/dttable1.c
  vendor-sys/acpica/dist/source/compiler/dttemplate.h
  vendor-sys/acpica/dist/source/components/debugger/dbmethod.c
  vendor-sys/acpica/dist/source/components/debugger/dbxface.c
  vendor-sys/acpica/dist/source/components/disassembler/dmcstyle.c
  vendor-sys/acpica/dist/source/components/disassembler/dmdeferred.c
  vendor-sys/acpica/dist/source/components/disassembler/dmnames.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/dscontrol.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/dswload2.c
  vendor-sys/acpica/dist/source/components/executer/exmisc.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/exoparg6.c
  vendor-sys/acpica/dist/source/components/executer/exresolv.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/hardware/hwvalid.c
  vendor-sys/acpica/dist/source/components/namespace/nsaccess.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/nsutils.c
  vendor-sys/acpica/dist/source/components/parser/psargs.c
  vendor-sys/acpica/dist/source/components/parser/psloop.c
  vendor-sys/acpica/dist/source/components/parser/psobject.c
  vendor-sys/acpica/dist/source/components/parser/psopcode.c
  vendor-sys/acpica/dist/source/components/parser/psopinfo.c
  vendor-sys/acpica/dist/source/components/parser/psparse.c
  vendor-sys/acpica/dist/source/components/parser/pstree.c
  vendor-sys/acpica/dist/source/components/parser/psutils.c
  vendor-sys/acpica/dist/source/components/utilities/utalloc.c
  vendor-sys/acpica/dist/source/components/utilities/utcache.c
  vendor-sys/acpica/dist/source/components/utilities/utdebug.c
  vendor-sys/acpica/dist/source/components/utilities/utresrc.c
  vendor-sys/acpica/dist/source/components/utilities/utxferror.c
  vendor-sys/acpica/dist/source/include/acconfig.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/acmacros.h
  vendor-sys/acpica/dist/source/include/acopcode.h
  vendor-sys/acpica/dist/source/include/acpixf.h
  vendor-sys/acpica/dist/source/include/actbl2.h
  vendor-sys/acpica/dist/source/include/amlcode.h
  vendor-sys/acpica/dist/source/tools/acpisrc/astable.c

Modified: vendor-sys/acpica/dist/changes.txt
==============================================================================
--- vendor-sys/acpica/dist/changes.txt	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/changes.txt	Tue Feb 28 20:06:31 2017	(r314405)
@@ -1,7 +1,68 @@
 ----------------------------------------
+24 February 2017. Summary of changes for version 20170224:
+
+
+1) ACPICA kernel-resident subsystem:
+
+Interpreter: Fixed two issues with the control method return value auto-
+repair feature, where an attempt to double-delete an internal object 
+could result in an ACPICA warning (for _CID repair and others). No fault 
+occurs, however, because the attempted deletion (actually a release to an 
+internal cache) is detected and ignored via object poisoning.
+
+Debugger: Fixed an AML interpreter mutex issue during the single stepping 
+of control methods. If certain debugger commands are executed during 
+stepping, a mutex aquire/release error could occur. Lv Zheng.
+
+Fixed some issues generating ACPICA with the Intel C compiler by 
+restoring the original behavior and compiler-specific include file in 
+acenv.h. Lv Zheng.
+
+Example Code and Data Size: These are the sizes for the OS-independent 
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The 
+debug version of the code includes the debug output trace mechanism and 
+has a much larger code and data size.
+
+  Current Release:
+    Non-Debug Version: 141.7K Code, 58.5K Data, 200.2K Total
+    Debug Version:     207.5K Code, 82.7K Data, 290.2K Total
+  Previous Release:
+    Non-Debug Version: 137.4K Code, 52.6K Data, 190.0K Total
+    Debug Version:     201.5K Code, 82.2K Data, 283.7K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL/Disassembler: A preliminary version of a new ASL-to-ASL+ conversion 
+tool has been designed, implemented, and included in this release. The 
+key feature of this utility is that the original comments within the 
+input ASL file are preserved during the conversion process, and included 
+within the converted ASL+ file -- thus creating a transparent conversion 
+of existing ASL files to ASL+ (ASL 2.0). Erik Schmauss.
+
+    Usage: iasl -ca <ASL-filename>  // Output is a .dsl file with 
+converted code
+
+iASL/Disassembler: Improved the detection and correct disassembly of 
+Switch/Case operators. This feature detects sequences of if/elseif/else 
+operators that originated from ASL Switch/Case/Default operators and 
+emits the original operators. David Box.
+
+iASL: Improved the IORT ACPI table support in the following areas. Lv 
+Zheng:
+    Clear MappingOffset if the MappingCount is zero.
+    Fix the disassembly of the SMMU GSU interrupt offset.
+    Update the template file for the IORT table.
+
+Disassembler: Enhanced the detection and disassembly of resource 
+template/descriptor within a Buffer object. An EndTag descriptor is now 
+required to have a zero second byte, since all known ASL compilers emit 
+this. This helps eliminate incorrect decisions when a buffer is 
+disassembled (false positives on resource templates).
+
+----------------------------------------
 19 January 2017. Summary of changes for version 20170119:
 
-This release is available at https://acpica.org/downloads
 
 1) General ACPICA software:
 

Modified: vendor-sys/acpica/dist/generate/unix/iasl/Makefile
==============================================================================
--- vendor-sys/acpica/dist/generate/unix/iasl/Makefile	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/generate/unix/iasl/Makefile	Tue Feb 28 20:06:31 2017	(r314405)
@@ -105,6 +105,9 @@ OBJECTS = \
 	$(OBJDIR)/aslwalks.o\
 	$(OBJDIR)/aslxref.o\
 	$(OBJDIR)/aslxrefout.o\
+	$(OBJDIR)/cvcompiler.o\
+	$(OBJDIR)/cvdisasm.o\
+	$(OBJDIR)/cvparser.o\
 	$(OBJDIR)/cmfsize.o\
 	$(OBJDIR)/dbfileio.o\
 	$(OBJDIR)/dmbuffer.o\

Modified: vendor-sys/acpica/dist/source/common/adisasm.c
==============================================================================
--- vendor-sys/acpica/dist/source/common/adisasm.c	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/common/adisasm.c	Tue Feb 28 20:06:31 2017	(r314405)
@@ -326,6 +326,21 @@ AdDisassembleOneTable (
     ACPI_OWNER_ID           OwnerId;
 
 
+#ifdef ACPI_ASL_COMPILER
+
+    /*
+     * For ASL-/ASL+ converter: replace the temporary "XXXX"
+     * table signature with the original. This "XXXX" makes
+     * it harder for the AML interpreter to run the badaml
+     * (.xxx) file produced from the converter in case if
+     * it fails to get deleted.
+     */
+    if (Gbl_CaptureComments)
+    {
+        strncpy (Table->Signature, AcpiGbl_TableSig, 4);
+    }
+#endif
+
     /* ForceAmlDisassembly means to assume the table contains valid AML */
 
     if (!AcpiGbl_ForceAmlDisassembly && !AcpiUtIsAmlTable (Table))
@@ -475,6 +490,7 @@ AdReparseOneTable (
     ACPI_OWNER_ID           OwnerId)
 {
     ACPI_STATUS             Status;
+    ACPI_COMMENT_ADDR_NODE  *AddrListHead;
 
 
     fprintf (stderr,
@@ -508,6 +524,15 @@ AdReparseOneTable (
 
     AcpiDmAddExternalsToNamespace ();
 
+    /* For -ca option: clear the list of comment addresses. */
+
+    while (AcpiGbl_CommentAddrListHead)
+    {
+        AddrListHead= AcpiGbl_CommentAddrListHead;
+        AcpiGbl_CommentAddrListHead = AcpiGbl_CommentAddrListHead->Next;
+        AcpiOsFree(AddrListHead);
+    }
+
     /* Parse the table again. No need to reload it, however */
 
     Status = AdParseTable (Table, NULL, FALSE, FALSE);

Modified: vendor-sys/acpica/dist/source/common/adwalk.c
==============================================================================
--- vendor-sys/acpica/dist/source/common/adwalk.c	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/common/adwalk.c	Tue Feb 28 20:06:31 2017	(r314405)
@@ -878,7 +878,7 @@ AcpiDmXrefDescendingOp (
              * method.
              */
             if (!(Op->Asl.Parent &&
-                (Op->Asl.Parent->Asl.AmlOpcode == AML_COND_REF_OF_OP)))
+                (Op->Asl.Parent->Asl.AmlOpcode == AML_CONDITIONAL_REF_OF_OP)))
             {
                 if (Node)
                 {

Modified: vendor-sys/acpica/dist/source/common/dmextern.c
==============================================================================
--- vendor-sys/acpica/dist/source/common/dmextern.c	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/common/dmextern.c	Tue Feb 28 20:06:31 2017	(r314405)
@@ -1165,6 +1165,31 @@ AcpiDmEmitExternals (
 
 /*******************************************************************************
  *
+ * FUNCTION:    AcpiDmEmitExternal
+ *
+ * PARAMETERS:  Op                  External Parse Object
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Emit an External() ASL statement for the current External
+ *              parse object
+ *
+ ******************************************************************************/
+
+void
+AcpiDmEmitExternal (
+    ACPI_PARSE_OBJECT       *NameOp,
+    ACPI_PARSE_OBJECT       *TypeOp)
+{
+    AcpiOsPrintf ("External (");
+    AcpiDmNamestring (NameOp->Common.Value.Name);
+    AcpiOsPrintf ("%s)\n",
+        AcpiDmGetObjectTypeName ((ACPI_OBJECT_TYPE) TypeOp->Common.Value.Integer));
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    AcpiDmUnresolvedWarning
  *
  * PARAMETERS:  Type                - Where to output the warning.

Modified: vendor-sys/acpica/dist/source/common/dmtables.c
==============================================================================
--- vendor-sys/acpica/dist/source/common/dmtables.c	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/common/dmtables.c	Tue Feb 28 20:06:31 2017	(r314405)
@@ -47,6 +47,8 @@
 #include "actables.h"
 #include "acparser.h"
 #include "acapps.h"
+#include "acmacros.h"
+#include "acconvert.h"
 
 
 #define _COMPONENT          ACPI_TOOLS
@@ -202,6 +204,14 @@ AdCreateTableHeader (
     AcpiOsPrintf (" */\n");
 
     /*
+     * Print comments that come before this definition block.
+     */
+    if (Gbl_CaptureComments)
+    {
+        ASL_CV_PRINT_ONE_COMMENT(AcpiGbl_ParseOpRoot,AML_COMMENT_STANDARD, NULL, 0);
+    }
+
+    /*
      * Open the ASL definition block.
      *
      * Note: the AMLFilename string is left zero-length in order to just let
@@ -388,6 +398,7 @@ AdParseTable (
 
     AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER);
     AmlStart = ((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER));
+    ASL_CV_INIT_FILETREE(Table, AmlStart, AmlLength);
 
     /* Create the root object */
 
@@ -397,6 +408,17 @@ AdParseTable (
         return (AE_NO_MEMORY);
     }
 
+#ifdef ACPI_ASL_COMPILER
+    if (Gbl_CaptureComments)
+    {
+        AcpiGbl_ParseOpRoot->Common.CvFilename = AcpiGbl_FileTreeRoot->Filename;
+    }
+    else
+    {
+        AcpiGbl_ParseOpRoot->Common.CvFilename = NULL;
+    }
+#endif
+
     /* Create and initialize a new walk state */
 
     WalkState = AcpiDsCreateWalkState (0, AcpiGbl_ParseOpRoot, NULL, NULL);

Modified: vendor-sys/acpica/dist/source/common/dmtbinfo.c
==============================================================================
--- vendor-sys/acpica/dist/source/common/dmtbinfo.c	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/common/dmtbinfo.c	Tue Feb 28 20:06:31 2017	(r314405)
@@ -171,6 +171,7 @@
 #define ACPI_IORT1_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_IORT_NAMED_COMPONENT,f)
 #define ACPI_IORT2_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_IORT_ROOT_COMPLEX,f)
 #define ACPI_IORT3_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU,f)
+#define ACPI_IORT3A_OFFSET(f)           (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU_GSI,f)
 #define ACPI_IORT4_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU_V3,f)
 #define ACPI_IORTA_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_IORT_MEMORY_ACCESS,f)
 #define ACPI_IORTH_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_IORT_NODE,f)
@@ -259,6 +260,7 @@
 #define ACPI_GTDT0a_FLAG_OFFSET(f,o)    ACPI_FLAG_OFFSET (ACPI_GTDT_TIMER_ENTRY,f,o)
 #define ACPI_GTDT1_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_GTDT_WATCHDOG,f,o)
 #define ACPI_IORT3_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_IORT_SMMU,f,o)
+#define ACPI_IORT3a_FLAG_OFFSET(f,o)    ACPI_FLAG_OFFSET (ACPI_IORT_SMMU_GSI,f,o)
 #define ACPI_IORT4_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_IORT_SMMU_V3,f,o)
 #define ACPI_IORTA_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_IORT_MEMORY_ACCESS,f,o)
 #define ACPI_IORTM_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_IORT_ID_MAPPING,f,o)
@@ -1549,8 +1551,12 @@ ACPI_DMTABLE_INFO           AcpiDmTableI
 
 ACPI_DMTABLE_INFO           AcpiDmTableInfoIort3a[] =
 {
-    {ACPI_DMT_UINT64,   0,                                          "SMMU_NSgIrpt Interrupt", 0},
-    {ACPI_DMT_UINT64,   0,                                          "SMMU_NSgCfgIrpt Interrupt", 0},
+    {ACPI_DMT_UINT32,   ACPI_IORT3A_OFFSET (NSgIrpt),                   "NSgIrpt", 0},
+    {ACPI_DMT_UINT32,   ACPI_IORT3A_OFFSET (NSgIrptFlags),              "NSgIrpt Flags (decoded below)", 0},
+    {ACPI_DMT_FLAG0,    ACPI_IORT3a_FLAG_OFFSET (NSgIrptFlags, 0),      "Edge Triggered", 0},
+    {ACPI_DMT_UINT32,   ACPI_IORT3A_OFFSET (NSgCfgIrpt),                "NSgCfgIrpt", 0},
+    {ACPI_DMT_UINT32,   ACPI_IORT3A_OFFSET (NSgCfgIrptFlags),           "NSgCfgIrpt Flags (decoded below)", 0},
+    {ACPI_DMT_FLAG0,    ACPI_IORT3a_FLAG_OFFSET (NSgCfgIrptFlags, 0),   "Edge Triggered", 0},
     ACPI_DMT_TERMINATOR
 };
 

Modified: vendor-sys/acpica/dist/source/compiler/aslcodegen.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslcodegen.c	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/compiler/aslcodegen.c	Tue Feb 28 20:06:31 2017	(r314405)
@@ -44,6 +44,7 @@
 #include "aslcompiler.h"
 #include "aslcompiler.y.h"
 #include "amlcode.h"
+#include "acconvert.h"
 
 #define _COMPONENT          ACPI_COMPILER
         ACPI_MODULE_NAME    ("aslcodegen")
@@ -57,12 +58,6 @@ CgAmlWriteWalk (
     void                    *Context);
 
 static void
-CgLocalWriteAmlData (
-    ACPI_PARSE_OBJECT       *Op,
-    void                    *Buffer,
-    UINT32                  Length);
-
-static void
 CgWriteAmlOpcode (
     ACPI_PARSE_OBJECT       *Op);
 
@@ -206,7 +201,7 @@ CgAmlWriteWalk (
  *
  ******************************************************************************/
 
-static void
+void
 CgLocalWriteAmlData (
     ACPI_PARSE_OBJECT       *Op,
     void                    *Buffer,
@@ -261,6 +256,15 @@ CgWriteAmlOpcode (
         return;
     }
 
+    /*
+     * Before printing the bytecode, generate comment byte codes
+     * associated with this node.
+     */
+    if (Gbl_CaptureComments)
+    {
+        CgWriteAmlComment(Op);
+    }
+
     switch (Op->Asl.AmlOpcode)
     {
     case AML_UNASSIGNED_OPCODE:
@@ -416,6 +420,8 @@ CgWriteTableHeader (
     ACPI_PARSE_OBJECT       *Op)
 {
     ACPI_PARSE_OBJECT       *Child;
+    UINT32                  CommentLength;
+    ACPI_COMMENT_NODE       *Current;
 
 
     /* AML filename */
@@ -425,6 +431,21 @@ CgWriteTableHeader (
     /* Signature */
 
     Child = Child->Asl.Next;
+
+    /*
+     * For ASL-/ASL+ converter: replace the table signature with
+     * "XXXX" and save the original table signature. This results in an AML
+     * file with the signature "XXXX". The converter should remove this AML
+     * file. In the event where this AML file does not get deleted, the
+     * "XXXX" table signature prevents this AML file from running on the AML
+     * interpreter.
+     */
+    if (Gbl_CaptureComments)
+    {
+        strncpy(AcpiGbl_TableSig, Child->Asl.Value.String, 4);
+        Child->Asl.Value.String = ACPI_SIG_XXXX;
+    }
+
     strncpy (TableHeader.Signature, Child->Asl.Value.String, 4);
 
     /* Revision */
@@ -466,6 +487,50 @@ CgWriteTableHeader (
 
     TableHeader.Length = sizeof (ACPI_TABLE_HEADER) +
         Op->Asl.AmlSubtreeLength;
+
+    /* Calculate the comment lengths for this definition block parseOp */
+
+    if (Gbl_CaptureComments)
+    {
+        CvDbgPrint ("Calculating comment lengths for %s in write header\n",
+            Op->Asl.ParseOpName);
+
+        /*
+         * Take the filename without extensions, add 3 for the new extension
+         * and another 3 for the a908 bytecode and null terminator.
+         */
+        TableHeader.Length += strrchr (Gbl_ParseTreeRoot->Asl.Filename, '.')
+            - Gbl_ParseTreeRoot->Asl.Filename + 1 + 3 + 3;
+        Op->Asl.AmlSubtreeLength +=
+            strlen (Gbl_ParseTreeRoot->Asl.Filename) + 3;
+    CvDbgPrint ("     Length: %lu\n",
+            strlen (Gbl_ParseTreeRoot->Asl.Filename) + 3);
+
+        if (Op->Asl.CommentList)
+        {
+            Current = Op->Asl.CommentList;
+            while (Current)
+            {
+                CommentLength = strlen (Current->Comment)+3;
+                CvDbgPrint ("Length of standard comment): %d\n", CommentLength);
+                CvDbgPrint ("    Comment string: %s\n\n", Current->Comment);
+                TableHeader.Length += CommentLength;
+                Op->Asl.AmlSubtreeLength += CommentLength;
+                Current = Current->Next;
+            CvDbgPrint ("    Length: %u\n", CommentLength);
+            }
+        }
+        if (Op->Asl.CloseBraceComment)
+        {
+            CommentLength = strlen (Op->Asl.CloseBraceComment)+3;
+            CvDbgPrint ("Length of inline comment +3: %d\n", CommentLength);
+            CvDbgPrint ("    Comment string: %s\n\n", Op->Asl.CloseBraceComment);
+            TableHeader.Length += CommentLength;
+            Op->Asl.AmlSubtreeLength += CommentLength;
+        CvDbgPrint ("    Length: %u\n", CommentLength);
+        }
+    }
+
     TableHeader.Checksum = 0;
 
     Op->Asl.FinalAmlOffset = ftell (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
@@ -492,13 +557,13 @@ CgWriteTableHeader (
 
 static void
 CgUpdateHeader (
-    ACPI_PARSE_OBJECT   *Op)
+    ACPI_PARSE_OBJECT       *Op)
 {
-    signed char         Sum;
-    UINT32              i;
-    UINT32              Length;
-    UINT8               FileByte;
-    UINT8               Checksum;
+    signed char             Sum;
+    UINT32                  i;
+    UINT32                  Length;
+    UINT8                   FileByte;
+    UINT8                   Checksum;
 
 
     /* Calculate the checksum over the entire definition block */
@@ -580,6 +645,12 @@ CgWriteNode (
     ASL_RESOURCE_NODE       *Rnode;
 
 
+    /* Write all comments here. */
+    if (Gbl_CaptureComments)
+    {
+        CgWriteAmlComment(Op);
+    }
+
     /* Always check for DEFAULT_ARG and other "Noop" nodes */
     /* TBD: this may not be the best place for this check */
 
@@ -641,6 +712,10 @@ CgWriteNode (
     case PARSEOP_DEFINITION_BLOCK:
 
         CgWriteTableHeader (Op);
+        if (Gbl_CaptureComments)
+        {
+            CgWriteAmlDefBlockComment (Op);
+        }
         break;
 
     case PARSEOP_NAMESEG:

Modified: vendor-sys/acpica/dist/source/compiler/aslcompile.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslcompile.c	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/compiler/aslcompile.c	Tue Feb 28 20:06:31 2017	(r314405)
@@ -285,8 +285,17 @@ CmDoCompile (
     {
         Event = UtBeginEvent ("Resolve all Externals");
         DbgPrint (ASL_DEBUG_OUTPUT, "\nResolve Externals\n\n");
-        TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE,
-            ExAmlExternalWalkBegin, ExAmlExternalWalkEnd, NULL);
+
+        if (Gbl_DoExternalsInPlace)
+        {
+            TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
+                ExAmlExternalWalkBegin, NULL, NULL);
+        }
+        else
+        {
+            TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE,
+                ExAmlExternalWalkBegin, ExAmlExternalWalkEnd, NULL);
+        }
         UtEndEvent (Event);
     }
 
@@ -347,6 +356,18 @@ CmDoCompile (
         NULL, &AnalysisWalkInfo);
     UtEndEvent (Event);
 
+    /*
+     * ASL-/ASL+ converter: Gbl_ParseTreeRoot->CommentList contains the
+     * very last comment of a given ASL file because it's the last constructed
+     * node during compilation. We take the very last comment and save it in a
+     * global for it to be used by the disassembler.
+     */
+    if (Gbl_CaptureComments)
+    {
+        AcpiGbl_LastListHead = Gbl_ParseTreeRoot->Asl.CommentList;
+        Gbl_ParseTreeRoot->Asl.CommentList = NULL;
+    }
+
     /* Calculate all AML package lengths */
 
     Event = UtBeginEvent ("Finish AML package length generation");
@@ -800,7 +821,11 @@ CmCleanupAndExit (
 
     /* Final cleanup after compiling one file */
 
-    CmDeleteCaches ();
+    if (!Gbl_DoAslConversion)
+    {
+        CmDeleteCaches ();
+    }
+
 }
 
 

Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.h
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslcompiler.h	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/compiler/aslcompiler.h	Tue Feb 28 20:06:31 2017	(r314405)
@@ -576,6 +576,12 @@ void
 CgGenerateAmlOutput (
     void);
 
+void
+CgLocalWriteAmlData (
+    ACPI_PARSE_OBJECT       *Op,
+    void                    *Buffer,
+    UINT32                  Length);
+
 
 /*
  * aslfile
@@ -1359,4 +1365,14 @@ ACPI_STATUS
 DtCreateTemplates (
     char                    **argv);
 
+
+/*
+ * ASL/ASL+ converter debug
+ */
+void
+CvDbgPrint (
+    char                    *Fmt,
+    ...);
+
+
 #endif /*  __ASLCOMPILER_H */

Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.l
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslcompiler.l	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/compiler/aslcompiler.l	Tue Feb 28 20:06:31 2017	(r314405)
@@ -44,6 +44,7 @@
 
 #include "aslcompiler.h"
 #include "aslcompiler.y.h"
+#include "acconvert.h"
 
 #include <stdlib.h>
 #include <string.h>
@@ -66,10 +67,10 @@ YYSTYPE AslCompilerlval;
 static void
 AslDoLineDirective (void);
 
-static char
+static BOOLEAN
 AslDoComment (void);
 
-static char
+static BOOLEAN
 AslDoCommentType2 (void);
 
 static char

Modified: vendor-sys/acpica/dist/source/compiler/asldebug.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/asldebug.c	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/compiler/asldebug.c	Tue Feb 28 20:06:31 2017	(r314405)
@@ -60,6 +60,40 @@ UtDumpParseOpName (
 
 /*******************************************************************************
  *
+ * FUNCTION:    CvDbgPrint
+ *
+ * PARAMETERS:  Type                - Type of output
+ *              Fmt                 - Printf format string
+ *              ...                 - variable printf list
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Print statement for debug messages within the converter.
+ *
+ ******************************************************************************/
+
+void
+CvDbgPrint (
+    char                    *Fmt,
+    ...)
+{
+    va_list                 Args;
+
+
+    if (!Gbl_CaptureComments || !AcpiGbl_DebugAslConversion)
+    {
+        return;
+    }
+
+    va_start (Args, Fmt);
+    (void) vfprintf (AcpiGbl_ConvDebugFile, Fmt, Args);
+    va_end (Args);
+    return;
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    UtDumpIntegerOp
  *
  * PARAMETERS:  Op                  - Current parse op

Modified: vendor-sys/acpica/dist/source/compiler/asldefine.h
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/asldefine.h	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/compiler/asldefine.h	Tue Feb 28 20:06:31 2017	(r314405)
@@ -159,7 +159,6 @@
 /*
  * Macros for debug output
  */
-
 #define DEBUG_MAX_LINE_LENGTH       61
 #define DEBUG_SPACES_PER_INDENT     3
 #define DEBUG_FULL_LINE_LENGTH      71
@@ -185,4 +184,11 @@
     " %08X %04X %04X %01X     %04X  %04X %05X  %05X   "\
     "%08X %08X %08X %08X %08X %08X %04X  %02d  %5d %5d %5d %5d\n"
 
+/*
+ * Macros for ASL/ASL+ converter
+ */
+#define COMMENT_CAPTURE_ON    Gbl_CommentState.CaptureComments = TRUE;
+#define COMMENT_CAPTURE_OFF   Gbl_CommentState.CaptureComments = FALSE;
+
+
 #endif /* ASLDEFINE.H */

Modified: vendor-sys/acpica/dist/source/compiler/aslfiles.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslfiles.c	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/compiler/aslfiles.c	Tue Feb 28 20:06:31 2017	(r314405)
@@ -511,8 +511,14 @@ FlOpenAmlOutputFile (
     if (!Filename)
     {
         /* Create the output AML filename */
-
-        Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_AML_CODE);
+        if (!Gbl_CaptureComments)
+        {
+            Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_AML_CODE);
+        }
+        else
+        {
+            Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_CONVERT_AML);
+        }
         if (!Filename)
         {
             AslCommonError (ASL_ERROR, ASL_MSG_OUTPUT_FILENAME,
@@ -854,6 +860,28 @@ FlOpenMiscOutputFiles (
         AslCompilerFileHeader (ASL_FILE_NAMESPACE_OUTPUT);
     }
 
+    /* Create a debug file for the converter */
+
+    if (AcpiGbl_DebugAslConversion)
+    {
+        Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_CONVERT_DEBUG);
+        if (!Filename)
+        {
+            AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
+                0, 0, 0, 0, NULL, NULL);
+            return (AE_ERROR);
+        }
+
+        /* Open the converter debug file, text mode */
+
+        FlOpenFile (ASL_FILE_CONV_DEBUG_OUTPUT, Filename, "w+t");
+
+        AslCompilerSignon (ASL_FILE_CONV_DEBUG_OUTPUT);
+        AslCompilerFileHeader (ASL_FILE_CONV_DEBUG_OUTPUT);
+
+        AcpiGbl_ConvDebugFile = Gbl_Files[ASL_FILE_CONV_DEBUG_OUTPUT].Handle;
+    }
+
     return (AE_OK);
 }
 

Modified: vendor-sys/acpica/dist/source/compiler/aslglobal.h
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslglobal.h	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/compiler/aslglobal.h	Tue Feb 28 20:06:31 2017	(r314405)
@@ -84,7 +84,8 @@ ASL_FILE_INFO                       Gbl_
     {NULL, NULL, "C Include:    ", "C Header Output"},
     {NULL, NULL, "Offset Table: ", "C Offset Table Output"},
     {NULL, NULL, "Device Map:   ", "Device Map Output"},
-    {NULL, NULL, "Cross Ref:    ", "Cross-reference Output"}
+    {NULL, NULL, "Cross Ref:    ", "Cross-reference Output"},
+    {NULL, NULL, "Converter db :", "Converter debug Output"}
 };
 
 #else
@@ -113,7 +114,7 @@ extern int                  AslCompilerd
 
 
 #define ASL_DEFAULT_LINE_BUFFER_SIZE    (1024 * 32) /* 32K */
-#define ASL_MSG_BUFFER_SIZE             4096
+#define ASL_MSG_BUFFER_SIZE             (1024 * 32) /* 32k */
 #define ASL_MAX_DISABLED_MESSAGES       32
 #define HEX_TABLE_LINE_SIZE             8
 #define HEX_LISTING_LINE_SIZE           8
@@ -182,6 +183,9 @@ ASL_EXTERN BOOLEAN                  ASL_
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DoTypechecking, TRUE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_EnableReferenceTypechecking, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DoExternals, TRUE);
+ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DoExternalsInPlace, FALSE);
+ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DoAslConversion, FALSE);
+ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_OptimizeTrivialParseNodes, TRUE);
 
 
 #define HEX_OUTPUT_NONE             0
@@ -265,6 +269,20 @@ ASL_EXTERN char                     ASL_
 ASL_EXTERN UINT8                    ASL_INIT_GLOBAL (Gbl_PruneDepth, 0);
 ASL_EXTERN UINT16                   ASL_INIT_GLOBAL (Gbl_PruneType, 0);
 
+ASL_EXTERN ASL_FILE_NODE            ASL_INIT_GLOBAL (*Gbl_IncludeFileStack, NULL);
+
+/* Specific to the -q option */
+
+ASL_EXTERN ASL_COMMENT_STATE        Gbl_CommentState;
+
+
+/*
+ * Determines if an inline comment should be saved in the InlineComment or NodeEndComment
+ *  field of ACPI_PARSE_OBJECT.
+ */
+ASL_EXTERN ACPI_COMMENT_NODE        ASL_INIT_GLOBAL (*Gbl_Comment_List_Head, NULL);
+ASL_EXTERN ACPI_COMMENT_NODE        ASL_INIT_GLOBAL (*Gbl_Comment_List_Tail, NULL);
+ASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_Inline_Comment_Buffer, NULL);
 
 /* Static structures */
 

Modified: vendor-sys/acpica/dist/source/compiler/aslhelp.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslhelp.c	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/compiler/aslhelp.c	Tue Feb 28 20:06:31 2017	(r314405)
@@ -69,9 +69,10 @@ Usage (
     ACPI_USAGE_HEADER ("iasl [Options] [Files]");
 
     printf ("\nGeneral:\n");
-    ACPI_OPTION ("-@ <file>",       "Specify command file");
-    ACPI_OPTION ("-I <dir>",        "Specify additional include directory");
-    ACPI_OPTION ("-p <prefix>",     "Specify path/filename prefix for all output files");
+    ACPI_OPTION ("-@  <file>",      "Specify command file");
+    ACPI_OPTION ("-I  <dir>",       "Specify additional include directory");
+    ACPI_OPTION ("-p  <prefix>",    "Specify path/filename prefix for all output files");
+    ACPI_OPTION ("-ca <file>",      "convert a given ASL file to ASL+ (retains comments)");
     ACPI_OPTION ("-v",              "Display compiler version");
     ACPI_OPTION ("-vd",             "Display compiler build date and time");
     ACPI_OPTION ("-vo",             "Enable optimization comments");
@@ -153,6 +154,7 @@ Usage (
     ACPI_OPTION ("-vt",             "Dump binary table data in hex format within output file");
 
     printf ("\nDebug Options:\n");
+    ACPI_OPTION ("-bc",             "Create converter debug file (*.cdb)");
     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");

Modified: vendor-sys/acpica/dist/source/compiler/asllength.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/asllength.c	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/compiler/asllength.c	Tue Feb 28 20:06:31 2017	(r314405)
@@ -44,6 +44,7 @@
 #include "aslcompiler.h"
 #include "aslcompiler.y.h"
 #include "amlcode.h"
+#include "acconvert.h"
 
 
 #define _COMPONENT          ACPI_COMPILER
@@ -136,7 +137,9 @@ LnPackageLengthWalk (
             Op->Asl.AmlLength +
             Op->Asl.AmlOpcodeLength +
             Op->Asl.AmlPkgLenBytes +
-            Op->Asl.AmlSubtreeLength);
+            Op->Asl.AmlSubtreeLength +
+            CvCalculateCommentLengths (Op)
+        );
     }
     return (AE_OK);
 }

Modified: vendor-sys/acpica/dist/source/compiler/aslmap.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslmap.c	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/compiler/aslmap.c	Tue Feb 28 20:06:31 2017	(r314405)
@@ -166,7 +166,7 @@ const ASL_MAPPING_ENTRY     AslKeywordMa
 /* BITSPERBYTE_SEVEN */         OP_TABLE_ENTRY (AML_BYTE_OP,                2,                              0,                  0),
 /* BITSPERBYTE_SIX */           OP_TABLE_ENTRY (AML_BYTE_OP,                1,                              0,                  0),
 /* BREAK */                     OP_TABLE_ENTRY (AML_BREAK_OP,               0,                              0,                  0),
-/* BREAKPOINT */                OP_TABLE_ENTRY (AML_BREAK_POINT_OP,         0,                              0,                  0),
+/* BREAKPOINT */                OP_TABLE_ENTRY (AML_BREAKPOINT_OP,          0,                              0,                  0),
 /* BUFFER */                    OP_TABLE_ENTRY (AML_BUFFER_OP,              0,                              NODE_AML_PACKAGE,   ACPI_BTYPE_BUFFER),
 /* BUSMASTERTYPE_MASTER */      OP_TABLE_ENTRY (AML_BYTE_OP,                1,                              0,                  0),
 /* BUSMASTERTYPE_NOTMASTER */   OP_TABLE_ENTRY (AML_BYTE_OP,                0,                              0,                  0),
@@ -176,12 +176,12 @@ const ASL_MAPPING_ENTRY     AslKeywordMa
 /* CLOCKPHASE_SECOND */         OP_TABLE_ENTRY (AML_BYTE_OP,                1,                              0,                  0),
 /* CLOCKPOLARITY_HIGH */        OP_TABLE_ENTRY (AML_BYTE_OP,                1,                              0,                  0),
 /* CLOCKPOLARITY_LOW */         OP_TABLE_ENTRY (AML_BYTE_OP,                0,                              0,                  0),
-/* CONCATENATE */               OP_TABLE_ENTRY (AML_CONCAT_OP,              0,                              0,                  ACPI_BTYPE_COMPUTE_DATA),
-/* CONCATENATERESTEMPLATE */    OP_TABLE_ENTRY (AML_CONCAT_RES_OP,          0,                              0,                  ACPI_BTYPE_BUFFER),
-/* CONDREFOF */                 OP_TABLE_ENTRY (AML_COND_REF_OF_OP,         0,                              0,                  ACPI_BTYPE_INTEGER),
+/* CONCATENATE */               OP_TABLE_ENTRY (AML_CONCATENATE_OP,         0,                              0,                  ACPI_BTYPE_COMPUTE_DATA),
+/* CONCATENATERESTEMPLATE */    OP_TABLE_ENTRY (AML_CONCATENATE_TEMPLATE_OP,0,                              0,                  ACPI_BTYPE_BUFFER),
+/* CONDREFOF */                 OP_TABLE_ENTRY (AML_CONDITIONAL_REF_OF_OP,  0,                              0,                  ACPI_BTYPE_INTEGER),
 /* CONNECTION */                OP_TABLE_ENTRY (AML_INT_CONNECTION_OP,      0,                              0,                  0),
 /* CONTINUE */                  OP_TABLE_ENTRY (AML_CONTINUE_OP,            0,                              0,                  0),
-/* COPY */                      OP_TABLE_ENTRY (AML_COPY_OP,                0,                              0,                  ACPI_BTYPE_DATA_REFERENCE),
+/* COPYOBJECT */                OP_TABLE_ENTRY (AML_COPY_OBJECT_OP,         0,                              0,                  ACPI_BTYPE_DATA_REFERENCE),
 /* CREATEBITFIELD */            OP_TABLE_ENTRY (AML_CREATE_BIT_FIELD_OP,    0,                              0,                  0),
 /* CREATEBYTEFIELD */           OP_TABLE_ENTRY (AML_CREATE_BYTE_FIELD_OP,   0,                              0,                  0),
 /* CREATEDWORDFIELD */          OP_TABLE_ENTRY (AML_CREATE_DWORD_FIELD_OP,  0,                              0,                  0),
@@ -261,14 +261,14 @@ const ASL_MAPPING_ENTRY     AslKeywordMa
 /* IORESTRICT_PRESERVE */       OP_TABLE_ENTRY (AML_BYTE_OP,                3,                              0,                  0),
 /* IRQ */                       OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP,         0,                              0,                  0),
 /* IRQNOFLAGS */                OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP,         0,                              0,                  0),
-/* LAND */                      OP_TABLE_ENTRY (AML_LAND_OP,                0,                              0,                  ACPI_BTYPE_INTEGER),
-/* LEQUAL */                    OP_TABLE_ENTRY (AML_LEQUAL_OP,              0,                              0,                  ACPI_BTYPE_INTEGER),
-/* LGREATER */                  OP_TABLE_ENTRY (AML_LGREATER_OP,            0,                              0,                  ACPI_BTYPE_INTEGER),
-/* LGREATEREQUAL */             OP_TABLE_ENTRY (AML_LGREATEREQUAL_OP,       0,                              0,                  ACPI_BTYPE_INTEGER),
-/* LLESS */                     OP_TABLE_ENTRY (AML_LLESS_OP,               0,                              0,                  ACPI_BTYPE_INTEGER),
-/* LLESSEQUAL */                OP_TABLE_ENTRY (AML_LLESSEQUAL_OP,          0,                              0,                  ACPI_BTYPE_INTEGER),
-/* LNOT */                      OP_TABLE_ENTRY (AML_LNOT_OP,                0,                              0,                  ACPI_BTYPE_INTEGER),
-/* LNOTEQUAL */                 OP_TABLE_ENTRY (AML_LNOTEQUAL_OP,           0,                              0,                  ACPI_BTYPE_INTEGER),
+/* LAND */                      OP_TABLE_ENTRY (AML_LOGICAL_AND_OP,         0,                              0,                  ACPI_BTYPE_INTEGER),
+/* LEQUAL */                    OP_TABLE_ENTRY (AML_LOGICAL_EQUAL_OP,       0,                              0,                  ACPI_BTYPE_INTEGER),
+/* LGREATER */                  OP_TABLE_ENTRY (AML_LOGICAL_GREATER_OP,     0,                              0,                  ACPI_BTYPE_INTEGER),
+/* LGREATEREQUAL */             OP_TABLE_ENTRY (AML_LOGICAL_GREATER_EQUAL_OP,0,                             0,                  ACPI_BTYPE_INTEGER),
+/* LLESS */                     OP_TABLE_ENTRY (AML_LOGICAL_LESS_OP,        0,                              0,                  ACPI_BTYPE_INTEGER),
+/* LLESSEQUAL */                OP_TABLE_ENTRY (AML_LOGICAL_LESS_EQUAL_OP,  0,                              0,                  ACPI_BTYPE_INTEGER),
+/* LNOT */                      OP_TABLE_ENTRY (AML_LOGICAL_NOT_OP,         0,                              0,                  ACPI_BTYPE_INTEGER),
+/* LNOTEQUAL */                 OP_TABLE_ENTRY (AML_LOGICAL_NOT_EQUAL_OP,   0,                              0,                  ACPI_BTYPE_INTEGER),
 /* LOAD */                      OP_TABLE_ENTRY (AML_LOAD_OP,                0,                              0,                  0),
 /* LOADTABLE */                 OP_TABLE_ENTRY (AML_LOAD_TABLE_OP,          0,                              0,                  ACPI_BTYPE_DDB_HANDLE),
 /* LOCAL0 */                    OP_TABLE_ENTRY (AML_LOCAL0,                 0,                              0,                  ACPI_BTYPE_OBJECTS_AND_REFS),
@@ -281,7 +281,7 @@ const ASL_MAPPING_ENTRY     AslKeywordMa
 /* LOCAL7 */                    OP_TABLE_ENTRY (AML_LOCAL7,                 0,                              0,                  ACPI_BTYPE_OBJECTS_AND_REFS),
 /* LOCKRULE_LOCK */             OP_TABLE_ENTRY (AML_BYTE_OP,                AML_FIELD_LOCK_ALWAYS,          0,                  0),
 /* LOCKRULE_NOLOCK */           OP_TABLE_ENTRY (AML_BYTE_OP,                AML_FIELD_LOCK_NEVER,           0,                  0),
-/* LOR */                       OP_TABLE_ENTRY (AML_LOR_OP,                 0,                              0,                  ACPI_BTYPE_INTEGER),
+/* LOR */                       OP_TABLE_ENTRY (AML_LOGICAL_OR_OP,          0,                              0,                  ACPI_BTYPE_INTEGER),
 /* MATCH */                     OP_TABLE_ENTRY (AML_MATCH_OP,               0,                              0,                  ACPI_BTYPE_INTEGER),
 /* MATCHTYPE_MEQ */             OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          MATCH_MEQ,                      0,                  ACPI_BTYPE_INTEGER),
 /* MATCHTYPE_MGE */             OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          MATCH_MGE,                      0,                  ACPI_BTYPE_INTEGER),
@@ -347,7 +347,7 @@ const ASL_MAPPING_ENTRY     AslKeywordMa
 /* PIN_PULLDEFAULT */           OP_TABLE_ENTRY (AML_BYTE_OP,                0,                              0,                  0),
 /* PIN_PULLDOWN */              OP_TABLE_ENTRY (AML_BYTE_OP,                2,                              0,                  0),
 /* PIN_PULLUP */                OP_TABLE_ENTRY (AML_BYTE_OP,                1,                              0,                  0),
-/* POWERRESOURCE */             OP_TABLE_ENTRY (AML_POWER_RES_OP,           0,                              NODE_AML_PACKAGE,   0),
+/* POWERRESOURCE */             OP_TABLE_ENTRY (AML_POWER_RESOURCE_OP,      0,                              NODE_AML_PACKAGE,   0),
 /* PROCESSOR */                 OP_TABLE_ENTRY (AML_PROCESSOR_OP,           0,                              NODE_AML_PACKAGE,   0),
 /* QWORDCONST */                OP_TABLE_ENTRY (AML_RAW_DATA_QWORD,         0,                              0,                  ACPI_BTYPE_INTEGER),
 /* QWORDIO */                   OP_TABLE_ENTRY (AML_BYTE_OP,                0,                              0,                  0),
@@ -412,8 +412,8 @@ const ASL_MAPPING_ENTRY     AslKeywordMa
 /* TIMER */                     OP_TABLE_ENTRY (AML_TIMER_OP,               0,                              0,                  ACPI_BTYPE_INTEGER),
 /* TOBCD */                     OP_TABLE_ENTRY (AML_TO_BCD_OP,              0,                              0,                  ACPI_BTYPE_INTEGER),
 /* TOBUFFER */                  OP_TABLE_ENTRY (AML_TO_BUFFER_OP,           0,                              0,                  ACPI_BTYPE_BUFFER),
-/* TODECIMALSTRING */           OP_TABLE_ENTRY (AML_TO_DECSTRING_OP,        0,                              0,                  ACPI_BTYPE_STRING),
-/* TOHEXSTRING */               OP_TABLE_ENTRY (AML_TO_HEXSTRING_OP,        0,                              0,                  ACPI_BTYPE_STRING),
+/* TODECIMALSTRING */           OP_TABLE_ENTRY (AML_TO_DECIMAL_STRING_OP,   0,                              0,                  ACPI_BTYPE_STRING),
+/* TOHEXSTRING */               OP_TABLE_ENTRY (AML_TO_HEX_STRING_OP,       0,                              0,                  ACPI_BTYPE_STRING),
 /* TOINTEGER */                 OP_TABLE_ENTRY (AML_TO_INTEGER_OP,          0,                              0,                  ACPI_BTYPE_INTEGER),
 /* TOSTRING */                  OP_TABLE_ENTRY (AML_TO_STRING_OP,           0,                              0,                  ACPI_BTYPE_STRING),
 /* TOUUID */                    OP_TABLE_ENTRY (AML_DWORD_OP,               0,                              NODE_AML_PACKAGE,   ACPI_BTYPE_INTEGER),
@@ -428,7 +428,7 @@ const ASL_MAPPING_ENTRY     AslKeywordMa
 /* UPDATERULE_ONES */           OP_TABLE_ENTRY (AML_BYTE_OP,                AML_FIELD_UPDATE_WRITE_AS_ONES, 0,                  0),
 /* UPDATERULE_PRESERVE */       OP_TABLE_ENTRY (AML_BYTE_OP,                AML_FIELD_UPDATE_PRESERVE,      0,                  0),
 /* UPDATERULE_ZEROS */          OP_TABLE_ENTRY (AML_BYTE_OP,                AML_FIELD_UPDATE_WRITE_AS_ZEROS,0,                  0),
-/* VAR_PACKAGE */               OP_TABLE_ENTRY (AML_VAR_PACKAGE_OP,         0,                              NODE_AML_PACKAGE,   ACPI_BTYPE_PACKAGE),
+/* VARIABLE_PACKAGE */          OP_TABLE_ENTRY (AML_VARIABLE_PACKAGE_OP,    0,                              NODE_AML_PACKAGE,   ACPI_BTYPE_PACKAGE),
 /* VENDORLONG */                OP_TABLE_ENTRY (AML_BYTE_OP,                0,                              0,                  0),
 /* VENDORSHORT */               OP_TABLE_ENTRY (AML_BYTE_OP,                0,                              0,                  0),
 /* WAIT */                      OP_TABLE_ENTRY (AML_WAIT_OP,                0,                              0,                  ACPI_BTYPE_INTEGER),

Modified: vendor-sys/acpica/dist/source/compiler/asloffset.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/asloffset.c	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/compiler/asloffset.c	Tue Feb 28 20:06:31 2017	(r314405)
@@ -185,7 +185,7 @@ LsAmlOffsetWalk (
             break;
 
         case AML_PACKAGE_OP:
-        case AML_VAR_PACKAGE_OP:
+        case AML_VARIABLE_PACKAGE_OP:
 
             /* Get the package element count */
 

Modified: vendor-sys/acpica/dist/source/compiler/asloperands.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/asloperands.c	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/compiler/asloperands.c	Tue Feb 28 20:06:31 2017	(r314405)
@@ -321,7 +321,7 @@ OpnDoFieldCommon (
                 Next->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
                 PkgLengthNode->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
             }
-            else if (NewBitOffset == CurrentBitOffset)
+            else if ((NewBitOffset == CurrentBitOffset) && Gbl_OptimizeTrivialParseNodes)
             {
                 /*
                  * Offset is redundant; we don't need to output an
@@ -352,7 +352,8 @@ OpnDoFieldCommon (
             CurrentBitOffset += NewBitOffset;
 
             if ((NewBitOffset == 0) &&
-                (Next->Asl.ParseOpcode == PARSEOP_RESERVED_BYTES))
+                (Next->Asl.ParseOpcode == PARSEOP_RESERVED_BYTES) &&
+                Gbl_OptimizeTrivialParseNodes)
             {
                 /*
                  * Unnamed field with a bit length of zero. We can
@@ -1072,7 +1073,7 @@ OpnAttachNameToNode (
     case AML_METHOD_OP:
     case AML_MUTEX_OP:
     case AML_REGION_OP:
-    case AML_POWER_RES_OP:
+    case AML_POWER_RESOURCE_OP:
     case AML_PROCESSOR_OP:
     case AML_THERMAL_ZONE_OP:
     case AML_NAME_OP:

Modified: vendor-sys/acpica/dist/source/compiler/asloptions.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/asloptions.c	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/compiler/asloptions.c	Tue Feb 28 20:06:31 2017	(r314405)
@@ -68,7 +68,7 @@ AslDoResponseFile (
 
 
 #define ASL_TOKEN_SEPARATORS    " \t\n"
-#define ASL_SUPPORTED_OPTIONS   "@:a:b|c|d^D:e:f^gh^i|I:l^m:no|p:P^r:s|t|T+G^v^w|x:z"
+#define ASL_SUPPORTED_OPTIONS   "@:a:b|c|d^D:e:f^gh^i|I:l^m:no|p:P^q^r:s|t|T+G^v^w|x:z"
 
 static char ASL_BUILD_DATE[] = __DATE__;
 static char ASL_BUILD_TIME[] = __TIME__;
@@ -209,6 +209,24 @@ AslDoOptions (
 
         switch (AcpiGbl_Optarg[0])
         {
+
+        case 'c':
+
+            printf ("Debug ASL to ASL+ conversion\n");
+
+            Gbl_DoAslConversion = TRUE;
+            Gbl_FoldConstants = FALSE;
+            Gbl_IntegerOptimizationFlag = FALSE;
+            Gbl_ReferenceOptimizationFlag = FALSE;
+            Gbl_OptimizeTrivialParseNodes = FALSE;
+            Gbl_CaptureComments = TRUE;
+            AcpiGbl_DoDisassemblerOptimizations = FALSE;
+            AcpiGbl_DebugAslConversion = TRUE;
+            AcpiGbl_DmEmitExternalOpcodes = TRUE;
+            Gbl_DoExternalsInPlace = TRUE;
+
+            return (0);
+
         case 'f':
 
             AslCompilerdebug = 1; /* same as yydebug */
@@ -260,6 +278,22 @@ AslDoOptions (
 
         switch (AcpiGbl_Optarg[0])
         {
+
+        case 'a':
+
+            printf ("Convert ASL to ASL+ with comments\n");
+            Gbl_DoAslConversion = TRUE;
+            Gbl_FoldConstants = FALSE;
+            Gbl_IntegerOptimizationFlag = FALSE;
+            Gbl_ReferenceOptimizationFlag = FALSE;
+            Gbl_OptimizeTrivialParseNodes = FALSE;
+            Gbl_CaptureComments = TRUE;
+            AcpiGbl_DoDisassemblerOptimizations = FALSE;
+            AcpiGbl_DmEmitExternalOpcodes = TRUE;
+            Gbl_DoExternalsInPlace = TRUE;
+
+            return (0);
+
         case 'r':
 
             Gbl_NoResourceChecking = TRUE;
@@ -552,6 +586,8 @@ AslDoOptions (
             Gbl_FoldConstants = FALSE;
             Gbl_IntegerOptimizationFlag = FALSE;
             Gbl_ReferenceOptimizationFlag = FALSE;
+            Gbl_OptimizeTrivialParseNodes = FALSE;
+
             break;
 
         case 'c':
@@ -570,15 +606,21 @@ AslDoOptions (
 
         case 'e':
 
-            /* iASL: Disable External opcode generation */
-
-            Gbl_DoExternals = FALSE;
-
             /* Disassembler: Emit embedded external operators */
 
             AcpiGbl_DmEmitExternalOpcodes = TRUE;
             break;
 
+        case 'E':
+
+            /*
+             * iASL: keep External opcodes in place.
+             * No affect if Gbl_DoExternals is false.
+             */
+
+            Gbl_DoExternalsInPlace = TRUE;
+            break;
+
         case 'f':
 
             /* Disable folding on "normal" expressions */
@@ -643,6 +685,17 @@ AslDoOptions (
         Gbl_UseDefaultAmlFilename = FALSE;
         break;
 
+    case 'q':   /* ASL/ASl+ converter: compile only and leave badaml. */
+
+        printf ("Convert ASL to ASL+ with comments\n");
+        Gbl_FoldConstants = FALSE;
+        Gbl_IntegerOptimizationFlag = FALSE;
+        Gbl_ReferenceOptimizationFlag = FALSE;
+        Gbl_OptimizeTrivialParseNodes = FALSE;
+        Gbl_CaptureComments = TRUE;
+        Gbl_DoExternalsInPlace = TRUE;
+        return (0);
+
     case 'r':   /* Override revision found in table header */
 
         Gbl_RevisionOverride = (UINT8) strtoul (AcpiGbl_Optarg, NULL, 0);

Modified: vendor-sys/acpica/dist/source/compiler/aslprimaries.y
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslprimaries.y	Tue Feb 28 19:55:16 2017	(r314404)
+++ vendor-sys/acpica/dist/source/compiler/aslprimaries.y	Tue Feb 28 20:06:31 2017	(r314405)
@@ -2,6 +2,8 @@ NoEcho('
 /******************************************************************************
  *

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702282006.v1SK6V1v015913>