Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Dec 2018 19:38:28 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r342198 - in stable/12/sys/contrib/dev/acpica: . common compiler components/debugger components/dispatcher components/executer components/namespace components/parser components/tables c...
Message-ID:  <201812181938.wBIJcSDd014266@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Tue Dec 18 19:38:28 2018
New Revision: 342198
URL: https://svnweb.freebsd.org/changeset/base/342198

Log:
  MFC:	r340090, r342056
  
  Merge ACPICA 20181031 and 20181213.

Modified:
  stable/12/sys/contrib/dev/acpica/changes.txt
  stable/12/sys/contrib/dev/acpica/common/ahpredef.c
  stable/12/sys/contrib/dev/acpica/common/dmswitch.c
  stable/12/sys/contrib/dev/acpica/common/dmtbdump3.c
  stable/12/sys/contrib/dev/acpica/common/dmtbinfo3.c
  stable/12/sys/contrib/dev/acpica/compiler/aslcodegen.c
  stable/12/sys/contrib/dev/acpica/compiler/aslcompile.c
  stable/12/sys/contrib/dev/acpica/compiler/aslcompiler.h
  stable/12/sys/contrib/dev/acpica/compiler/aslerror.c
  stable/12/sys/contrib/dev/acpica/compiler/aslglobal.h
  stable/12/sys/contrib/dev/acpica/compiler/aslhelp.c
  stable/12/sys/contrib/dev/acpica/compiler/asllength.c
  stable/12/sys/contrib/dev/acpica/compiler/aslload.c
  stable/12/sys/contrib/dev/acpica/compiler/aslmain.c
  stable/12/sys/contrib/dev/acpica/compiler/aslmessages.c
  stable/12/sys/contrib/dev/acpica/compiler/aslmessages.h
  stable/12/sys/contrib/dev/acpica/compiler/aslopcodes.c
  stable/12/sys/contrib/dev/acpica/compiler/asloptions.c
  stable/12/sys/contrib/dev/acpica/compiler/aslpredef.c
  stable/12/sys/contrib/dev/acpica/compiler/asltransform.c
  stable/12/sys/contrib/dev/acpica/compiler/aslxref.c
  stable/12/sys/contrib/dev/acpica/compiler/dtio.c
  stable/12/sys/contrib/dev/acpica/compiler/dttable2.c
  stable/12/sys/contrib/dev/acpica/compiler/prscan.c
  stable/12/sys/contrib/dev/acpica/components/debugger/dbxface.c
  stable/12/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
  stable/12/sys/contrib/dev/acpica/components/dispatcher/dsobject.c
  stable/12/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c
  stable/12/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c
  stable/12/sys/contrib/dev/acpica/components/dispatcher/dsutils.c
  stable/12/sys/contrib/dev/acpica/components/dispatcher/dswload.c
  stable/12/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
  stable/12/sys/contrib/dev/acpica/components/dispatcher/dswstate.c
  stable/12/sys/contrib/dev/acpica/components/executer/exconvrt.c
  stable/12/sys/contrib/dev/acpica/components/executer/excreate.c
  stable/12/sys/contrib/dev/acpica/components/executer/exoparg2.c
  stable/12/sys/contrib/dev/acpica/components/executer/exserial.c
  stable/12/sys/contrib/dev/acpica/components/executer/exutils.c
  stable/12/sys/contrib/dev/acpica/components/namespace/nsaccess.c
  stable/12/sys/contrib/dev/acpica/components/namespace/nseval.c
  stable/12/sys/contrib/dev/acpica/components/namespace/nsload.c
  stable/12/sys/contrib/dev/acpica/components/namespace/nsparse.c
  stable/12/sys/contrib/dev/acpica/components/parser/psloop.c
  stable/12/sys/contrib/dev/acpica/components/parser/psobject.c
  stable/12/sys/contrib/dev/acpica/components/parser/psparse.c
  stable/12/sys/contrib/dev/acpica/components/parser/psxface.c
  stable/12/sys/contrib/dev/acpica/components/tables/tbxfload.c
  stable/12/sys/contrib/dev/acpica/components/utilities/utglobal.c
  stable/12/sys/contrib/dev/acpica/components/utilities/utmisc.c
  stable/12/sys/contrib/dev/acpica/components/utilities/utosi.c
  stable/12/sys/contrib/dev/acpica/include/acdisasm.h
  stable/12/sys/contrib/dev/acpica/include/acglobal.h
  stable/12/sys/contrib/dev/acpica/include/acnamesp.h
  stable/12/sys/contrib/dev/acpica/include/acoutput.h
  stable/12/sys/contrib/dev/acpica/include/acpixf.h
  stable/12/sys/contrib/dev/acpica/include/acstruct.h
  stable/12/sys/contrib/dev/acpica/include/actbinfo.h
  stable/12/sys/contrib/dev/acpica/include/actbl.h
  stable/12/sys/contrib/dev/acpica/include/actbl3.h
  stable/12/sys/contrib/dev/acpica/include/actypes.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/contrib/dev/acpica/changes.txt
==============================================================================
--- stable/12/sys/contrib/dev/acpica/changes.txt	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/changes.txt	Tue Dec 18 19:38:28 2018	(r342198)
@@ -1,4 +1,115 @@
 ----------------------------------------
+13 December 2018. Summary of changes for version 20181213:
+
+
+1) ACPICA Kernel-resident Subsystem:
+
+Fixed some buffer length issues with the GenericSerialBus, related to two 
+of the bidirectional protocols: AttribRawProcessBytes and AttribRawBytes, 
+which are rarely seen in the field. For these, the LEN field of the ASL 
+buffer is now ignored. Hans de Goede
+
+Implemented a new object evaluation trace mechanism for control methods 
+and data objects. This includes nested control methods. It is 
+particularly useful for examining the ACPI execution during system 
+initialization since the output is relatively terse. The flag below 
+enables the output of the trace via the ACPI_DEBUG_PRINT_RAW interface:
+   #define ACPI_LV_EVALUATION          0x00080000
+
+Examples:
+   Enter evaluation       :  _SB.PCI0._INI (Method)
+   Exit evaluation        :  _SB.PCI0._INI
+   Enter evaluation       :  _OSI (Method)
+   Exit evaluation        :  _OSI
+   Enter evaluation       :  _SB.PCI0.TEST (Method)
+   Nested method call     :     _SB.PCI0.NST1
+   Exit nested method     :     _SB.PCI0.NST1
+   Exit evaluation        :  _SB.PCI0.TEST
+
+Added two recently-defined _OSI strings. See 
+https://docs.microsoft.com/en-us/windows-hardware/drivers/acpi/winacpi-
+osi.
+   "Windows 2018"
+   "Windows 2018.2"
+
+Update for buffer-to-string conversions via the ToHexString ASL operator. 
+A "0x" is now prepended to each of the hex values in the output string. 
+This provides compatibility with other ACPI implementations. The ACPI 
+specification is somewhat vague on this issue.
+   Example output string after conversion: 
+"0x01,0x02,0x03,0x04,0x05,0x06"
+
+Return a run-time error for TermArg expressions within individual package 
+elements. Although this is technically supported by the ASL grammar, 
+other ACPI implementations do not support this either. Also, this fixes a 
+fault if this type of construct is ever encountered (it never has been).
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Implemented a new compile option (-ww) that will promote individual 
+warnings and remarks to errors. This is intended to enhance the firmware 
+build process.
+
+AcpiExec: Implemented a new command-line option (-eo) to support the new 
+object evaluation trace mechanism described above.
+
+Disassembler: Added support to disassemble OEMx tables as AML/ASL tables 
+instead of a "unknown table" message.
+
+AcpiHelp: Improved support for the "special" predefined names such as 
+_Lxx, _Exx, _EJx, _T_x, etc. For these, any legal hex value can now be 
+used for "xx" and "x".
+
+----------------------------------------
+31 October 2018. Summary of changes for version 20181031:
+
+
+An Operation Region regression was fixed by properly adding address 
+ranges to a global list during initialization. This allows OS to 
+accurately check for overlapping regions between native devices (such as 
+PCI) and Operation regions as well as checking for region conflicts 
+between two Operation Regions.
+
+Added support for the 2-byte extended opcodes in the code/feature that 
+attempts to continue parsing during the table load phase. Skip parsing 
+Device declarations (and other extended opcodes) when an error occurs 
+during parsing. Previously, only single-byte opcodes were supported.
+
+Cleanup: Simplified the module-level code support by eliminating a 
+useless global variable (AcpiGbl_GroupModuleLeveCode).
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL/Preprocessor: Fixed a regression where an incorrect use of ACPI_FREE 
+could cause a fault in the preprocessor. This was an inadvertent side-
+effect from moving more allocations/frees to the local cache/memory 
+mechanism.
+
+iASL: Enhanced error detection by validating that all NameSeg elements 
+within a NamePatch actually exist. The previous behavior was spotty at 
+best, and such errors could be improperly ignored at compiler time (never 
+at runtime, however. There are two new error messages, as shown in the 
+examples below:
+
+dsdt.asl     33:     CreateByteField (TTTT.BXXX, 1, CBF1)
+Error    6161 -                              ^ One or more objects within 
+the Pathname do not exist (TTTT.BXXX)
+
+dsdt.asl     34:     CreateByteField (BUF1, UUUU.INT1, BBBB.CBF1)
+Error    6160 -        One or more prefix Scopes do not exist ^  
+(BBBB.CBF1)
+
+iASL: Disassembler/table-compiler: Added support for the static data 
+table TPM2 revision 3 (an older version of TPM2). The support has been 
+added for the compiler and the disassembler.
+
+Fixed compilation of DOS format data table file on Unix/Linux systems. 
+iASL now properly detects line continuations (\) for DOS format data 
+table definition language files on when executing on Unix/Linux.
+
+----------------------------------------
 03 October 2018. Summary of changes for version 20181003:
 
 

Modified: stable/12/sys/contrib/dev/acpica/common/ahpredef.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/common/ahpredef.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/common/ahpredef.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -171,7 +171,7 @@
  */
 const AH_PREDEFINED_NAME    AslPredefinedInfo[] =
 {
-    AH_PREDEF ("_ACx",    "Active Cooling", "Returns the active cooling policy threshold values"),
+    AH_PREDEF ("_ACx",    "Active Cooling, x=0-9", "Returns the active cooling policy threshold values"),
     AH_PREDEF ("_ADR",    "Address", "Returns address of a device on parent bus, and resource field"),
     AH_PREDEF ("_AEI",    "ACPI Event Interrupts", "Returns a list of GPIO events to be used as ACPI events"),
     AH_PREDEF ("_ALC",    "Ambient Light Chromaticity", "Returns the ambient light color chromaticity"),
@@ -180,7 +180,7 @@ const AH_PREDEFINED_NAME    AslPredefinedInfo[] =
     AH_PREDEF ("_ALP",    "Ambient Light Polling", "Returns the ambient light sensor polling frequency"),
     AH_PREDEF ("_ALR",    "Ambient Light Response", "Returns the ambient light brightness to display brightness mappings"),
     AH_PREDEF ("_ALT",    "Ambient Light Temperature", "Returns the ambient light color temperature"),
-    AH_PREDEF ("_ALx",    "Active List", "Returns a list of active cooling device objects"),
+    AH_PREDEF ("_ALx",    "Active List, x=0-9", "Returns a list of active cooling device objects"),
     AH_PREDEF ("_ART",    "Active Cooling Relationship Table", "Returns thermal relationship information between platform devices and fan devices"),
     AH_PREDEF ("_ASI",    "Address Space Id", "Resource Descriptor field"),
     AH_PREDEF ("_ASZ",    "Access Size", "Resource Descriptor field"),
@@ -237,11 +237,11 @@ const AH_PREDEFINED_NAME    AslPredefinedInfo[] =
     AH_PREDEF ("_DSS",    "Device Set State", "Sets the display device state"),
     AH_PREDEF ("_DSW",    "Device Sleep Wake", "Sets the sleep and wake transition states for a device"),
     AH_PREDEF ("_DTI",    "Device Temperature Indication", "Conveys native device temperature to the platform"),
-    AH_PREDEF ("_Exx",    "Edge-Triggered GPE", "Method executed as a result of a general-purpose event"),
+    AH_PREDEF ("_Exx",    "Edge-Triggered GPE, xx=0x00-0xFF", "Method executed as a result of a general-purpose event"),
     AH_PREDEF ("_EC_",    "Embedded Controller", "returns EC offset and query information"),
     AH_PREDEF ("_EDL",    "Eject Device List", "Returns a list of devices that are dependent on a device (docking)"),
     AH_PREDEF ("_EJD",    "Ejection Dependent Device", "Returns the name of dependent (parent) device (docking)"),
-    AH_PREDEF ("_EJx",    "Eject Device", "Begin or cancel a device ejection request (docking)"),
+    AH_PREDEF ("_EJx",    "Eject Device, x=0-9", "Begin or cancel a device ejection request (docking)"),
     AH_PREDEF ("_END",    "Endianness", "Endian orientation, Resource Descriptor field"),
     AH_PREDEF ("_EVT",    "Event", "Event method for GPIO events"),
     AH_PREDEF ("_FDE",    "Floppy Disk Enumerate", "Returns floppy disk configuration information"),
@@ -281,7 +281,7 @@ const AH_PREDEFINED_NAME    AslPredefinedInfo[] =
     AH_PREDEF ("_INT",    "Interrupts", "Interrupt mask bits, Resource Descriptor field"),
     AH_PREDEF ("_IOR",    "I/O Restriction", "Restriction type, Resource Descriptor field"),
     AH_PREDEF ("_IRC",    "Inrush Current", "Presence indicates that a device has a significant inrush current draw"),
-    AH_PREDEF ("_Lxx",    "Level-Triggered GPE", "Control method executed as a result of a general-purpose event"),
+    AH_PREDEF ("_Lxx",    "Level-Triggered GPE, xx=0x00-0xFF", "Control method executed as a result of a general-purpose event"),
     AH_PREDEF ("_LCK",    "Lock Device", "Locks or unlocks a device (docking)"),
     AH_PREDEF ("_LEN",    "Length", "Range length, Resource Descriptor field"),
     AH_PREDEF ("_LID",    "Lid Status", "Returns the open/closed status of the lid on a mobile system"),
@@ -358,7 +358,7 @@ const AH_PREDEFINED_NAME    AslPredefinedInfo[] =
     AH_PREDEF ("_PTS",    "Prepare To Sleep", "Inform the platform of an impending sleep transition"),
     AH_PREDEF ("_PUR",    "Processor Utilization Request", "Returns the number of processors that the platform would like to idle"),
     AH_PREDEF ("_PXM",    "Device Proximity", "Returns a device's proximity domain identifier"),
-    AH_PREDEF ("_Qxx",    "EC Query", "Embedded Controller query and SMBus Alarm control method"),
+    AH_PREDEF ("_Qxx",    "EC Query, xx=0x00-0xFF", "Embedded Controller query and SMBus Alarm control method"),
     AH_PREDEF ("_RBO",    "Register Bit Offset", "Resource Descriptor field"),
     AH_PREDEF ("_RBW",    "Register Bit Width", "Resource Descriptor field"),
     AH_PREDEF ("_RDI",    "Resource Dependencies for Idle", "Returns a list of dependencies for idle states"),
@@ -413,7 +413,7 @@ const AH_PREDEFINED_NAME    AslPredefinedInfo[] =
     AH_PREDEF ("_SUB",    "Subsystem ID", "Returns the subsystem ID for a device"),
     AH_PREDEF ("_SUN",    "Slot User Number", "Returns the slot unique ID number"),
     AH_PREDEF ("_SWS",    "System Wake Source", "Returns the source event that caused the system to wake"),
-    AH_PREDEF ("_T_x",    "Emitted by ASL Compiler", "Reserved for use by ASL compilers"),
+    AH_PREDEF ("_T_x",    "Emitted by ASL Compiler, x=0-9, A-Z", "Reserved for use by ASL compilers"),
     AH_PREDEF ("_TC1",    "Thermal Constant 1", "Returns TC1 for the passive cooling formula"),
     AH_PREDEF ("_TC2",    "Thermal Constant 2", "Returns TC2 for the passive cooling formula"),
     AH_PREDEF ("_TDL",    "T-State Depth Limit", "Returns the _TSS entry number of the lowest power throttling state"),
@@ -447,7 +447,7 @@ const AH_PREDEFINED_NAME    AslPredefinedInfo[] =
     AH_PREDEF ("_VAL",    "Pin Configuration Value", "Resource Descriptor field"),
     AH_PREDEF ("_VEN",    "Vendor Data", "Resource Descriptor field"),
     AH_PREDEF ("_VPO",    "Video Post Options", "Returns the implemented video post options"),
-    AH_PREDEF ("_Wxx",    "Wake Event", "Method executed as a result of a wake event"),
+    AH_PREDEF ("_Wxx",    "Wake Event, xx=0x00-0xFF", "Method executed as a result of a wake event"),
     AH_PREDEF ("_WAK",    "Wake", "Inform AML that the system has just awakened"),
     AH_PREDEF ("_WPC",    "Wireless Power Calibration", "Calibrate power and notify wireless device"),
     AH_PREDEF ("_WPP",    "Wireless Power Polling", "Get recommended polling interval"),

Modified: stable/12/sys/contrib/dev/acpica/common/dmswitch.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/common/dmswitch.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/common/dmswitch.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -325,6 +325,8 @@ AcpiDmClearTempList (
  * FUNCTION:    AcpiDmIsSwitchBlock
  *
  * PARAMETERS:  Op              - While Object
+ *              Temp            - Where the compiler temp name is returned
+ *                                  (_T_x)
  *
  * RETURN:      TRUE if While block can be converted to a Switch/Case block
  *
@@ -550,6 +552,10 @@ AcpiDmIsSwitchBlock (
     if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP)
     {
         CurrentOp = CurrentOp->Common.Next;
+        if (!CurrentOp)
+        {
+            return (FALSE);
+        }
     }
 
     /* Ignore the Break Op */

Modified: stable/12/sys/contrib/dev/acpica/common/dmtbdump3.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/common/dmtbdump3.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/common/dmtbdump3.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -497,7 +497,52 @@ AcpiDmDumpTcpa (
  * DESCRIPTION: Format the contents of a TPM2.
  *
  ******************************************************************************/
+static void
+AcpiDmDumpTpm2Rev3 (
+    ACPI_TABLE_HEADER       *Table)
+{
+    UINT32                  Offset = sizeof (ACPI_TABLE_TPM23);
+    ACPI_TABLE_TPM23        *CommonHeader = ACPI_CAST_PTR (ACPI_TABLE_TPM23, Table);
+    ACPI_TPM23_TRAILER      *Subtable = ACPI_ADD_PTR (ACPI_TPM23_TRAILER, Table, Offset);
+    ACPI_STATUS             Status;
 
+
+    /* Main table */
+
+    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoTpm23);
+    if (ACPI_FAILURE (Status))
+    {
+        return;
+    }
+
+    /* Optional subtable if start method is ACPI start method */
+
+    switch (CommonHeader->StartMethod)
+    {
+    case ACPI_TPM23_ACPI_START_METHOD:
+
+        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+            Table->Length - Offset, AcpiDmTableInfoTpm23a);
+        break;
+
+    default:
+        break;
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDmDumpTpm2
+ *
+ * PARAMETERS:  Table               - A TPM2 table
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Format the contents of a TPM2.
+ *
+ ******************************************************************************/
+
 void
 AcpiDmDumpTpm2 (
     ACPI_TABLE_HEADER       *Table)
@@ -509,9 +554,16 @@ AcpiDmDumpTpm2 (
     ACPI_STATUS             Status;
 
 
+    if (Table->Revision == 3)
+    {
+        AcpiDmDumpTpm2Rev3(Table);
+        return;
+    }
+
     /* Main table */
 
     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoTpm2);
+
     if (ACPI_FAILURE (Status))
     {
         return;

Modified: stable/12/sys/contrib/dev/acpica/common/dmtbinfo3.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/common/dmtbinfo3.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/common/dmtbinfo3.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -446,6 +446,26 @@ ACPI_DMTABLE_INFO           AcpiDmTableInfoTcpaServer[
  *
  ******************************************************************************/
 
+/* TPM2 revision 3 */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoTpm23[] =
+{
+    {ACPI_DMT_UINT32,   ACPI_TPM23_OFFSET (Reserved),           "Reserved", 0},
+    {ACPI_DMT_UINT64,   ACPI_TPM23_OFFSET (ControlAddress),     "Control Address", 0},
+    {ACPI_DMT_UINT32,   ACPI_TPM23_OFFSET (StartMethod),        "Start Method", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+/* Trailer in the case that StartMethod == 2 */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoTpm23a[] =
+{
+    {ACPI_DMT_UINT32,   ACPI_TPM23A_OFFSET (Reserved),          "Reserved", DT_OPTIONAL},
+    ACPI_DMT_TERMINATOR
+};
+
+/* TPM2 revision 4 */
+
 ACPI_DMTABLE_INFO           AcpiDmTableInfoTpm2[] =
 {
     {ACPI_DMT_UINT16,   ACPI_TPM2_OFFSET (PlatformClass),           "Platform Class", 0},

Modified: stable/12/sys/contrib/dev/acpica/compiler/aslcodegen.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/compiler/aslcodegen.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/compiler/aslcodegen.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -773,12 +773,6 @@ CgWriteNode (
         return;
     }
 
-    if ((Op->Asl.ParseOpcode == PARSEOP_EXTERNAL) &&
-        AslGbl_DoExternals == FALSE)
-    {
-        return;
-    }
-
     Op->Asl.FinalAmlLength = 0;
 
     switch (Op->Asl.AmlOpcode)

Modified: stable/12/sys/contrib/dev/acpica/compiler/aslcompile.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/compiler/aslcompile.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/compiler/aslcompile.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -388,23 +388,20 @@ CmDoCompile (
 
     /* Resolve External Declarations */
 
-    if (AslGbl_DoExternals)
-    {
-        Event = UtBeginEvent ("Resolve all Externals");
-        DbgPrint (ASL_DEBUG_OUTPUT, "\nResolve Externals\n\n");
+    Event = UtBeginEvent ("Resolve all Externals");
+    DbgPrint (ASL_DEBUG_OUTPUT, "\nResolve Externals\n\n");
 
-        if (AslGbl_DoExternalsInPlace)
-        {
-            TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
-                ExAmlExternalWalkBegin, NULL, NULL);
-        }
-        else
-        {
-            TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE,
-                ExAmlExternalWalkBegin, ExAmlExternalWalkEnd, NULL);
-        }
-        UtEndEvent (Event);
+    if (AslGbl_DoExternalsInPlace)
+    {
+        TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
+            ExAmlExternalWalkBegin, NULL, NULL);
     }
+    else
+    {
+        TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE,
+            ExAmlExternalWalkBegin, ExAmlExternalWalkEnd, NULL);
+    }
+    UtEndEvent (Event);
 
     /*
      * Semantic analysis. This can happen only after the
@@ -858,7 +855,7 @@ CmCleanupAndExit (
 
     if (AslGbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT)
     {
-        printf ("\nMaximum error count (%u) exceeded\n",
+        printf ("\nMaximum error count (%d) exceeded\n",
             ASL_MAX_ERROR_COUNT);
     }
 

Modified: stable/12/sys/contrib/dev/acpica/compiler/aslcompiler.h
==============================================================================
--- stable/12/sys/contrib/dev/acpica/compiler/aslcompiler.h	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/compiler/aslcompiler.h	Tue Dec 18 19:38:28 2018	(r342198)
@@ -475,6 +475,10 @@ AslExpectException (
     char                    *MessageIdString);
 
 ACPI_STATUS
+AslElevateException (
+    char                    *MessageIdString);
+
+ACPI_STATUS
 AslDisableException (
     char                    *MessageIdString);
 

Modified: stable/12/sys/contrib/dev/acpica/compiler/aslerror.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/compiler/aslerror.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/compiler/aslerror.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -201,7 +201,12 @@ AePrintSubError (
     FILE                    *OutputFile,
     ASL_ERROR_MSG           *Enode);
 
+static UINT8
+GetModifiedLevel (
+    UINT8                   Level,
+    UINT16                  MessageId);
 
+
 /*******************************************************************************
  *
  * FUNCTION:    AslAbort
@@ -968,11 +973,12 @@ AslLogNewError (
     ASL_ERROR_MSG           *SubError)
 {
     ASL_ERROR_MSG           *Enode = NULL;
+    UINT8                   ModifiedLevel = GetModifiedLevel (Level, MessageId);
 
 
-    AslInitEnode (&Enode, Level, MessageId, LineNumber, LogicalLineNumber,
-        LogicalByteOffset, Column, Filename, Message, SourceLine,
-        SubError);
+    AslInitEnode (&Enode, ModifiedLevel, MessageId, LineNumber,
+        LogicalLineNumber, LogicalByteOffset, Column, Filename, Message,
+        SourceLine, SubError);
 
     /* Add the new node to the error node list */
 
@@ -985,7 +991,7 @@ AslLogNewError (
         AePrintException (ASL_FILE_STDERR, Enode, NULL);
     }
 
-    AslGbl_ExceptionCount[Level]++;
+    AslGbl_ExceptionCount[ModifiedLevel]++;
     if (AslGbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT)
     {
         printf ("\nMaximum error count (%u) exceeded\n", ASL_MAX_ERROR_COUNT);
@@ -999,8 +1005,46 @@ AslLogNewError (
     return;
 }
 
+
 /*******************************************************************************
  *
+ * FUNCTION:    GetModifiedLevel
+ *
+ * PARAMETERS:  Level           - Seriousness (Warning/error, etc.)
+ *              MessageId       - Index into global message buffer
+ *
+ * RETURN:      UINT8           - modified level
+ *
+ * DESCRIPTION: Get the modified level of exception codes that are reported as
+ *              errors from the -ww option.
+ *
+ ******************************************************************************/
+
+static UINT8
+GetModifiedLevel (
+    UINT8                   Level,
+    UINT16                  MessageId)
+{
+    UINT16                  i;
+    UINT16                  ExceptionCode;
+
+
+    ExceptionCode = AeBuildFullExceptionCode (Level, MessageId);
+
+    for (i = 0; i < AslGbl_ElevatedMessagesIndex; i++)
+    {
+        if (ExceptionCode == AslGbl_ElevatedMessages[i])
+        {
+            return (ASL_ERROR);
+        }
+    }
+
+    return (Level);
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    AslIsExceptionIgnored
  *
  * PARAMETERS:  Level           - Seriousness (Warning/error, etc.)
@@ -1097,7 +1141,7 @@ AslExpectException (
 
     if (AslGbl_ExpectedMessagesIndex >= ASL_MAX_EXPECTED_MESSAGES)
     {
-        printf ("Too many messages have been registered as expected (max %u)\n",
+        printf ("Too many messages have been registered as expected (max %d)\n",
             ASL_MAX_DISABLED_MESSAGES);
         return (AE_LIMIT);
     }
@@ -1144,7 +1188,7 @@ AslDisableException (
 
     if (AslGbl_DisabledMessagesIndex >= ASL_MAX_DISABLED_MESSAGES)
     {
-        printf ("Too many messages have been disabled (max %u)\n",
+        printf ("Too many messages have been disabled (max %d)\n",
             ASL_MAX_DISABLED_MESSAGES);
         return (AE_LIMIT);
     }
@@ -1154,6 +1198,51 @@ AslDisableException (
     return (AE_OK);
 }
 
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AslElevateException
+ *
+ * PARAMETERS:  MessageIdString     - ID of excepted exception during compile
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Enter a message ID into the global elevated exceptions table.
+ *              These messages will be considered as compilation errors.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AslElevateException (
+    char                    *MessageIdString)
+{
+    UINT32                  MessageId;
+
+
+    /* Convert argument to an integer and validate it */
+
+    MessageId = (UINT32) strtoul (MessageIdString, NULL, 0);
+
+    if (MessageId > 6999)
+    {
+        printf ("\"%s\" is not a valid warning/remark/erro ID\n",
+            MessageIdString);
+        return (AE_BAD_PARAMETER);
+    }
+
+    /* Insert value into the global expected message array */
+
+    if (AslGbl_ElevatedMessagesIndex >= ASL_MAX_ELEVATED_MESSAGES)
+    {
+        printf ("Too many messages have been registered as elevated (max %d)\n",
+            ASL_MAX_DISABLED_MESSAGES);
+        return (AE_LIMIT);
+    }
+
+    AslGbl_ElevatedMessages[AslGbl_ExpectedMessagesIndex] = MessageId;
+    AslGbl_ElevatedMessagesIndex++;
+    return (AE_OK);
+}
 
 /*******************************************************************************
  *

Modified: stable/12/sys/contrib/dev/acpica/compiler/aslglobal.h
==============================================================================
--- stable/12/sys/contrib/dev/acpica/compiler/aslglobal.h	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/compiler/aslglobal.h	Tue Dec 18 19:38:28 2018	(r342198)
@@ -255,6 +255,7 @@ extern int                  AslCompilerdebug;
 #define ASL_STRING_BUFFER_SIZE          (1024 * 32) /* 32k */
 #define ASL_MAX_DISABLED_MESSAGES       32
 #define ASL_MAX_EXPECTED_MESSAGES       32
+#define ASL_MAX_ELEVATED_MESSAGES       32
 #define HEX_TABLE_LINE_SIZE             8
 #define HEX_LISTING_LINE_SIZE           8
 
@@ -319,7 +320,6 @@ ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (A
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (AslGbl_PruneParseTree, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (AslGbl_DoTypechecking, TRUE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (AslGbl_EnableReferenceTypechecking, FALSE);
-ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (AslGbl_DoExternals, TRUE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (AslGbl_DoExternalsInPlace, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (AslGbl_DoAslConversion, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (AslGbl_OptimizeTrivialParseNodes, TRUE);
@@ -394,6 +394,7 @@ ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (A
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (AslGbl_CurrentLine, 0);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (AslGbl_DisabledMessagesIndex, 0);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (AslGbl_ExpectedMessagesIndex, 0);
+ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (AslGbl_ElevatedMessagesIndex, 0);
 ASL_EXTERN UINT8                    ASL_INIT_GLOBAL (AslGbl_HexBytesWereWritten, FALSE);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (AslGbl_NumNamespaceObjects, 0);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (AslGbl_ReservedMethods, 0);
@@ -435,6 +436,7 @@ ASL_EXTERN char                     AslGbl_StringBuffe
 ASL_EXTERN char                     AslGbl_StringBuffer2[ASL_STRING_BUFFER_SIZE];
 ASL_EXTERN UINT32                   AslGbl_DisabledMessages[ASL_MAX_DISABLED_MESSAGES];
 ASL_EXTERN ASL_EXPECTED_MESSAGE     AslGbl_ExpectedMessages[ASL_MAX_EXPECTED_MESSAGES];
+ASL_EXTERN UINT32                   AslGbl_ElevatedMessages[ASL_MAX_ELEVATED_MESSAGES];
 
 
 #endif /* __ASLGLOBAL_H */

Modified: stable/12/sys/contrib/dev/acpica/compiler/aslhelp.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/compiler/aslhelp.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/compiler/aslhelp.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -208,6 +208,7 @@ Usage (
     ACPI_OPTION ("-vx <messageid>", "Expect a specific warning, remark, or error");
     ACPI_OPTION ("-w <1|2|3>",      "Set warning reporting level");
     ACPI_OPTION ("-we",             "Report warnings as errors");
+    ACPI_OPTION ("-ww <messageid>", "Report specific warning or remark as error");
 
     printf ("\nAML Bytecode Generation (*.aml):\n");
     ACPI_OPTION ("-oa",             "Disable all optimizations (compatibility mode)");

Modified: stable/12/sys/contrib/dev/acpica/compiler/asllength.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/compiler/asllength.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/compiler/asllength.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -519,10 +519,7 @@ CgGenerateAmlLengths (
 
     case PARSEOP_EXTERNAL:
 
-        if (AslGbl_DoExternals == TRUE)
-        {
-            CgGenerateAmlOpcodeLength (Op);
-        }
+        CgGenerateAmlOpcodeLength (Op);
         break;
 
     default:

Modified: stable/12/sys/contrib/dev/acpica/compiler/aslload.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/compiler/aslload.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/compiler/aslload.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -417,10 +417,8 @@ LdLoadResourceElements (
         {
             Status = AcpiNsLookup (WalkState->ScopeInfo,
                 InitializerOp->Asl.ExternalName,
-                ACPI_TYPE_LOCAL_RESOURCE_FIELD,
-                ACPI_IMODE_LOAD_PASS1,
-                ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE,
-                NULL, &Node);
+                ACPI_TYPE_LOCAL_RESOURCE_FIELD, ACPI_IMODE_LOAD_PASS1,
+                ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node);
             if (ACPI_FAILURE (Status))
             {
                 return (Status);
@@ -687,8 +685,7 @@ LdNamespace1Begin (
          * handle this case. Perhaps someday this case can go away.
          */
         Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
-            ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
-            WalkState, &(Node));
+            ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &Node);
         if (ACPI_FAILURE (Status))
         {
             if (Status == AE_NOT_FOUND)
@@ -696,23 +693,26 @@ LdNamespace1Begin (
                 /* The name was not found, go ahead and create it */
 
                 Status = AcpiNsLookup (WalkState->ScopeInfo, Path,
-                    ACPI_TYPE_LOCAL_SCOPE,
-                    ACPI_IMODE_LOAD_PASS1, Flags,
-                    WalkState, &(Node));
+                    ACPI_TYPE_LOCAL_SCOPE, ACPI_IMODE_LOAD_PASS1,
+                    Flags, WalkState, &Node);
                 if (ACPI_FAILURE (Status))
                 {
                     return_ACPI_STATUS (Status);
                 }
 
-                /*
-                 * However, this is an error -- primarily because the MS
-                 * interpreter can't handle a forward reference from the
-                 * Scope() operator.
-                 */
-                AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op,
-                    Op->Asl.ExternalName);
-                AslError (ASL_ERROR, ASL_MSG_SCOPE_FWD_REF, Op,
-                    Op->Asl.ExternalName);
+                /* However, this is an error -- operand to Scope must exist */
+
+                if (strlen (Op->Asl.ExternalName) == ACPI_NAME_SIZE)
+                {
+                    AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op,
+                        Op->Asl.ExternalName);
+                }
+                else
+                {
+                    AslError (ASL_ERROR, ASL_MSG_NAMEPATH_NOT_EXIST, Op,
+                        Op->Asl.ExternalName);
+                }
+
                 goto FinishNode;
             }
 
@@ -824,7 +824,6 @@ LdNamespace1Begin (
         break;
     }
 
-
     ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Loading name: %s, (%s)\n",
         Op->Asl.ExternalName, AcpiUtGetTypeName (ObjectType)));
 
@@ -833,6 +832,18 @@ LdNamespace1Begin (
     Flags |= ACPI_NS_ERROR_IF_FOUND;
 
     /*
+     * For opcodes that enter new names into the namespace,
+     * all prefix NameSegs must exist.
+     */
+    WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
+    if (((WalkState->OpInfo->Flags & AML_NAMED) ||
+        (WalkState->OpInfo->Flags & AML_CREATE)) &&
+        (Op->Asl.AmlOpcode != AML_EXTERNAL_OP))
+    {
+        Flags |= ACPI_NS_PREFIX_MUST_EXIST;
+    }
+
+    /*
      * Enter the named type into the internal namespace. We enter the name
      * as we go downward in the parse tree. Any necessary subobjects that
      * involve arguments to the opcode must be created as we go back up the
@@ -915,8 +926,20 @@ LdNamespace1Begin (
                 return_ACPI_STATUS (AE_OK);
             }
         }
+        else if (AE_NOT_FOUND)
+        {
+            /*
+             * One or more prefix NameSegs of the NamePath do not exist
+             * (all of them must exist). Attempt to continue compilation
+             * by setting the current scope to the root.
+             */
+            Node = AcpiGbl_RootNode;
+            Status = AE_OK;
+        }
         else
         {
+            /* Flag all other errors as coming from the ACPICA core */
+
             AslCoreSubsystemError (Op, Status,
                 "Failure from namespace lookup", FALSE);
             return_ACPI_STATUS (Status);
@@ -1043,10 +1066,10 @@ LdNamespace2Begin (
 
     if (Op->Asl.ParseOpcode == PARSEOP_ALIAS)
     {
-        /* Complete the alias node by getting and saving the target node */
-
-        /* First child is the alias target */
-
+        /*
+         * Complete the alias node by getting and saving the target node.
+         * First child is the alias target
+         */
         Arg = Op->Asl.Child;
 
         /* Get the target pathname */
@@ -1070,18 +1093,34 @@ LdNamespace2Begin (
         {
             if (Status == AE_NOT_FOUND)
             {
-                AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op,
-                    Op->Asl.ExternalName);
+                /* Standalone NameSeg vs. NamePath */
 
+                if (strlen (Arg->Asl.ExternalName) == ACPI_NAME_SIZE)
+                {
+                    AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op,
+                        Arg->Asl.ExternalName);
+                }
+                else
+                {
+                    AslError (ASL_ERROR, ASL_MSG_NAMEPATH_NOT_EXIST, Op,
+                        Arg->Asl.ExternalName);
+                }
+
+#if 0
+/*
+ * NOTE: Removed 10/2018 to enhance compiler error reporting. No
+ * regressions seen.
+ */
                 /*
                  * The name was not found, go ahead and create it.
                  * This prevents more errors later.
                  */
                 Status = AcpiNsLookup (WalkState->ScopeInfo, Path,
-                    ACPI_TYPE_ANY,
-                    ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH,
-                    WalkState, &(Node));
-                return (AE_OK);
+                    ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS1,
+                    ACPI_NS_NO_UPSEARCH, WalkState, &Node);
+#endif
+                return (Status);
+/* Removed: return (AE_OK)*/
             }
 
             AslCoreSubsystemError (Op, Status,

Modified: stable/12/sys/contrib/dev/acpica/compiler/aslmain.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/compiler/aslmain.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/compiler/aslmain.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -329,7 +329,7 @@ AslSignalHandler (
 
     default:
 
-        printf (ASL_PREFIX "Unknown interrupt signal (%u)\n", Sig);
+        printf (ASL_PREFIX "Unknown interrupt signal (%d)\n", Sig);
         break;
     }
 

Modified: stable/12/sys/contrib/dev/acpica/compiler/aslmessages.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/compiler/aslmessages.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/compiler/aslmessages.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -285,7 +285,7 @@ const char                      *AslCompilerMsgs [] =
 /*    ASL_MSG_NON_ASCII */                  "Invalid characters found in file",
 /*    ASL_MSG_NON_ZERO */                   "Operand evaluates to zero",
 /*    ASL_MSG_NOT_EXIST */                  "Object does not exist",
-/*    ASL_MSG_NOT_FOUND */                  "Object not found or not accessible from scope",
+/*    ASL_MSG_NOT_FOUND */                  "Object not found or not accessible from current scope",
 /*    ASL_MSG_NOT_METHOD */                 "Not a control method, cannot invoke",
 /*    ASL_MSG_NOT_PARAMETER */              "Not a parameter, used as local only",
 /*    ASL_MSG_NOT_REACHABLE */              "Object is not accessible from this scope",
@@ -359,7 +359,9 @@ const char                      *AslCompilerMsgs [] =
 /*    ASL_MSG_OEM_ID */                     "Invalid OEM ID",
 /*    ASL_MSG_UNLOAD */                     "Unload is not supported by all operating systems",
 /*    ASL_MSG_OFFSET */                     "Unnecessary/redundant use of Offset operator",
-/*    ASL_MSG_LONG_SLEEP */                 "Very long Sleep, greater than 1 second"
+/*    ASL_MSG_LONG_SLEEP */                 "Very long Sleep, greater than 1 second",
+/*    ASL_MSG_PREFIX_NOT_EXIST */           "One or more prefix Scopes do not exist",
+/*    ASL_MSG_NAMEPATH_NOT_EXIST */         "One or more objects within the Pathname do not exist"
 };
 
 /* Table compiler */

Modified: stable/12/sys/contrib/dev/acpica/compiler/aslmessages.h
==============================================================================
--- stable/12/sys/contrib/dev/acpica/compiler/aslmessages.h	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/compiler/aslmessages.h	Tue Dec 18 19:38:28 2018	(r342198)
@@ -362,6 +362,8 @@ typedef enum
     ASL_MSG_UNLOAD,
     ASL_MSG_OFFSET,
     ASL_MSG_LONG_SLEEP,
+    ASL_MSG_PREFIX_NOT_EXIST,
+    ASL_MSG_NAMEPATH_NOT_EXIST,
 
     /* These messages are used by the Data Table compiler only */
 

Modified: stable/12/sys/contrib/dev/acpica/compiler/aslopcodes.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/compiler/aslopcodes.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/compiler/aslopcodes.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -927,15 +927,6 @@ OpcGenerateAmlOpcode (
         AslGbl_HasIncludeFiles = TRUE;
         break;
 
-    case PARSEOP_EXTERNAL:
-
-        if (AslGbl_DoExternals == FALSE)
-        {
-            Op->Asl.Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
-            Op->Asl.Child->Asl.Next->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
-        }
-        break;
-
     case PARSEOP_TIMER:
 
         if (AcpiGbl_IntegerBitWidth == 32)

Modified: stable/12/sys/contrib/dev/acpica/compiler/asloptions.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/compiler/asloptions.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/compiler/asloptions.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -976,6 +976,23 @@ AslDoOptions (
             AslGbl_WarningsAsErrors = TRUE;
             break;
 
+        case 'w':
+
+            /* Get the required argument */
+
+            if (AcpiGetoptArgument (argc, argv))
+            {
+                return (-1);
+            }
+
+            Status = AslElevateException (AcpiGbl_Optarg);
+            if (ACPI_FAILURE (Status))
+            {
+                return (-1);
+            }
+            break;
+
+
         default:
 
             printf ("Unknown option: -w%s\n", AcpiGbl_Optarg);

Modified: stable/12/sys/contrib/dev/acpica/compiler/aslpredef.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/compiler/aslpredef.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/compiler/aslpredef.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -222,7 +222,7 @@ ApCheckForPredefinedMethod (
 
         if (MethodInfo->NumArguments != 0)
         {
-            sprintf (AslGbl_MsgBuffer, "%s requires %u", Op->Asl.ExternalName, 0);
+            sprintf (AslGbl_MsgBuffer, "%s requires %d", Op->Asl.ExternalName, 0);
 
             AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op,
                 AslGbl_MsgBuffer);

Modified: stable/12/sys/contrib/dev/acpica/compiler/asltransform.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/compiler/asltransform.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/compiler/asltransform.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -460,11 +460,7 @@ TrTransformSubtree (
 
     case PARSEOP_EXTERNAL:
 
-        if (AslGbl_DoExternals == TRUE)
-        {
-            ExDoExternal (Op);
-        }
-
+        ExDoExternal (Op);
         break;
 
     case PARSEOP___METHOD__:

Modified: stable/12/sys/contrib/dev/acpica/compiler/aslxref.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/compiler/aslxref.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/compiler/aslxref.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -718,23 +718,55 @@ XfNamespaceLocateBegin (
             }
             else
             {
-                /* Check for a fully qualified path */
+                /* The NamePath contains multiple NameSegs */
 
-                if (Path[0] == AML_ROOT_PREFIX)
+                if ((OpInfo->Flags & AML_CREATE) ||
+                    (OpInfo->ObjectType == ACPI_TYPE_LOCAL_ALIAS))
                 {
-                    /* Gave full path, the object does not exist */
+                    /*
+                     * The new name is the last parameter. For the
+                     * CreateXXXXField and Alias operators
+                     */
+                    NextOp = Op->Asl.Child;
+                    while (!(NextOp->Asl.CompileFlags & OP_IS_NAME_DECLARATION))
+                    {
+                        NextOp = NextOp->Asl.Next;
+                    }
 
+                    AslError (ASL_ERROR, ASL_MSG_PREFIX_NOT_EXIST, NextOp,
+                        NextOp->Asl.ExternalName);
+                }
+                else if (OpInfo->Flags & AML_NAMED)
+                {
+                    /* The new name is the first parameter */
+
+                    AslError (ASL_ERROR, ASL_MSG_PREFIX_NOT_EXIST, Op,
+                        Op->Asl.ExternalName);
+                }
+                else if (Path[0] == AML_ROOT_PREFIX)
+                {
+                    /* Full namepath from root, the object does not exist */
+
                     AslError (ASL_ERROR, ASL_MSG_NOT_EXIST, Op,
                         Op->Asl.ExternalName);
                 }
                 else
                 {
                     /*
-                     * We can't tell whether it doesn't exist or just
-                     * can't be reached.
+                     * Generic "not found" error. Cannot determine whether it
+                     * doesn't exist or just can't be reached. However, we
+                     * can differentiate between a NameSeg vs. NamePath.
                      */
-                    AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op,
-                        Op->Asl.ExternalName);
+                    if (strlen (Op->Asl.ExternalName) == ACPI_NAME_SIZE)
+                    {
+                        AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op,
+                            Op->Asl.ExternalName);
+                    }
+                    else
+                    {
+                        AslError (ASL_ERROR, ASL_MSG_NAMEPATH_NOT_EXIST, Op,
+                            Op->Asl.ExternalName);
+                    }
                 }
             }
 

Modified: stable/12/sys/contrib/dev/acpica/compiler/dtio.c
==============================================================================
--- stable/12/sys/contrib/dev/acpica/compiler/dtio.c	Tue Dec 18 19:38:13 2018	(r342197)
+++ stable/12/sys/contrib/dev/acpica/compiler/dtio.c	Tue Dec 18 19:38:28 2018	(r342198)
@@ -236,7 +236,7 @@ DtTrim (
 
     /* Skip lines that start with a space */
 
-    if (!strcmp (String, " "))
+    if (*String == 0 || !strcmp (String, " "))
     {
         ReturnString = UtLocalCacheCalloc (1);
         return (ReturnString);
@@ -258,7 +258,7 @@ DtTrim (
 
     while (End >= Start)
     {
-        if (*End == '\r' || *End == '\n')
+        if (*End == '\n')
         {
             End--;
             continue;
@@ -522,6 +522,7 @@ DtGetNextLine (
     UINT32                  CurrentLineOffset;
     UINT32                  i;
     int                     c;
+    int                     c1;
 
 
     memset (AslGbl_CurrentLineBuffer, 0, AslGbl_LineBufferSize);
@@ -568,6 +569,29 @@ DtGetNextLine (
              */
             c = '\n';
             State = DT_NORMAL_TEXT;
+        }
+        else if (c == '\r')
+        {
+            c1 = getc (Handle);
+            if (c1 == '\n')
+            {
+                /*
+                 * Skip the carriage return as if it didn't exist. This is
+                 * onlt meant for input files in DOS format in unix. fopen in
+                 * unix may not support "text mode" and leaves CRLF intact.
+                 */
+                c = '\n';
+            }
+            else
+            {
+                /* This was not a CRLF. Only a CR */
+
+                ungetc(c1, Handle);
+
+                DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL,

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



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