merge new acpica trunk
authorchristos <christos@NetBSD.org>
Sat, 09 Jan 2016 21:14:12 +0000
branchtrunk
changeset 240048 4d0bf7357509
parent 240047 98168cf40e6f
child 240049 017a0b7b7b40
merge new acpica
sys/dev/acpi/acpica/OsdMisc.c
sys/dev/acpi/acpica/OsdSchedule.c
sys/external/bsd/acpica/conf/files.acpica
sys/external/bsd/acpica/dist/common/dmtbdump.c
sys/external/bsd/acpica/dist/common/dmtbinfo.c
sys/external/bsd/acpica/dist/compiler/aslanalyze.c
sys/external/bsd/acpica/dist/compiler/aslcompile.c
sys/external/bsd/acpica/dist/compiler/aslcompiler.h
sys/external/bsd/acpica/dist/compiler/aslcompiler.l
sys/external/bsd/acpica/dist/compiler/aslerror.c
sys/external/bsd/acpica/dist/compiler/aslfileio.c
sys/external/bsd/acpica/dist/compiler/aslfiles.c
sys/external/bsd/acpica/dist/compiler/aslload.c
sys/external/bsd/acpica/dist/compiler/asllookup.c
sys/external/bsd/acpica/dist/compiler/aslopcodes.c
sys/external/bsd/acpica/dist/compiler/aslpredef.c
sys/external/bsd/acpica/dist/compiler/aslprepkg.c
sys/external/bsd/acpica/dist/compiler/aslsupport.l
sys/external/bsd/acpica/dist/compiler/asltree.c
sys/external/bsd/acpica/dist/compiler/aslutils.c
sys/external/bsd/acpica/dist/compiler/aslwalks.c
sys/external/bsd/acpica/dist/compiler/aslxref.c
sys/external/bsd/acpica/dist/compiler/dtcompile.c
sys/external/bsd/acpica/dist/compiler/dtfield.c
sys/external/bsd/acpica/dist/compiler/dtparser.y
sys/external/bsd/acpica/dist/compiler/dtsubtable.c
sys/external/bsd/acpica/dist/compiler/dttable.c
sys/external/bsd/acpica/dist/compiler/dtutils.c
sys/external/bsd/acpica/dist/compiler/prparser.y
sys/external/bsd/acpica/dist/compiler/prutils.c
sys/external/bsd/acpica/dist/debugger/dbcmds.c
sys/external/bsd/acpica/dist/debugger/dbdisply.c
sys/external/bsd/acpica/dist/debugger/dbexec.c
sys/external/bsd/acpica/dist/debugger/dbinput.c
sys/external/bsd/acpica/dist/debugger/dbmethod.c
sys/external/bsd/acpica/dist/debugger/dbnames.c
sys/external/bsd/acpica/dist/debugger/dbtest.c
sys/external/bsd/acpica/dist/debugger/dbutils.c
sys/external/bsd/acpica/dist/disassembler/dmbuffer.c
sys/external/bsd/acpica/dist/disassembler/dmcstyle.c
sys/external/bsd/acpica/dist/disassembler/dmresrc.c
sys/external/bsd/acpica/dist/disassembler/dmresrcl.c
sys/external/bsd/acpica/dist/disassembler/dmresrcl2.c
sys/external/bsd/acpica/dist/disassembler/dmwalk.c
sys/external/bsd/acpica/dist/dispatcher/dscontrol.c
sys/external/bsd/acpica/dist/dispatcher/dsopcode.c
sys/external/bsd/acpica/dist/dispatcher/dsutils.c
sys/external/bsd/acpica/dist/events/evregion.c
sys/external/bsd/acpica/dist/events/evrgnini.c
sys/external/bsd/acpica/dist/events/evxface.c
sys/external/bsd/acpica/dist/executer/exconfig.c
sys/external/bsd/acpica/dist/executer/exdebug.c
sys/external/bsd/acpica/dist/executer/exdump.c
sys/external/bsd/acpica/dist/hardware/hwesleep.c
sys/external/bsd/acpica/dist/hardware/hwsleep.c
sys/external/bsd/acpica/dist/hardware/hwxfsleep.c
sys/external/bsd/acpica/dist/include/acapps.h
sys/external/bsd/acpica/dist/include/acdebug.h
sys/external/bsd/acpica/dist/include/acdisasm.h
sys/external/bsd/acpica/dist/include/acexcep.h
sys/external/bsd/acpica/dist/include/acglobal.h
sys/external/bsd/acpica/dist/include/acinterp.h
sys/external/bsd/acpica/dist/include/aclocal.h
sys/external/bsd/acpica/dist/include/acmacros.h
sys/external/bsd/acpica/dist/include/acnamesp.h
sys/external/bsd/acpica/dist/include/acpiosxf.h
sys/external/bsd/acpica/dist/include/acpixf.h
sys/external/bsd/acpica/dist/include/acresrc.h
sys/external/bsd/acpica/dist/include/actables.h
sys/external/bsd/acpica/dist/include/actbl1.h
sys/external/bsd/acpica/dist/include/actypes.h
sys/external/bsd/acpica/dist/include/acutils.h
sys/external/bsd/acpica/dist/include/platform/acnetbsd.h
sys/external/bsd/acpica/dist/namespace/nsaccess.c
sys/external/bsd/acpica/dist/namespace/nsdump.c
sys/external/bsd/acpica/dist/namespace/nseval.c
sys/external/bsd/acpica/dist/namespace/nsinit.c
sys/external/bsd/acpica/dist/namespace/nsrepair2.c
sys/external/bsd/acpica/dist/namespace/nsxfeval.c
sys/external/bsd/acpica/dist/namespace/nsxfname.c
sys/external/bsd/acpica/dist/os_specific/service_layers/oslinuxtbl.c
sys/external/bsd/acpica/dist/parser/psopcode.c
sys/external/bsd/acpica/dist/parser/psopinfo.c
sys/external/bsd/acpica/dist/resources/rsdump.c
sys/external/bsd/acpica/dist/resources/rsdumpinfo.c
sys/external/bsd/acpica/dist/resources/rsutils.c
sys/external/bsd/acpica/dist/resources/rsxface.c
sys/external/bsd/acpica/dist/tables/tbdata.c
sys/external/bsd/acpica/dist/tables/tbfadt.c
sys/external/bsd/acpica/dist/tables/tbinstal.c
sys/external/bsd/acpica/dist/tables/tbutils.c
sys/external/bsd/acpica/dist/tables/tbxface.c
sys/external/bsd/acpica/dist/tables/tbxfroot.c
sys/external/bsd/acpica/dist/tools/acpidump/apfiles.c
sys/external/bsd/acpica/dist/tools/acpixtract/acpixtract.c
sys/external/bsd/acpica/dist/utilities/utcache.c
sys/external/bsd/acpica/dist/utilities/utdebug.c
sys/external/bsd/acpica/dist/utilities/utdecode.c
sys/external/bsd/acpica/dist/utilities/uteval.c
sys/external/bsd/acpica/dist/utilities/utglobal.c
sys/external/bsd/acpica/dist/utilities/utmisc.c
sys/external/bsd/acpica/dist/utilities/utmutex.c
sys/external/bsd/acpica/dist/utilities/utobject.c
sys/external/bsd/acpica/dist/utilities/utosi.c
sys/external/bsd/acpica/dist/utilities/uttrack.c
sys/external/bsd/acpica/dist/utilities/utuuid.c
--- a/sys/dev/acpi/acpica/OsdMisc.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/dev/acpi/acpica/OsdMisc.c	Sat Jan 09 21:14:12 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: OsdMisc.c,v 1.14 2013/12/27 20:55:59 christos Exp $	*/
+/*	$NetBSD: OsdMisc.c,v 1.15 2016/01/09 21:14:42 christos Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: OsdMisc.c,v 1.14 2013/12/27 20:55:59 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: OsdMisc.c,v 1.15 2016/01/09 21:14:42 christos Exp $");
 
 #include "opt_acpi.h"
 #include "opt_ddb.h"
@@ -198,17 +198,10 @@
 acpi_osd_debugger(void)
 {
 #ifdef ACPI_DEBUG
-	static int beenhere;
 	ACPI_PARSE_OBJECT obj;
 	label_t	acpi_jmpbuf;
 	label_t	*savejmp;
 
-	if (beenhere == 0) {
-		printf("Initializing ACPICA debugger...\n");
-		AcpiDbInitialize();
-		beenhere = 1;
-	}
-
 	printf("Entering ACPICA debugger...\n");
 	savejmp = db_recover;
 	setjmp(&acpi_jmpbuf);
--- a/sys/dev/acpi/acpica/OsdSchedule.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/dev/acpi/acpica/OsdSchedule.c	Sat Jan 09 21:14:12 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: OsdSchedule.c,v 1.17 2013/12/27 18:53:25 christos Exp $	*/
+/*	$NetBSD: OsdSchedule.c,v 1.18 2016/01/09 21:14:42 christos Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: OsdSchedule.c,v 1.17 2013/12/27 18:53:25 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: OsdSchedule.c,v 1.18 2016/01/09 21:14:42 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -113,9 +113,6 @@
 	case OSL_NOTIFY_HANDLER:
 		pri = 3;
 		break;
-	case OSL_DEBUGGER_THREAD:
-		pri = 0;
-		break;
 	default:
 		return AE_BAD_PARAMETER;
 	}
--- a/sys/external/bsd/acpica/conf/files.acpica	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/conf/files.acpica	Sat Jan 09 21:14:12 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.acpica,v 1.11 2015/08/28 02:33:59 uebayasi Exp $
+# $NetBSD: files.acpica,v 1.12 2016/01/09 21:14:12 christos Exp $
 
 define		acpica
 makeoptions	acpi	CPPFLAGS+="-I$S/external/bsd/acpica/dist/include"
@@ -14,7 +14,6 @@
 file	debugger/dbconvert.c		acpica & acpi_debug & ddb
 file	debugger/dbdisply.c		acpica & acpi_debug & ddb
 file	debugger/dbexec.c		acpica & acpi_debug & ddb
-file	debugger/dbfileio.c		acpica & acpi_debug & ddb
 file	debugger/dbhistry.c		acpica & acpi_debug & ddb
 file	debugger/dbinput.c		acpica & acpi_debug & ddb
 file	debugger/dbmethod.c		acpica & acpi_debug & ddb
@@ -96,6 +95,7 @@
 file	executer/exstoren.c		acpica
 file	executer/exstorob.c		acpica
 file	executer/exsystem.c		acpica
+file	executer/extrace.c		acpica
 file	executer/exutils.c		acpica
 
 # hardware/
--- a/sys/external/bsd/acpica/dist/common/dmtbdump.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/common/dmtbdump.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -178,6 +178,7 @@
     {
         AcpiOsPrintf ("%c", Buffer[i]);
     }
+
     AcpiOsPrintf ("\"\n");
     return;
 
@@ -222,7 +223,7 @@
     /* Validate the first checksum */
 
     Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_RSDP_COMMON),
-                Rsdp->Checksum);
+        Rsdp->Checksum);
     if (Checksum != Rsdp->Checksum)
     {
         AcpiOsPrintf ("/* Incorrect Checksum above, should be 0x%2.2X */\n",
@@ -243,7 +244,7 @@
         /* Validate the extended checksum over entire RSDP */
 
         Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_TABLE_RSDP),
-                    Rsdp->ExtendedChecksum);
+            Rsdp->ExtendedChecksum);
         if (Checksum != Rsdp->ExtendedChecksum)
         {
             AcpiOsPrintf (
@@ -361,7 +362,8 @@
 
     /* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */
 
-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt1);
+    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+        AcpiDmTableInfoFadt1);
     if (ACPI_FAILURE (Status))
     {
         return;
@@ -372,7 +374,8 @@
     if ((Table->Length > ACPI_FADT_V1_SIZE) &&
         (Table->Length <= ACPI_FADT_V2_SIZE))
     {
-        Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2);
+        Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+            AcpiDmTableInfoFadt2);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -383,7 +386,8 @@
 
     else if (Table->Length > ACPI_FADT_V2_SIZE)
     {
-        Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt3);
+        Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+            AcpiDmTableInfoFadt3);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -393,7 +397,8 @@
 
         if (Table->Length > ACPI_FADT_V3_SIZE)
         {
-            Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt5);
+            Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+                AcpiDmTableInfoFadt5);
             if (ACPI_FAILURE (Status))
             {
                 return;
@@ -404,7 +409,8 @@
 
         if (Table->Length > ACPI_FADT_V3_SIZE)
         {
-            Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt6);
+            Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+                AcpiDmTableInfoFadt6);
             if (ACPI_FAILURE (Status))
             {
                 return;
@@ -485,7 +491,8 @@
     }
 
     AcpiOsPrintf (
-        "\n// ACPI Warning: FADT revision %X does not match length: found %X expected %X\n",
+        "\n// ACPI Warning: FADT revision %X does not match length: "
+        "found %X expected %X\n",
         Revision, Length, ExpectedLength);
 }
 
@@ -527,7 +534,7 @@
         /* Common subtable header */
 
         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
-                    SubTable->Header.Length, AcpiDmTableInfoAsfHdr);
+            SubTable->Header.Length, AcpiDmTableInfoAsfHdr);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -579,12 +586,13 @@
 
         default:
 
-            AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n", SubTable->Header.Type);
+            AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n",
+                SubTable->Header.Type);
             return;
         }
 
         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
-                    SubTable->Header.Length, InfoTable);
+            SubTable->Header.Length, InfoTable);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -601,7 +609,7 @@
             {
                 AcpiOsPrintf ("\n");
                 Status = AcpiDmDumpTable (Table->Length, DataOffset,
-                            DataTable, DataLength, DataInfoTable);
+                    DataTable, DataLength, DataInfoTable);
                 if (ACPI_FAILURE (Status))
                 {
                     return;
@@ -624,9 +632,12 @@
                 AcpiOsPrintf ("%2.2X ", *DataTable);
                 DataTable++;
                 DataOffset++;
+
                 if (DataOffset > Table->Length)
                 {
-                    AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure! (ASF! table)\n");
+                    AcpiOsPrintf (
+                        "**** ACPI table terminates in the middle of a "
+                        "data structure! (ASF! table)\n");
                     return;
                 }
             }
@@ -650,7 +661,8 @@
         }
 
         Offset += SubTable->Header.Length;
-        SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, SubTable, SubTable->Header.Length);
+        SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, SubTable,
+            SubTable->Header.Length);
     }
 }
 
@@ -693,7 +705,7 @@
     {
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTable->Header.Length, AcpiDmTableInfoCpep0);
+            SubTable->Header.Length, AcpiDmTableInfoCpep0);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -703,7 +715,7 @@
 
         Offset += SubTable->Header.Length;
         SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable,
-                    SubTable->Header.Length);
+            SubTable->Header.Length);
     }
 }
 
@@ -747,7 +759,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTable->Length, AcpiDmTableInfoCsrt0);
+            SubTable->Length, AcpiDmTableInfoCsrt0);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -761,7 +773,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Length, Offset + SubOffset, SharedInfoTable,
-                    sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1);
+            sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -779,7 +791,7 @@
         {
             AcpiOsPrintf ("\n");
             Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubTable,
-                        SubSubTable->Length, AcpiDmTableInfoCsrt2);
+                SubSubTable->Length, AcpiDmTableInfoCsrt2);
             if (ACPI_FAILURE (Status))
             {
                 return;
@@ -793,8 +805,8 @@
             if (InfoLength)
             {
                 Status = AcpiDmDumpTable (Length,
-                            Offset + SubOffset + SubSubOffset, Table,
-                            InfoLength, AcpiDmTableInfoCsrt2a);
+                    Offset + SubOffset + SubSubOffset, Table,
+                    InfoLength, AcpiDmTableInfoCsrt2a);
                 if (ACPI_FAILURE (Status))
                 {
                     return;
@@ -806,14 +818,14 @@
 
             SubOffset += SubSubTable->Length;
             SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubTable,
-                        SubSubTable->Length);
+                SubSubTable->Length);
         }
 
         /* Point to next subtable */
 
         Offset += SubTable->Length;
         SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable,
-                    SubTable->Length);
+            SubTable->Length);
     }
 }
 
@@ -860,7 +872,7 @@
     {
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTable->Length, AcpiDmTableInfoDbg2Device);
+            SubTable->Length, AcpiDmTableInfoDbg2Device);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -876,7 +888,7 @@
             Array = (UINT8 *) SubTable + ArrayOffset;
 
             Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
-                        SubTable->Length, AcpiDmTableInfoDbg2Addr);
+                SubTable->Length, AcpiDmTableInfoDbg2Addr);
             if (ACPI_FAILURE (Status))
             {
                 return;
@@ -893,7 +905,7 @@
             Array = (UINT8 *) SubTable + ArrayOffset;
 
             Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
-                        SubTable->Length, AcpiDmTableInfoDbg2Size);
+                SubTable->Length, AcpiDmTableInfoDbg2Size);
             if (ACPI_FAILURE (Status))
             {
                 return;
@@ -908,7 +920,7 @@
         Array = (UINT8 *) SubTable + ArrayOffset;
 
         Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
-                    SubTable->Length, AcpiDmTableInfoDbg2Name);
+            SubTable->Length, AcpiDmTableInfoDbg2Name);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -919,8 +931,8 @@
         if (SubTable->OemDataOffset)
         {
             Status = AcpiDmDumpTable (Length, Offset + SubTable->OemDataOffset,
-                        Table, SubTable->OemDataLength,
-                        AcpiDmTableInfoDbg2OemData);
+                Table, SubTable->OemDataLength,
+                AcpiDmTableInfoDbg2OemData);
             if (ACPI_FAILURE (Status))
             {
                 return;
@@ -931,7 +943,7 @@
 
         Offset += SubTable->Length;
         SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, SubTable,
-                    SubTable->Length);
+            SubTable->Length);
     }
 }
 
@@ -981,11 +993,12 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTable->Length, AcpiDmTableInfoDmarHdr);
+            SubTable->Length, AcpiDmTableInfoDmarHdr);
         if (ACPI_FAILURE (Status))
         {
             return;
         }
+
         AcpiOsPrintf ("\n");
 
         switch (SubTable->Type)
@@ -1022,12 +1035,13 @@
 
         default:
 
-            AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", SubTable->Type);
+            AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n",
+                SubTable->Type);
             return;
         }
 
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTable->Length, InfoTable);
+            SubTable->Length, InfoTable);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -1049,7 +1063,7 @@
         {
             AcpiOsPrintf ("\n");
             Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
-                        ScopeTable->Length, AcpiDmTableInfoDmarScope);
+                ScopeTable->Length, AcpiDmTableInfoDmarScope);
             if (ACPI_FAILURE (Status))
             {
                 return;
@@ -1065,7 +1079,8 @@
 
             while (PathOffset < ScopeTable->Length)
             {
-                AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, "PCI Path");
+                AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2,
+                    "PCI Path");
                 AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]);
 
                 /* Point to next PCI Path entry */
@@ -1086,7 +1101,8 @@
         /* Point to next subtable */
 
         Offset += SubTable->Length;
-        SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable, SubTable->Length);
+        SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable,
+            SubTable->Length);
     }
 }
 
@@ -1118,7 +1134,7 @@
     /* Main table */
 
     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
-                AcpiDmTableInfoDrtm);
+        AcpiDmTableInfoDrtm);
     if (ACPI_FAILURE (Status))
     {
         return;
@@ -1133,12 +1149,13 @@
     DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset);
     AcpiOsPrintf ("\n");
     Status = AcpiDmDumpTable (Table->Length, Offset,
-                DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables),
-                AcpiDmTableInfoDrtm0);
+        DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables),
+        AcpiDmTableInfoDrtm0);
     if (ACPI_FAILURE (Status))
     {
             return;
     }
+
     Offset += ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables);
 
     /* Dump Validated table addresses */
@@ -1148,12 +1165,13 @@
             (DrtmVtl->ValidatedTableCount > Count))
     {
         Status = AcpiDmDumpTable (Table->Length, Offset,
-                    ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64),
-                    AcpiDmTableInfoDrtm0a);
+            ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64),
+            AcpiDmTableInfoDrtm0a);
         if (ACPI_FAILURE (Status))
         {
             return;
         }
+
         Offset += sizeof (UINT64);
         Count++;
     }
@@ -1163,8 +1181,8 @@
     DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset);
     AcpiOsPrintf ("\n");
     Status = AcpiDmDumpTable (Table->Length, Offset,
-                DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources),
-                AcpiDmTableInfoDrtm1);
+        DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources),
+        AcpiDmTableInfoDrtm1);
     if (ACPI_FAILURE (Status))
     {
         return;
@@ -1179,9 +1197,8 @@
            (DrtmRl->ResourceCount > Count))
     {
         Status = AcpiDmDumpTable (Table->Length, Offset,
-                    ACPI_ADD_PTR (void, Table, Offset),
-                    sizeof (ACPI_DRTM_RESOURCE),
-                    AcpiDmTableInfoDrtm1a);
+            ACPI_ADD_PTR (void, Table, Offset),
+            sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -1196,8 +1213,7 @@
     DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset);
     AcpiOsPrintf ("\n");
     (void) AcpiDmDumpTable (Table->Length, Offset,
-                DrtmDps, sizeof (ACPI_DRTM_DPS_ID),
-                AcpiDmTableInfoDrtm2);
+        DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2);
 }
 
 
@@ -1239,7 +1255,7 @@
     {
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
+            sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -1249,7 +1265,7 @@
 
         Offset += sizeof (ACPI_WHEA_HEADER);
         SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
-                        sizeof (ACPI_WHEA_HEADER));
+            sizeof (ACPI_WHEA_HEADER));
     }
 }
 
@@ -1292,7 +1308,7 @@
     {
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0);
+            sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -1302,7 +1318,7 @@
 
         Offset += sizeof (ACPI_WHEA_HEADER);
         SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
-                        sizeof (ACPI_WHEA_HEADER));
+            sizeof (ACPI_WHEA_HEADER));
     }
 }
 
@@ -1342,7 +1358,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTable->Length, AcpiDmTableInfoFpdtHdr);
+            SubTable->Length, AcpiDmTableInfoFpdtHdr);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -1362,7 +1378,8 @@
 
         default:
 
-            AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", SubTable->Type);
+            AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n",
+                SubTable->Type);
 
             /* Attempt to continue */
 
@@ -1375,7 +1392,7 @@
         }
 
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTable->Length, InfoTable);
+            SubTable->Length, InfoTable);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -1385,7 +1402,8 @@
         /* Point to next subtable */
 
         Offset += SubTable->Length;
-        SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable, SubTable->Length);
+        SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable,
+            SubTable->Length);
     }
 }
 
@@ -1434,7 +1452,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTable->Length, AcpiDmTableInfoGtdtHdr);
+            SubTable->Length, AcpiDmTableInfoGtdtHdr);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -1447,7 +1465,7 @@
 
             SubTableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
             GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
-                        SubTable))->TimerCount;
+                SubTable))->TimerCount;
 
             InfoTable = AcpiDmTableInfoGtdt0;
             break;
@@ -1463,12 +1481,13 @@
 
             /* Cannot continue on unknown type - no length */
 
-            AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n", SubTable->Type);
+            AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n",
+                SubTable->Type);
             return;
         }
 
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTable->Length, InfoTable);
+            SubTable->Length, InfoTable);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -1482,14 +1501,15 @@
 
         if (GtCount)
         {
-            GtxTable = ACPI_ADD_PTR (ACPI_GTDT_TIMER_ENTRY, SubTable, SubTableLength);
+            GtxTable = ACPI_ADD_PTR (
+                ACPI_GTDT_TIMER_ENTRY, SubTable, SubTableLength);
             SubTableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY);
 
             while (GtCount)
             {
                 AcpiOsPrintf ("\n");
                 Status = AcpiDmDumpTable (Length, Offset, GtxTable,
-                            sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
+                    sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
                 if (ACPI_FAILURE (Status))
                 {
                     return;
@@ -1555,7 +1575,7 @@
             InfoTable = AcpiDmTableInfoHest0;
             SubTableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK);
             BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
-                            SubTable))->NumHardwareBanks;
+                SubTable))->NumHardwareBanks;
             break;
 
         case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
@@ -1563,7 +1583,7 @@
             InfoTable = AcpiDmTableInfoHest1;
             SubTableLength = sizeof (ACPI_HEST_IA_CORRECTED);
             BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
-                            SubTable))->NumHardwareBanks;
+                SubTable))->NumHardwareBanks;
             break;
 
         case ACPI_HEST_TYPE_IA32_NMI:
@@ -1600,13 +1620,14 @@
 
             /* Cannot continue on unknown type - no length */
 
-            AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n", SubTable->Type);
+            AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n",
+                SubTable->Type);
             return;
         }
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTableLength, InfoTable);
+            SubTableLength, InfoTable);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -1620,18 +1641,20 @@
 
         if (BankCount)
         {
-            BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, SubTable, SubTableLength);
+            BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, SubTable,
+                SubTableLength);
             SubTableLength += BankCount * sizeof (ACPI_HEST_IA_ERROR_BANK);
 
             while (BankCount)
             {
                 AcpiOsPrintf ("\n");
                 Status = AcpiDmDumpTable (Length, Offset, BankTable,
-                            sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank);
+                    sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank);
                 if (ACPI_FAILURE (Status))
                 {
                     return;
                 }
+
                 Offset += sizeof (ACPI_HEST_IA_ERROR_BANK);
                 BankTable++;
                 BankCount--;
@@ -1690,7 +1713,7 @@
     if (Iort->NodeOffset > Offset)
     {
         Status = AcpiDmDumpTable (Table->Length, Offset, Table,
-                    Iort->NodeOffset - Offset, AcpiDmTableInfoIortPad);
+            Iort->NodeOffset - Offset, AcpiDmTableInfoIortPad);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -1706,7 +1729,7 @@
         AcpiOsPrintf ("\n");
         Length = ACPI_OFFSET (ACPI_IORT_NODE, NodeData);
         Status = AcpiDmDumpTable (Table->Length, Offset,
-                    IortNode, Length, AcpiDmTableInfoIortHdr);
+            IortNode, Length, AcpiDmTableInfoIortHdr);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -1763,8 +1786,8 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
-                    ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
-                    Length, InfoTable);
+            ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+            Length, InfoTable);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -1785,8 +1808,8 @@
                 for (i = 0; i < IortItsGroup->ItsCount; i++)
                 {
                     Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
-                                ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
-                                4, AcpiDmTableInfoIort0a);
+                        ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+                        4, AcpiDmTableInfoIort0a);
                     NodeOffset += 4;
                 }
             }
@@ -1799,8 +1822,8 @@
             if (IortNode->Length > NodeOffset)
             {
                 Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
-                            Table, IortNode->Length - NodeOffset,
-                            AcpiDmTableInfoIort1a);
+                    Table, IortNode->Length - NodeOffset,
+                    AcpiDmTableInfoIort1a);
                 if (ACPI_FAILURE (Status))
                 {
                     return;
@@ -1819,8 +1842,8 @@
                 Length = 2 * sizeof (UINT64);
                 NodeOffset = IortSmmu->GlobalInterruptOffset;
                 Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
-                            ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
-                            Length, AcpiDmTableInfoIort3a);
+                    ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+                    Length, AcpiDmTableInfoIort3a);
                 if (ACPI_FAILURE (Status))
                 {
                     return;
@@ -1830,12 +1853,13 @@
                 for (i = 0; i < IortSmmu->ContextInterruptCount; i++)
                 {
                     Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
-                                ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
-                                8, AcpiDmTableInfoIort3b);
+                        ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+                        8, AcpiDmTableInfoIort3b);
                     if (ACPI_FAILURE (Status))
                     {
                         return;
                     }
+
                     NodeOffset += 8;
                 }
 
@@ -1843,12 +1867,13 @@
                 for (i = 0; i < IortSmmu->PmuInterruptCount; i++)
                 {
                     Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
-                                ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
-                                8, AcpiDmTableInfoIort3c);
+                        ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+                        8, AcpiDmTableInfoIort3c);
                     if (ACPI_FAILURE (Status))
                     {
                         return;
                     }
+
                     NodeOffset += 8;
                 }
             }
@@ -1867,12 +1892,13 @@
             AcpiOsPrintf ("\n");
             Length = sizeof (ACPI_IORT_ID_MAPPING);
             Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
-                        ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
-                        Length, AcpiDmTableInfoIortMap);
+                ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+                Length, AcpiDmTableInfoIortMap);
             if (ACPI_FAILURE (Status))
             {
                 return;
             }
+
             NodeOffset += Length;
         }
 
@@ -1930,7 +1956,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
-                    SubTable->Length, AcpiDmTableInfoIvrsHdr);
+            SubTable->Length, AcpiDmTableInfoIvrsHdr);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -1969,7 +1995,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
-                    SubTable->Length, InfoTable);
+            SubTable->Length, InfoTable);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -1981,7 +2007,7 @@
         {
             EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE);
             DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, SubTable,
-                            sizeof (ACPI_IVRS_HARDWARE));
+                sizeof (ACPI_IVRS_HARDWARE));
 
             while (EntryOffset < (Offset + SubTable->Length))
             {
@@ -2046,7 +2072,7 @@
                 /* Dump the Device Entry */
 
                 Status = AcpiDmDumpTable (Table->Length, EntryOffset,
-                            DeviceEntry, EntryLength, InfoTable);
+                    DeviceEntry, EntryLength, InfoTable);
                 if (ACPI_FAILURE (Status))
                 {
                     return;
@@ -2054,7 +2080,7 @@
 
                 EntryOffset += EntryLength;
                 DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, DeviceEntry,
-                                EntryLength);
+                    EntryLength);
             }
         }
 
@@ -2102,7 +2128,7 @@
         /* Common subtable header */
 
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    sizeof (ACPI_LPIT_HEADER), AcpiDmTableInfoLpitHdr);
+            sizeof (ACPI_LPIT_HEADER), AcpiDmTableInfoLpitHdr);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -2120,16 +2146,18 @@
 
             /* Cannot continue on unknown type - no length */
 
-            AcpiOsPrintf ("\n**** Unknown LPIT subtable type 0x%X\n", SubTable->Type);
+            AcpiOsPrintf ("\n**** Unknown LPIT subtable type 0x%X\n",
+                SubTable->Type);
             return;
         }
 
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTableLength, InfoTable);
+            SubTableLength, InfoTable);
         if (ACPI_FAILURE (Status))
         {
             return;
         }
+
         AcpiOsPrintf ("\n");
 
         /* Point to next subtable */
@@ -2181,7 +2209,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTable->Length, AcpiDmTableInfoMadtHdr);
+            SubTable->Length, AcpiDmTableInfoMadtHdr);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -2271,7 +2299,8 @@
 
         default:
 
-            AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n", SubTable->Type);
+            AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n",
+                SubTable->Type);
 
             /* Attempt to continue */
 
@@ -2280,11 +2309,12 @@
                 AcpiOsPrintf ("Invalid zero length subtable\n");
                 return;
             }
+
             goto NextSubTable;
         }
 
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTable->Length, InfoTable);
+            SubTable->Length, InfoTable);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -2294,7 +2324,8 @@
         /* Point to next subtable */
 
         Offset += SubTable->Length;
-        SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
+        SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable,
+            SubTable->Length);
     }
 }
 
@@ -2342,7 +2373,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
-                    sizeof (ACPI_MCFG_ALLOCATION), AcpiDmTableInfoMcfg0);
+            sizeof (ACPI_MCFG_ALLOCATION), AcpiDmTableInfoMcfg0);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -2352,7 +2383,7 @@
 
         Offset += sizeof (ACPI_MCFG_ALLOCATION);
         SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, SubTable,
-                        sizeof (ACPI_MCFG_ALLOCATION));
+            sizeof (ACPI_MCFG_ALLOCATION));
     }
 }
 
@@ -2402,7 +2433,7 @@
     {
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0,
-                    sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0);
+            sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -2423,7 +2454,7 @@
         {
             AcpiOsPrintf ("\n");
             Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0A,
-                        sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A);
+                sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A);
             if (ACPI_FAILURE (Status))
             {
                 return;
@@ -2446,7 +2477,7 @@
         while (ComponentCount)
         {
             Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0B,
-                        sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B);
+                sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B);
             if (ACPI_FAILURE (Status))
             {
                 return;
@@ -2471,7 +2502,7 @@
     AcpiOsPrintf ("\n");
     SubTable1 = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, SubTable0);
     Status = AcpiDmDumpTable (Table->Length, Offset, SubTable1,
-                sizeof (ACPI_MPST_DATA_HDR), AcpiDmTableInfoMpst1);
+        sizeof (ACPI_MPST_DATA_HDR), AcpiDmTableInfoMpst1);
     if (ACPI_FAILURE (Status))
     {
         return;
@@ -2482,13 +2513,14 @@
 
     /* Subtable: Memory Power State Characteristics structure(s) */
 
-    SubTable2 = ACPI_ADD_PTR (ACPI_MPST_POWER_DATA, SubTable1, sizeof (ACPI_MPST_DATA_HDR));
+    SubTable2 = ACPI_ADD_PTR (ACPI_MPST_POWER_DATA, SubTable1,
+        sizeof (ACPI_MPST_DATA_HDR));
 
     while ((Offset < Table->Length) && SubtableCount)
     {
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable2,
-                    sizeof (ACPI_MPST_POWER_DATA), AcpiDmTableInfoMpst2);
+            sizeof (ACPI_MPST_POWER_DATA), AcpiDmTableInfoMpst2);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -2539,7 +2571,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
-                    sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0);
+            sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -2548,7 +2580,8 @@
         /* Point to next subtable */
 
         Offset += sizeof (ACPI_MSCT_PROXIMITY);
-        SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, SubTable, sizeof (ACPI_MSCT_PROXIMITY));
+        SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, SubTable,
+            sizeof (ACPI_MSCT_PROXIMITY));
     }
 }
 
@@ -2591,7 +2624,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
-                    sizeof (ACPI_MTMR_ENTRY), AcpiDmTableInfoMtmr0);
+            sizeof (ACPI_MTMR_ENTRY), AcpiDmTableInfoMtmr0);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -2600,7 +2633,8 @@
         /* Point to next subtable */
 
         Offset += sizeof (ACPI_MTMR_ENTRY);
-        SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, SubTable, sizeof (ACPI_MTMR_ENTRY));
+        SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, SubTable,
+            sizeof (ACPI_MTMR_ENTRY));
     }
 }
 
@@ -2650,7 +2684,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
-                    SubTable->Length, AcpiDmTableInfoNfitHdr);
+            SubTable->Length, AcpiDmTableInfoNfitHdr);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -2703,7 +2737,8 @@
             break;
 
         default:
-            AcpiOsPrintf ("\n**** Unknown NFIT subtable type 0x%X\n", SubTable->Type);
+            AcpiOsPrintf ("\n**** Unknown NFIT subtable type 0x%X\n",
+                SubTable->Type);
 
             /* Attempt to continue */
 
@@ -2717,7 +2752,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
-                    SubTable->Length, InfoTable);
+            SubTable->Length, InfoTable);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -2732,8 +2767,8 @@
             for (i = 0; i < Interleave->LineCount; i++)
             {
                 Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
-                            &Interleave->LineOffset[i],
-                            sizeof (UINT32), AcpiDmTableInfoNfit2a);
+                    &Interleave->LineOffset[i],
+                    sizeof (UINT32), AcpiDmTableInfoNfit2a);
                 if (ACPI_FAILURE (Status))
                 {
                     return;
@@ -2745,13 +2780,15 @@
 
         case ACPI_NFIT_TYPE_SMBIOS:
 
-            Length = SubTable->Length - sizeof (ACPI_NFIT_SMBIOS) + sizeof (UINT8);
+            Length = SubTable->Length -
+                sizeof (ACPI_NFIT_SMBIOS) + sizeof (UINT8);
+
             if (Length)
             {
                 Status = AcpiDmDumpTable (Table->Length,
-                            sizeof (ACPI_NFIT_SMBIOS) - sizeof (UINT8),
-                            SmbiosInfo,
-                            Length, AcpiDmTableInfoNfit3a);
+                    sizeof (ACPI_NFIT_SMBIOS) - sizeof (UINT8),
+                    SmbiosInfo,
+                    Length, AcpiDmTableInfoNfit3a);
                 if (ACPI_FAILURE (Status))
                 {
                     return;
@@ -2765,8 +2802,8 @@
             for (i = 0; i < Hint->HintCount; i++)
             {
                 Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
-                            &Hint->HintAddress[i],
-                            sizeof (UINT64), AcpiDmTableInfoNfit6a);
+                    &Hint->HintAddress[i],
+                    sizeof (UINT64), AcpiDmTableInfoNfit6a);
                 if (ACPI_FAILURE (Status))
                 {
                     return;
@@ -2830,7 +2867,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTable->Header.Length, AcpiDmTableInfoPcctHdr);
+            SubTable->Header.Length, AcpiDmTableInfoPcctHdr);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -2858,7 +2895,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTable->Header.Length, InfoTable);
+            SubTable->Header.Length, InfoTable);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -2868,7 +2905,7 @@
 
         Offset += SubTable->Header.Length;
         SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, SubTable,
-                    SubTable->Header.Length);
+            SubTable->Header.Length);
     }
 }
 
@@ -2920,7 +2957,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTable->Length, AcpiDmTableInfoPmttHdr);
+            SubTable->Length, AcpiDmTableInfoPmttHdr);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -2939,7 +2976,7 @@
         /* Dump the fixed-length portion of the subtable */
 
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTable->Length, AcpiDmTableInfoPmtt0);
+            SubTable->Length, AcpiDmTableInfoPmtt0);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -2958,8 +2995,8 @@
 
             AcpiOsPrintf ("\n");
             Status = AcpiDmDumpTable (Length,
-                        Offset + MemOffset, MemSubTable,
-                        MemSubTable->Length, AcpiDmTableInfoPmttHdr);
+                Offset + MemOffset, MemSubTable,
+                MemSubTable->Length, AcpiDmTableInfoPmttHdr);
             if (ACPI_FAILURE (Status))
             {
                 return;
@@ -2978,8 +3015,8 @@
             /* Dump the fixed-length portion of the controller subtable */
 
             Status = AcpiDmDumpTable (Length,
-                        Offset + MemOffset, MemSubTable,
-                        MemSubTable->Length, AcpiDmTableInfoPmtt1);
+                Offset + MemOffset, MemSubTable,
+                MemSubTable->Length, AcpiDmTableInfoPmtt1);
             if (ACPI_FAILURE (Status))
             {
                 return;
@@ -2997,8 +3034,8 @@
                 DomainCount)
             {
                 Status = AcpiDmDumpTable (Length,
-                            Offset + MemOffset + DomainOffset, DomainArray,
-                            sizeof (ACPI_PMTT_DOMAIN), AcpiDmTableInfoPmtt1a);
+                    Offset + MemOffset + DomainOffset, DomainArray,
+                    sizeof (ACPI_PMTT_DOMAIN), AcpiDmTableInfoPmtt1a);
                 if (ACPI_FAILURE (Status))
                 {
                     return;
@@ -3028,8 +3065,8 @@
 
                 AcpiOsPrintf ("\n");
                 Status = AcpiDmDumpTable (Length,
-                            Offset + MemOffset + DimmOffset, DimmSubTable,
-                            DimmSubTable->Length, AcpiDmTableInfoPmttHdr);
+                    Offset + MemOffset + DimmOffset, DimmSubTable,
+                    DimmSubTable->Length, AcpiDmTableInfoPmttHdr);
                 if (ACPI_FAILURE (Status))
                 {
                     return;
@@ -3048,8 +3085,8 @@
                 /* Dump the fixed-length DIMM subtable */
 
                 Status = AcpiDmDumpTable (Length,
-                            Offset + MemOffset + DimmOffset, DimmSubTable,
-                            DimmSubTable->Length, AcpiDmTableInfoPmtt2);
+                    Offset + MemOffset + DimmOffset, DimmSubTable,
+                    DimmSubTable->Length, AcpiDmTableInfoPmtt2);
                 if (ACPI_FAILURE (Status))
                 {
                     return;
@@ -3116,7 +3153,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable,
-                    SubTable->Length, AcpiDmTableInfoS3ptHdr);
+            SubTable->Length, AcpiDmTableInfoS3ptHdr);
         if (ACPI_FAILURE (Status))
         {
             return 0;
@@ -3136,7 +3173,8 @@
 
         default:
 
-            AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n", SubTable->Type);
+            AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n",
+                SubTable->Type);
 
             /* Attempt to continue */
 
@@ -3150,7 +3188,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable,
-                    SubTable->Length, InfoTable);
+            SubTable->Length, InfoTable);
         if (ACPI_FAILURE (Status))
         {
             return 0;
@@ -3183,8 +3221,9 @@
 AcpiDmDumpSlic (
     ACPI_TABLE_HEADER       *Table)
 {
+
     (void) AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table,
-                Table->Length - sizeof (*Table), AcpiDmTableInfoSlic);
+        Table->Length - sizeof (*Table), AcpiDmTableInfoSlic);
 }
 
 
@@ -3237,7 +3276,8 @@
 
             if (Offset >= Table->Length)
             {
-                AcpiOsPrintf ("\n**** Not enough room in table for all localities\n");
+                AcpiOsPrintf (
+                    "\n**** Not enough room in table for all localities\n");
                 return;
             }
 
@@ -3305,7 +3345,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
-                    SubTable->Length, AcpiDmTableInfoSratHdr);
+            SubTable->Length, AcpiDmTableInfoSratHdr);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -3334,7 +3374,8 @@
             break;
 
         default:
-            AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n", SubTable->Type);
+            AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n",
+                SubTable->Type);
 
             /* Attempt to continue */
 
@@ -3348,7 +3389,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
-                    SubTable->Length, InfoTable);
+            SubTable->Length, InfoTable);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -3358,7 +3399,8 @@
         /* Point to next subtable */
 
         Offset += SubTable->Length;
-        SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
+        SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable,
+            SubTable->Length);
     }
 }
 
@@ -3522,7 +3564,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
-                    sizeof (ACPI_VRTC_ENTRY), AcpiDmTableInfoVrtc0);
+            sizeof (ACPI_VRTC_ENTRY), AcpiDmTableInfoVrtc0);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -3531,7 +3573,8 @@
         /* Point to next subtable */
 
         Offset += sizeof (ACPI_VRTC_ENTRY);
-        SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, SubTable, sizeof (ACPI_VRTC_ENTRY));
+        SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, SubTable,
+            sizeof (ACPI_VRTC_ENTRY));
     }
 }
 
@@ -3574,7 +3617,7 @@
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
-                    sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0);
+            sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -3583,10 +3626,12 @@
         /* Point to next subtable */
 
         Offset += sizeof (ACPI_WDAT_ENTRY);
-        SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, SubTable, sizeof (ACPI_WDAT_ENTRY));
+        SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, SubTable,
+            sizeof (ACPI_WDAT_ENTRY));
     }
 }
 
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiDmDumpWpbt
--- a/sys/external/bsd/acpica/dist/common/dmtbinfo.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/common/dmtbinfo.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
--- a/sys/external/bsd/acpica/dist/compiler/aslanalyze.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslanalyze.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -139,8 +139,7 @@
     Length = strlen (Op->Asl.Value.String);
     if (!Length)
     {
-        AslError (ASL_ERROR, ASL_MSG_NULL_STRING,
-            Op, NULL);
+        AslError (ASL_ERROR, ASL_MSG_NULL_STRING, Op, NULL);
         return;
     }
 
@@ -191,7 +190,7 @@
         return;
     }
 
-    /* _HID Length is valid (7 or 8), now check the prefix (first 3 or 4 chars) */
+    /* _HID Length is valid (7 or 8), now check prefix (first 3 or 4 chars) */
 
     if (Length == 7)
     {
@@ -231,8 +230,8 @@
     {
         if (!isxdigit ((int) Op->Asl.Value.String[i]))
         {
-         AslError (ASL_ERROR, ASL_MSG_HID_SUFFIX,
-            Op, &Op->Asl.Value.String[i]);
+            AslError (ASL_ERROR, ASL_MSG_HID_SUFFIX,
+                Op, &Op->Asl.Value.String[i]);
             break;
         }
     }
@@ -323,7 +322,8 @@
     {
         /* Method SOMETIMES returns a value, SOMETIMES not */
 
-        AslError (ASL_WARNING, ASL_MSG_SOME_NO_RETVAL, Op, Op->Asl.ExternalName);
+        AslError (ASL_WARNING, ASL_MSG_SOME_NO_RETVAL,
+            Op, Op->Asl.ExternalName);
     }
     else if (!(ThisNodeBtype & RequiredBtypes))
     {
@@ -400,12 +400,13 @@
         {
             return (TRUE);
         }
+
         return (FALSE);
 
     /* Not used if one of these is the parent */
 
     case PARSEOP_METHOD:
-    case PARSEOP_DEFINITIONBLOCK:
+    case PARSEOP_DEFINITION_BLOCK:
     case PARSEOP_ELSE:
 
         return (FALSE);
--- a/sys/external/bsd/acpica/dist/compiler/aslcompile.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslcompile.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -130,7 +130,8 @@
 
     if (Gbl_SyntaxError)
     {
-        fprintf (stderr, "Compiler aborting due to parser-detected syntax error(s)\n");
+        fprintf (stderr,
+            "Compiler aborting due to parser-detected syntax error(s)\n");
         LsDumpParseTree ();
         goto ErrorExit;
     }
@@ -165,7 +166,7 @@
 
     LsDumpParseTree ();
 
-    OpcGetIntegerWidth (RootNode);
+    OpcGetIntegerWidth (RootNode->Asl.Child);
     UtEndEvent (Event);
 
     /* Pre-process parse tree for any operator transforms */
@@ -186,8 +187,8 @@
 
     /*
      * Now that the input is parsed, we can open the AML output file.
-     * Note: by default, the name of this file comes from the table descriptor
-     * within the input file.
+     * Note: by default, the name of this file comes from the table
+     * descriptor within the input file.
      */
     Event = UtBeginEvent ("Open AML output file");
     Status = FlOpenAmlOutputFile (Gbl_OutputFilenamePrefix);
@@ -263,7 +264,8 @@
 
     /* Namespace cross-reference */
 
-    AslGbl_NamespaceEvent = UtBeginEvent ("Cross reference parse tree and Namespace");
+    AslGbl_NamespaceEvent = UtBeginEvent (
+        "Cross reference parse tree and Namespace");
     Status = XfCrossReferenceNamespace ();
     if (ACPI_FAILURE (Status))
     {
@@ -301,9 +303,13 @@
     /* Semantic error checking part three - operand type checking */
 
     Event = UtBeginEvent ("Analyze AML operand types");
-    DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Operand type checking\n\n");
-    TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
-        NULL, AnOperandTypecheckWalkEnd, &AnalysisWalkInfo);
+    DbgPrint (ASL_DEBUG_OUTPUT,
+        "\nSemantic analysis - Operand type checking\n\n");
+    if (Gbl_DoTypechecking)
+    {
+        TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
+            NULL, AnOperandTypecheckWalkEnd, &AnalysisWalkInfo);
+    }
     UtEndEvent (Event);
 
     /* Semantic error checking part four - other miscellaneous checks */
@@ -587,8 +593,8 @@
 {
     ASL_EVENT_INFO          *Event;
     UINT32                  Delta;
-    UINT32                  USec;
-    UINT32                  MSec;
+    UINT32                  MicroSeconds;
+    UINT32                  MilliSeconds;
     UINT32                  i;
 
 
@@ -608,23 +614,23 @@
 
             Delta = (UINT32) (Event->EndTime - Event->StartTime);
 
-            USec = Delta / ACPI_100NSEC_PER_USEC;
-            MSec = Delta / ACPI_100NSEC_PER_MSEC;
+            MicroSeconds = Delta / ACPI_100NSEC_PER_USEC;
+            MilliSeconds = Delta / ACPI_100NSEC_PER_MSEC;
 
             /* Round milliseconds up */
 
-            if ((USec - (MSec * ACPI_USEC_PER_MSEC)) >= 500)
+            if ((MicroSeconds - (MilliSeconds * ACPI_USEC_PER_MSEC)) >= 500)
             {
-                MSec++;
+                MilliSeconds++;
             }
 
             DbgPrint (ASL_DEBUG_OUTPUT, "%8u usec %8u msec - %s\n",
-                USec, MSec, Event->EventName);
+                MicroSeconds, MilliSeconds, Event->EventName);
 
             if (Gbl_CompileTimesFlag)
             {
                 printf ("%8u usec %8u msec - %s\n",
-                    USec, MSec, Event->EventName);
+                    MicroSeconds, MilliSeconds, Event->EventName);
             }
         }
 
--- a/sys/external/bsd/acpica/dist/compiler/aslcompiler.h	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslcompiler.h	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -167,11 +167,7 @@
  * aslascii - ascii support
  */
 ACPI_STATUS
-FlCheckForAcpiTable (
-    FILE                    *Handle);
-
-ACPI_STATUS
-FlCheckForAscii (
+FlIsFileAsciiSource (
     char                    *Filename,
     BOOLEAN                 DisplayErrors);
 
@@ -741,6 +737,10 @@
     ACPI_PARSE_OBJECT       *Op);
 
 void
+TrSetCurrentFilename (
+    ACPI_PARSE_OBJECT       *Op);
+
+void
 TrWalkTree (
     void);
 
@@ -923,6 +923,10 @@
 #define ASL_PARSE_OUTPUT    1
 #define ASL_TREE_OUTPUT     2
 
+BOOLEAN
+UtQueryForOverwrite (
+    char                    *Pathname);
+
 void
 UtDisplaySupportedTables (
     void);
@@ -1286,6 +1290,6 @@
 
 ACPI_STATUS
 DtCreateTemplates (
-    char                    *Signature);
+    char                    **argv);
 
 #endif /*  __ASLCOMPILER_H */
--- a/sys/external/bsd/acpica/dist/compiler/aslcompiler.l	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslcompiler.l	Sat Jan 09 21:14:12 2016 +0000
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -156,6 +156,9 @@
 "^="                        { count (3); return (PARSEOP_EXP_XOR_EQ); }
 "|="                        { count (3); return (PARSEOP_EXP_OR_EQ); }
 
+"["                         { count (3); return(PARSEOP_EXP_INDEX_LEFT); }
+"]"                         { count (0); return(PARSEOP_EXP_INDEX_RIGHT); }
+
 
     /*
      * Begin standard ASL grammar
@@ -207,7 +210,7 @@
 "Debug"                     { count (1); return (PARSEOP_DEBUG); }
 "Decrement"                 { count (3); return (PARSEOP_DECREMENT); }
 "Default"                   { count (3); return (PARSEOP_DEFAULT); }
-"DefinitionBlock"           { count (1); return (PARSEOP_DEFINITIONBLOCK); }
+"DefinitionBlock"           { count (1); return (PARSEOP_DEFINITION_BLOCK); }
 "DeRefOf"                   { count (3); return (PARSEOP_DEREFOF); }
 "Device"                    { count (2); return (PARSEOP_DEVICE); }
 "Divide"                    { count (3); return (PARSEOP_DIVIDE); }
--- a/sys/external/bsd/acpica/dist/compiler/aslerror.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslerror.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -267,8 +267,10 @@
 
     if (!Enode->SourceLine)
     {
-        /* Use the merged header/source file if present, otherwise use input file */
-
+        /*
+         * Use the merged header/source file if present, otherwise
+         * use input file
+         */
         SourceFile = Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle;
         if (!SourceFile)
         {
@@ -314,18 +316,18 @@
                     fprintf (OutputFile, " %6u: ", Enode->LineNumber);
 
                     /*
-                     * If not at EOF, get the corresponding source code line and
-                     * display it. Don't attempt this if we have a premature EOF
-                     * condition.
+                     * If not at EOF, get the corresponding source code line
+                     * and display it. Don't attempt this if we have a
+                     * premature EOF condition.
                      */
                     if (!PrematureEOF)
                     {
                         /*
-                         * Seek to the offset in the combined source file, read
-                         * the source line, and write it to the output.
+                         * Seek to the offset in the combined source file,
+                         * read the source line, and write it to the output.
                          */
-                        Actual = fseek (SourceFile, (long) Enode->LogicalByteOffset,
-                                    (int) SEEK_SET);
+                        Actual = fseek (SourceFile,
+                            (long) Enode->LogicalByteOffset, (int) SEEK_SET);
                         if (Actual)
                         {
                             fprintf (OutputFile,
@@ -880,16 +882,17 @@
 
     if (Op)
     {
-        AslCommonError (ASL_ERROR, ASL_MSG_CORE_EXCEPTION, Op->Asl.LineNumber,
-                        Op->Asl.LogicalLineNumber,
-                        Op->Asl.LogicalByteOffset,
-                        Op->Asl.Column,
-                        Op->Asl.Filename, MsgBuffer);
+        AslCommonError (ASL_ERROR, ASL_MSG_CORE_EXCEPTION,
+            Op->Asl.LineNumber,
+            Op->Asl.LogicalLineNumber,
+            Op->Asl.LogicalByteOffset,
+            Op->Asl.Column,
+            Op->Asl.Filename, MsgBuffer);
     }
     else
     {
-        AslCommonError (ASL_ERROR, ASL_MSG_CORE_EXCEPTION, 0,
-                        0, 0, 0, NULL, MsgBuffer);
+        AslCommonError (ASL_ERROR, ASL_MSG_CORE_EXCEPTION,
+            0, 0, 0, 0, NULL, MsgBuffer);
     }
 
     if (Abort)
--- a/sys/external/bsd/acpica/dist/compiler/aslfileio.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslfileio.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -70,6 +70,7 @@
 
     snprintf (MsgBuffer, sizeof(MsgBuffer), "\"%s\" (%s) - %s", Gbl_Files[FileId].Filename,
         Gbl_Files[FileId].Description, strerror (errno));
+
     AslCommonError (ASL_ERROR, ErrorId, 0, 0, 0, 0, NULL, MsgBuffer);
 }
 
@@ -269,7 +270,8 @@
         AslAbort ();
     }
 
-    if ((FileId == ASL_FILE_PREPROCESSOR) && Gbl_PreprocessorOutputFlag)
+    if ((FileId == ASL_FILE_PREPROCESSOR) &&
+        Gbl_PreprocessorOutputFlag)
     {
         /*
          * Duplicate the output to the user preprocessor (.i) file,
@@ -291,7 +293,6 @@
             AslAbort ();
         }
     }
-
 }
 
 
--- a/sys/external/bsd/acpica/dist/compiler/aslfiles.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslfiles.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -56,7 +56,6 @@
     ACPI_PARSE_OBJECT       *Op,
     char                    *Filename);
 
-
 #ifdef ACPI_OBSOLETE_FUNCTIONS
 ACPI_STATUS
 FlParseInputPathname (
@@ -262,7 +261,8 @@
     /* Build the final merged pathname */
 
 ConcatenatePaths:
-    Pathname = UtStringCacheCalloc (strlen (CommonPath) + strlen (FilePathname) + 2);
+    Pathname = UtStringCacheCalloc (
+        strlen (CommonPath) + strlen (FilePathname) + 2);
     if (LastElement && *CommonPath)
     {
         strcpy (Pathname, CommonPath);
@@ -336,6 +336,7 @@
      */
     Gbl_CurrentLineNumber--;
     OriginalLineNumber = Gbl_CurrentLineNumber;
+
     while (DtGetNextLine (IncludeFile, DT_ALLOW_MULTILINE_QUOTES) != ASL_EOF)
     {
         if (Gbl_CurrentLineBuffer[0] == '#')
@@ -344,6 +345,7 @@
                 Op, "use #include instead");
         }
     }
+
     Gbl_CurrentLineNumber = OriginalLineNumber;
 
     /* Must seek back to the start of the file */
@@ -422,7 +424,8 @@
      *
      * Construct the file pathname from the global directory name.
      */
-    IncludeFile = FlOpenIncludeWithPrefix (Gbl_DirectoryPath, Op, Op->Asl.Value.String);
+    IncludeFile = FlOpenIncludeWithPrefix (
+        Gbl_DirectoryPath, Op, Op->Asl.Value.String);
     if (IncludeFile)
     {
         return;
@@ -435,7 +438,8 @@
     NextDir = Gbl_IncludeDirList;
     while (NextDir)
     {
-        IncludeFile = FlOpenIncludeWithPrefix (NextDir->Dir, Op, Op->Asl.Value.String);
+        IncludeFile = FlOpenIncludeWithPrefix (
+            NextDir->Dir, Op, Op->Asl.Value.String);
         if (IncludeFile)
         {
             return;
@@ -568,7 +572,7 @@
 
     /* All done for disassembler */
 
-    if (Gbl_FileType == ASL_INPUT_TYPE_ACPI_TABLE)
+    if (Gbl_FileType == ASL_INPUT_TYPE_BINARY_ACPI_TABLE)
     {
         return (AE_OK);
     }
--- a/sys/external/bsd/acpica/dist/compiler/aslload.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslload.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -196,12 +196,11 @@
         default:
 
             Status = AcpiNsLookup (WalkState->ScopeInfo,
-                        Child->Asl.Value.String,
-                        ACPI_TYPE_LOCAL_REGION_FIELD,
-                        ACPI_IMODE_LOAD_PASS1,
-                        ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
-                            ACPI_NS_ERROR_IF_FOUND,
-                        NULL, &Node);
+                Child->Asl.Value.String,
+                ACPI_TYPE_LOCAL_REGION_FIELD,
+                ACPI_IMODE_LOAD_PASS1,
+                ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
+                    ACPI_NS_ERROR_IF_FOUND, NULL, &Node);
             if (ACPI_FAILURE (Status))
             {
                 if (Status != AE_ALREADY_EXISTS)
@@ -266,9 +265,9 @@
      * This opens a scope, so later field names are guaranteed to be new/unique.
      */
     Status = AcpiNsLookup (WalkState->ScopeInfo, Op->Asl.Namepath,
-                ACPI_TYPE_LOCAL_RESOURCE, ACPI_IMODE_LOAD_PASS1,
-                ACPI_NS_NO_UPSEARCH | ACPI_NS_ERROR_IF_FOUND,
-                WalkState, &Node);
+        ACPI_TYPE_LOCAL_RESOURCE, ACPI_IMODE_LOAD_PASS1,
+        ACPI_NS_NO_UPSEARCH | ACPI_NS_ERROR_IF_FOUND,
+        WalkState, &Node);
     if (ACPI_FAILURE (Status))
     {
         if (Status == AE_ALREADY_EXISTS)
@@ -296,11 +295,11 @@
         if (InitializerOp->Asl.ExternalName)
         {
             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);
+                InitializerOp->Asl.ExternalName,
+                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);
@@ -344,6 +343,7 @@
 {
     ACPI_WALK_STATE         *WalkState = (ACPI_WALK_STATE *) Context;
     ACPI_NAMESPACE_NODE     *Node;
+    ACPI_PARSE_OBJECT       *MethodOp;
     ACPI_STATUS             Status;
     ACPI_OBJECT_TYPE        ObjectType;
     ACPI_OBJECT_TYPE        ActualObjectType = ACPI_TYPE_ANY;
@@ -500,8 +500,8 @@
          * 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)
@@ -509,9 +509,9 @@
                 /* 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);
@@ -534,6 +534,35 @@
 
             return_ACPI_STATUS (Status);
         }
+        else /* Status AE_OK */
+        {
+            /*
+             * Do not allow references to external scopes from the DSDT.
+             * This is because the DSDT is always loaded first, and the
+             * external reference cannot be resolved -- causing a runtime
+             * error because Scope() must be resolved immediately.
+             * 10/2015.
+             */
+            if ((Node->Flags & ANOBJ_IS_EXTERNAL) &&
+                (ACPI_COMPARE_NAME (Gbl_TableSignature, "DSDT")))
+            {
+                /* However, allowed if the reference is within a method */
+
+                MethodOp = Op->Asl.Parent;
+                while (MethodOp &&
+                      (MethodOp->Asl.ParseOpcode != PARSEOP_METHOD))
+                {
+                    MethodOp = MethodOp->Asl.Parent;
+                }
+
+                if (!MethodOp)
+                {
+                    /* Not in a control method, error */
+
+                    AslError (ASL_ERROR, ASL_MSG_CROSS_TABLE_SCOPE, Op, NULL);
+                }
+            }
+        }
 
         /* We found a node with this name, now check the type */
 
@@ -569,7 +598,7 @@
 
             Node->Type = ACPI_TYPE_LOCAL_SCOPE;
             Status = AcpiDsScopeStackPush (Node, ACPI_TYPE_LOCAL_SCOPE,
-                        WalkState);
+                WalkState);
             if (ACPI_FAILURE (Status))
             {
                 return_ACPI_STATUS (Status);
@@ -591,7 +620,7 @@
              */
             Node->Type = ACPI_TYPE_LOCAL_SCOPE;
             Status = AcpiDsScopeStackPush (Node, ACPI_TYPE_LOCAL_SCOPE,
-                        WalkState);
+                WalkState);
             if (ACPI_FAILURE (Status))
             {
                 return_ACPI_STATUS (Status);
@@ -611,7 +640,7 @@
 
 
     ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Loading name: %s, (%s)\n",
-            Op->Asl.ExternalName, AcpiUtGetTypeName (ObjectType)));
+        Op->Asl.ExternalName, AcpiUtGetTypeName (ObjectType)));
 
     /* The name must not already exist */
 
@@ -624,7 +653,7 @@
      * parse tree later.
      */
     Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
-                    ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node);
+        ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node);
     if (ACPI_FAILURE (Status))
     {
         if (Status == AE_ALREADY_EXISTS)
@@ -658,6 +687,17 @@
                         return_ACPI_STATUS (Status);
                     }
                 }
+
+                Status = AE_OK;
+            }
+            else if (!(Node->Flags & ANOBJ_IS_EXTERNAL) &&
+                     (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL))
+            {
+                /*
+                 * Allow externals in same scope as the definition of the
+                 * actual object. Similar to C. Allows multiple definition
+                 * blocks that refer to each other in the same file.
+                 */
                 Status = AE_OK;
             }
             else
@@ -818,8 +858,8 @@
         /* Get the NS node associated with the target. It must exist. */
 
         Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
-                    ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
-                    WalkState, &TargetNode);
+            ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
+            WalkState, &TargetNode);
         if (ACPI_FAILURE (Status))
         {
             if (Status == AE_NOT_FOUND)
@@ -832,9 +872,9 @@
                  * This prevents more errors later.
                  */
                 Status = AcpiNsLookup (WalkState->ScopeInfo, Path,
-                            ACPI_TYPE_ANY,
-                            ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH,
-                            WalkState, &(Node));
+                    ACPI_TYPE_ANY,
+                    ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH,
+                    WalkState, &(Node));
                 return (AE_OK);
             }
 
--- a/sys/external/bsd/acpica/dist/compiler/asllookup.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asllookup.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
--- a/sys/external/bsd/acpica/dist/compiler/aslopcodes.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslopcodes.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -260,7 +260,7 @@
      */
     if (Op->Asl.Parent &&
         Op->Asl.Parent->Asl.Parent &&
-       (Op->Asl.Parent->Asl.Parent->Asl.ParseOpcode == PARSEOP_DEFINITIONBLOCK))
+       (Op->Asl.Parent->Asl.Parent->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK))
     {
         return (0);
     }
@@ -330,11 +330,13 @@
         Op->Asl.AmlOpcode = AML_BYTE_OP;
         return (1);
     }
+
     if (Op->Asl.Value.Integer <= ACPI_UINT16_MAX)
     {
         Op->Asl.AmlOpcode = AML_WORD_OP;
         return (2);
     }
+
     if (Op->Asl.Value.Integer <= ACPI_UINT32_MAX)
     {
         Op->Asl.AmlOpcode = AML_DWORD_OP;
@@ -398,6 +400,7 @@
     {
         AttribOp->Asl.Value.Integer = 0;
     }
+
     AttribOp->Asl.AmlOpcode = AML_RAW_DATA_BYTE;
     AttribOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
 
@@ -486,21 +489,21 @@
      * First Child  -> BufferLength
      * Second Child -> Descriptor Buffer (raw byte data)
      */
-    BufferOp->Asl.ParseOpcode         = PARSEOP_BUFFER;
-    BufferOp->Asl.AmlOpcode           = AML_BUFFER_OP;
-    BufferOp->Asl.CompileFlags        = NODE_AML_PACKAGE | NODE_IS_RESOURCE_DESC;
+    BufferOp->Asl.ParseOpcode = PARSEOP_BUFFER;
+    BufferOp->Asl.AmlOpcode = AML_BUFFER_OP;
+    BufferOp->Asl.CompileFlags = NODE_AML_PACKAGE | NODE_IS_RESOURCE_DESC;
     UtSetParseOpName (BufferOp);
 
-    BufferLengthOp->Asl.ParseOpcode   = PARSEOP_INTEGER;
+    BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER;
     BufferLengthOp->Asl.Value.Integer = Rnode->BufferLength;
     (void) OpcSetOptimalIntegerSize (BufferLengthOp);
     UtSetParseOpName (BufferLengthOp);
 
-    BufferDataOp->Asl.ParseOpcode         = PARSEOP_RAW_DATA;
-    BufferDataOp->Asl.AmlOpcode           = AML_RAW_DATA_CHAIN;
-    BufferDataOp->Asl.AmlOpcodeLength     = 0;
-    BufferDataOp->Asl.AmlLength           = Rnode->BufferLength;
-    BufferDataOp->Asl.Value.Buffer        = (UINT8 *) Rnode;
+    BufferDataOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
+    BufferDataOp->Asl.AmlOpcode = AML_RAW_DATA_CHAIN;
+    BufferDataOp->Asl.AmlOpcodeLength = 0;
+    BufferDataOp->Asl.AmlLength = Rnode->BufferLength;
+    BufferDataOp->Asl.Value.Buffer = (UINT8 *) Rnode;
     UtSetParseOpName (BufferDataOp);
 }
 
@@ -564,8 +567,8 @@
      * Just set the buffer size node to be the buffer length, regardless
      * of whether it was previously an integer or a default_arg placeholder
      */
-    BufferLengthOp->Asl.ParseOpcode   = PARSEOP_INTEGER;
-    BufferLengthOp->Asl.AmlOpcode     = AML_DWORD_OP;
+    BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER;
+    BufferLengthOp->Asl.AmlOpcode = AML_DWORD_OP;
     BufferLengthOp->Asl.Value.Integer = Length;
     UtSetParseOpName (BufferLengthOp);
 
@@ -573,11 +576,11 @@
 
     /* The Unicode string is a raw data buffer */
 
-    InitializerOp->Asl.Value.Buffer   = (UINT8 *) UnicodeString;
-    InitializerOp->Asl.AmlOpcode      = AML_RAW_DATA_BUFFER;
-    InitializerOp->Asl.AmlLength      = Length;
-    InitializerOp->Asl.ParseOpcode    = PARSEOP_RAW_DATA;
-    InitializerOp->Asl.Child          = NULL;
+    InitializerOp->Asl.Value.Buffer = (UINT8 *) UnicodeString;
+    InitializerOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
+    InitializerOp->Asl.AmlLength = Length;
+    InitializerOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
+    InitializerOp->Asl.Child = NULL;
     UtSetParseOpName (InitializerOp);
 }
 
@@ -1330,9 +1333,9 @@
 
     NewOp = TrAllocateNode (PARSEOP_INTEGER);
 
-    NewOp->Asl.AmlOpcode     = AML_BYTE_OP;
+    NewOp->Asl.AmlOpcode = AML_BYTE_OP;
     NewOp->Asl.Value.Integer = 20;
-    NewOp->Asl.Parent        = Op;
+    NewOp->Asl.Parent = Op;
 
     Op->Asl.Child = NewOp;
     Op = NewOp;
@@ -1340,10 +1343,10 @@
     /* Peer to the child is the raw buffer data */
 
     NewOp = TrAllocateNode (PARSEOP_RAW_DATA);
-    NewOp->Asl.AmlOpcode     = AML_RAW_DATA_BUFFER;
-    NewOp->Asl.AmlLength     = 20;
-    NewOp->Asl.Value.String  = ACPI_CAST_PTR (char, Buffer);
-    NewOp->Asl.Parent        = Op->Asl.Parent;
+    NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
+    NewOp->Asl.AmlLength = 20;
+    NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
+    NewOp->Asl.Parent = Op->Asl.Parent;
 
     Op->Asl.Next = NewOp;
 }
@@ -1398,9 +1401,9 @@
 
     NewOp = TrAllocateNode (PARSEOP_INTEGER);
 
-    NewOp->Asl.AmlOpcode     = AML_BYTE_OP;
+    NewOp->Asl.AmlOpcode = AML_BYTE_OP;
     NewOp->Asl.Value.Integer = 16;
-    NewOp->Asl.Parent        = Op;
+    NewOp->Asl.Parent = Op;
 
     Op->Asl.Child = NewOp;
     Op = NewOp;
@@ -1408,10 +1411,10 @@
     /* Peer to the child is the raw buffer data */
 
     NewOp = TrAllocateNode (PARSEOP_RAW_DATA);
-    NewOp->Asl.AmlOpcode     = AML_RAW_DATA_BUFFER;
-    NewOp->Asl.AmlLength     = 16;
-    NewOp->Asl.Value.String  = ACPI_CAST_PTR (char, Buffer);
-    NewOp->Asl.Parent        = Op->Asl.Parent;
+    NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
+    NewOp->Asl.AmlLength = 16;
+    NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
+    NewOp->Asl.Parent = Op->Asl.Parent;
 
     Op->Asl.Next = NewOp;
 }
@@ -1507,7 +1510,6 @@
 
     case PARSEOP_INCLUDE:
 
-        Op->Asl.Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
         Gbl_HasIncludeFiles = TRUE;
         break;
 
--- a/sys/external/bsd/acpica/dist/compiler/aslpredef.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslpredef.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -259,7 +259,7 @@
      */
     Gbl_AllExceptionsDisabled = TRUE;
     Index = ApCheckForPredefinedName (MethodInfo->Op,
-                MethodInfo->Op->Asl.NameSeg);
+        MethodInfo->Op->Asl.NameSeg);
     Gbl_AllExceptionsDisabled = FALSE;
 
     switch (Index)
@@ -571,7 +571,8 @@
          * warning and force the user to manually change the names. So, we
          * will issue a remark instead.
          */
-        AslError (ASL_REMARK, ASL_MSG_COMPILER_RESERVED, Op, Op->Asl.ExternalName);
+        AslError (ASL_REMARK, ASL_MSG_COMPILER_RESERVED,
+            Op, Op->Asl.ExternalName);
         return (ACPI_COMPILER_RESERVED_NAME);
     }
 
@@ -580,8 +581,8 @@
      * warning, since the entire namespace starting with an underscore is
      * reserved by the ACPI spec.
      */
-    AslError (ASL_WARNING, ASL_MSG_UNKNOWN_RESERVED_NAME, Op,
-        Op->Asl.ExternalName);
+    AslError (ASL_WARNING, ASL_MSG_UNKNOWN_RESERVED_NAME,
+        Op, Op->Asl.ExternalName);
 
     return (ACPI_NOT_RESERVED_NAME);
 }
--- a/sys/external/bsd/acpica/dist/compiler/aslprepkg.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslprepkg.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -238,6 +238,7 @@
                 ApCheckObjectType (Predefined->Info.Name, Op,
                     Package->RetInfo3.TailObjectType, i);
             }
+
             Op = Op->Asl.Next;
         }
         break;
--- a/sys/external/bsd/acpica/dist/compiler/aslsupport.l	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslsupport.l	Sat Jan 09 21:14:12 2016 +0000
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -196,9 +196,13 @@
     ASL_FILE_NODE           *Fnode;
 
 
+    Gbl_PreviousIncludeFilename = Gbl_Files[ASL_FILE_INPUT].Filename;
     Fnode = Gbl_IncludeFileStack;
     DbgPrint (ASL_PARSE_OUTPUT,
-        "\nPop InputFile Stack, Fnode %p\n\n", Fnode);
+        "\nPop InputFile Stack, Fnode %p\n", Fnode);
+
+    DbgPrint (ASL_PARSE_OUTPUT,
+        "Include: Closing \"%s\"\n\n", Gbl_Files[ASL_FILE_INPUT].Filename);
 
     if (!Fnode)
     {
--- a/sys/external/bsd/acpica/dist/compiler/asltree.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asltree.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -157,10 +157,30 @@
 
 /*******************************************************************************
  *
+ * FUNCTION:    TrSetCurrentFilename
+ *
+ * PARAMETERS:  Op                  - An existing parse node
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Save the include file filename. Used for debug output only.
+ *
+ ******************************************************************************/
+
+void
+TrSetCurrentFilename (
+    ACPI_PARSE_OBJECT       *Op)
+{
+    Op->Asl.Filename = Gbl_PreviousIncludeFilename;
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    TrUpdateNode
  *
  * PARAMETERS:  ParseOpcode         - New opcode to be assigned to the node
- *              Op                - An existing parse node
+ *              Op                  - An existing parse node
  *
  * RETURN:      The updated node
  *
@@ -340,6 +360,11 @@
             FlagName = "NODE_METHOD_TYPED";
             break;
 
+        case NODE_COULD_NOT_REDUCE:
+
+            FlagName = "NODE_COULD_NOT_REDUCE";
+            break;
+
         case NODE_COMPILE_TIME_CONST:
 
             FlagName = "NODE_COMPILE_TIME_CONST";
@@ -489,7 +514,7 @@
         return;
     }
 
-    Op->Asl.EndLine        = Gbl_CurrentLineNumber;
+    Op->Asl.EndLine = Gbl_CurrentLineNumber;
     Op->Asl.EndLogicalLine = Gbl_LogicalLineNumber;
 }
 
@@ -538,6 +563,7 @@
     case PARSEOP_ADD:
     case PARSEOP_AND:
     case PARSEOP_DIVIDE:
+    case PARSEOP_INDEX:
     case PARSEOP_MOD:
     case PARSEOP_MULTIPLY:
     case PARSEOP_NOT:
@@ -752,7 +778,8 @@
     }
 
     DbgPrint (ASL_PARSE_OUTPUT,
-        "\nCreateConstantLeafNode  Ln/Col %u/%u NewNode %p  Op %s  Value %8.8X%8.8X  \n",
+        "\nCreateConstantLeafNode  Ln/Col %u/%u NewNode %p  "
+        "Op %s  Value %8.8X%8.8X  \n",
         Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode),
         ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer));
     return (Op);
@@ -859,7 +886,8 @@
     Op = TrAllocateNode (ParseOpcode);
 
     DbgPrint (ASL_PARSE_OUTPUT,
-        "\nCreateValuedLeafNode  Ln/Col %u/%u NewNode %p  Op %s  Value %8.8X%8.8X  ",
+        "\nCreateValuedLeafNode  Ln/Col %u/%u NewNode %p  "
+        "Op %s  Value %8.8X%8.8X  ",
         Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode),
         ACPI_FORMAT_UINT64 (Value));
     Op->Asl.Value.Integer = Value;
@@ -945,15 +973,22 @@
 
     DbgPrint (ASL_PARSE_OUTPUT,
         "\nCreateNode  Ln/Col %u/%u NewParent %p Child %u Op %s  ",
-        Op->Asl.LineNumber, Op->Asl.Column, Op, NumChildren, UtGetOpName(ParseOpcode));
+        Op->Asl.LineNumber, Op->Asl.Column, Op,
+        NumChildren, UtGetOpName(ParseOpcode));
 
     /* Some extra debug output based on the parse opcode */
 
     switch (ParseOpcode)
     {
-    case PARSEOP_DEFINITIONBLOCK:
+    case PARSEOP_ASL_CODE:
 
         RootNode = Op;
+        Op->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
+        DbgPrint (ASL_PARSE_OUTPUT, "ASLCODE (Tree Completed)->");
+        break;
+
+    case PARSEOP_DEFINITION_BLOCK:
+
         DbgPrint (ASL_PARSE_OUTPUT, "DEFINITION_BLOCK (Tree Completed)->");
         break;
 
@@ -1074,9 +1109,15 @@
 
     switch (Op->Asl.ParseOpcode)
     {
-    case PARSEOP_DEFINITIONBLOCK:
+    case PARSEOP_ASL_CODE:
 
         RootNode = Op;
+        Op->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
+        DbgPrint (ASL_PARSE_OUTPUT, "ASLCODE (Tree Completed)->");
+        break;
+
+    case PARSEOP_DEFINITION_BLOCK:
+
         DbgPrint (ASL_PARSE_OUTPUT, "DEFINITION_BLOCK (Tree Completed)->");
         break;
 
@@ -1154,6 +1195,7 @@
             Child = Child->Asl.Next;
             Child->Asl.Parent = Op;
         }
+
         PrevChild = Child;
     }
 
--- a/sys/external/bsd/acpica/dist/compiler/aslutils.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslutils.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,9 @@
 #include "acdisasm.h"
 #include "acnamesp.h"
 #include "amlcode.h"
-#include <acapps.h>
+#include "acapps.h"
+#include <sys/stat.h>
+
 
 #define _COMPONENT          ACPI_COMPILER
         ACPI_MODULE_NAME    ("aslutils")
@@ -65,6 +67,40 @@
     char                    *Name);
 
 
+/******************************************************************************
+ *
+ * FUNCTION:    UtQueryForOverwrite
+ *
+ * PARAMETERS:  Pathname            - Output filename
+ *
+ * RETURN:      TRUE if file does not exist or overwrite is authorized
+ *
+ * DESCRIPTION: Query for file overwrite if it already exists.
+ *
+ ******************************************************************************/
+
+BOOLEAN
+UtQueryForOverwrite (
+    char                    *Pathname)
+{
+    struct stat             StatInfo;
+
+
+    if (!stat (Pathname, &StatInfo))
+    {
+        fprintf (stderr, "Target file \"%s\" already exists, overwrite? [y|n] ",
+            Pathname);
+
+        if (getchar () != 'y')
+        {
+            return (FALSE);
+        }
+    }
+
+    return (TRUE);
+}
+
+
 /*******************************************************************************
  *
  * FUNCTION:    UtDisplaySupportedTables
@@ -219,7 +255,6 @@
     AslGbl_Events[AslGbl_NextEvent].StartTime = AcpiOsGetTimer ();
     AslGbl_Events[AslGbl_NextEvent].EventName = Name;
     AslGbl_Events[AslGbl_NextEvent].Valid = TRUE;
-
     return (AslGbl_NextEvent++);
 }
 
@@ -470,9 +505,11 @@
             if (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle)
             {
                 FlPrintFile (FileId,
-                    "%-14s %s - %u bytes, %u named objects, %u executable opcodes\n",
+                    "%-14s %s - %u bytes, %u named objects, "
+                    "%u executable opcodes\n",
                     "AML Output:",
-                    Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength,
+                    Gbl_Files[ASL_FILE_AML_OUTPUT].Filename,
+                    FlGetFileSize (ASL_FILE_AML_OUTPUT),
                     TotalNamedObjects, TotalExecutableOpcodes);
             }
         }
@@ -826,6 +863,7 @@
         {
             *PaddedNameSeg = '_';
         }
+
         PaddedNameSeg++;
     }
 }
@@ -1110,7 +1148,7 @@
         /* Check to see if value is out of range: */
 
         if (ReturnValue > ((ACPI_UINT64_MAX - (UINT64) Index) /
-                            (UINT64) Base))
+            (UINT64) Base))
         {
             goto ErrorExit;
         }
--- a/sys/external/bsd/acpica/dist/compiler/aslwalks.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslwalks.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,13 @@
         ACPI_MODULE_NAME    ("aslwalks")
 
 
+/* Local prototypes */
+
+static void
+AnAnalyzeStoreOperator (
+    ACPI_PARSE_OBJECT       *Op);
+
+
 /*******************************************************************************
  *
  * FUNCTION:    AnMethodTypingWalkEnd
@@ -73,7 +80,7 @@
     UINT32                  Level,
     void                    *Context)
 {
-    UINT32                  ThisNodeBtype;
+    UINT32                  ThisOpBtype;
 
 
     switch (Op->Asl.ParseOpcode)
@@ -88,10 +95,10 @@
         if ((Op->Asl.Child) &&
             (Op->Asl.Child->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG))
         {
-            ThisNodeBtype = AnGetBtype (Op->Asl.Child);
+            ThisOpBtype = AnGetBtype (Op->Asl.Child);
 
             if ((Op->Asl.Child->Asl.ParseOpcode == PARSEOP_METHODCALL) &&
-                (ThisNodeBtype == (ACPI_UINT32_MAX -1)))
+                (ThisOpBtype == (ACPI_UINT32_MAX -1)))
             {
                 /*
                  * The called method is untyped at this time (typically a
@@ -107,7 +114,7 @@
                         ASL_WALK_VISIT_UPWARD, NULL,
                         AnMethodTypingWalkEnd, NULL);
 
-                    ThisNodeBtype = AnGetBtype (Op->Asl.Child);
+                    ThisOpBtype = AnGetBtype (Op->Asl.Child);
                 }
             }
 
@@ -115,7 +122,7 @@
 
             if (Op->Asl.ParentMethod)
             {
-                Op->Asl.ParentMethod->Asl.AcpiBtype |= ThisNodeBtype;
+                Op->Asl.ParentMethod->Asl.AcpiBtype |= ThisOpBtype;
             }
         }
         break;
@@ -186,9 +193,9 @@
         return (AE_OK);
     }
 
-    ArgOp           = Op->Asl.Child;
+    ArgOp = Op->Asl.Child;
+    OpcodeClass = OpInfo->Class;
     RuntimeArgTypes = OpInfo->RuntimeArgs;
-    OpcodeClass     = OpInfo->Class;
 
 #ifdef ASL_ERROR_NAMED_OBJECT_IN_WHILE
     /*
@@ -247,6 +254,7 @@
             {
                 return (AE_OK);
             }
+
             AnCheckMethodReturnValue (Op, OpInfo, ArgOp,
                 RequiredBtypes, ThisNodeBtype);
         }
@@ -271,6 +279,70 @@
         return (AE_OK);
     }
 
+    /*
+     * Special handling for certain opcodes.
+     */
+    switch (Op->Asl.AmlOpcode)
+    {
+        /* BankField has one TermArg */
+
+    case AML_BANK_FIELD_OP:
+
+        OpcodeClass = AML_CLASS_EXECUTE;
+        ArgOp = ArgOp->Asl.Next;
+        ArgOp = ArgOp->Asl.Next;
+        break;
+
+        /* Operation Region has 2 TermArgs */
+
+    case AML_REGION_OP:
+
+        OpcodeClass = AML_CLASS_EXECUTE;
+        ArgOp = ArgOp->Asl.Next;
+        ArgOp = ArgOp->Asl.Next;
+        break;
+
+        /* DataTableRegion has 3 TermArgs */
+
+    case AML_DATA_REGION_OP:
+
+        OpcodeClass = AML_CLASS_EXECUTE;
+        ArgOp = ArgOp->Asl.Next;
+        break;
+
+        /* Buffers/Packages have a length that is a TermArg */
+
+    case AML_BUFFER_OP:
+    case AML_PACKAGE_OP:
+    case AML_VAR_PACKAGE_OP:
+
+            /* If length is a constant, we are done */
+
+        if ((ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER) ||
+            (ArgOp->Asl.ParseOpcode == PARSEOP_RAW_DATA))
+        {
+            return (AE_OK);
+        }
+        break;
+
+        /* Store can write any object to the Debug object */
+
+    case AML_STORE_OP:
+        /*
+         * If this is a Store() to the Debug object, we don't need
+         * to perform any further validation -- because a Store of
+         * any object to Debug is permitted and supported.
+         */
+        if (ArgOp->Asl.Next->Asl.AmlOpcode == AML_DEBUG_OP)
+        {
+            return (AE_OK);
+        }
+        break;
+
+    default:
+        break;
+    }
+
     switch (OpcodeClass)
     {
     case AML_CLASS_EXECUTE:
@@ -278,15 +350,6 @@
     case AML_CLASS_CONTROL:
     case AML_CLASS_RETURN_VALUE:
 
-        /* TBD: Change class or fix typechecking for these */
-
-        if ((Op->Asl.AmlOpcode == AML_BUFFER_OP)        ||
-            (Op->Asl.AmlOpcode == AML_PACKAGE_OP)       ||
-            (Op->Asl.AmlOpcode == AML_VAR_PACKAGE_OP))
-        {
-            break;
-        }
-
         /* Reverse the runtime argument list */
 
         RuntimeArgTypes2 = 0;
@@ -297,8 +360,12 @@
             INCREMENT_ARG_LIST (RuntimeArgTypes);
         }
 
+        /* Typecheck each argument */
+
         while ((ArgType = GET_CURRENT_ARG_TYPE (RuntimeArgTypes2)))
         {
+            /* Get the required type(s) for the argument */
+
             RequiredBtypes = AnMapArgTypeToBtype (ArgType);
 
             if (!ArgOp)
@@ -308,6 +375,8 @@
                 AslAbort ();
             }
 
+            /* Get the actual type of the argument */
+
             ThisNodeBtype = AnGetBtype (ArgOp);
             if (ThisNodeBtype == ACPI_UINT32_MAX)
             {
@@ -328,6 +397,10 @@
                     break;
                 }
 
+            /* Fallthrough */
+
+            case ARGI_STORE_TARGET:
+
                 if (ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER)
                 {
                     /*
@@ -339,25 +412,22 @@
                     if ((ArgOp->Asl.Node->Type == ACPI_TYPE_LOCAL_RESOURCE_FIELD) ||
                         (ArgOp->Asl.Node->Type == ACPI_TYPE_LOCAL_RESOURCE))
                     {
-                        AslError (ASL_ERROR, ASL_MSG_RESOURCE_FIELD, ArgOp, NULL);
+                        AslError (ASL_ERROR, ASL_MSG_RESOURCE_FIELD,
+                            ArgOp, NULL);
                     }
                     else
                     {
-                        AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, NULL);
+                        AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE,
+                            ArgOp, NULL);
                     }
-                    break;
                 }
-
-                if ((ArgOp->Asl.ParseOpcode == PARSEOP_METHODCALL) ||
-                    (ArgOp->Asl.ParseOpcode == PARSEOP_DEREFOF))
-                {
-                    break;
-                }
-
-                ThisNodeBtype = RequiredBtypes;
                 break;
 
 
+#ifdef __FUTURE_IMPLEMENTATION
+/*
+ * Possible future typechecking support
+ */
             case ARGI_REFERENCE:            /* References */
             case ARGI_INTEGER_REF:
             case ARGI_OBJECT_REF:
@@ -388,8 +458,8 @@
                 case PARSEOP_ARG5:
                 case PARSEOP_ARG6:
 
-                    /* Hard to analyze argument types, sow we won't */
-                    /* For now, just treat any arg as a typematch */
+                    /* Hard to analyze argument types, so we won't */
+                    /* for now. Just treat any arg as a typematch */
 
                     /* ThisNodeBtype = RequiredBtypes; */
                     break;
@@ -400,10 +470,9 @@
                 default:
 
                     break;
-
                 }
                 break;
-
+#endif
             case ARGI_INTEGER:
             default:
 
@@ -411,6 +480,8 @@
             }
 
 
+            /* Check for a type mismatch (required versus actual) */
+
             CommonBtypes = ThisNodeBtype & RequiredBtypes;
 
             if (ArgOp->Asl.ParseOpcode == PARSEOP_METHODCALL)
@@ -438,9 +509,10 @@
                 AnFormatBtype (StringBuffer2, RequiredBtypes);
 
                 snprintf (MsgBuffer, sizeof(MsgBuffer), "[%s] found, %s operator requires [%s]",
-                            StringBuffer, OpInfo->Name, StringBuffer2);
+                    StringBuffer, OpInfo->Name, StringBuffer2);
 
-                AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, MsgBuffer);
+                AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE,
+                    ArgOp, MsgBuffer);
             }
 
         NextArgument:
@@ -477,14 +549,15 @@
     UINT32                  Level,
     void                    *Context)
 {
-    ACPI_PARSE_OBJECT       *ArgNode;
-    ACPI_PARSE_OBJECT       *PrevArgNode = NULL;
+    ACPI_PARSE_OBJECT       *ArgOp;
+    ACPI_PARSE_OBJECT       *PrevArgOp = NULL;
     const ACPI_OPCODE_INFO  *OpInfo;
     ACPI_NAMESPACE_NODE     *Node;
 
 
     OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
 
+
     /*
      * Determine if an execution class operator actually does something by
      * checking if it has a target and/or the function return value is used.
@@ -497,30 +570,31 @@
         if (OpInfo->Flags & AML_HAS_TARGET)
         {
             /*
-             * Find the target node, it is always the last child. If the traget
+             * Find the target node, it is always the last child. If the target
              * is not specified in the ASL, a default node of type Zero was
              * created by the parser.
              */
-            ArgNode = Op->Asl.Child;
-            while (ArgNode->Asl.Next)
+            ArgOp = Op->Asl.Child;
+            while (ArgOp->Asl.Next)
             {
-                PrevArgNode = ArgNode;
-                ArgNode = ArgNode->Asl.Next;
+                PrevArgOp = ArgOp;
+                ArgOp = ArgOp->Asl.Next;
             }
 
             /* Divide() is the only weird case, it has two targets */
 
             if (Op->Asl.AmlOpcode == AML_DIVIDE_OP)
             {
-                if ((ArgNode->Asl.ParseOpcode == PARSEOP_ZERO) &&
-                    (PrevArgNode) &&
-                    (PrevArgNode->Asl.ParseOpcode == PARSEOP_ZERO))
+                if ((ArgOp->Asl.ParseOpcode == PARSEOP_ZERO) &&
+                    (PrevArgOp) &&
+                    (PrevArgOp->Asl.ParseOpcode == PARSEOP_ZERO))
                 {
                     AslError (ASL_ERROR, ASL_MSG_RESULT_NOT_USED,
                         Op, Op->Asl.ExternalName);
                 }
             }
-            else if (ArgNode->Asl.ParseOpcode == PARSEOP_ZERO)
+
+            else if (ArgOp->Asl.ParseOpcode == PARSEOP_ZERO)
             {
                 AslError (ASL_ERROR, ASL_MSG_RESULT_NOT_USED,
                     Op, Op->Asl.ExternalName);
@@ -555,6 +629,15 @@
      */
     switch (Op->Asl.ParseOpcode)
     {
+    case PARSEOP_STORE:
+
+        if (Gbl_DoTypechecking)
+        {
+            AnAnalyzeStoreOperator (Op);
+        }
+        break;
+
+
     case PARSEOP_ACQUIRE:
     case PARSEOP_WAIT:
         /*
@@ -566,16 +649,16 @@
 
         /* First child is the namepath, 2nd child is timeout */
 
-        ArgNode = Op->Asl.Child;
-        ArgNode = ArgNode->Asl.Next;
+        ArgOp = Op->Asl.Child;
+        ArgOp = ArgOp->Asl.Next;
 
         /*
          * Check for the WAIT_FOREVER case - defined by the ACPI spec to be
          * 0xFFFF or greater
          */
-        if (((ArgNode->Asl.ParseOpcode == PARSEOP_WORDCONST) ||
-             (ArgNode->Asl.ParseOpcode == PARSEOP_INTEGER))  &&
-             (ArgNode->Asl.Value.Integer >= (UINT64) ACPI_WAIT_FOREVER))
+        if (((ArgOp->Asl.ParseOpcode == PARSEOP_WORDCONST) ||
+             (ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER))  &&
+             (ArgOp->Asl.Value.Integer >= (UINT64) ACPI_WAIT_FOREVER))
         {
             break;
         }
@@ -586,7 +669,7 @@
          */
         if (!AnIsResultUsed (Op))
         {
-            AslError (ASL_WARNING, ASL_MSG_TIMEOUT, ArgNode,
+            AslError (ASL_WARNING, ASL_MSG_TIMEOUT, ArgOp,
                 Op->Asl.ExternalName);
         }
         break;
@@ -595,15 +678,15 @@
         /*
          * Check for a zero Length (NumBits) operand. NumBits is the 3rd operand
          */
-        ArgNode = Op->Asl.Child;
-        ArgNode = ArgNode->Asl.Next;
-        ArgNode = ArgNode->Asl.Next;
+        ArgOp = Op->Asl.Child;
+        ArgOp = ArgOp->Asl.Next;
+        ArgOp = ArgOp->Asl.Next;
 
-        if ((ArgNode->Asl.ParseOpcode == PARSEOP_ZERO) ||
-           ((ArgNode->Asl.ParseOpcode == PARSEOP_INTEGER) &&
-            (ArgNode->Asl.Value.Integer == 0)))
+        if ((ArgOp->Asl.ParseOpcode == PARSEOP_ZERO) ||
+           ((ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER) &&
+            (ArgOp->Asl.Value.Integer == 0)))
         {
-            AslError (ASL_ERROR, ASL_MSG_NON_ZERO, ArgNode, NULL);
+            AslError (ASL_ERROR, ASL_MSG_NON_ZERO, ArgOp, NULL);
         }
         break;
 
@@ -612,24 +695,24 @@
          * Ensure that the referenced operation region has the correct SPACE_ID.
          * From the grammar/parser, we know the parent is a FIELD definition.
          */
-        ArgNode = Op->Asl.Parent;       /* Field definition */
-        ArgNode = ArgNode->Asl.Child;   /* First child is the OpRegion Name */
-        Node = ArgNode->Asl.Node;       /* OpRegion namespace node */
+        ArgOp = Op->Asl.Parent;     /* Field definition */
+        ArgOp = ArgOp->Asl.Child;   /* First child is the OpRegion Name */
+        Node = ArgOp->Asl.Node;     /* OpRegion namespace node */
         if (!Node)
         {
             break;
         }
 
-        ArgNode = Node->Op;             /* OpRegion definition */
-        ArgNode = ArgNode->Asl.Child;   /* First child is the OpRegion Name */
-        ArgNode = ArgNode->Asl.Next;    /* Next peer is the SPACE_ID (what we want) */
+        ArgOp = Node->Op;           /* OpRegion definition */
+        ArgOp = ArgOp->Asl.Child;   /* First child is the OpRegion Name */
+        ArgOp = ArgOp->Asl.Next;    /* Next peer is the SPACE_ID (what we want) */
 
         /*
          * The Connection() operator is only valid for the following operation
          * region SpaceIds: GeneralPurposeIo and GenericSerialBus.
          */
-        if ((ArgNode->Asl.Value.Integer != ACPI_ADR_SPACE_GPIO) &&
-            (ArgNode->Asl.Value.Integer != ACPI_ADR_SPACE_GSBUS))
+        if ((ArgOp->Asl.Value.Integer != ACPI_ADR_SPACE_GPIO) &&
+            (ArgOp->Asl.Value.Integer != ACPI_ADR_SPACE_GSBUS))
         {
             AslError (ASL_ERROR, ASL_MSG_CONNECTION_INVALID, Op, NULL);
         }
@@ -640,46 +723,46 @@
          * Ensure that fields for GeneralPurposeIo and GenericSerialBus
          * contain at least one Connection() operator
          */
-        ArgNode = Op->Asl.Child;        /* 1st child is the OpRegion Name */
-        Node = ArgNode->Asl.Node;       /* OpRegion namespace node */
+        ArgOp = Op->Asl.Child;      /* 1st child is the OpRegion Name */
+        Node = ArgOp->Asl.Node;     /* OpRegion namespace node */
         if (!Node)
         {
             break;
         }
 
-        ArgNode = Node->Op;             /* OpRegion definition */
-        ArgNode = ArgNode->Asl.Child;   /* First child is the OpRegion Name */
-        ArgNode = ArgNode->Asl.Next;    /* Next peer is the SPACE_ID (what we want) */
+        ArgOp = Node->Op;           /* OpRegion definition */
+        ArgOp = ArgOp->Asl.Child;   /* First child is the OpRegion Name */
+        ArgOp = ArgOp->Asl.Next;    /* Next peer is the SPACE_ID (what we want) */
 
         /* We are only interested in GeneralPurposeIo and GenericSerialBus */
 
-        if ((ArgNode->Asl.Value.Integer != ACPI_ADR_SPACE_GPIO) &&
-            (ArgNode->Asl.Value.Integer != ACPI_ADR_SPACE_GSBUS))
+        if ((ArgOp->Asl.Value.Integer != ACPI_ADR_SPACE_GPIO) &&
+            (ArgOp->Asl.Value.Integer != ACPI_ADR_SPACE_GSBUS))
         {
             break;
         }
 
-        ArgNode = Op->Asl.Child;        /* 1st child is the OpRegion Name */
-        ArgNode = ArgNode->Asl.Next;    /* AccessType */
-        ArgNode = ArgNode->Asl.Next;    /* LockRule */
-        ArgNode = ArgNode->Asl.Next;    /* UpdateRule */
-        ArgNode = ArgNode->Asl.Next;    /* Start of FieldUnitList */
+        ArgOp = Op->Asl.Child;      /* 1st child is the OpRegion Name */
+        ArgOp = ArgOp->Asl.Next;    /* AccessType */
+        ArgOp = ArgOp->Asl.Next;    /* LockRule */
+        ArgOp = ArgOp->Asl.Next;    /* UpdateRule */
+        ArgOp = ArgOp->Asl.Next;    /* Start of FieldUnitList */
 
         /* Walk the FieldUnitList */
 
-        while (ArgNode)
+        while (ArgOp)
         {
-            if (ArgNode->Asl.ParseOpcode == PARSEOP_CONNECTION)
+            if (ArgOp->Asl.ParseOpcode == PARSEOP_CONNECTION)
             {
                 break;
             }
-            else if (ArgNode->Asl.ParseOpcode == PARSEOP_NAMESEG)
+            else if (ArgOp->Asl.ParseOpcode == PARSEOP_NAMESEG)
             {
-                AslError (ASL_ERROR, ASL_MSG_CONNECTION_MISSING, ArgNode, NULL);
+                AslError (ASL_ERROR, ASL_MSG_CONNECTION_MISSING, ArgOp, NULL);
                 break;
             }
 
-            ArgNode = ArgNode->Asl.Next;
+            ArgOp = ArgOp->Asl.Next;
         }
         break;
 
@@ -690,3 +773,191 @@
 
     return (AE_OK);
 }
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AnAnalyzeStoreOperator
+ *
+ * PARAMETERS:  Op                  - Store() operator
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Analyze a store operator. Mostly for stores to/from package
+ *              objects where there are more restrictions than other data
+ *              types.
+ *
+ ******************************************************************************/
+
+static void
+AnAnalyzeStoreOperator (
+    ACPI_PARSE_OBJECT       *Op)
+{
+    ACPI_NAMESPACE_NODE     *SourceNode;
+    ACPI_NAMESPACE_NODE     *TargetNode;
+    ACPI_PARSE_OBJECT       *SourceOperandOp;
+    ACPI_PARSE_OBJECT       *TargetOperandOp;
+    UINT32                  SourceOperandBtype;
+    UINT32                  TargetOperandBtype;
+
+
+    /* Extract the two operands for STORE */
+
+    SourceOperandOp = Op->Asl.Child;
+    TargetOperandOp = SourceOperandOp->Asl.Next;
+
+    /*
+     * Ignore these Source operand opcodes, they cannot be typechecked,
+     * the actual result is unknown here.
+     */
+    switch (SourceOperandOp->Asl.ParseOpcode)
+    {
+    /* For these, type of the returned value is unknown at compile time */
+
+    case PARSEOP_DEREFOF:
+    case PARSEOP_METHODCALL:
+    case PARSEOP_STORE:
+    case PARSEOP_COPYOBJECT:
+
+        return;
+
+    case PARSEOP_INDEX:
+    case PARSEOP_REFOF:
+
+        if (!Gbl_EnableReferenceTypechecking)
+        {
+            return;
+        }
+
+        /*
+         * These opcodes always return an object reference, and thus
+         * the result can only be stored to a Local, Arg, or Debug.
+         */
+        if (TargetOperandOp->Asl.AmlOpcode == AML_DEBUG_OP)
+        {
+            return;
+        }
+
+        if ((TargetOperandOp->Asl.AmlOpcode < AML_LOCAL0) ||
+            (TargetOperandOp->Asl.AmlOpcode > AML_ARG6))
+        {
+            AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, TargetOperandOp,
+                "Source [Reference], Target must be [Local/Arg/Debug]");
+        }
+        return;
+
+    default:
+        break;
+    }
+
+    /*
+     * Ignore these Target operand opcodes, they cannot be typechecked
+     */
+    switch (TargetOperandOp->Asl.ParseOpcode)
+    {
+    case PARSEOP_DEBUG:
+    case PARSEOP_DEREFOF:
+    case PARSEOP_REFOF:
+    case PARSEOP_INDEX:
+    case PARSEOP_METHODCALL:
+
+        return;
+
+    default:
+        break;
+    }
+
+    /*
+     * Ignore typecheck for External() operands of type "UnknownObj",
+     * we don't know the actual type (source or target).
+     */
+    SourceNode = SourceOperandOp->Asl.Node;
+    if (SourceNode &&
+        (SourceNode->Flags & ANOBJ_IS_EXTERNAL) &&
+        (SourceNode->Type == ACPI_TYPE_ANY))
+    {
+        return;
+    }
+
+    TargetNode = TargetOperandOp->Asl.Node;
+    if (TargetNode &&
+        (TargetNode->Flags & ANOBJ_IS_EXTERNAL) &&
+        (TargetNode->Type == ACPI_TYPE_ANY))
+    {
+        return;
+    }
+
+    /*
+     * A NULL node with a namepath AML opcode indicates non-existent
+     * name. Just return, the error message is generated elsewhere.
+     */
+    if ((!SourceNode && (SourceOperandOp->Asl.AmlOpcode == AML_INT_NAMEPATH_OP)) ||
+        (!TargetNode && (TargetOperandOp->Asl.AmlOpcode == AML_INT_NAMEPATH_OP)))
+    {
+        return;
+    }
+
+    /*
+     * Simple check for source same as target via NS node.
+     * -- Could be expanded to locals and args.
+     */
+    if (SourceNode && TargetNode)
+    {
+        if (SourceNode == TargetNode)
+        {
+            AslError (ASL_WARNING, ASL_MSG_DUPLICATE_ITEM,
+                TargetOperandOp, "Source is the same as Target");
+            return;
+        }
+    }
+
+    /* Ignore typecheck if either source or target is a local or arg */
+
+    if ((SourceOperandOp->Asl.AmlOpcode >= AML_LOCAL0) &&
+        (SourceOperandOp->Asl.AmlOpcode <= AML_ARG6))
+    {
+        return; /* Cannot type a local/arg at compile time */
+    }
+
+    if ((TargetOperandOp->Asl.AmlOpcode >= AML_LOCAL0) &&
+        (TargetOperandOp->Asl.AmlOpcode <= AML_ARG6))
+    {
+        return; /* Cannot type a local/arg at compile time */
+    }
+
+    /*
+     * Package objects are a special case because they cannot by implicitly
+     * converted to/from anything. Check for these two illegal cases:
+     *
+     *      Store (non-package, package)
+     *      Store (package, non-package)
+     */
+    SourceOperandBtype = AnGetBtype (SourceOperandOp);
+    TargetOperandBtype = AnGetBtype (TargetOperandOp);
+
+    /* Check source first for (package, non-package) case */
+
+    if (SourceOperandBtype & ACPI_BTYPE_PACKAGE)
+    {
+        /* If Source is PACKAGE-->Target must be PACKAGE */
+
+        if (!(TargetOperandBtype & ACPI_BTYPE_PACKAGE))
+        {
+            AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, TargetOperandOp,
+                "Source is [Package], Target must be a package also");
+        }
+    }
+
+    /* Else check target for (non-package, package) case */
+
+    else if (TargetOperandBtype & ACPI_BTYPE_PACKAGE)
+    {
+        /* If Target is PACKAGE, Source must be PACKAGE */
+
+        if (!(SourceOperandBtype & ACPI_BTYPE_PACKAGE))
+        {
+            AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, SourceOperandOp,
+                "Target is [Package], Source must be a package also");
+        }
+    }
+}
--- a/sys/external/bsd/acpica/dist/compiler/aslxref.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslxref.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -148,7 +148,7 @@
     /* Walk the entire parse tree */
 
     TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, XfNamespaceLocateBegin,
-                        XfNamespaceLocateEnd, WalkState);
+        XfNamespaceLocateEnd, WalkState);
 
     ACPI_FREE (WalkState);
     return (AE_OK);
@@ -177,8 +177,8 @@
     /* Walk entire namespace from the supplied root */
 
     Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
-                ACPI_UINT32_MAX, FALSE, XfCompareOneNamespaceObject, NULL,
-                Name, NULL);
+        ACPI_UINT32_MAX, FALSE, XfCompareOneNamespaceObject, NULL,
+        Name, NULL);
     if (Status == AE_CTRL_TRUE)
     {
         /* At least one instance of the name was found */
@@ -575,6 +575,7 @@
         {
             NextOp = NextOp->Asl.Next;
         }
+
         Path = NextOp->Asl.Value.String;
     }
     else
@@ -596,7 +597,7 @@
     Gbl_NsLookupCount++;
 
     Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
-                ACPI_IMODE_EXECUTE, Flags, WalkState, &(Node));
+        ACPI_IMODE_EXECUTE, Flags, WalkState, &(Node));
     if (ACPI_FAILURE (Status))
     {
         if (Status == AE_NOT_FOUND)
@@ -778,7 +779,8 @@
 
             if (Message)
             {
-                snprintf (MsgBuffer, sizeof(MsgBuffer), "Size mismatch, Tag: %u bit%s, Field: %u bit%s",
+                snprintf (MsgBuffer, sizeof(MsgBuffer),
+                    "Size mismatch, Tag: %u bit%s, Field: %u bit%s",
                     TagBitLength, (TagBitLength > 1) ? "s" : "",
                     FieldBitLength, (FieldBitLength > 1) ? "s" : "");
 
@@ -847,7 +849,7 @@
         if (Node->Type != ACPI_TYPE_METHOD)
         {
             snprintf (MsgBuffer, sizeof(MsgBuffer), "%s is a %s",
-                    Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type));
+                Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type));
 
             AslError (ASL_ERROR, ASL_MSG_NOT_METHOD, Op, MsgBuffer);
             return_ACPI_STATUS (AE_OK);
@@ -870,7 +872,7 @@
         UtSetParseOpName (Op);
 
         PassedArgs = 0;
-        NextOp     = Op->Asl.Child;
+        NextOp = Op->Asl.Child;
 
         while (NextOp)
         {
@@ -976,7 +978,8 @@
             case ACPI_ADR_SPACE_CMOS:
             case ACPI_ADR_SPACE_GPIO:
 
-                if ((UINT8) Op->Asl.Parent->Asl.Value.Integer != AML_FIELD_ACCESS_BYTE)
+                if ((UINT8) Op->Asl.Parent->Asl.Value.Integer !=
+                    AML_FIELD_ACCESS_BYTE)
                 {
                     AslError (ASL_ERROR, ASL_MSG_REGION_BYTE_ACCESS, Op, NULL);
                 }
@@ -986,7 +989,8 @@
             case ACPI_ADR_SPACE_IPMI:
             case ACPI_ADR_SPACE_GSBUS:
 
-                if ((UINT8) Op->Asl.Parent->Asl.Value.Integer != AML_FIELD_ACCESS_BUFFER)
+                if ((UINT8) Op->Asl.Parent->Asl.Value.Integer !=
+                    AML_FIELD_ACCESS_BUFFER)
                 {
                     AslError (ASL_ERROR, ASL_MSG_REGION_BUFFER_ACCESS, Op, NULL);
                 }
@@ -1014,10 +1018,10 @@
             if (Op->Asl.Parent->Asl.ExtraValue && Op->Asl.Child)
             {
                 XfCheckFieldRange (Op,
-                            Op->Asl.Parent->Asl.ExtraValue,
-                            Op->Asl.ExtraValue,
-                            (UINT32) Op->Asl.Child->Asl.Value.Integer,
-                            Op->Asl.Child->Asl.ExtraValue);
+                    Op->Asl.Parent->Asl.ExtraValue,
+                    Op->Asl.ExtraValue,
+                    (UINT32) Op->Asl.Child->Asl.Value.Integer,
+                    Op->Asl.Child->Asl.ExtraValue);
             }
         }
     }
--- a/sys/external/bsd/acpica/dist/compiler/dtcompile.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/dtcompile.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -346,7 +346,7 @@
     DtInsertCompilerIds (*FieldList);
 
     Status = DtCompileTable (FieldList, AcpiDmTableInfoHeader,
-                &Gbl_RootTable, TRUE);
+        &Gbl_RootTable, TRUE);
     if (ACPI_FAILURE (Status))
     {
         return (Status);
@@ -383,7 +383,7 @@
 
         Subtable = NULL;
         Status = DtCompileTable (FieldList, TableData->TableInfo,
-                    &Subtable, TRUE);
+            &Subtable, TRUE);
         if (ACPI_FAILURE (Status))
         {
             return (Status);
@@ -640,6 +640,57 @@
 
 /******************************************************************************
  *
+ * FUNCTION:    DtCompileTwoSubtables
+ *
+ * PARAMETERS:  List                - Current field list pointer
+ *              TableInfo1          - Info table 1
+ *              TableInfo1          - Info table 2
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Compile tables with a header and one or more same subtables.
+ *              Include CPEP, EINJ, ERST, MCFG, MSCT, WDAT
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileTwoSubtables (
+    void                    **List,
+    ACPI_DMTABLE_INFO       *TableInfo1,
+    ACPI_DMTABLE_INFO       *TableInfo2)
+{
+    ACPI_STATUS             Status;
+    DT_SUBTABLE             *Subtable;
+    DT_SUBTABLE             *ParentTable;
+    DT_FIELD                **PFieldList = (DT_FIELD **) List;
+
+
+    Status = DtCompileTable (PFieldList, TableInfo1, &Subtable, TRUE);
+    if (ACPI_FAILURE (Status))
+    {
+        return (Status);
+    }
+
+    ParentTable = DtPeekSubtable ();
+    DtInsertSubtable (ParentTable, Subtable);
+
+    while (*PFieldList)
+    {
+        Status = DtCompileTable (PFieldList, TableInfo2, &Subtable, FALSE);
+        if (ACPI_FAILURE (Status))
+        {
+            return (Status);
+        }
+
+        DtInsertSubtable (ParentTable, Subtable);
+    }
+
+    return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
  * FUNCTION:    DtCompilePadding
  *
  * PARAMETERS:  Length              - Padding field size
--- a/sys/external/bsd/acpica/dist/compiler/dtfield.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/dtfield.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -99,6 +99,7 @@
 {
     ACPI_STATUS             Status;
 
+
     switch (Type)
     {
     case DT_FIELD_TYPE_INTEGER:
--- a/sys/external/bsd/acpica/dist/compiler/dtparser.y	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/dtparser.y	Sat Jan 09 21:14:12 2016 +0000
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
--- a/sys/external/bsd/acpica/dist/compiler/dtsubtable.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/dtsubtable.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
--- a/sys/external/bsd/acpica/dist/compiler/dttable.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/dttable.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,7 @@
  * POSSIBILITY OF SUCH DAMAGES.
  */
 
-/* Compile all complex data tables */
+/* Compile routines for the basic ACPI tables */
 
 #include "aslcompiler.h"
 #include "dtcompiler.h"
@@ -50,58 +50,90 @@
         ACPI_MODULE_NAME    ("dttable")
 
 
-/* TBD: merge these into dmtbinfo.c? */
+/******************************************************************************
+ *
+ * FUNCTION:    DtCompileRsdp
+ *
+ * PARAMETERS:  PFieldList          - Current field list pointer
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Compile RSDP.
+ *
+ *****************************************************************************/
 
-static ACPI_DMTABLE_INFO           TableInfoAsfAddress[] =
+ACPI_STATUS
+DtCompileRsdp (
+    DT_FIELD                **PFieldList)
 {
-    {ACPI_DMT_BUFFER,   0,               "Addresses", 0},
-    {ACPI_DMT_EXIT,     0,               NULL, 0}
-};
-
-static ACPI_DMTABLE_INFO           TableInfoDmarPciPath[] =
-{
-    {ACPI_DMT_PCI_PATH, 0,               "PCI Path", 0},
-    {ACPI_DMT_EXIT,     0,               NULL, 0}
-};
+    DT_SUBTABLE             *Subtable;
+    ACPI_TABLE_RSDP         *Rsdp;
+    ACPI_RSDP_EXTENSION     *RsdpExtension;
+    ACPI_STATUS             Status;
 
 
-/* Local prototypes */
+    /* Compile the "common" RSDP (ACPI 1.0) */
+
+    Status = DtCompileTable (PFieldList, AcpiDmTableInfoRsdp1,
+        &Gbl_RootTable, TRUE);
+    if (ACPI_FAILURE (Status))
+    {
+        return (Status);
+    }
+
+    Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Gbl_RootTable->Buffer);
+    DtSetTableChecksum (&Rsdp->Checksum);
+
+    if (Rsdp->Revision > 0)
+    {
+        /* Compile the "extended" part of the RSDP as a subtable */
 
-static ACPI_STATUS
-DtCompileTwoSubtables (
-    void                    **List,
-    ACPI_DMTABLE_INFO       *TableInfo1,
-    ACPI_DMTABLE_INFO       *TableInfo2);
+        Status = DtCompileTable (PFieldList, AcpiDmTableInfoRsdp2,
+            &Subtable, TRUE);
+        if (ACPI_FAILURE (Status))
+        {
+            return (Status);
+        }
+
+        DtInsertSubtable (Gbl_RootTable, Subtable);
+
+        /* Set length and extended checksum for entire RSDP */
+
+        RsdpExtension = ACPI_CAST_PTR (ACPI_RSDP_EXTENSION, Subtable->Buffer);
+        RsdpExtension->Length = Gbl_RootTable->Length + Subtable->Length;
+        DtSetTableChecksum (&RsdpExtension->ExtendedChecksum);
+    }
+
+    return (AE_OK);
+}
 
 
 /******************************************************************************
  *
- * FUNCTION:    DtCompileTwoSubtables
+ * FUNCTION:    DtCompileFadt
  *
  * PARAMETERS:  List                - Current field list pointer
- *              TableInfo1          - Info table 1
- *              TableInfo1          - Info table 2
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Compile tables with a header and one or more same subtables.
- *              Include CPEP, EINJ, ERST, MCFG, MSCT, WDAT
+ * DESCRIPTION: Compile FADT.
  *
  *****************************************************************************/
 
-static ACPI_STATUS
-DtCompileTwoSubtables (
-    void                    **List,
-    ACPI_DMTABLE_INFO       *TableInfo1,
-    ACPI_DMTABLE_INFO       *TableInfo2)
+ACPI_STATUS
+DtCompileFadt (
+    void                    **List)
 {
     ACPI_STATUS             Status;
     DT_SUBTABLE             *Subtable;
     DT_SUBTABLE             *ParentTable;
     DT_FIELD                **PFieldList = (DT_FIELD **) List;
+    ACPI_TABLE_HEADER       *Table;
+    UINT8                   Revision;
 
 
-    Status = DtCompileTable (PFieldList, TableInfo1, &Subtable, TRUE);
+    Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt1,
+        &Subtable, TRUE);
     if (ACPI_FAILURE (Status))
     {
         return (Status);
@@ -110,15 +142,54 @@
     ParentTable = DtPeekSubtable ();
     DtInsertSubtable (ParentTable, Subtable);
 
-    while (*PFieldList)
+    Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer);
+    Revision = Table->Revision;
+
+    if (Revision == 2)
     {
-        Status = DtCompileTable (PFieldList, TableInfo2, &Subtable, FALSE);
+        Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt2,
+            &Subtable, TRUE);
+        if (ACPI_FAILURE (Status))
+        {
+            return (Status);
+        }
+
+        DtInsertSubtable (ParentTable, Subtable);
+    }
+    else if (Revision >= 2)
+    {
+        Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt3,
+            &Subtable, TRUE);
         if (ACPI_FAILURE (Status))
         {
             return (Status);
         }
 
         DtInsertSubtable (ParentTable, Subtable);
+
+        if (Revision >= 5)
+        {
+            Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt5,
+                &Subtable, TRUE);
+            if (ACPI_FAILURE (Status))
+            {
+                return (Status);
+            }
+
+            DtInsertSubtable (ParentTable, Subtable);
+        }
+
+        if (Revision >= 6)
+        {
+            Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt6,
+                &Subtable, TRUE);
+            if (ACPI_FAILURE (Status))
+            {
+                return (Status);
+            }
+
+            DtInsertSubtable (ParentTable, Subtable);
+        }
     }
 
     return (AE_OK);
@@ -148,7 +219,7 @@
 
 
     Status = DtCompileTable (PFieldList, AcpiDmTableInfoFacs,
-                &Gbl_RootTable, TRUE);
+        &Gbl_RootTable, TRUE);
     if (ACPI_FAILURE (Status))
     {
         return (Status);
@@ -165,3360 +236,3 @@
     DtInsertSubtable (Gbl_RootTable, Subtable);
     return (AE_OK);
 }
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileRsdp
- *
- * PARAMETERS:  PFieldList          - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile RSDP.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileRsdp (
-    DT_FIELD                **PFieldList)
-{
-    DT_SUBTABLE             *Subtable;
-    ACPI_TABLE_RSDP         *Rsdp;
-    ACPI_RSDP_EXTENSION     *RsdpExtension;
-    ACPI_STATUS             Status;
-
-
-    /* Compile the "common" RSDP (ACPI 1.0) */
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoRsdp1,
-                &Gbl_RootTable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Gbl_RootTable->Buffer);
-    DtSetTableChecksum (&Rsdp->Checksum);
-
-    if (Rsdp->Revision > 0)
-    {
-        /* Compile the "extended" part of the RSDP as a subtable */
-
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoRsdp2,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        DtInsertSubtable (Gbl_RootTable, Subtable);
-
-        /* Set length and extended checksum for entire RSDP */
-
-        RsdpExtension = ACPI_CAST_PTR (ACPI_RSDP_EXTENSION, Subtable->Buffer);
-        RsdpExtension->Length = Gbl_RootTable->Length + Subtable->Length;
-        DtSetTableChecksum (&RsdpExtension->ExtendedChecksum);
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileAsf
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile ASF!.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileAsf (
-    void                    **List)
-{
-    ACPI_ASF_INFO           *AsfTable;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    ACPI_DMTABLE_INFO       *InfoTable;
-    ACPI_DMTABLE_INFO       *DataInfoTable = NULL;
-    UINT32                  DataCount = 0;
-    ACPI_STATUS             Status;
-    UINT32                  i;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    DT_FIELD                *SubtableStart;
-
-
-    while (*PFieldList)
-    {
-        SubtableStart = *PFieldList;
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoAsfHdr,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPushSubtable (Subtable);
-
-        AsfTable = ACPI_CAST_PTR (ACPI_ASF_INFO, Subtable->Buffer);
-
-        switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */
-        {
-        case ACPI_ASF_TYPE_INFO:
-
-            InfoTable = AcpiDmTableInfoAsf0;
-            break;
-
-        case ACPI_ASF_TYPE_ALERT:
-
-            InfoTable = AcpiDmTableInfoAsf1;
-            break;
-
-        case ACPI_ASF_TYPE_CONTROL:
-
-            InfoTable = AcpiDmTableInfoAsf2;
-            break;
-
-        case ACPI_ASF_TYPE_BOOT:
-
-            InfoTable = AcpiDmTableInfoAsf3;
-            break;
-
-        case ACPI_ASF_TYPE_ADDRESS:
-
-            InfoTable = AcpiDmTableInfoAsf4;
-            break;
-
-        default:
-
-            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!");
-            return (AE_ERROR);
-        }
-
-        Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-
-        switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */
-        {
-        case ACPI_ASF_TYPE_INFO:
-
-            DataInfoTable = NULL;
-            break;
-
-        case ACPI_ASF_TYPE_ALERT:
-
-            DataInfoTable = AcpiDmTableInfoAsf1a;
-            DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT,
-                        ACPI_SUB_PTR (UINT8, Subtable->Buffer,
-                            sizeof (ACPI_ASF_HEADER)))->Alerts;
-            break;
-
-        case ACPI_ASF_TYPE_CONTROL:
-
-            DataInfoTable = AcpiDmTableInfoAsf2a;
-            DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE,
-                        ACPI_SUB_PTR (UINT8, Subtable->Buffer,
-                            sizeof (ACPI_ASF_HEADER)))->Controls;
-            break;
-
-        case ACPI_ASF_TYPE_BOOT:
-
-            DataInfoTable = NULL;
-            break;
-
-        case ACPI_ASF_TYPE_ADDRESS:
-
-            DataInfoTable = TableInfoAsfAddress;
-            DataCount = ACPI_CAST_PTR (ACPI_ASF_ADDRESS,
-                        ACPI_SUB_PTR (UINT8, Subtable->Buffer,
-                            sizeof (ACPI_ASF_HEADER)))->Devices;
-            break;
-
-        default:
-
-            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!");
-            return (AE_ERROR);
-        }
-
-        if (DataInfoTable)
-        {
-            switch (AsfTable->Header.Type & 0x7F)
-            {
-            case ACPI_ASF_TYPE_ADDRESS:
-
-                while (DataCount > 0)
-                {
-                    Status = DtCompileTable (PFieldList, DataInfoTable,
-                                &Subtable, TRUE);
-                    if (ACPI_FAILURE (Status))
-                    {
-                        return (Status);
-                    }
-
-                    DtInsertSubtable (ParentTable, Subtable);
-                    DataCount = DataCount - Subtable->Length;
-                }
-                break;
-
-            default:
-
-                for (i = 0; i < DataCount; i++)
-                {
-                    Status = DtCompileTable (PFieldList, DataInfoTable,
-                                &Subtable, TRUE);
-                    if (ACPI_FAILURE (Status))
-                    {
-                        return (Status);
-                    }
-
-                    DtInsertSubtable (ParentTable, Subtable);
-                }
-                break;
-            }
-        }
-
-        DtPopSubtable ();
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileCpep
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile CPEP.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileCpep (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-
-
-    Status = DtCompileTwoSubtables (List,
-                 AcpiDmTableInfoCpep, AcpiDmTableInfoCpep0);
-    return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileCsrt
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile CSRT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileCsrt (
-    void                    **List)
-{
-    ACPI_STATUS             Status = AE_OK;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    UINT32                  DescriptorCount;
-    UINT32                  GroupLength;
-
-
-    /* Subtables (Resource Groups) */
-
-    ParentTable = DtPeekSubtable ();
-    while (*PFieldList)
-    {
-        /* Resource group subtable */
-
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt0,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        /* Compute the number of resource descriptors */
-
-        GroupLength =
-            (ACPI_CAST_PTR (ACPI_CSRT_GROUP,
-                Subtable->Buffer))->Length -
-            (ACPI_CAST_PTR (ACPI_CSRT_GROUP,
-                Subtable->Buffer))->SharedInfoLength -
-            sizeof (ACPI_CSRT_GROUP);
-
-        DescriptorCount = (GroupLength  /
-            sizeof (ACPI_CSRT_DESCRIPTOR));
-
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPushSubtable (Subtable);
-        ParentTable = DtPeekSubtable ();
-
-        /* Shared info subtable (One per resource group) */
-
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt1,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        DtInsertSubtable (ParentTable, Subtable);
-
-        /* Sub-Subtables (Resource Descriptors) */
-
-        while (*PFieldList && DescriptorCount)
-        {
-
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt2,
-                        &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-            DtInsertSubtable (ParentTable, Subtable);
-
-            DtPushSubtable (Subtable);
-            ParentTable = DtPeekSubtable ();
-            if (*PFieldList)
-            {
-                Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt2a,
-                            &Subtable, TRUE);
-                if (ACPI_FAILURE (Status))
-                {
-                    return (Status);
-                }
-                if (Subtable)
-                {
-                    DtInsertSubtable (ParentTable, Subtable);
-                }
-            }
-            DtPopSubtable ();
-            ParentTable = DtPeekSubtable ();
-
-            DescriptorCount--;
-        }
-
-        DtPopSubtable ();
-        ParentTable = DtPeekSubtable ();
-    }
-
-    return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileDbg2
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile DBG2.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileDbg2 (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    UINT32                  SubtableCount;
-    ACPI_DBG2_HEADER        *Dbg2Header;
-    ACPI_DBG2_DEVICE        *DeviceInfo;
-    UINT16                  CurrentOffset;
-    UINT32                  i;
-
-
-    /* Main table */
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2, &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-
-    /* Main table fields */
-
-    Dbg2Header = ACPI_CAST_PTR (ACPI_DBG2_HEADER, Subtable->Buffer);
-    Dbg2Header->InfoOffset = sizeof (ACPI_TABLE_HEADER) + ACPI_PTR_DIFF (
-        ACPI_ADD_PTR (UINT8, Dbg2Header, sizeof (ACPI_DBG2_HEADER)), Dbg2Header);
-
-    SubtableCount = Dbg2Header->InfoCount;
-    DtPushSubtable (Subtable);
-
-    /* Process all Device Information subtables (Count = InfoCount) */
-
-    while (*PFieldList && SubtableCount)
-    {
-        /* Subtable: Debug Device Information */
-
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Device,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        DeviceInfo = ACPI_CAST_PTR (ACPI_DBG2_DEVICE, Subtable->Buffer);
-        CurrentOffset = (UINT16) sizeof (ACPI_DBG2_DEVICE);
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPushSubtable (Subtable);
-
-        ParentTable = DtPeekSubtable ();
-
-        /* BaseAddressRegister GAS array (Required, size is RegisterCount) */
-
-        DeviceInfo->BaseAddressOffset = CurrentOffset;
-        for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
-        {
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Addr,
-                        &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-
-            CurrentOffset += (UINT16) sizeof (ACPI_GENERIC_ADDRESS);
-            DtInsertSubtable (ParentTable, Subtable);
-        }
-
-        /* AddressSize array (Required, size = RegisterCount) */
-
-        DeviceInfo->AddressSizeOffset = CurrentOffset;
-        for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
-        {
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Size,
-                        &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-
-            CurrentOffset += (UINT16) sizeof (UINT32);
-            DtInsertSubtable (ParentTable, Subtable);
-        }
-
-        /* NamespaceString device identifier (Required, size = NamePathLength) */
-
-        DeviceInfo->NamepathOffset = CurrentOffset;
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Name,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        /* Update the device info header */
-
-        DeviceInfo->NamepathLength = (UINT16) Subtable->Length;
-        CurrentOffset += (UINT16) DeviceInfo->NamepathLength;
-        DtInsertSubtable (ParentTable, Subtable);
-
-        /* OemData - Variable-length data (Optional, size = OemDataLength) */
-
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2OemData,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        /* Update the device info header (zeros if no OEM data present) */
-
-        DeviceInfo->OemDataOffset = 0;
-        DeviceInfo->OemDataLength = 0;
-
-        /* Optional subtable (OemData) */
-
-        if (Subtable && Subtable->Length)
-        {
-            DeviceInfo->OemDataOffset = CurrentOffset;
-            DeviceInfo->OemDataLength = (UINT16) Subtable->Length;
-
-            DtInsertSubtable (ParentTable, Subtable);
-        }
-
-        SubtableCount--;
-        DtPopSubtable (); /* Get next Device Information subtable */
-    }
-
-    DtPopSubtable ();
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileDmar
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile DMAR.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileDmar (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    DT_FIELD                *SubtableStart;
-    ACPI_DMTABLE_INFO       *InfoTable;
-    ACPI_DMAR_HEADER        *DmarHeader;
-    ACPI_DMAR_DEVICE_SCOPE  *DmarDeviceScope;
-    UINT32                  DeviceScopeLength;
-    UINT32                  PciPathLength;
-
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmar, &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-    DtPushSubtable (Subtable);
-
-    while (*PFieldList)
-    {
-        /* DMAR Header */
-
-        SubtableStart = *PFieldList;
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarHdr,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPushSubtable (Subtable);
-
-        DmarHeader = ACPI_CAST_PTR (ACPI_DMAR_HEADER, Subtable->Buffer);
-
-        switch (DmarHeader->Type)
-        {
-        case ACPI_DMAR_TYPE_HARDWARE_UNIT:
-
-            InfoTable = AcpiDmTableInfoDmar0;
-            break;
-
-        case ACPI_DMAR_TYPE_RESERVED_MEMORY:
-
-            InfoTable = AcpiDmTableInfoDmar1;
-            break;
-
-        case ACPI_DMAR_TYPE_ROOT_ATS:
-
-            InfoTable = AcpiDmTableInfoDmar2;
-            break;
-
-        case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
-
-            InfoTable = AcpiDmTableInfoDmar3;
-            break;
-
-        case ACPI_DMAR_TYPE_NAMESPACE:
-
-            InfoTable = AcpiDmTableInfoDmar4;
-            break;
-
-        default:
-
-            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "DMAR");
-            return (AE_ERROR);
-        }
-
-        /* DMAR Subtable */
-
-        Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-
-        /*
-         * Optional Device Scope subtables
-         */
-        if ((DmarHeader->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
-            (DmarHeader->Type == ACPI_DMAR_TYPE_NAMESPACE))
-        {
-            /* These types do not support device scopes */
-
-            DtPopSubtable ();
-            continue;
-        }
-
-        DtPushSubtable (Subtable);
-        DeviceScopeLength = DmarHeader->Length - Subtable->Length -
-            ParentTable->Length;
-        while (DeviceScopeLength)
-        {
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarScope,
-                        &Subtable, FALSE);
-            if (Status == AE_NOT_FOUND)
-            {
-                break;
-            }
-
-            ParentTable = DtPeekSubtable ();
-            DtInsertSubtable (ParentTable, Subtable);
-            DtPushSubtable (Subtable);
-
-            DmarDeviceScope = ACPI_CAST_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable->Buffer);
-
-            /* Optional PCI Paths */
-
-            PciPathLength = DmarDeviceScope->Length - Subtable->Length;
-            while (PciPathLength)
-            {
-                Status = DtCompileTable (PFieldList, TableInfoDmarPciPath,
-                            &Subtable, FALSE);
-                if (Status == AE_NOT_FOUND)
-                {
-                    DtPopSubtable ();
-                    break;
-                }
-
-                ParentTable = DtPeekSubtable ();
-                DtInsertSubtable (ParentTable, Subtable);
-                PciPathLength -= Subtable->Length;
-            }
-
-            DtPopSubtable ();
-            DeviceScopeLength -= DmarDeviceScope->Length;
-        }
-
-        DtPopSubtable ();
-        DtPopSubtable ();
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileDrtm
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile DRTM.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileDrtm (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    UINT32                  Count;
-    /* ACPI_TABLE_DRTM         *Drtm; */
-    ACPI_DRTM_VTABLE_LIST   *DrtmVtl;
-    ACPI_DRTM_RESOURCE_LIST *DrtmRl;
-    /* ACPI_DRTM_DPS_ID        *DrtmDps; */
-
-
-    ParentTable = DtPeekSubtable ();
-
-    /* Compile DRTM header */
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-    DtInsertSubtable (ParentTable, Subtable);
-
-    /*
-     * Using ACPI_SUB_PTR, We needn't define a seperate structure. Care
-     * should be taken to avoid accessing ACPI_TABLE_HADER fields.
-     */
-#if 0
-    Drtm = ACPI_SUB_PTR (ACPI_TABLE_DRTM,
-                    Subtable->Buffer, sizeof (ACPI_TABLE_HEADER));
-#endif
-    /* Compile VTL */
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm0,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-    DtInsertSubtable (ParentTable, Subtable);
-    DrtmVtl = ACPI_CAST_PTR (ACPI_DRTM_VTABLE_LIST, Subtable->Buffer);
-
-    DtPushSubtable (Subtable);
-    ParentTable = DtPeekSubtable ();
-    Count = 0;
-    while (*PFieldList)
-    {
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm0a,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-        if (!Subtable)
-        {
-            break;
-        }
-        DtInsertSubtable (ParentTable, Subtable);
-        Count++;
-    }
-    DrtmVtl->ValidatedTableCount = Count;
-    DtPopSubtable ();
-    ParentTable = DtPeekSubtable ();
-
-    /* Compile RL */
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm1,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-    DtInsertSubtable (ParentTable, Subtable);
-    DrtmRl = ACPI_CAST_PTR (ACPI_DRTM_RESOURCE_LIST, Subtable->Buffer);
-
-    DtPushSubtable (Subtable);
-    ParentTable = DtPeekSubtable ();
-    Count = 0;
-    while (*PFieldList)
-    {
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm1a,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-        if (!Subtable)
-        {
-            break;
-        }
-        DtInsertSubtable (ParentTable, Subtable);
-        Count++;
-    }
-    DrtmRl->ResourceCount = Count;
-    DtPopSubtable ();
-    ParentTable = DtPeekSubtable ();
-
-    /* Compile DPS */
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm2,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-    DtInsertSubtable (ParentTable, Subtable);
-    /* DrtmDps = ACPI_CAST_PTR (ACPI_DRTM_DPS_ID, Subtable->Buffer);*/
-
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileEinj
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile EINJ.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileEinj (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-
-
-    Status = DtCompileTwoSubtables (List,
-                 AcpiDmTableInfoEinj, AcpiDmTableInfoEinj0);
-    return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileErst
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile ERST.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileErst (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-
-
-    Status = DtCompileTwoSubtables (List,
-                 AcpiDmTableInfoErst, AcpiDmTableInfoEinj0);
-    return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileFadt
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile FADT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileFadt (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    ACPI_TABLE_HEADER       *Table;
-    UINT8                   Revision;
-
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt1,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-
-    Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer);
-    Revision = Table->Revision;
-
-    if (Revision == 2)
-    {
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt2,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        DtInsertSubtable (ParentTable, Subtable);
-    }
-    else if (Revision >= 2)
-    {
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt3,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        DtInsertSubtable (ParentTable, Subtable);
-
-        if (Revision >= 5)
-        {
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt5,
-                        &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-
-            DtInsertSubtable (ParentTable, Subtable);
-        }
-
-        if (Revision >= 6)
-        {
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt6,
-                        &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-
-            DtInsertSubtable (ParentTable, Subtable);
-        }
-    }
-
-    return (AE_OK);
-}
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileGtdt
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile GTDT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileGtdt (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    DT_FIELD                *SubtableStart;
-    ACPI_SUBTABLE_HEADER    *GtdtHeader;
-    ACPI_DMTABLE_INFO       *InfoTable;
-    UINT32                  GtCount;
-
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-
-    while (*PFieldList)
-    {
-        SubtableStart = *PFieldList;
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdtHdr,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPushSubtable (Subtable);
-
-        GtdtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
-
-        switch (GtdtHeader->Type)
-        {
-        case ACPI_GTDT_TYPE_TIMER_BLOCK:
-
-            InfoTable = AcpiDmTableInfoGtdt0;
-            break;
-
-        case ACPI_GTDT_TYPE_WATCHDOG:
-
-            InfoTable = AcpiDmTableInfoGtdt1;
-            break;
-
-        default:
-
-            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "GTDT");
-            return (AE_ERROR);
-        }
-
-        Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-
-        /*
-         * Additional GT block subtable data
-         */
-
-        switch (GtdtHeader->Type)
-        {
-        case ACPI_GTDT_TYPE_TIMER_BLOCK:
-
-            DtPushSubtable (Subtable);
-            ParentTable = DtPeekSubtable ();
-
-            GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
-                Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
-            while (GtCount)
-            {
-                Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt0a,
-                            &Subtable, TRUE);
-                if (ACPI_FAILURE (Status))
-                {
-                    return (Status);
-                }
-
-
-                DtInsertSubtable (ParentTable, Subtable);
-                GtCount--;
-            }
-            DtPopSubtable ();
-            break;
-
-        default:
-
-            break;
-        }
-
-        DtPopSubtable ();
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileFpdt
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile FPDT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileFpdt (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    ACPI_FPDT_HEADER        *FpdtHeader;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    ACPI_DMTABLE_INFO       *InfoTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    DT_FIELD                *SubtableStart;
-
-
-    while (*PFieldList)
-    {
-        SubtableStart = *PFieldList;
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoFpdtHdr,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPushSubtable (Subtable);
-
-        FpdtHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
-
-        switch (FpdtHeader->Type)
-        {
-        case ACPI_FPDT_TYPE_BOOT:
-
-            InfoTable = AcpiDmTableInfoFpdt0;
-            break;
-
-        case ACPI_FPDT_TYPE_S3PERF:
-
-            InfoTable = AcpiDmTableInfoFpdt1;
-            break;
-
-        default:
-
-            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "FPDT");
-            return (AE_ERROR);
-            break;
-        }
-
-        Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPopSubtable ();
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileHest
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile HEST.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileHest (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    DT_FIELD                *SubtableStart;
-    ACPI_DMTABLE_INFO       *InfoTable;
-    UINT16                  Type;
-    UINT32                  BankCount;
-
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoHest,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-
-    while (*PFieldList)
-    {
-        /* Get subtable type */
-
-        SubtableStart = *PFieldList;
-        DtCompileInteger ((UINT8 *) &Type, *PFieldList, 2, 0);
-
-        switch (Type)
-        {
-        case ACPI_HEST_TYPE_IA32_CHECK:
-
-            InfoTable = AcpiDmTableInfoHest0;
-            break;
-
-        case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
-
-            InfoTable = AcpiDmTableInfoHest1;
-            break;
-
-        case ACPI_HEST_TYPE_IA32_NMI:
-
-            InfoTable = AcpiDmTableInfoHest2;
-            break;
-
-        case ACPI_HEST_TYPE_AER_ROOT_PORT:
-
-            InfoTable = AcpiDmTableInfoHest6;
-            break;
-
-        case ACPI_HEST_TYPE_AER_ENDPOINT:
-
-            InfoTable = AcpiDmTableInfoHest7;
-            break;
-
-        case ACPI_HEST_TYPE_AER_BRIDGE:
-
-            InfoTable = AcpiDmTableInfoHest8;
-            break;
-
-        case ACPI_HEST_TYPE_GENERIC_ERROR:
-
-            InfoTable = AcpiDmTableInfoHest9;
-            break;
-
-        default:
-
-            /* Cannot continue on unknown type */
-
-            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "HEST");
-            return (AE_ERROR);
-        }
-
-        Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        DtInsertSubtable (ParentTable, Subtable);
-
-        /*
-         * Additional subtable data - IA32 Error Bank(s)
-         */
-        BankCount = 0;
-        switch (Type)
-        {
-        case ACPI_HEST_TYPE_IA32_CHECK:
-
-            BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
-                            Subtable->Buffer))->NumHardwareBanks;
-            break;
-
-        case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
-
-            BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
-                            Subtable->Buffer))->NumHardwareBanks;
-            break;
-
-        default:
-
-            break;
-        }
-
-        while (BankCount)
-        {
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoHestBank,
-                        &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-
-            DtInsertSubtable (ParentTable, Subtable);
-            BankCount--;
-        }
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileIort
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile IORT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileIort (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    DT_FIELD                *SubtableStart;
-    ACPI_TABLE_IORT         *Iort;
-    ACPI_IORT_NODE          *IortNode;
-    ACPI_IORT_ITS_GROUP     *IortItsGroup;
-    ACPI_IORT_SMMU          *IortSmmu;
-    UINT32                  NodeNumber;
-    UINT32                  NodeLength;
-    UINT32                  IdMappingNumber;
-    UINT32                  ItsNumber;
-    UINT32                  ContextIrptNumber;
-    UINT32                  PmuIrptNumber;
-    UINT32                  PaddingLength;
-
-
-    ParentTable = DtPeekSubtable ();
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-    DtInsertSubtable (ParentTable, Subtable);
-
-    /*
-     * Using ACPI_SUB_PTR, We needn't define a seperate structure. Care
-     * should be taken to avoid accessing ACPI_TABLE_HADER fields.
-     */
-    Iort = ACPI_SUB_PTR (ACPI_TABLE_IORT,
-                    Subtable->Buffer, sizeof (ACPI_TABLE_HEADER));
-
-    /*
-     * OptionalPadding - Variable-length data
-     * (Optional, size = OffsetToNodes - sizeof (ACPI_TABLE_IORT))
-     * Optionally allows the generic data types to be used for filling
-     * this field.
-     */
-    Iort->NodeOffset = sizeof (ACPI_TABLE_IORT);
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortPad,
-                    &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-    if (Subtable)
-    {
-        DtInsertSubtable (ParentTable, Subtable);
-        Iort->NodeOffset += Subtable->Length;
-    }
-    else
-    {
-        Status = DtCompileGeneric (ACPI_CAST_PTR (void *, PFieldList),
-                    AcpiDmTableInfoIortHdr[0].Name, &PaddingLength);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-        Iort->NodeOffset += PaddingLength;
-    }
-
-    NodeNumber = 0;
-    while (*PFieldList)
-    {
-        SubtableStart = *PFieldList;
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortHdr,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-        DtInsertSubtable (ParentTable, Subtable);
-        IortNode = ACPI_CAST_PTR (ACPI_IORT_NODE, Subtable->Buffer);
-        NodeLength = ACPI_OFFSET (ACPI_IORT_NODE, NodeData);
-
-        DtPushSubtable (Subtable);
-        ParentTable = DtPeekSubtable ();
-
-        switch (IortNode->Type)
-        {
-        case ACPI_IORT_NODE_ITS_GROUP:
-
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort0,
-                        &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-            DtInsertSubtable (ParentTable, Subtable);
-            IortItsGroup = ACPI_CAST_PTR (ACPI_IORT_ITS_GROUP, Subtable->Buffer);
-            NodeLength += Subtable->Length;
-
-            ItsNumber = 0;
-            while (*PFieldList)
-            {
-                Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort0a,
-                            &Subtable, TRUE);
-                if (ACPI_FAILURE (Status))
-                {
-                    return (Status);
-                }
-                if (!Subtable)
-                {
-                    break;
-                }
-                DtInsertSubtable (ParentTable, Subtable);
-                NodeLength += Subtable->Length;
-                ItsNumber++;
-            }
-
-            IortItsGroup->ItsCount = ItsNumber;
-            break;
-
-        case ACPI_IORT_NODE_NAMED_COMPONENT:
-
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort1,
-                        &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-            DtInsertSubtable (ParentTable, Subtable);
-            NodeLength += Subtable->Length;
-
-            /*
-             * Padding - Variable-length data
-             * Optionally allows the offset of the ID mappings to be used
-             * for filling this field.
-             */
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort1a,
-                            &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-            if (Subtable)
-            {
-                DtInsertSubtable (ParentTable, Subtable);
-                NodeLength += Subtable->Length;
-            }
-            else
-            {
-                if (NodeLength > IortNode->MappingOffset)
-                {
-                    return (AE_BAD_DATA);
-                }
-                if (NodeLength < IortNode->MappingOffset)
-                {
-                    Status = DtCompilePadding (
-                                IortNode->MappingOffset - NodeLength,
-                                &Subtable);
-                    if (ACPI_FAILURE (Status))
-                    {
-                        return (Status);
-                    }
-                    DtInsertSubtable (ParentTable, Subtable);
-                    NodeLength = IortNode->MappingOffset;
-                }
-            }
-            break;
-
-        case ACPI_IORT_NODE_PCI_ROOT_COMPLEX:
-
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort2,
-                        &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-            DtInsertSubtable (ParentTable, Subtable);
-            NodeLength += Subtable->Length;
-            break;
-
-        case ACPI_IORT_NODE_SMMU:
-
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3,
-                        &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-            DtInsertSubtable (ParentTable, Subtable);
-            IortSmmu = ACPI_CAST_PTR (ACPI_IORT_SMMU, Subtable->Buffer);
-            NodeLength += Subtable->Length;
-
-            /* Compile global interrupt array */
-
-            IortSmmu->GlobalInterruptOffset = NodeLength;
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3a,
-                        &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-            DtInsertSubtable (ParentTable, Subtable);
-            NodeLength += Subtable->Length;
-
-            /* Compile context interrupt array */
-
-            ContextIrptNumber = 0;
-            IortSmmu->ContextInterruptOffset = NodeLength;
-            while (*PFieldList)
-            {
-                Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3b,
-                            &Subtable, TRUE);
-                if (ACPI_FAILURE (Status))
-                {
-                    return (Status);
-                }
-                if (!Subtable)
-                {
-                    break;
-                }
-                DtInsertSubtable (ParentTable, Subtable);
-                NodeLength += Subtable->Length;
-                ContextIrptNumber++;
-            }
-            IortSmmu->ContextInterruptCount = ContextIrptNumber;
-
-            /* Compile PMU interrupt array */
-
-            PmuIrptNumber = 0;
-            IortSmmu->PmuInterruptOffset = NodeLength;
-            while (*PFieldList)
-            {
-                Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3c,
-                            &Subtable, TRUE);
-                if (ACPI_FAILURE (Status))
-                {
-                    return (Status);
-                }
-                if (!Subtable)
-                {
-                    break;
-                }
-                DtInsertSubtable (ParentTable, Subtable);
-                NodeLength += Subtable->Length;
-                PmuIrptNumber++;
-            }
-            IortSmmu->PmuInterruptCount = PmuIrptNumber;
-            break;
-
-        default:
-
-            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IORT");
-            return (AE_ERROR);
-        }
-
-        /* Compile Array of ID mappings */
-
-        IortNode->MappingOffset = NodeLength;
-        IdMappingNumber = 0;
-        while (*PFieldList)
-        {
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortMap,
-                        &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-            if (!Subtable)
-            {
-                break;
-            }
-            DtInsertSubtable (ParentTable, Subtable);
-            NodeLength += sizeof (ACPI_IORT_ID_MAPPING);
-            IdMappingNumber++;
-        }
-        IortNode->MappingCount = IdMappingNumber;
-
-        /*
-         * Node length can be determined by DT_LENGTH option
-         * IortNode->Length = NodeLength;
-         */
-        DtPopSubtable ();
-        ParentTable = DtPeekSubtable ();
-        NodeNumber++;
-    }
-    Iort->NodeCount = NodeNumber;
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileIvrs
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile IVRS.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileIvrs (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    DT_FIELD                *SubtableStart;
-    ACPI_DMTABLE_INFO       *InfoTable;
-    ACPI_IVRS_HEADER        *IvrsHeader;
-    UINT8                   EntryType;
-
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrs,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-
-    while (*PFieldList)
-    {
-        SubtableStart = *PFieldList;
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrsHdr,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPushSubtable (Subtable);
-
-        IvrsHeader = ACPI_CAST_PTR (ACPI_IVRS_HEADER, Subtable->Buffer);
-
-        switch (IvrsHeader->Type)
-        {
-        case ACPI_IVRS_TYPE_HARDWARE:
-
-            InfoTable = AcpiDmTableInfoIvrs0;
-            break;
-
-        case ACPI_IVRS_TYPE_MEMORY1:
-        case ACPI_IVRS_TYPE_MEMORY2:
-        case ACPI_IVRS_TYPE_MEMORY3:
-
-            InfoTable = AcpiDmTableInfoIvrs1;
-            break;
-
-        default:
-
-            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IVRS");
-            return (AE_ERROR);
-        }
-
-        Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-
-        if (IvrsHeader->Type == ACPI_IVRS_TYPE_HARDWARE)
-        {
-            while (*PFieldList &&
-                    !strcmp ((*PFieldList)->Name, "Entry Type"))
-            {
-                SubtableStart = *PFieldList;
-                DtCompileInteger (&EntryType, *PFieldList, 1, 0);
-
-                switch (EntryType)
-                {
-                /* 4-byte device entries */
-
-                case ACPI_IVRS_TYPE_PAD4:
-                case ACPI_IVRS_TYPE_ALL:
-                case ACPI_IVRS_TYPE_SELECT:
-                case ACPI_IVRS_TYPE_START:
-                case ACPI_IVRS_TYPE_END:
-
-                    InfoTable = AcpiDmTableInfoIvrs4;
-                    break;
-
-                /* 8-byte entries, type A */
-
-                case ACPI_IVRS_TYPE_ALIAS_SELECT:
-                case ACPI_IVRS_TYPE_ALIAS_START:
-
-                    InfoTable = AcpiDmTableInfoIvrs8a;
-                    break;
-
-                /* 8-byte entries, type B */
-
-                case ACPI_IVRS_TYPE_PAD8:
-                case ACPI_IVRS_TYPE_EXT_SELECT:
-                case ACPI_IVRS_TYPE_EXT_START:
-
-                    InfoTable = AcpiDmTableInfoIvrs8b;
-                    break;
-
-                /* 8-byte entries, type C */
-
-                case ACPI_IVRS_TYPE_SPECIAL:
-
-                    InfoTable = AcpiDmTableInfoIvrs8c;
-                    break;
-
-                default:
-
-                    DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart,
-                        "IVRS Device Entry");
-                    return (AE_ERROR);
-                }
-
-                Status = DtCompileTable (PFieldList, InfoTable,
-                            &Subtable, TRUE);
-                if (ACPI_FAILURE (Status))
-                {
-                    return (Status);
-                }
-
-                DtInsertSubtable (ParentTable, Subtable);
-            }
-        }
-
-        DtPopSubtable ();
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileLpit
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile LPIT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileLpit (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    DT_FIELD                *SubtableStart;
-    ACPI_DMTABLE_INFO       *InfoTable;
-    ACPI_LPIT_HEADER        *LpitHeader;
-
-
-    /* Note: Main table consists only of the standard ACPI table header */
-
-    while (*PFieldList)
-    {
-        SubtableStart = *PFieldList;
-
-        /* LPIT Subtable header */
-
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoLpitHdr,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPushSubtable (Subtable);
-
-        LpitHeader = ACPI_CAST_PTR (ACPI_LPIT_HEADER, Subtable->Buffer);
-
-        switch (LpitHeader->Type)
-        {
-        case ACPI_LPIT_TYPE_NATIVE_CSTATE:
-
-            InfoTable = AcpiDmTableInfoLpit0;
-            break;
-
-        default:
-
-            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "LPIT");
-            return (AE_ERROR);
-        }
-
-        /* LPIT Subtable */
-
-        Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPopSubtable ();
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileMadt
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile MADT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileMadt (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    DT_FIELD                *SubtableStart;
-    ACPI_SUBTABLE_HEADER    *MadtHeader;
-    ACPI_DMTABLE_INFO       *InfoTable;
-
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadt,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-
-    while (*PFieldList)
-    {
-        SubtableStart = *PFieldList;
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadtHdr,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPushSubtable (Subtable);
-
-        MadtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
-
-        switch (MadtHeader->Type)
-        {
-        case ACPI_MADT_TYPE_LOCAL_APIC:
-
-            InfoTable = AcpiDmTableInfoMadt0;
-            break;
-
-        case ACPI_MADT_TYPE_IO_APIC:
-
-            InfoTable = AcpiDmTableInfoMadt1;
-            break;
-
-        case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE:
-
-            InfoTable = AcpiDmTableInfoMadt2;
-            break;
-
-        case ACPI_MADT_TYPE_NMI_SOURCE:
-
-            InfoTable = AcpiDmTableInfoMadt3;
-            break;
-
-        case ACPI_MADT_TYPE_LOCAL_APIC_NMI:
-
-            InfoTable = AcpiDmTableInfoMadt4;
-            break;
-
-        case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE:
-
-            InfoTable = AcpiDmTableInfoMadt5;
-            break;
-
-        case ACPI_MADT_TYPE_IO_SAPIC:
-
-            InfoTable = AcpiDmTableInfoMadt6;
-            break;
-
-        case ACPI_MADT_TYPE_LOCAL_SAPIC:
-
-            InfoTable = AcpiDmTableInfoMadt7;
-            break;
-
-        case ACPI_MADT_TYPE_INTERRUPT_SOURCE:
-
-            InfoTable = AcpiDmTableInfoMadt8;
-            break;
-
-        case ACPI_MADT_TYPE_LOCAL_X2APIC:
-
-            InfoTable = AcpiDmTableInfoMadt9;
-            break;
-
-        case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI:
-
-            InfoTable = AcpiDmTableInfoMadt10;
-            break;
-
-        case ACPI_MADT_TYPE_GENERIC_INTERRUPT:
-
-            InfoTable = AcpiDmTableInfoMadt11;
-            break;
-
-        case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR:
-
-            InfoTable = AcpiDmTableInfoMadt12;
-            break;
-
-        case ACPI_MADT_TYPE_GENERIC_MSI_FRAME:
-
-            InfoTable = AcpiDmTableInfoMadt13;
-            break;
-
-        case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR:
-
-            InfoTable = AcpiDmTableInfoMadt14;
-            break;
-
-        case ACPI_MADT_TYPE_GENERIC_TRANSLATOR:
-
-            InfoTable = AcpiDmTableInfoMadt15;
-            break;
-
-        default:
-
-            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "MADT");
-            return (AE_ERROR);
-        }
-
-        Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPopSubtable ();
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileMcfg
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile MCFG.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileMcfg (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-
-
-    Status = DtCompileTwoSubtables (List,
-                 AcpiDmTableInfoMcfg, AcpiDmTableInfoMcfg0);
-    return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileMpst
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile MPST.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileMpst (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    ACPI_MPST_CHANNEL       *MpstChannelInfo;
-    ACPI_MPST_POWER_NODE    *MpstPowerNode;
-    ACPI_MPST_DATA_HDR      *MpstDataHeader;
-    UINT16                  SubtableCount;
-    UINT32                  PowerStateCount;
-    UINT32                  ComponentCount;
-
-
-    /* Main table */
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst, &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-    DtPushSubtable (Subtable);
-
-    MpstChannelInfo = ACPI_CAST_PTR (ACPI_MPST_CHANNEL, Subtable->Buffer);
-    SubtableCount = MpstChannelInfo->PowerNodeCount;
-
-    while (*PFieldList && SubtableCount)
-    {
-        /* Subtable: Memory Power Node(s) */
-
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPushSubtable (Subtable);
-
-        MpstPowerNode = ACPI_CAST_PTR (ACPI_MPST_POWER_NODE, Subtable->Buffer);
-        PowerStateCount = MpstPowerNode->NumPowerStates;
-        ComponentCount = MpstPowerNode->NumPhysicalComponents;
-
-        ParentTable = DtPeekSubtable ();
-
-        /* Sub-subtables - Memory Power State Structure(s) */
-
-        while (*PFieldList && PowerStateCount)
-        {
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0A,
-                        &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-
-            DtInsertSubtable (ParentTable, Subtable);
-            PowerStateCount--;
-        }
-
-        /* Sub-subtables - Physical Component ID Structure(s) */
-
-        while (*PFieldList && ComponentCount)
-        {
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0B,
-                        &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-
-            DtInsertSubtable (ParentTable, Subtable);
-            ComponentCount--;
-        }
-
-        SubtableCount--;
-        DtPopSubtable ();
-    }
-
-    /* Subtable: Count of Memory Power State Characteristic structures */
-
-    DtPopSubtable ();
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst1, &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-    DtPushSubtable (Subtable);
-
-    MpstDataHeader = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, Subtable->Buffer);
-    SubtableCount = MpstDataHeader->CharacteristicsCount;
-
-    ParentTable = DtPeekSubtable ();
-
-    /* Subtable: Memory Power State Characteristics structure(s) */
-
-    while (*PFieldList && SubtableCount)
-    {
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst2,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        DtInsertSubtable (ParentTable, Subtable);
-        SubtableCount--;
-    }
-
-    DtPopSubtable ();
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileMsct
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile MSCT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileMsct (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-
-
-    Status = DtCompileTwoSubtables (List,
-                 AcpiDmTableInfoMsct, AcpiDmTableInfoMsct0);
-    return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileMtmr
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile MTMR.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileMtmr (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-
-
-    Status = DtCompileTwoSubtables (List,
-                 AcpiDmTableInfoMtmr, AcpiDmTableInfoMtmr0);
-    return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileNfit
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile NFIT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileNfit (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    DT_FIELD                *SubtableStart;
-    ACPI_NFIT_HEADER        *NfitHeader;
-    ACPI_DMTABLE_INFO       *InfoTable;
-    UINT32                  Count;
-    ACPI_NFIT_INTERLEAVE    *Interleave = NULL;
-    ACPI_NFIT_FLUSH_ADDRESS *Hint = NULL;
-
-    /* Main table */
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-    DtPushSubtable (Subtable);
-
-    /* Subtables */
-
-    while (*PFieldList)
-    {
-        SubtableStart = *PFieldList;
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfitHdr,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPushSubtable (Subtable);
-
-        NfitHeader = ACPI_CAST_PTR (ACPI_NFIT_HEADER, Subtable->Buffer);
-
-        switch (NfitHeader->Type)
-        {
-        case ACPI_NFIT_TYPE_SYSTEM_ADDRESS:
-
-            InfoTable = AcpiDmTableInfoNfit0;
-            break;
-
-        case ACPI_NFIT_TYPE_MEMORY_MAP:
-
-            InfoTable = AcpiDmTableInfoNfit1;
-            break;
-
-        case ACPI_NFIT_TYPE_INTERLEAVE:
-
-            Interleave = ACPI_CAST_PTR (ACPI_NFIT_INTERLEAVE, Subtable->Buffer);
-            InfoTable = AcpiDmTableInfoNfit2;
-            break;
-
-        case ACPI_NFIT_TYPE_SMBIOS:
-
-            InfoTable = AcpiDmTableInfoNfit3;
-            break;
-
-        case ACPI_NFIT_TYPE_CONTROL_REGION:
-
-            InfoTable = AcpiDmTableInfoNfit4;
-            break;
-
-        case ACPI_NFIT_TYPE_DATA_REGION:
-
-            InfoTable = AcpiDmTableInfoNfit5;
-            break;
-
-        case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
-
-            Hint = ACPI_CAST_PTR (ACPI_NFIT_FLUSH_ADDRESS, Subtable->Buffer);
-            InfoTable = AcpiDmTableInfoNfit6;
-            break;
-
-        default:
-
-            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "NFIT");
-            return (AE_ERROR);
-        }
-
-        Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPopSubtable ();
-
-        switch (NfitHeader->Type)
-        {
-        case ACPI_NFIT_TYPE_INTERLEAVE:
-
-            Count = 0;
-            DtPushSubtable (Subtable);
-            while (*PFieldList)
-            {
-                Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit2a,
-                            &Subtable, FALSE);
-                if (ACPI_FAILURE (Status))
-                {
-                    return (Status);
-                }
-                if (!Subtable)
-                {
-                    DtPopSubtable ();
-                    break;
-                }
-
-                ParentTable = DtPeekSubtable ();
-                DtInsertSubtable (ParentTable, Subtable);
-                Count++;
-            }
-
-            Interleave->LineCount = Count;
-            DtPopSubtable ();
-            break;
-
-        case ACPI_NFIT_TYPE_SMBIOS:
-
-            if (*PFieldList)
-            {
-                Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit3a,
-                            &Subtable, TRUE);
-                if (ACPI_FAILURE (Status))
-                {
-                    return (Status);
-                }
-                if (Subtable)
-                {
-                    DtInsertSubtable (ParentTable, Subtable);
-                }
-            }
-            break;
-
-        case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
-
-            Count = 0;
-            DtPushSubtable (Subtable);
-            while (*PFieldList)
-            {
-                Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit6a,
-                            &Subtable, FALSE);
-                if (ACPI_FAILURE (Status))
-                {
-                    return (Status);
-                }
-                if (!Subtable)
-                {
-                    DtPopSubtable ();
-                    break;
-                }
-
-                ParentTable = DtPeekSubtable ();
-                DtInsertSubtable (ParentTable, Subtable);
-                Count++;
-            }
-
-            Hint->HintCount = (UINT16) Count;
-            DtPopSubtable ();
-            break;
-
-        default:
-            break;
-        }
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompilePcct
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile PCCT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompilePcct (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    DT_FIELD                *SubtableStart;
-    ACPI_SUBTABLE_HEADER    *PcctHeader;
-    ACPI_DMTABLE_INFO       *InfoTable;
-
-
-    /* Main table */
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcct,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-
-    /* Subtables */
-
-    while (*PFieldList)
-    {
-        SubtableStart = *PFieldList;
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcctHdr,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPushSubtable (Subtable);
-
-        PcctHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
-
-        switch (PcctHeader->Type)
-        {
-        case ACPI_PCCT_TYPE_GENERIC_SUBSPACE:
-
-            InfoTable = AcpiDmTableInfoPcct0;
-            break;
-
-        case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE:
-
-            InfoTable = AcpiDmTableInfoPcct1;
-            break;
-
-        default:
-
-            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PCCT");
-            return (AE_ERROR);
-        }
-
-        Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPopSubtable ();
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompilePmtt
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile PMTT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompilePmtt (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    DT_FIELD                *SubtableStart;
-    ACPI_PMTT_HEADER        *PmttHeader;
-    ACPI_PMTT_CONTROLLER    *PmttController;
-    UINT16                  DomainCount;
-    UINT8                   PrevType = ACPI_PMTT_TYPE_SOCKET;
-
-
-    /* Main table */
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt, &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-    DtPushSubtable (Subtable);
-
-    while (*PFieldList)
-    {
-        SubtableStart = *PFieldList;
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmttHdr,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        PmttHeader = ACPI_CAST_PTR (ACPI_PMTT_HEADER, Subtable->Buffer);
-        while (PrevType >= PmttHeader->Type)
-        {
-            DtPopSubtable ();
-
-            if (PrevType == ACPI_PMTT_TYPE_SOCKET)
-            {
-                break;
-            }
-            PrevType--;
-        }
-        PrevType = PmttHeader->Type;
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPushSubtable (Subtable);
-
-        switch (PmttHeader->Type)
-        {
-        case ACPI_PMTT_TYPE_SOCKET:
-
-            /* Subtable: Socket Structure */
-
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt0,
-                    &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-
-            ParentTable = DtPeekSubtable ();
-            DtInsertSubtable (ParentTable, Subtable);
-            break;
-
-        case ACPI_PMTT_TYPE_CONTROLLER:
-
-            /* Subtable: Memory Controller Structure */
-
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt1,
-                    &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-
-            ParentTable = DtPeekSubtable ();
-            DtInsertSubtable (ParentTable, Subtable);
-
-            PmttController = ACPI_CAST_PTR (ACPI_PMTT_CONTROLLER,
-                (Subtable->Buffer - sizeof (ACPI_PMTT_HEADER)));
-            DomainCount = PmttController->DomainCount;
-
-            while (DomainCount)
-            {
-                Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt1a,
-                    &Subtable, TRUE);
-                if (ACPI_FAILURE (Status))
-                {
-                    return (Status);
-                }
-
-                DtInsertSubtable (ParentTable, Subtable);
-                DomainCount--;
-            }
-            break;
-
-        case ACPI_PMTT_TYPE_DIMM:
-
-            /* Subtable: Physical Component Structure */
-
-            Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt2,
-                    &Subtable, TRUE);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
-
-            ParentTable = DtPeekSubtable ();
-            DtInsertSubtable (ParentTable, Subtable);
-            break;
-
-        default:
-
-            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PMTT");
-            return (AE_ERROR);
-        }
-    }
-
-    return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileRsdt
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile RSDT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileRsdt (
-    void                    **List)
-{
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                *FieldList = *(DT_FIELD **) List;
-    UINT32                  Address;
-
-
-    ParentTable = DtPeekSubtable ();
-
-    while (FieldList)
-    {
-        DtCompileInteger ((UINT8 *) &Address, FieldList, 4, DT_NON_ZERO);
-
-        DtCreateSubtable ((UINT8 *) &Address, 4, &Subtable);
-        DtInsertSubtable (ParentTable, Subtable);
-        FieldList = FieldList->Next;
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileS3pt
- *
- * PARAMETERS:  PFieldList          - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile S3PT (Pointed to by FPDT)
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileS3pt (
-    DT_FIELD                **PFieldList)
-{
-    ACPI_STATUS             Status;
-    ACPI_S3PT_HEADER        *S3ptHeader;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    ACPI_DMTABLE_INFO       *InfoTable;
-    DT_FIELD                *SubtableStart;
-
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3pt,
-                &Gbl_RootTable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    DtPushSubtable (Gbl_RootTable);
-
-    while (*PFieldList)
-    {
-        SubtableStart = *PFieldList;
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3ptHdr,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPushSubtable (Subtable);
-
-        S3ptHeader = ACPI_CAST_PTR (ACPI_S3PT_HEADER, Subtable->Buffer);
-
-        switch (S3ptHeader->Type)
-        {
-        case ACPI_S3PT_TYPE_RESUME:
-
-            InfoTable = AcpiDmTableInfoS3pt0;
-            break;
-
-        case ACPI_S3PT_TYPE_SUSPEND:
-
-            InfoTable = AcpiDmTableInfoS3pt1;
-            break;
-
-        default:
-
-            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "S3PT");
-            return (AE_ERROR);
-        }
-
-        Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPopSubtable ();
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileSlic
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile SLIC.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileSlic (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-
-
-    while (*PFieldList)
-    {
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlic,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPushSubtable (Subtable);
-        DtPopSubtable ();
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileSlit
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile SLIT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileSlit (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    DT_FIELD                *FieldList;
-    UINT32                  Localities;
-    UINT8                   *LocalityBuffer;
-
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlit,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-
-    Localities = *ACPI_CAST_PTR (UINT32, Subtable->Buffer);
-    LocalityBuffer = UtLocalCalloc (Localities);
-
-    /* Compile each locality buffer */
-
-    FieldList = *PFieldList;
-    while (FieldList)
-    {
-        DtCompileBuffer (LocalityBuffer,
-            FieldList->Value, FieldList, Localities);
-
-        DtCreateSubtable (LocalityBuffer, Localities, &Subtable);
-        DtInsertSubtable (ParentTable, Subtable);
-        FieldList = FieldList->Next;
-    }
-
-    ACPI_FREE (LocalityBuffer);
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileSrat
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile SRAT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileSrat (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    DT_FIELD                *SubtableStart;
-    ACPI_SUBTABLE_HEADER    *SratHeader;
-    ACPI_DMTABLE_INFO       *InfoTable;
-
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoSrat,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-
-    while (*PFieldList)
-    {
-        SubtableStart = *PFieldList;
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoSratHdr,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPushSubtable (Subtable);
-
-        SratHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
-
-        switch (SratHeader->Type)
-        {
-        case ACPI_SRAT_TYPE_CPU_AFFINITY:
-
-            InfoTable = AcpiDmTableInfoSrat0;
-            break;
-
-        case ACPI_SRAT_TYPE_MEMORY_AFFINITY:
-
-            InfoTable = AcpiDmTableInfoSrat1;
-            break;
-
-        case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY:
-
-            InfoTable = AcpiDmTableInfoSrat2;
-            break;
-
-        case ACPI_SRAT_TYPE_GICC_AFFINITY:
-
-            InfoTable = AcpiDmTableInfoSrat3;
-            break;
-
-        default:
-
-            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT");
-            return (AE_ERROR);
-        }
-
-        Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-        DtPopSubtable ();
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileStao
- *
- * PARAMETERS:  PFieldList          - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile STAO.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileStao (
-    void                    **List)
-{
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    ACPI_STATUS             Status;
-
-
-    /* Compile the main table */
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoStao,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-
-    /* Compile each ASCII namestring as a subtable */
-
-    while (*PFieldList)
-    {
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoStaoStr,
-                    &Subtable, TRUE);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileTcpa
- *
- * PARAMETERS:  PFieldList          - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile TCPA.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileTcpa (
-    void                    **List)
-{
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    DT_SUBTABLE             *Subtable;
-    ACPI_TABLE_TCPA_HDR     *TcpaHeader;
-    DT_SUBTABLE             *ParentTable;
-    ACPI_STATUS             Status;
-
-
-    /* Compile the main table */
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaHdr,
-            &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-
-    /*
-     * Examine the PlatformClass field to determine the table type.
-     * Either a client or server table. Only one.
-     */
-    TcpaHeader = ACPI_CAST_PTR (ACPI_TABLE_TCPA_HDR, ParentTable->Buffer);
-
-    switch (TcpaHeader->PlatformClass)
-    {
-    case ACPI_TCPA_CLIENT_TABLE:
-
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaClient,
-                &Subtable, TRUE);
-        break;
-
-    case ACPI_TCPA_SERVER_TABLE:
-
-        Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaServer,
-                &Subtable, TRUE);
-        break;
-
-    default:
-
-        AcpiOsPrintf ("\n**** Unknown TCPA Platform Class 0x%X\n",
-            TcpaHeader->PlatformClass);
-        Status = AE_ERROR;
-        break;
-    }
-
-
-        ParentTable = DtPeekSubtable ();
-        DtInsertSubtable (ParentTable, Subtable);
-
-    return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtGetGenericTableInfo
- *
- * PARAMETERS:  Name                - Generic type name
- *
- * RETURN:      Info entry
- *
- * DESCRIPTION: Obtain table info for a generic name entry
- *
- *****************************************************************************/
-
-ACPI_DMTABLE_INFO *
-DtGetGenericTableInfo (
-    char                    *Name)
-{
-    ACPI_DMTABLE_INFO       *Info;
-    UINT32                  i;
-
-
-    if (!Name)
-    {
-        return (NULL);
-    }
-
-    /* Search info table for name match */
-
-    for (i = 0; ; i++)
-    {
-        Info = AcpiDmTableInfoGeneric[i];
-        if (Info->Opcode == ACPI_DMT_EXIT)
-        {
-            Info = NULL;
-            break;
-        }
-
-        /* Use caseless compare for generic keywords */
-
-        if (!AcpiUtStricmp (Name, Info->Name))
-        {
-            break;
-        }
-    }
-
-    return (Info);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileUefi
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile UEFI.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileUefi (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    UINT16                  *DataOffset;
-
-
-    /* Compile the predefined portion of the UEFI table */
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoUefi,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    DataOffset = (UINT16 *) (Subtable->Buffer + 16);
-    *DataOffset = sizeof (ACPI_TABLE_UEFI);
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-
-    /*
-     * Compile the "generic" portion of the UEFI table. This
-     * part of the table is not predefined and any of the generic
-     * operators may be used.
-     */
-
-    DtCompileGeneric ((void **) PFieldList, NULL, NULL);
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileVrtc
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile VRTC.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileVrtc (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-
-
-    Status = DtCompileTwoSubtables (List,
-                 AcpiDmTableInfoVrtc, AcpiDmTableInfoVrtc0);
-    return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileWdat
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile WDAT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileWdat (
-    void                    **List)
-{
-    ACPI_STATUS             Status;
-
-
-    Status = DtCompileTwoSubtables (List,
-                 AcpiDmTableInfoWdat, AcpiDmTableInfoWdat0);
-    return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileWpbt
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile WPBT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileWpbt (
-    void                    **List)
-{
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    ACPI_TABLE_WPBT         *Table;
-    ACPI_STATUS             Status;
-    UINT16                  Length;
-
-
-    /* Compile the main table */
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-
-    /* Compile the argument list subtable */
-
-    Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt0,
-                &Subtable, TRUE);
-    if (ACPI_FAILURE (Status))
-    {
-        return (Status);
-    }
-
-    /* Extract the length of the Arguments buffer, insert into main table */
-
-    Length = (UINT16) Subtable->TotalLength;
-    Table = ACPI_CAST_PTR (ACPI_TABLE_WPBT, ParentTable->Buffer);
-    Table->ArgumentsLength = Length;
-
-    ParentTable = DtPeekSubtable ();
-    DtInsertSubtable (ParentTable, Subtable);
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileXsdt
- *
- * PARAMETERS:  List                - Current field list pointer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile XSDT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileXsdt (
-    void                    **List)
-{
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                *FieldList = *(DT_FIELD **) List;
-    UINT64                  Address;
-
-
-    ParentTable = DtPeekSubtable ();
-
-    while (FieldList)
-    {
-        DtCompileInteger ((UINT8 *) &Address, FieldList, 8, DT_NON_ZERO);
-
-        DtCreateSubtable ((UINT8 *) &Address, 8, &Subtable);
-        DtInsertSubtable (ParentTable, Subtable);
-        FieldList = FieldList->Next;
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    DtCompileGeneric
- *
- * PARAMETERS:  List                - Current field list pointer
- *              Name                - Field name to end generic compiling
- *              Length              - Compiled table length to return
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compile generic unknown table.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileGeneric (
-    void                    **List,
-    char                    *Name,
-    UINT32                  *Length)
-{
-    ACPI_STATUS             Status;
-    DT_SUBTABLE             *Subtable;
-    DT_SUBTABLE             *ParentTable;
-    DT_FIELD                **PFieldList = (DT_FIELD **) List;
-    ACPI_DMTABLE_INFO       *Info;
-
-
-    ParentTable = DtPeekSubtable ();
-
-    /*
-     * Compile the "generic" portion of the table. This
-     * part of the table is not predefined and any of the generic
-     * operators may be used.
-     */
-
-    /* Find any and all labels in the entire generic portion */
-
-    DtDetectAllLabels (*PFieldList);
-
-    /* Now we can actually compile the parse tree */
-
-    if (Length)
-    {
-        *Length = 0;
-    }
-    while (*PFieldList)
-    {
-        if (Name && !strcmp ((*PFieldList)->Name, Name))
-        {
-            break;
-        }
-        Info = DtGetGenericTableInfo ((*PFieldList)->Name);
-        if (!Info)
-        {
-            snprintf (MsgBuffer, sizeof(MsgBuffer), "Generic data type \"%s\" not found",
-                (*PFieldList)->Name);
-            DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME,
-                (*PFieldList), MsgBuffer);
-
-            *PFieldList = (*PFieldList)->Next;
-            continue;
-        }
-
-        Status = DtCompileTable (PFieldList, Info,
-                    &Subtable, TRUE);
-        if (ACPI_SUCCESS (Status))
-        {
-            DtInsertSubtable (ParentTable, Subtable);
-            if (Length)
-            {
-                *Length += Subtable->Length;
-            }
-        }
-        else
-        {
-            *PFieldList = (*PFieldList)->Next;
-
-            if (Status == AE_NOT_FOUND)
-            {
-                snprintf (MsgBuffer, sizeof(MsgBuffer), "Generic data type \"%s\" not found",
-                    (*PFieldList)->Name);
-                DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME,
-                    (*PFieldList), MsgBuffer);
-            }
-        }
-    }
-
-    return (AE_OK);
-}
--- a/sys/external/bsd/acpica/dist/compiler/dtutils.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/dtutils.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
--- a/sys/external/bsd/acpica/dist/compiler/prparser.y	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/prparser.y	Sat Jan 09 21:14:12 2016 +0000
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
--- a/sys/external/bsd/acpica/dist/compiler/prutils.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/prutils.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -122,8 +122,10 @@
             {
                 *Next = NULL;
             }
+
             return (TokenStart);
         }
+
         Buffer++;
     }
 
@@ -413,7 +415,6 @@
 
     /* Emit a new #line directive for the include file */
 
-    Gbl_CurrentLineNumber = 1;
     FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\"\n", 1, Filename);
 }
 
--- a/sys/external/bsd/acpica/dist/debugger/dbcmds.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbcmds.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -49,7 +49,6 @@
 #include "acresrc.h"
 #include "actables.h"
 
-#ifdef ACPI_DEBUGGER
 
 #define _COMPONENT          ACPI_CA_DEBUGGER
         ACPI_MODULE_NAME    ("dbcmds")
@@ -88,6 +87,7 @@
 
 static char                 *AcpiDbTraceMethodName = NULL;
 
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiDbConvertToNode
@@ -117,8 +117,7 @@
         Node = ACPI_TO_POINTER (Address);
         if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
         {
-            AcpiOsPrintf ("Address %p is invalid",
-                Node);
+            AcpiOsPrintf ("Address %p is invalid", Node);
             return (NULL);
         }
 
@@ -127,7 +126,7 @@
         if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
         {
             AcpiOsPrintf ("Address %p is not a valid namespace node [%s]\n",
-                    Node, AcpiUtGetDescriptorName (Node));
+                Node, AcpiUtGetDescriptorName (Node));
             return (NULL);
         }
     }
@@ -140,7 +139,8 @@
         Node = AcpiDbLocalNsLookup (InString);
         if (!Node)
         {
-            AcpiOsPrintf ("Could not find [%s] in namespace, defaulting to root node\n",
+            AcpiOsPrintf (
+                "Could not find [%s] in namespace, defaulting to root node\n",
                 InString);
             Node = AcpiGbl_RootNode;
         }
@@ -203,7 +203,7 @@
  *
  * PARAMETERS:  SleepState          - Desired sleep state (0-5)
  *
- * RETURN:      Status
+ * RETURN:      None
  *
  * DESCRIPTION: Simulate a sleep/wake sequence
  *
@@ -340,7 +340,8 @@
 
     /* Header */
 
-    AcpiOsPrintf ("Idx ID    Status Type              TableHeader (Sig, Address, Length)\n");
+    AcpiOsPrintf ("Idx ID    Status Type                    "
+        "TableHeader (Sig, Address, Length, Misc)\n");
 
     /* Walk the entire root table list */
 
@@ -499,7 +500,8 @@
     else
     {
         AcpiOsPrintf (
-            "Named object [%4.4s] Type %s, must be Device/Thermal/Processor type\n",
+            "Named object [%4.4s] Type %s, "
+            "must be Device/Thermal/Processor type\n",
             AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type));
     }
 }
@@ -532,8 +534,7 @@
 
     if (!ActionArg)
     {
-        (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex,
-                    ACPI_WAIT_FOREVER);
+        (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
 
         NextInterface = AcpiGbl_SupportedInterfaces;
         while (NextInterface)
@@ -542,6 +543,7 @@
             {
                 AcpiOsPrintf ("%s\n", NextInterface->Name);
             }
+
             NextInterface = NextInterface->Next;
         }
 
@@ -647,7 +649,8 @@
 
     if (ACPI_FAILURE (Status))
     {
-        AcpiOsPrintf ("Could not convert Buffer to a resource list: %s, %s\n",
+        AcpiOsPrintf (
+            "Could not convert Buffer to a resource list: %s, %s\n",
             BufferArg, AcpiFormatException (Status));
         goto DumpBuffer;
     }
@@ -708,7 +711,8 @@
     if (Aml1BufferLength != Aml2BufferLength)
     {
         AcpiOsPrintf (
-            "**** Buffer length mismatch in converted AML: Original %X, New %X ****\n",
+            "**** Buffer length mismatch in converted "
+            "AML: Original %X, New %X ****\n",
             Aml1BufferLength, Aml2BufferLength);
     }
 
@@ -732,7 +736,8 @@
         if (Aml1Length != Aml2Length)
         {
             AcpiOsPrintf (
-                "**** Length mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X Len1 %X, Len2 %X ****\n",
+                "**** Length mismatch in descriptor [%.2X] type %2.2X, "
+                "Offset %8.8X Len1 %X, Len2 %X ****\n",
                 Count, ResourceType, Offset, Aml1Length, Aml2Length);
         }
 
@@ -741,7 +746,8 @@
         else if (memcmp (Aml1, Aml2, Aml1Length))
         {
             AcpiOsPrintf (
-                "**** Data mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X ****\n",
+                "**** Data mismatch in descriptor [%.2X] type %2.2X, "
+                "Offset %8.8X ****\n",
                 Count, ResourceType, Offset);
 
             for (i = 0; i < Aml1Length; i++)
@@ -749,7 +755,8 @@
                 if (Aml1[i] != Aml2[i])
                 {
                     AcpiOsPrintf (
-                        "Mismatch at byte offset %.2X: is %2.2X, should be %2.2X\n",
+                        "Mismatch at byte offset %.2X: is %2.2X, "
+                        "should be %2.2X\n",
                         i, Aml2[i], Aml1[i]);
                 }
             }
@@ -906,7 +913,7 @@
 
 
     Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
-    ParentPath = AcpiNsGetExternalPathname (Node);
+    ParentPath = AcpiNsGetNormalizedPathname (Node, TRUE);
     if (!ParentPath)
     {
         return (AE_NO_MEMORY);
@@ -914,10 +921,15 @@
 
     /* Get handles to the resource methods for this device */
 
-    (void) AcpiGetHandle (Node, METHOD_NAME__PRT, ACPI_CAST_PTR (ACPI_HANDLE, &PrtNode));
-    (void) AcpiGetHandle (Node, METHOD_NAME__CRS, ACPI_CAST_PTR (ACPI_HANDLE, &CrsNode));
-    (void) AcpiGetHandle (Node, METHOD_NAME__PRS, ACPI_CAST_PTR (ACPI_HANDLE, &PrsNode));
-    (void) AcpiGetHandle (Node, METHOD_NAME__AEI, ACPI_CAST_PTR (ACPI_HANDLE, &AeiNode));
+    (void) AcpiGetHandle (Node, METHOD_NAME__PRT,
+        ACPI_CAST_PTR (ACPI_HANDLE, &PrtNode));
+    (void) AcpiGetHandle (Node, METHOD_NAME__CRS,
+        ACPI_CAST_PTR (ACPI_HANDLE, &CrsNode));
+    (void) AcpiGetHandle (Node, METHOD_NAME__PRS,
+        ACPI_CAST_PTR (ACPI_HANDLE, &PrsNode));
+    (void) AcpiGetHandle (Node, METHOD_NAME__AEI,
+        ACPI_CAST_PTR (ACPI_HANDLE, &AeiNode));
+
     if (!PrtNode && !CrsNode && !PrsNode && !AeiNode)
     {
         goto Cleanup;   /* Nothing to do */
@@ -992,7 +1004,7 @@
         /* Get the _CRS resource list (test ALLOCATE buffer) */
 
         ReturnBuffer.Pointer = NULL;
-        ReturnBuffer.Length  = ACPI_ALLOCATE_LOCAL_BUFFER;
+        ReturnBuffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
 
         Status = AcpiGetCurrentResources (Node, &ReturnBuffer);
         if (ACPI_FAILURE (Status))
@@ -1061,7 +1073,7 @@
         }
 
         ReturnBuffer.Pointer = AcpiGbl_DbBuffer;
-        ReturnBuffer.Length  = ACPI_DEBUG_BUFFER_SIZE;
+        ReturnBuffer.Length = ACPI_DEBUG_BUFFER_SIZE;
 
         Status = AcpiGetPossibleResources (Node, &ReturnBuffer);
         if (ACPI_FAILURE (Status))
@@ -1071,7 +1083,8 @@
             goto GetAei;
         }
 
-        AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer));
+        AcpiRsDumpResourceList (ACPI_CAST_PTR (
+            ACPI_RESOURCE, AcpiGbl_DbBuffer));
     }
 
 
@@ -1083,7 +1096,7 @@
         AcpiOsPrintf ("Evaluating _AEI\n");
 
         ReturnBuffer.Pointer = AcpiGbl_DbBuffer;
-        ReturnBuffer.Length  = ACPI_DEBUG_BUFFER_SIZE;
+        ReturnBuffer.Length = ACPI_DEBUG_BUFFER_SIZE;
 
         Status = AcpiEvaluateObject (AeiNode, NULL, NULL, &ReturnBuffer);
         if (ACPI_FAILURE (Status))
@@ -1094,7 +1107,7 @@
         }
 
         ReturnBuffer.Pointer = AcpiGbl_DbBuffer;
-        ReturnBuffer.Length  = ACPI_DEBUG_BUFFER_SIZE;
+        ReturnBuffer.Length = ACPI_DEBUG_BUFFER_SIZE;
 
         Status = AcpiGetEventResources (Node, &ReturnBuffer);
         if (ACPI_FAILURE (Status))
@@ -1104,7 +1117,8 @@
             goto Cleanup;
         }
 
-        AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer));
+        AcpiRsDumpResourceList (ACPI_CAST_PTR (
+            ACPI_RESOURCE, AcpiGbl_DbBuffer));
     }
 
 
@@ -1143,7 +1157,7 @@
     if (!ObjectArg || (!strcmp (ObjectArg, "*")))
     {
         (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
-                    ACPI_UINT32_MAX, AcpiDbDeviceResources, NULL, NULL, NULL);
+            ACPI_UINT32_MAX, AcpiDbDeviceResources, NULL, NULL, NULL);
     }
     else
     {
@@ -1154,7 +1168,8 @@
         {
             if (Node->Type != ACPI_TYPE_DEVICE)
             {
-                AcpiOsPrintf ("%4.4s: Name is not a device object (%s)\n",
+                AcpiOsPrintf (
+                    "%4.4s: Name is not a device object (%s)\n",
                     Node->Name.Ascii, AcpiUtGetTypeName (Node->Type));
             }
             else
@@ -1208,8 +1223,8 @@
         }
     }
 
-    GpeEventInfo = AcpiEvGetGpeEventInfo (ACPI_TO_POINTER (BlockNumber),
-        GpeNumber);
+    GpeEventInfo = AcpiEvGetGpeEventInfo (
+        ACPI_TO_POINTER (BlockNumber), GpeNumber);
     if (!GpeEventInfo)
     {
         AcpiOsPrintf ("Invalid GPE\n");
@@ -1219,6 +1234,19 @@
     (void) AcpiEvGpeDispatch (NULL, GpeEventInfo, GpeNumber);
 }
 
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbGenerateSci
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Simulate an SCI -- just call the SCI dispatch.
+ *
+ ******************************************************************************/
+
 void
 AcpiDbGenerateSci (
     void)
@@ -1255,14 +1283,9 @@
     UINT32                  Flags = 0;
 
 
-    if (EnableArg)
-    {
-        AcpiUtStrupr (EnableArg);
-    }
-    if (OnceArg)
-    {
-        AcpiUtStrupr (OnceArg);
-    }
+    AcpiUtStrupr (EnableArg);
+    AcpiUtStrupr (OnceArg);
+
     if (MethodArg)
     {
         if (AcpiDbTraceMethodName)
@@ -1270,14 +1293,18 @@
             ACPI_FREE (AcpiDbTraceMethodName);
             AcpiDbTraceMethodName = NULL;
         }
+
         AcpiDbTraceMethodName = ACPI_ALLOCATE (strlen (MethodArg) + 1);
         if (!AcpiDbTraceMethodName)
         {
-            AcpiOsPrintf ("Failed to allocate method name (%s)\n", MethodArg);
+            AcpiOsPrintf ("Failed to allocate method name (%s)\n",
+                MethodArg);
             return;
         }
+
         strcpy (AcpiDbTraceMethodName, MethodArg);
     }
+
     if (!strcmp (EnableArg, "ENABLE") ||
         !strcmp (EnableArg, "METHOD") ||
         !strcmp (EnableArg, "OPCODE"))
@@ -1298,10 +1325,12 @@
         }
 
         Flags = ACPI_TRACE_ENABLED;
+
         if (!strcmp (EnableArg, "OPCODE"))
         {
             Flags |= ACPI_TRACE_OPCODE;
         }
+
         if (OnceArg && !strcmp (OnceArg, "ONCE"))
         {
             Flags |= ACPI_TRACE_ONESHOT;
@@ -1309,7 +1338,5 @@
     }
 
     (void) AcpiDebugTrace (AcpiDbTraceMethodName,
-                DebugLevel, DebugLayer, Flags);
+        DebugLevel, DebugLayer, Flags);
 }
-
-#endif /* ACPI_DEBUGGER */
--- a/sys/external/bsd/acpica/dist/debugger/dbdisply.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbdisply.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -48,11 +48,10 @@
 #include "acnamesp.h"
 #include "acparser.h"
 #include "acinterp.h"
+#include "acevents.h"
 #include "acdebug.h"
 
 
-#ifdef ACPI_DEBUGGER
-
 #define _COMPONENT          ACPI_CA_DEBUGGER
         ACPI_MODULE_NAME    ("dbdisply")
 
@@ -242,7 +241,8 @@
         ObjPtr = AcpiDbGetPointer (Target);
         if (!AcpiOsReadable (ObjPtr, 16))
         {
-            AcpiOsPrintf ("Address %p is invalid in this address space\n",
+            AcpiOsPrintf (
+                "Address %p is invalid in this address space\n",
                 ObjPtr);
             return;
         }
@@ -258,7 +258,8 @@
             if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_NAMESPACE_NODE)))
             {
                 AcpiOsPrintf (
-                    "Cannot read entire Named object at address %p\n", ObjPtr);
+                    "Cannot read entire Named object at address %p\n",
+                    ObjPtr);
                 return;
             }
 
@@ -271,13 +272,14 @@
 
             if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_OPERAND_OBJECT)))
             {
-                AcpiOsPrintf ("Cannot read entire ACPI object at address %p\n",
+                AcpiOsPrintf (
+                    "Cannot read entire ACPI object at address %p\n",
                     ObjPtr);
                 return;
             }
 
-            AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT), Display,
-                ACPI_UINT32_MAX);
+            AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT),
+                Display, ACPI_UINT32_MAX);
             AcpiExDumpObjectDescriptor (ObjPtr, 1);
             break;
 
@@ -288,12 +290,13 @@
             if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_PARSE_OBJECT)))
             {
                 AcpiOsPrintf (
-                    "Cannot read entire Parser object at address %p\n", ObjPtr);
+                    "Cannot read entire Parser object at address %p\n",
+                    ObjPtr);
                 return;
             }
 
-            AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), Display,
-                ACPI_UINT32_MAX);
+            AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT),
+                Display, ACPI_UINT32_MAX);
             AcpiDbDumpParserDescriptor ((ACPI_PARSE_OBJECT *) ObjPtr);
             break;
 
@@ -332,7 +335,7 @@
 DumpNode:
     /* Now dump the NS node */
 
-    Status = AcpiGetName (Node, ACPI_FULL_PATHNAME, &RetBuf);
+    Status = AcpiGetName (Node, ACPI_FULL_PATHNAME_NO_TRAILING, &RetBuf);
     if (ACPI_FAILURE (Status))
     {
         AcpiOsPrintf ("Could not convert name to pathname\n");
@@ -365,8 +368,8 @@
             return;
         }
 
-        AcpiUtDebugDumpBuffer ((void *) ObjDesc, sizeof (ACPI_OPERAND_OBJECT),
-            Display, ACPI_UINT32_MAX);
+        AcpiUtDebugDumpBuffer ((void *) ObjDesc,
+            sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX);
         AcpiExDumpObjectDescriptor (ObjDesc, 1);
     }
 }
@@ -411,14 +414,13 @@
     }
 
     ObjDesc = WalkState->MethodDesc;
-    Node    = WalkState->MethodNode;
+    Node = WalkState->MethodNode;
 
     AcpiOsPrintf ("Currently executing control method is [%4.4s]\n",
-            AcpiUtGetNodeName (Node));
+        AcpiUtGetNodeName (Node));
     AcpiOsPrintf ("%X Arguments, SyncLevel = %X\n",
-            (UINT32) ObjDesc->Method.ParamCount,
-            (UINT32) ObjDesc->Method.SyncLevel);
-
+        (UINT32) ObjDesc->Method.ParamCount,
+        (UINT32) ObjDesc->Method.SyncLevel);
 
     RootOp = StartOp;
     while (RootOp->Common.Parent)
@@ -579,7 +581,7 @@
     }
 
     ObjDesc = WalkState->MethodDesc;
-    Node    = WalkState->MethodNode;
+    Node  = WalkState->MethodNode;
 
     if (WalkState->Results)
     {
@@ -587,7 +589,7 @@
     }
 
     AcpiOsPrintf ("Method [%4.4s] has %X stacked result objects\n",
-            AcpiUtGetNodeName (Node), ResultCount);
+        AcpiUtGetNodeName (Node), ResultCount);
 
     /* From the top element of result stack */
 
@@ -599,11 +601,13 @@
         ObjDesc = Frame->Results.ObjDesc[Index];
         AcpiOsPrintf ("Result%u: ", i);
         AcpiDbDisplayInternalObject (ObjDesc, WalkState);
+
         if (Index == 0)
         {
             Frame = Frame->Results.Next;
             Index = ACPI_RESULTS_FRAME_OBJ_NUM;
         }
+
         Index--;
     }
 }
@@ -642,7 +646,6 @@
     while (WalkState)
     {
         Node = WalkState->MethodNode;
-
         AcpiOsPrintf ("    [%4.4s]\n", AcpiUtGetNodeName (Node));
 
         WalkState = WalkState->Next;
@@ -654,7 +657,7 @@
  *
  * FUNCTION:    AcpiDbDisplayObjectType
  *
- * PARAMETERS:  Name            - User entered NS node handle or name
+ * PARAMETERS:  ObjectArg       - User entered NS node handle
  *
  * RETURN:      None
  *
@@ -664,21 +667,19 @@
 
 void
 AcpiDbDisplayObjectType (
-    char                    *Name)
+    char                    *ObjectArg)
 {
-    ACPI_NAMESPACE_NODE     *Node;
+    ACPI_SIZE               Arg;
+    ACPI_HANDLE             Handle;
     ACPI_DEVICE_INFO        *Info;
     ACPI_STATUS             Status;
     UINT32                  i;
 
 
-    Node = AcpiDbConvertToNode (Name);
-    if (!Node)
-    {
-        return;
-    }
+    Arg = strtoul (ObjectArg, NULL, 16);
+    Handle = ACPI_TO_POINTER (Arg);
 
-    Status = AcpiGetObjectInfo (ACPI_CAST_PTR (ACPI_HANDLE, Node), &Info);
+    Status = AcpiGetObjectInfo (Handle, &Info);
     if (ACPI_FAILURE (Status))
     {
         AcpiOsPrintf ("Could not get object info, %s\n",
@@ -686,38 +687,29 @@
         return;
     }
 
-    if (Info->Valid & ACPI_VALID_ADR)
-    {
-        AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
-            ACPI_FORMAT_UINT64 (Info->Address),
-            Info->CurrentStatus, Info->Flags);
-    }
-    if (Info->Valid & ACPI_VALID_SXDS)
-    {
-        AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
-            Info->HighestDstates[0], Info->HighestDstates[1],
-            Info->HighestDstates[2], Info->HighestDstates[3]);
-    }
-    if (Info->Valid & ACPI_VALID_SXWS)
-    {
-        AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
-            Info->LowestDstates[0], Info->LowestDstates[1],
-            Info->LowestDstates[2], Info->LowestDstates[3],
-            Info->LowestDstates[4]);
-    }
+    AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
+        ACPI_FORMAT_UINT64 (Info->Address),
+        Info->CurrentStatus, Info->Flags);
+
+    AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
+        Info->HighestDstates[0], Info->HighestDstates[1],
+        Info->HighestDstates[2], Info->HighestDstates[3]);
+
+    AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
+        Info->LowestDstates[0], Info->LowestDstates[1],
+        Info->LowestDstates[2], Info->LowestDstates[3],
+        Info->LowestDstates[4]);
 
     if (Info->Valid & ACPI_VALID_HID)
     {
         AcpiOsPrintf ("HID: %s\n", Info->HardwareId.String);
     }
+
     if (Info->Valid & ACPI_VALID_UID)
     {
         AcpiOsPrintf ("UID: %s\n", Info->UniqueId.String);
     }
-    if (Info->Valid & ACPI_VALID_SUB)
-    {
-        AcpiOsPrintf ("SUB: %s\n", Info->SubsystemId.String);
-    }
+
     if (Info->Valid & ACPI_VALID_CID)
     {
         for (i = 0; i < Info->CompatibleIdList.Count; i++)
@@ -754,6 +746,13 @@
     ACPI_WALK_STATE         *WalkState)
 {
 
+#ifndef ACPI_APPLICATION
+    if (AcpiGbl_DbThreadId != AcpiOsGetThreadId())
+    {
+        return;
+    }
+#endif
+
     /* Only display if single stepping */
 
     if (!AcpiGbl_CmSingleStep)
@@ -786,6 +785,13 @@
     ACPI_WALK_STATE         *WalkState)
 {
 
+#ifndef ACPI_APPLICATION
+    if (AcpiGbl_DbThreadId != AcpiOsGetThreadId())
+    {
+        return;
+    }
+#endif
+
     if (!AcpiGbl_CmSingleStep)
     {
         return;
@@ -842,7 +848,8 @@
         GpeBlock = GpeXruptInfo->GpeBlockListHead;
         while (GpeBlock)
         {
-            Status = AcpiGetName (GpeBlock->Node, ACPI_FULL_PATHNAME, &RetBuf);
+            Status = AcpiGetName (GpeBlock->Node,
+                ACPI_FULL_PATHNAME_NO_TRAILING, &RetBuf);
             if (ACPI_FAILURE (Status))
             {
                 AcpiOsPrintf ("Could not convert name to pathname\n");
@@ -857,13 +864,16 @@
                 GpeType = "GPE Block Device";
             }
 
-            AcpiOsPrintf ("\nBlock %u - Info %p  DeviceNode %p [%s] - %s\n",
+            AcpiOsPrintf (
+                "\nBlock %u - Info %p  DeviceNode %p [%s] - %s\n",
                 Block, GpeBlock, GpeBlock->Node, Buffer, GpeType);
 
-            AcpiOsPrintf ("    Registers:    %u (%u GPEs)\n",
+            AcpiOsPrintf (
+                "    Registers:    %u (%u GPEs)\n",
                 GpeBlock->RegisterCount, GpeBlock->GpeCount);
 
-            AcpiOsPrintf ("    GPE range:    0x%X to 0x%X on interrupt %u\n",
+            AcpiOsPrintf (
+                "    GPE range:    0x%X to 0x%X on interrupt %u\n",
                 GpeBlock->BlockBaseNumber,
                 GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1),
                 GpeXruptInfo->InterruptNumber);
@@ -871,8 +881,10 @@
             AcpiOsPrintf (
                 "    RegisterInfo: %p  Status %8.8X%8.8X Enable %8.8X%8.8X\n",
                 GpeBlock->RegisterInfo,
-                ACPI_FORMAT_UINT64 (GpeBlock->RegisterInfo->StatusAddress.Address),
-                ACPI_FORMAT_UINT64 (GpeBlock->RegisterInfo->EnableAddress.Address));
+                ACPI_FORMAT_UINT64 (
+                    GpeBlock->RegisterInfo->StatusAddress.Address),
+                ACPI_FORMAT_UINT64 (
+                    GpeBlock->RegisterInfo->EnableAddress.Address));
 
             AcpiOsPrintf ("    EventInfo:    %p\n", GpeBlock->EventInfo);
 
@@ -883,14 +895,18 @@
                 GpeRegisterInfo = &GpeBlock->RegisterInfo[i];
 
                 AcpiOsPrintf (
-                    "    Reg %u: (GPE %.2X-%.2X)  RunEnable %2.2X WakeEnable %2.2X"
+                    "    Reg %u: (GPE %.2X-%.2X)  "
+                    "RunEnable %2.2X WakeEnable %2.2X"
                     " Status %8.8X%8.8X Enable %8.8X%8.8X\n",
                     i, GpeRegisterInfo->BaseGpeNumber,
-                    GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
+                    GpeRegisterInfo->BaseGpeNumber +
+                        (ACPI_GPE_REGISTER_WIDTH - 1),
                     GpeRegisterInfo->EnableForRun,
                     GpeRegisterInfo->EnableForWake,
-                    ACPI_FORMAT_UINT64 (GpeRegisterInfo->StatusAddress.Address),
-                    ACPI_FORMAT_UINT64 (GpeRegisterInfo->EnableAddress.Address));
+                    ACPI_FORMAT_UINT64 (
+                        GpeRegisterInfo->StatusAddress.Address),
+                    ACPI_FORMAT_UINT64 (
+                        GpeRegisterInfo->EnableAddress.Address));
 
                 /* Now look at the individual GPEs in this byte register */
 
@@ -958,7 +974,9 @@
                             Count++;
                             Notify = Notify->Next;
                         }
-                        AcpiOsPrintf ("Implicit Notify on %u devices", Count);
+
+                        AcpiOsPrintf ("Implicit Notify on %u devices",
+                            Count);
                         break;
 
                     case ACPI_GPE_DISPATCH_RAW_HANDLER:
@@ -976,9 +994,11 @@
                     AcpiOsPrintf (")\n");
                 }
             }
+
             Block++;
             GpeBlock = GpeBlock->Next;
         }
+
         GpeXruptInfo = GpeXruptInfo->Next;
     }
 }
@@ -1017,23 +1037,21 @@
         for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_SpaceIdList); i++)
         {
             SpaceId = AcpiGbl_SpaceIdList[i];
-            HandlerObj = ObjDesc->Device.Handler;
 
             AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
                 AcpiUtGetRegionName ((UINT8) SpaceId), SpaceId);
 
-            while (HandlerObj)
+            HandlerObj = AcpiEvFindRegionHandler (
+                SpaceId, ObjDesc->CommonNotify.Handler);
+            if (HandlerObj)
             {
-                if (AcpiGbl_SpaceIdList[i] == HandlerObj->AddressSpace.SpaceId)
-                {
-                    AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,
-                        (HandlerObj->AddressSpace.HandlerFlags &
-                            ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
-                        HandlerObj->AddressSpace.Handler);
-                    goto FoundHandler;
-                }
+                AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,
+                    (HandlerObj->AddressSpace.HandlerFlags &
+                        ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ?
+                        "Default" : "User",
+                    HandlerObj->AddressSpace.Handler);
 
-                HandlerObj = HandlerObj->AddressSpace.Next;
+                goto FoundHandler;
             }
 
             /* There is no handler for this SpaceId */
@@ -1045,7 +1063,7 @@
 
         /* Find all handlers for user-defined SpaceIDs */
 
-        HandlerObj = ObjDesc->Device.Handler;
+        HandlerObj = ObjDesc->CommonNotify.Handler;
         while (HandlerObj)
         {
             if (HandlerObj->AddressSpace.SpaceId >= ACPI_USER_REGION_BEGIN)
@@ -1054,7 +1072,8 @@
                     "User-defined ID", HandlerObj->AddressSpace.SpaceId);
                 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,
                     (HandlerObj->AddressSpace.HandlerFlags &
-                        ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
+                        ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ?
+                        "Default" : "User",
                     HandlerObj->AddressSpace.Handler);
             }
 
@@ -1090,7 +1109,9 @@
 
     for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_HandlerList); i++)
     {
-        AcpiOsPrintf (ACPI_HANDLER_NAME_STRING, AcpiGbl_HandlerList[i].Name);
+        AcpiOsPrintf (ACPI_HANDLER_NAME_STRING,
+            AcpiGbl_HandlerList[i].Name);
+
         if (AcpiGbl_HandlerList[i].Handler)
         {
             AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, "User",
@@ -1108,8 +1129,8 @@
     AcpiOsPrintf ("\nOperation Region Handlers for specific devices:\n");
 
     (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
-                ACPI_UINT32_MAX, AcpiDbDisplayNonRootHandlers,
-                NULL, NULL, NULL);
+        ACPI_UINT32_MAX, AcpiDbDisplayNonRootHandlers,
+        NULL, NULL, NULL);
 }
 
 
@@ -1145,7 +1166,7 @@
         return (AE_OK);
     }
 
-    Pathname = AcpiNsGetExternalPathname (Node);
+    Pathname = AcpiNsGetNormalizedPathname (Node, TRUE);
     if (!Pathname)
     {
         return (AE_OK);
@@ -1153,7 +1174,7 @@
 
     /* Display all handlers associated with this device */
 
-    HandlerObj = ObjDesc->Device.Handler;
+    HandlerObj = ObjDesc->CommonNotify.Handler;
     while (HandlerObj)
     {
         AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
@@ -1173,5 +1194,3 @@
     ACPI_FREE (Pathname);
     return (AE_OK);
 }
-
-#endif /* ACPI_DEBUGGER */
--- a/sys/external/bsd/acpica/dist/debugger/dbexec.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbexec.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
 #include "acdebug.h"
 #include "acnamesp.h"
 
-#ifdef ACPI_DEBUGGER
 
 #define _COMPONENT          ACPI_CA_DEBUGGER
         ACPI_MODULE_NAME    ("dbexec")
@@ -213,7 +212,8 @@
         if (Status == AE_BUFFER_OVERFLOW)
         {
             ACPI_ERROR ((AE_INFO,
-                "Possible overflow of internal debugger buffer (size 0x%X needed 0x%X)",
+                "Possible overflow of internal debugger "
+                "buffer (size 0x%X needed 0x%X)",
                 ACPI_DEBUG_BUFFER_SIZE, (UINT32) ReturnObj->Length));
         }
     }
@@ -382,10 +382,11 @@
 
     Status = AcpiEvaluateObject (Node, NULL, NULL, &ReturnObj);
 
-    AcpiOsPrintf ("Evaluation of [%4.4s] returned %s\n", AcpiUtGetNodeName (Node),
-            AcpiFormatException (Status));
+    AcpiOsPrintf ("Evaluation of [%4.4s] returned %s\n",
+        AcpiUtGetNodeName (Node),
+        AcpiFormatException (Status));
+
     AcpiGbl_MethodExecuting = FALSE;
-
     return (AE_OK);
 }
 
@@ -396,6 +397,7 @@
  *
  * PARAMETERS:  Name                - Name of method to execute
  *              Args                - Parameters to the method
+ *              Types               -
  *              Flags               - single step/no single step
  *
  * RETURN:      None
@@ -416,12 +418,23 @@
     ACPI_BUFFER             ReturnObj;
     char                    *NameString;
 
-
 #ifdef ACPI_DEBUG_OUTPUT
     UINT32                  PreviousAllocations;
     UINT32                  Allocations;
+#endif
 
 
+    /*
+     * Allow one execution to be performed by debugger or single step
+     * execution will be dead locked by the interpreter mutexes.
+     */
+    if (AcpiGbl_MethodExecuting)
+    {
+        AcpiOsPrintf ("Only one debugger execution is allowed.\n");
+        return;
+    }
+
+#ifdef ACPI_DEBUG_OUTPUT
     /* Memory allocation tracking */
 
     PreviousAllocations = AcpiDbGetOutstandingAllocations ();
@@ -430,7 +443,7 @@
     if (*Name == '*')
     {
         (void) AcpiWalkNamespace (ACPI_TYPE_METHOD, ACPI_ROOT_OBJECT,
-                    ACPI_UINT32_MAX, AcpiDbExecutionWalk, NULL, NULL, NULL);
+            ACPI_UINT32_MAX, AcpiDbExecutionWalk, NULL, NULL, NULL);
         return;
     }
     else
@@ -466,7 +479,8 @@
             &AcpiGbl_DbMethodInfo.Method);
         if (ACPI_SUCCESS (Status))
         {
-            Status = AcpiDbExecuteMethod (&AcpiGbl_DbMethodInfo, &ReturnObj);
+            Status = AcpiDbExecuteMethod (&AcpiGbl_DbMethodInfo,
+                &ReturnObj);
         }
         ACPI_FREE (NameString);
     }
@@ -487,15 +501,17 @@
 
     if (Allocations > 0)
     {
-        AcpiOsPrintf ("0x%X Outstanding allocations after evaluation of %s\n",
-                        Allocations, AcpiGbl_DbMethodInfo.Pathname);
+        AcpiOsPrintf (
+            "0x%X Outstanding allocations after evaluation of %s\n",
+            Allocations, AcpiGbl_DbMethodInfo.Pathname);
     }
 #endif
 
     if (ACPI_FAILURE (Status))
     {
         AcpiOsPrintf ("Evaluation of %s failed with status %s\n",
-            AcpiGbl_DbMethodInfo.Pathname, AcpiFormatException (Status));
+            AcpiGbl_DbMethodInfo.Pathname,
+            AcpiFormatException (Status));
     }
     else
     {
@@ -504,15 +520,18 @@
         if (ReturnObj.Length)
         {
             AcpiOsPrintf (
-                "Evaluation of %s returned object %p, external buffer length %X\n",
+                "Evaluation of %s returned object %p, "
+                "external buffer length %X\n",
                 AcpiGbl_DbMethodInfo.Pathname, ReturnObj.Pointer,
                 (UINT32) ReturnObj.Length);
+
             AcpiDbDumpExternalObject (ReturnObj.Pointer, 1);
 
             /* Dump a _PLD buffer if present */
 
             if (ACPI_COMPARE_NAME ((ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
-                    AcpiGbl_DbMethodInfo.Method)->Name.Ascii), METHOD_NAME__PLD))
+                AcpiGbl_DbMethodInfo.Method)->Name.Ascii),
+                METHOD_NAME__PLD))
             {
                 AcpiDbDumpPldBuffer (ReturnObj.Pointer);
             }
@@ -565,8 +584,10 @@
 
     if (Info->InitArgs)
     {
-        AcpiDbUint32ToHexString (Info->NumCreated, Info->IndexOfThreadStr);
-        AcpiDbUint32ToHexString ((UINT32) AcpiOsGetThreadId (), Info->IdOfThreadStr);
+        AcpiDbUint32ToHexString (Info->NumCreated,
+            Info->IndexOfThreadStr);
+        AcpiDbUint32ToHexString ((UINT32) AcpiOsGetThreadId (),
+            Info->IdOfThreadStr);
     }
 
     if (Info->Threads && (Info->NumCreated < Info->NumThreads))
@@ -601,13 +622,15 @@
 #if 0
         if ((i % 100) == 0)
         {
-            AcpiOsPrintf ("%u loops, Thread 0x%x\n", i, AcpiOsGetThreadId ());
+            AcpiOsPrintf ("%u loops, Thread 0x%x\n",
+                i, AcpiOsGetThreadId ());
         }
 
         if (ReturnObj.Length)
         {
             AcpiOsPrintf ("Evaluation of %s returned object %p Buflen %X\n",
-                Info->Pathname, ReturnObj.Pointer, (UINT32) ReturnObj.Length);
+                Info->Pathname, ReturnObj.Pointer,
+                (UINT32) ReturnObj.Length);
             AcpiDbDumpExternalObject (ReturnObj.Pointer, 1);
         }
 #endif
@@ -616,7 +639,8 @@
     /* Signal our completion */
 
     Allow = 0;
-    (void) AcpiOsWaitSemaphore (Info->ThreadCompleteGate, 1, ACPI_WAIT_FOREVER);
+    (void) AcpiOsWaitSemaphore (Info->ThreadCompleteGate,
+        1, ACPI_WAIT_FOREVER);
     Info->NumCompleted++;
 
     if (Info->NumCompleted == Info->NumThreads)
@@ -632,7 +656,8 @@
         Status = AcpiOsSignalSemaphore (Info->MainThreadGate, 1);
         if (ACPI_FAILURE (Status))
         {
-            AcpiOsPrintf ("Could not signal debugger thread sync semaphore, %s\n",
+            AcpiOsPrintf (
+                "Could not signal debugger thread sync semaphore, %s\n",
                 AcpiFormatException (Status));
         }
     }
@@ -672,7 +697,7 @@
     /* Get the arguments */
 
     NumThreads = strtoul (NumThreadsArg, NULL, 0);
-    NumLoops   = strtoul (NumLoopsArg, NULL, 0);
+    NumLoops = strtoul (NumLoopsArg, NULL, 0);
 
     if (!NumThreads || !NumLoops)
     {
@@ -688,7 +713,8 @@
     Status = AcpiOsCreateSemaphore (1, 0, &MainThreadGate);
     if (ACPI_FAILURE (Status))
     {
-        AcpiOsPrintf ("Could not create semaphore for synchronization with the main thread, %s\n",
+        AcpiOsPrintf ("Could not create semaphore for "
+            "synchronization with the main thread, %s\n",
             AcpiFormatException (Status));
         return;
     }
@@ -700,8 +726,10 @@
     Status = AcpiOsCreateSemaphore (1, 1, &ThreadCompleteGate);
     if (ACPI_FAILURE (Status))
     {
-        AcpiOsPrintf ("Could not create semaphore for synchronization between the created threads, %s\n",
+        AcpiOsPrintf ("Could not create semaphore for "
+            "synchronization between the created threads, %s\n",
             AcpiFormatException (Status));
+
         (void) AcpiOsDeleteSemaphore (MainThreadGate);
         return;
     }
@@ -709,8 +737,10 @@
     Status = AcpiOsCreateSemaphore (1, 1, &InfoGate);
     if (ACPI_FAILURE (Status))
     {
-        AcpiOsPrintf ("Could not create semaphore for synchronization of AcpiGbl_DbMethodInfo, %s\n",
+        AcpiOsPrintf ("Could not create semaphore for "
+            "synchronization of AcpiGbl_DbMethodInfo, %s\n",
             AcpiFormatException (Status));
+
         (void) AcpiOsDeleteSemaphore (ThreadCompleteGate);
         (void) AcpiOsDeleteSemaphore (MainThreadGate);
         return;
@@ -722,6 +752,7 @@
 
     AcpiGbl_DbMethodInfo.NumThreads = NumThreads;
     Size = sizeof (ACPI_THREAD_ID) * AcpiGbl_DbMethodInfo.NumThreads;
+
     AcpiGbl_DbMethodInfo.Threads = AcpiOsAllocate (Size);
     if (AcpiGbl_DbMethodInfo.Threads == NULL)
     {
@@ -782,7 +813,7 @@
 
     for (i = 0; i < (NumThreads); i++)
     {
-        Status = AcpiOsExecute (OSL_DEBUGGER_THREAD, AcpiDbMethodThread,
+        Status = AcpiOsExecute (OSL_DEBUGGER_EXEC_THREAD, AcpiDbMethodThread,
             &AcpiGbl_DbMethodInfo);
         if (ACPI_FAILURE (Status))
         {
@@ -809,5 +840,3 @@
     AcpiOsFree (AcpiGbl_DbMethodInfo.Threads);
     AcpiGbl_DbMethodInfo.Threads = NULL;
 }
-
-#endif /* ACPI_DEBUGGER */
--- a/sys/external/bsd/acpica/dist/debugger/dbinput.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbinput.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -45,12 +45,14 @@
 #include "accommon.h"
 #include "acdebug.h"
 
-
-#ifdef ACPI_DEBUGGER
+#ifdef ACPI_APPLICATION
+#include "acapps.h"
+#endif
 
 #define _COMPONENT          ACPI_CA_DEBUGGER
         ACPI_MODULE_NAME    ("dbinput")
 
+
 /* Local prototypes */
 
 static UINT32
@@ -95,20 +97,15 @@
     CMD_BREAKPOINT,
     CMD_BUSINFO,
     CMD_CALL,
-    CMD_CLOSE,
     CMD_DEBUG,
     CMD_DISASSEMBLE,
     CMD_DISASM,
     CMD_DUMP,
-    CMD_ENABLEACPI,
     CMD_EVALUATE,
-    CMD_EVENT,
     CMD_EXECUTE,
     CMD_EXIT,
     CMD_FIND,
     CMD_GO,
-    CMD_GPE,
-    CMD_GPES,
     CMD_HANDLERS,
     CMD_HELP,
     CMD_HELP2,
@@ -120,14 +117,12 @@
     CMD_INTO,
     CMD_LEVEL,
     CMD_LIST,
-    CMD_LOAD,
     CMD_LOCALS,
     CMD_LOCKS,
     CMD_METHODS,
     CMD_NAMESPACE,
     CMD_NOTIFY,
     CMD_OBJECTS,
-    CMD_OPEN,
     CMD_OSI,
     CMD_OWNER,
     CMD_PATHS,
@@ -137,20 +132,32 @@
     CMD_REFERENCES,
     CMD_RESOURCES,
     CMD_RESULTS,
-    CMD_SCI,
     CMD_SET,
-    CMD_SLEEP,
     CMD_STATS,
     CMD_STOP,
     CMD_TABLES,
     CMD_TEMPLATE,
-    CMD_TERMINATE,
-    CMD_TEST,
-    CMD_THREADS,
     CMD_TRACE,
     CMD_TREE,
     CMD_TYPE,
-    CMD_UNLOAD
+#ifdef ACPI_APPLICATION
+    CMD_ENABLEACPI,
+    CMD_EVENT,
+    CMD_GPE,
+    CMD_GPES,
+    CMD_SCI,
+    CMD_SLEEP,
+
+    CMD_CLOSE,
+    CMD_LOAD,
+    CMD_OPEN,
+    CMD_UNLOAD,
+
+    CMD_TERMINATE,
+    CMD_THREADS,
+
+    CMD_TEST,
+#endif
 };
 
 #define CMD_FIRST_VALID     2
@@ -168,20 +175,15 @@
     {"BREAKPOINT",   1},
     {"BUSINFO",      0},
     {"CALL",         0},
-    {"CLOSE",        0},
     {"DEBUG",        1},
     {"DISASSEMBLE",  1},
     {"DISASM",       1},
     {"DUMP",         1},
-    {"ENABLEACPI",   0},
     {"EVALUATE",     1},
-    {"EVENT",        1},
     {"EXECUTE",      1},
     {"EXIT",         0},
     {"FIND",         1},
     {"GO",           0},
-    {"GPE",          1},
-    {"GPES",         0},
     {"HANDLERS",     0},
     {"HELP",         0},
     {"?",            0},
@@ -193,14 +195,12 @@
     {"INTO",         0},
     {"LEVEL",        0},
     {"LIST",         0},
-    {"LOAD",         1},
     {"LOCALS",       0},
     {"LOCKS",        0},
     {"METHODS",      0},
     {"NAMESPACE",    0},
     {"NOTIFY",       2},
-    {"OBJECTS",      1},
-    {"OPEN",         1},
+    {"OBJECTS",      0},
     {"OSI",          0},
     {"OWNER",        1},
     {"PATHS",        0},
@@ -210,20 +210,32 @@
     {"REFERENCES",   1},
     {"RESOURCES",    0},
     {"RESULTS",      0},
-    {"SCI",          0},
     {"SET",          3},
-    {"SLEEP",        0},
     {"STATS",        1},
     {"STOP",         0},
     {"TABLES",       0},
     {"TEMPLATE",     1},
-    {"TERMINATE",    0},
-    {"TEST",         1},
-    {"THREADS",      3},
     {"TRACE",        1},
     {"TREE",         0},
     {"TYPE",         1},
+#ifdef ACPI_APPLICATION
+    {"ENABLEACPI",   0},
+    {"EVENT",        1},
+    {"GPE",          1},
+    {"GPES",         0},
+    {"SCI",          0},
+    {"SLEEP",        0},
+
+    {"CLOSE",        0},
+    {"LOAD",         1},
+    {"OPEN",         1},
     {"UNLOAD",       1},
+
+    {"TERMINATE",    0},
+    {"THREADS",      3},
+
+    {"TEST",         1},
+#endif
     {NULL,           0}
 };
 
@@ -237,7 +249,6 @@
     {1, "  Allocations",                       "Display list of current memory allocations\n"},
     {2, "  Dump <Address>|<Namepath>",         "\n"},
     {0, "       [Byte|Word|Dword|Qword]",      "Display ACPI objects or memory\n"},
-    {1, "  EnableAcpi",                        "Enable ACPI (hardware) mode\n"},
     {1, "  Handlers",                          "Info about global handlers\n"},
     {1, "  Help [Command]",                    "This help screen or individual command\n"},
     {1, "  History",                           "Display command history buffer\n"},
@@ -254,7 +265,6 @@
     {1, "     Stack",                          "Display CPU stack usage\n"},
     {1, "     Tables",                         "Info about current ACPI table(s)\n"},
     {1, "  Tables",                            "Display info about loaded ACPI tables\n"},
-    {1, "  Unload <Namepath>",                 "Unload an ACPI table via namespace object\n"},
     {1, "  ! <CommandNumber>",                 "Execute command from history buffer\n"},
     {1, "  !!",                                "Execute last command again\n"},
 
@@ -266,7 +276,7 @@
     {1, "  Methods",                           "Display list of loaded control methods\n"},
     {1, "  Namespace [Object] [Depth]",        "Display loaded namespace tree/subtree\n"},
     {1, "  Notify <Object> <Value>",           "Send a notification on Object\n"},
-    {1, "  Objects <ObjectType>",              "Display all objects of the given type\n"},
+    {1, "  Objects [ObjectType]",              "Display summary of all objects or just given type\n"},
     {1, "  Owner <OwnerId> [Depth]",           "Display loaded namespace by object owner\n"},
     {1, "  Paths",                             "Display full pathnames of namespace objects\n"},
     {1, "  Predefined",                        "Check all predefined names\n"},
@@ -275,7 +285,6 @@
     {1, "  Resources [DeviceName]",            "Display Device resources (no arg = all devices)\n"},
     {1, "  Set N <NamedObject> <Value>",       "Set value for named integer\n"},
     {1, "  Template <Object>",                 "Format/dump a Buffer/ResourceTemplate\n"},
-    {1, "  Terminate",                         "Delete namespace and all internal objects\n"},
     {1, "  Type <Object>",                     "Display object type\n"},
 
     {0, "\nControl Method Execution Commands:","\n"},
@@ -297,7 +306,6 @@
     {1, "  Results",                           "Display method result stack\n"},
     {1, "  Set <A|L> <#> <Value>",             "Set method data (Arguments/Locals)\n"},
     {1, "  Stop",                              "Terminate control method\n"},
-    {1, "  Thread <Threads><Loops><Namepath>", "Spawn threads to execute method(s)\n"},
     {5, "  Trace <State> [<Namepath>] [Once]", "Trace control method execution\n"},
     {1, "     Enable",                         "Enable all messages\n"},
     {1, "     Disable",                        "Disable tracing\n"},
@@ -306,10 +314,12 @@
     {1, "  Tree",                              "Display control method calling tree\n"},
     {1, "  <Enter>",                           "Single step next AML opcode (over calls)\n"},
 
-    {0, "\nHardware Related Commands:",         "\n"},
+#ifdef ACPI_APPLICATION
+    {0, "\nHardware Simulation Commands:",         "\n"},
+    {1, "  EnableAcpi",                        "Enable ACPI (hardware) mode\n"},
     {1, "  Event <F|G> <Value>",               "Generate AcpiEvent (Fixed/GPE)\n"},
     {1, "  Gpe <GpeNum> [GpeBlockDevice]",     "Simulate a GPE\n"},
-    {1, "  Gpes",                              "Display info on all GPEs\n"},
+    {1, "  Gpes",                              "Display info on all GPE devices\n"},
     {1, "  Sci",                               "Generate an SCI\n"},
     {1, "  Sleep [SleepState]",                "Simulate sleep/wake sequence(s) (0-5)\n"},
 
@@ -317,11 +327,17 @@
     {1, "  Close",                             "Close debug output file\n"},
     {1, "  Load <Input Filename>",             "Load ACPI table from a file\n"},
     {1, "  Open <Output Filename>",            "Open a file for debug output\n"},
+    {1, "  Unload <Namepath>",                 "Unload an ACPI table via namespace object\n"},
+
+    {0, "\nUser Space Commands:",              "\n"},
+    {1, "  Terminate",                         "Delete namespace and all internal objects\n"},
+    {1, "  Thread <Threads><Loops><NamePath>", "Spawn threads to execute method(s)\n"},
 
     {0, "\nDebug Test Commands:",              "\n"},
     {3, "  Test <TestName>",                   "Invoke a debug test\n"},
     {1, "     Objects",                        "Read/write/compare all namespace data objects\n"},
     {1, "     Predefined",                     "Execute all ACPI predefined names (_STA, etc.)\n"},
+#endif
     {0, NULL, NULL}
 };
 
@@ -645,7 +661,8 @@
     if (AcpiUtSafeStrcpy (AcpiGbl_DbParsedBuf, sizeof (AcpiGbl_DbParsedBuf),
         InputBuffer))
     {
-        AcpiOsPrintf ("Buffer overflow while parsing input line (max %u characters)\n",
+        AcpiOsPrintf (
+            "Buffer overflow while parsing input line (max %u characters)\n",
             sizeof (AcpiGbl_DbParsedBuf));
         return (0);
     }
@@ -665,10 +682,7 @@
 
     /* Uppercase the actual command */
 
-    if (AcpiGbl_DbArgs[0])
-    {
-        AcpiUtStrupr (AcpiGbl_DbArgs[0]);
-    }
+    AcpiUtStrupr (AcpiGbl_DbArgs[0]);
 
     Count = i;
     if (Count)
@@ -707,7 +721,7 @@
     for (i = CMD_FIRST_VALID; AcpiGbl_DbCommands[i].Name; i++)
     {
         if (strstr (AcpiGbl_DbCommands[i].Name, UserCommand) ==
-                         AcpiGbl_DbCommands[i].Name)
+            AcpiGbl_DbCommands[i].Name)
         {
             return (i);
         }
@@ -748,7 +762,7 @@
 
     /* If AcpiTerminate has been called, terminate this thread */
 
-    if (AcpiGbl_DbTerminateThreads)
+    if (AcpiGbl_DbTerminateLoop)
     {
         return (AE_CTRL_TERMINATE);
     }
@@ -777,7 +791,8 @@
             ParamCount, AcpiGbl_DbCommands[CommandIndex].Name,
             AcpiGbl_DbCommands[CommandIndex].MinArgs);
 
-        AcpiDbDisplayCommandInfo (AcpiGbl_DbCommands[CommandIndex].Name, FALSE);
+        AcpiDbDisplayCommandInfo (
+            AcpiGbl_DbCommands[CommandIndex].Name, FALSE);
         return (AE_CTRL_TRUE);
     }
 
@@ -822,11 +837,6 @@
         Status = AE_OK;
         break;
 
-    case CMD_CLOSE:
-
-        AcpiDbCloseDebugFile ();
-        break;
-
     case CMD_DEBUG:
 
         AcpiDbExecute (AcpiGbl_DbArgs[1],
@@ -844,23 +854,6 @@
         AcpiDbDecodeAndDisplayObject (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
         break;
 
-    case CMD_ENABLEACPI:
-#if (!ACPI_REDUCED_HARDWARE)
-
-        Status = AcpiEnable();
-        if (ACPI_FAILURE(Status))
-        {
-            AcpiOsPrintf("AcpiEnable failed (Status=%X)\n", Status);
-            return (Status);
-        }
-#endif /* !ACPI_REDUCED_HARDWARE */
-        break;
-
-    case CMD_EVENT:
-
-        AcpiOsPrintf ("Event command not implemented\n");
-        break;
-
     case CMD_EVALUATE:
     case CMD_EXECUTE:
 
@@ -878,16 +871,6 @@
         AcpiGbl_CmSingleStep = FALSE;
         return (AE_OK);
 
-    case CMD_GPE:
-
-        AcpiDbGenerateGpe (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
-        break;
-
-    case CMD_GPES:
-
-        AcpiDbDisplayGpes ();
-        break;
-
     case CMD_HANDLERS:
 
         AcpiDbDisplayHandlers ();
@@ -949,16 +932,18 @@
 
         if (ParamCount == 0)
         {
-            AcpiOsPrintf ("Current debug level for file output is:    %8.8lX\n",
+            AcpiOsPrintf (
+                "Current debug level for file output is:    %8.8lX\n",
                 AcpiGbl_DbDebugLevel);
-            AcpiOsPrintf ("Current debug level for console output is: %8.8lX\n",
+            AcpiOsPrintf (
+                "Current debug level for console output is: %8.8lX\n",
                 AcpiGbl_DbConsoleDebugLevel);
         }
         else if (ParamCount == 2)
         {
             Temp = AcpiGbl_DbConsoleDebugLevel;
-            AcpiGbl_DbConsoleDebugLevel = strtoul (AcpiGbl_DbArgs[1],
-                                            NULL, 16);
+            AcpiGbl_DbConsoleDebugLevel =
+                strtoul (AcpiGbl_DbArgs[1], NULL, 16);
             AcpiOsPrintf (
                 "Debug Level for console output was %8.8lX, now %8.8lX\n",
                 Temp, AcpiGbl_DbConsoleDebugLevel);
@@ -978,11 +963,6 @@
         AcpiDbDisassembleAml (AcpiGbl_DbArgs[1], Op);
         break;
 
-    case CMD_LOAD:
-
-        Status = AcpiDbGetTableFromFile (AcpiGbl_DbArgs[1], NULL, FALSE);
-        break;
-
     case CMD_LOCKS:
 
         AcpiDbDisplayLocks ();
@@ -1014,11 +994,6 @@
         Status = AcpiDbDisplayObjects (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
         break;
 
-    case CMD_OPEN:
-
-        AcpiDbOpenDebugFile (AcpiGbl_DbArgs[1]);
-        break;
-
     case CMD_OSI:
 
         AcpiDbDisplayInterfaces (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
@@ -1034,11 +1009,6 @@
         AcpiDbDumpNamespacePaths ();
         break;
 
-    case CMD_PREDEFINED:
-
-        AcpiDbCheckPredefinedNames ();
-        break;
-
     case CMD_PREFIX:
 
         AcpiDbSetScope (AcpiGbl_DbArgs[1]);
@@ -1059,22 +1029,12 @@
         AcpiDbDisplayResults ();
         break;
 
-    case CMD_SCI:
-
-        AcpiDbGenerateSci ();
-        break;
-
     case CMD_SET:
 
         AcpiDbSetMethodData (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2],
             AcpiGbl_DbArgs[3]);
         break;
 
-    case CMD_SLEEP:
-
-        Status = AcpiDbSleep (AcpiGbl_DbArgs[1]);
-        break;
-
     case CMD_STATS:
 
         Status = AcpiDbDisplayStatistics (AcpiGbl_DbArgs[1]);
@@ -1094,30 +1054,6 @@
         AcpiDbDisplayTemplate (AcpiGbl_DbArgs[1]);
         break;
 
-    case CMD_TERMINATE:
-
-        AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
-        AcpiUtSubsystemShutdown ();
-
-        /*
-         * TBD: [Restructure] Need some way to re-initialize without
-         * re-creating the semaphores!
-         */
-
-        /*  AcpiInitialize (NULL);  */
-        break;
-
-    case CMD_TEST:
-
-        AcpiDbExecuteTest (AcpiGbl_DbArgs[1]);
-        break;
-
-    case CMD_THREADS:
-
-        AcpiDbCreateExecutionThreads (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2],
-            AcpiGbl_DbArgs[3]);
-        break;
-
     case CMD_TRACE:
 
         AcpiDbTrace (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2], AcpiGbl_DbArgs[3]);
@@ -1133,10 +1069,111 @@
         AcpiDbDisplayObjectType (AcpiGbl_DbArgs[1]);
         break;
 
+#ifdef ACPI_APPLICATION
+
+    /* Hardware simulation commands. */
+
+    case CMD_ENABLEACPI:
+#if (!ACPI_REDUCED_HARDWARE)
+
+        Status = AcpiEnable();
+        if (ACPI_FAILURE(Status))
+        {
+            AcpiOsPrintf("AcpiEnable failed (Status=%X)\n", Status);
+            return (Status);
+        }
+#endif /* !ACPI_REDUCED_HARDWARE */
+        break;
+
+    case CMD_EVENT:
+
+        AcpiOsPrintf ("Event command not implemented\n");
+        break;
+
+    case CMD_GPE:
+
+        AcpiDbGenerateGpe (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
+        break;
+
+    case CMD_GPES:
+
+        AcpiDbDisplayGpes ();
+        break;
+
+    case CMD_SCI:
+
+        AcpiDbGenerateSci ();
+        break;
+
+    case CMD_SLEEP:
+
+        Status = AcpiDbSleep (AcpiGbl_DbArgs[1]);
+        break;
+
+    /* File I/O commands. */
+
+    case CMD_CLOSE:
+
+        AcpiDbCloseDebugFile ();
+        break;
+
+    case CMD_LOAD:
+        {
+            ACPI_NEW_TABLE_DESC     *ListHead = NULL;
+
+            Status = AcGetAllTablesFromFile (AcpiGbl_DbArgs[1],
+                ACPI_GET_ALL_TABLES, &ListHead);
+            if (ACPI_SUCCESS (Status))
+            {
+                AcpiDbLoadTables (ListHead);
+            }
+        }
+        break;
+
+    case CMD_OPEN:
+
+        AcpiDbOpenDebugFile (AcpiGbl_DbArgs[1]);
+        break;
+
+    /* User space commands. */
+
+    case CMD_TERMINATE:
+
+        AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
+        AcpiUtSubsystemShutdown ();
+
+        /*
+         * TBD: [Restructure] Need some way to re-initialize without
+         * re-creating the semaphores!
+         */
+
+        AcpiGbl_DbTerminateLoop = TRUE;
+        /*  AcpiInitialize (NULL);  */
+        break;
+
+    case CMD_THREADS:
+
+        AcpiDbCreateExecutionThreads (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2],
+            AcpiGbl_DbArgs[3]);
+        break;
+
+    /* Debug test commands. */
+
+    case CMD_PREDEFINED:
+
+        AcpiDbCheckPredefinedNames ();
+        break;
+
+    case CMD_TEST:
+
+        AcpiDbExecuteTest (AcpiGbl_DbArgs[1]);
+        break;
+
     case CMD_UNLOAD:
 
         AcpiDbUnloadAcpiTable (AcpiGbl_DbArgs[1]);
         break;
+#endif
 
     case CMD_EXIT:
     case CMD_QUIT:
@@ -1152,8 +1189,10 @@
             AcpiDbgLevel = ACPI_DEBUG_DEFAULT;
         }
 
+#ifdef ACPI_APPLICATION
         AcpiDbCloseDebugFile ();
-        AcpiGbl_DbTerminateThreads = TRUE;
+#endif
+        AcpiGbl_DbTerminateLoop = TRUE;
         return (AE_CTRL_TERMINATE);
 
     case CMD_NOT_FOUND:
@@ -1193,12 +1232,13 @@
     ACPI_STATUS             MStatus;
 
 
-    while (Status != AE_CTRL_TERMINATE)
+    while (Status != AE_CTRL_TERMINATE && !AcpiGbl_DbTerminateLoop)
     {
         AcpiGbl_MethodExecuting = FALSE;
         AcpiGbl_StepToNextCall = FALSE;
 
-        MStatus = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY);
+        MStatus = AcpiOsAcquireMutex (AcpiGbl_DbCommandReady,
+            ACPI_WAIT_FOREVER);
         if (ACPI_FAILURE (MStatus))
         {
             return;
@@ -1206,12 +1246,9 @@
 
         Status = AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL);
 
-        MStatus = AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
-        if (ACPI_FAILURE (MStatus))
-        {
-            return;
-        }
+        AcpiOsReleaseMutex (AcpiGbl_DbCommandComplete);
     }
+    AcpiGbl_DbThreadsTerminated = TRUE;
 }
 
 
@@ -1266,7 +1303,7 @@
 
     /* TBD: [Restructure] Need a separate command line buffer for step mode */
 
-    while (!AcpiGbl_DbTerminateThreads)
+    while (!AcpiGbl_DbTerminateLoop)
     {
         /* Force output to console until a command is entered */
 
@@ -1301,13 +1338,10 @@
              * Signal the debug thread that we have a command to execute,
              * and wait for the command to complete.
              */
-            Status = AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_READY);
-            if (ACPI_FAILURE (Status))
-            {
-                return (Status);
-            }
+            AcpiOsReleaseMutex (AcpiGbl_DbCommandReady);
 
-            Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
+            Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandComplete,
+                ACPI_WAIT_FOREVER);
             if (ACPI_FAILURE (Status))
             {
                 return (Status);
@@ -1321,12 +1355,5 @@
         }
     }
 
-    /*
-     * Only this thread (the original thread) should actually terminate the
-     * subsystem, because all the semaphores are deleted during termination
-     */
-    Status = AcpiTerminate ();
     return (Status);
 }
-
-#endif  /* ACPI_DEBUGGER */
--- a/sys/external/bsd/acpica/dist/debugger/dbmethod.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbmethod.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -46,15 +46,10 @@
 #include "acdispat.h"
 #include "acnamesp.h"
 #include "acdebug.h"
-#ifdef ACPI_DISASSEMBLER
-#include "acdisasm.h"
-#endif
 #include "acparser.h"
 #include "acpredef.h"
 
 
-#ifdef ACPI_DEBUGGER
-
 #define _COMPONENT          ACPI_CA_DEBUGGER
         ACPI_MODULE_NAME    ("dbmethod")
 
@@ -94,7 +89,7 @@
 
     Address = strtoul (Location, NULL, 16);
     AmlOffset = (UINT32) ACPI_PTR_DIFF (Op->Common.Aml,
-                    WalkState->ParserState.AmlStart);
+        WalkState->ParserState.AmlStart);
     if (Address <= AmlOffset)
     {
         AcpiOsPrintf ("Breakpoint %X is beyond current address %X\n",
@@ -229,12 +224,13 @@
 
         if (Index > ACPI_METHOD_MAX_ARG)
         {
-            AcpiOsPrintf ("Arg%u - Invalid argument name\n", Index);
+            AcpiOsPrintf ("Arg%u - Invalid argument name\n",
+                Index);
             goto Cleanup;
         }
 
-        Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_ARG, Index, ObjDesc,
-                    WalkState);
+        Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_ARG,
+            Index, ObjDesc, WalkState);
         if (ACPI_FAILURE (Status))
         {
             goto Cleanup;
@@ -252,12 +248,13 @@
 
         if (Index > ACPI_METHOD_MAX_LOCAL)
         {
-            AcpiOsPrintf ("Local%u - Invalid local variable name\n", Index);
+            AcpiOsPrintf ("Local%u - Invalid local variable name\n",
+                Index);
             goto Cleanup;
         }
 
-        Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_LOCAL, Index, ObjDesc,
-                    WalkState);
+        Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_LOCAL,
+            Index, ObjDesc, WalkState);
         if (ACPI_FAILURE (Status))
         {
             goto Cleanup;
@@ -398,14 +395,14 @@
 
     Status = AcpiPsParseAml (WalkState);
 
-#ifdef ACPI_DISASSEMBER
+#ifdef ACPI_DISASSEMBLER
     (void) AcpiDmParseDeferredOps (Op);
 
     /* Now we can disassemble the method */
 
-    AcpiGbl_DbOpt_Verbose = FALSE;
+    AcpiGbl_DmOpt_Verbose = FALSE;
     AcpiDmDisassemble (NULL, Op, 0);
-    AcpiGbl_DbOpt_Verbose = TRUE;
+    AcpiGbl_DmOpt_Verbose = TRUE;
 #endif
 
     AcpiPsDeleteParseTree (Op);
@@ -417,5 +414,3 @@
     AcpiUtReleaseOwnerId (&ObjDesc->Method.OwnerId);
     return (AE_OK);
 }
-
-#endif /* ACPI_DEBUGGER */
--- a/sys/external/bsd/acpica/dist/debugger/dbnames.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbnames.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -48,8 +48,6 @@
 #include "acpredef.h"
 
 
-#ifdef ACPI_DEBUGGER
-
 #define _COMPONENT          ACPI_CA_DEBUGGER
         ACPI_MODULE_NAME    ("dbnames")
 
@@ -78,6 +76,13 @@
     void                    **ReturnValue);
 
 static ACPI_STATUS
+AcpiDbWalkForObjectCounts (
+    ACPI_HANDLE             ObjHandle,
+    UINT32                  NestingLevel,
+    void                    *Context,
+    void                    **ReturnValue);
+
+static ACPI_STATUS
 AcpiDbIntegrityWalk (
     ACPI_HANDLE             ObjHandle,
     UINT32                  NestingLevel,
@@ -125,7 +130,13 @@
     {"BANKFIELDS"},
     {"INDEXFIELDS"},
     {"REFERENCES"},
-    {"ALIAS"},
+    {"ALIASES"},
+    {"METHODALIASES"},
+    {"NOTIFY"},
+    {"ADDRESSHANDLER"},
+    {"RESOURCE"},
+    {"RESOURCEFIELD"},
+    {"SCOPES"},
     {NULL}           /* Must be null terminated */
 };
 
@@ -163,8 +174,8 @@
     {
         /* Validate new scope from the root */
 
-        Status = AcpiNsGetNode (AcpiGbl_RootNode, Name, ACPI_NS_NO_UPSEARCH,
-                    &Node);
+        Status = AcpiNsGetNode (AcpiGbl_RootNode, Name,
+            ACPI_NS_NO_UPSEARCH, &Node);
         if (ACPI_FAILURE (Status))
         {
             goto ErrorExit;
@@ -176,8 +187,8 @@
     {
         /* Validate new scope relative to old scope */
 
-        Status = AcpiNsGetNode (AcpiGbl_DbScopeNode, Name, ACPI_NS_NO_UPSEARCH,
-                    &Node);
+        Status = AcpiNsGetNode (AcpiGbl_DbScopeNode, Name,
+            ACPI_NS_NO_UPSEARCH, &Node);
         if (ACPI_FAILURE (Status))
         {
             goto ErrorExit;
@@ -194,7 +205,7 @@
     }
 
     if (AcpiUtSafeStrcat (AcpiGbl_DbScopeBuf, sizeof (AcpiGbl_DbScopeBuf),
-        __UNCONST("\\")))
+	    __UNCONST("\\")))
     {
         Status = AE_BUFFER_OVERFLOW;
         goto ErrorExit;
@@ -334,8 +345,8 @@
     /* Display the subtree */
 
     AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
-    AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth, OwnerId,
-        SubtreeEntry);
+    AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth,
+        OwnerId, SubtreeEntry);
     AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
 }
 
@@ -374,7 +385,8 @@
         /* Wildcard support */
 
         if ((RequestedName[i] != '?') &&
-            (RequestedName[i] != ((ACPI_NAMESPACE_NODE *) ObjHandle)->Name.Ascii[i]))
+            (RequestedName[i] != ((ACPI_NAMESPACE_NODE *)
+                ObjHandle)->Name.Ascii[i]))
         {
             /* No match, just exit */
 
@@ -385,10 +397,11 @@
     /* Get the full pathname to this object */
 
     Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
-    Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, FALSE);
+    Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, TRUE);
     if (ACPI_FAILURE (Status))
     {
-        AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
+        AcpiOsPrintf ("Could Not get pathname for object %p\n",
+            ObjHandle);
     }
     else
     {
@@ -426,7 +439,7 @@
     char                    *AcpiNamePtr = AcpiName;
 
 
-    if (strlen (NameArg) > 4)
+    if (strlen (NameArg) > ACPI_NAME_SIZE)
     {
         AcpiOsPrintf ("Name must be no longer than 4 characters\n");
         return (AE_OK);
@@ -444,8 +457,8 @@
 
     /* Walk the namespace from the root */
 
-    (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
-                        AcpiDbWalkAndMatchName, NULL, AcpiName, NULL);
+    (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+        ACPI_UINT32_MAX, AcpiDbWalkAndMatchName, NULL, AcpiName, NULL);
 
     AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
     return (AE_OK);
@@ -486,7 +499,7 @@
         return (AE_OK);
     }
 
-    Pathname = AcpiNsGetExternalPathname (Node);
+    Pathname = AcpiNsGetNormalizedPathname (Node, TRUE);
     if (!Pathname)
     {
         return (AE_OK);
@@ -546,8 +559,9 @@
 
     /* Search all nodes in namespace */
 
-    (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
-                AcpiDbWalkForPredefinedNames, NULL, (void *) &Count, NULL);
+    (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+        ACPI_UINT32_MAX, AcpiDbWalkForPredefinedNames,
+        NULL, (void *) &Count, NULL);
 
     AcpiOsPrintf ("Found %u predefined names in the namespace\n", Count);
 }
@@ -555,6 +569,43 @@
 
 /*******************************************************************************
  *
+ * FUNCTION:    AcpiDbWalkForObjectCounts
+ *
+ * PARAMETERS:  Callback from WalkNamespace
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Display short info about objects in the namespace
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbWalkForObjectCounts (
+    ACPI_HANDLE             ObjHandle,
+    UINT32                  NestingLevel,
+    void                    *Context,
+    void                    **ReturnValue)
+{
+    ACPI_OBJECT_INFO        *Info = (ACPI_OBJECT_INFO *) Context;
+    ACPI_NAMESPACE_NODE     *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
+
+
+    if (Node->Type > ACPI_TYPE_NS_NODE_MAX)
+    {
+        AcpiOsPrintf ("[%4.4s]: Unknown object type %X\n",
+            Node->Name.Ascii, Node->Type);
+    }
+    else
+    {
+        Info->Types[Node->Type]++;
+    }
+
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    AcpiDbWalkForSpecificObjects
  *
  * PARAMETERS:  Callback from WalkNamespace
@@ -582,7 +633,7 @@
     /* Get and display the full pathname to this object */
 
     Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
-    Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, FALSE);
+    Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, TRUE);
     if (ACPI_FAILURE (Status))
     {
         AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
@@ -619,8 +670,40 @@
 {
     ACPI_WALK_INFO          Info;
     ACPI_OBJECT_TYPE        Type;
+    ACPI_OBJECT_INFO        *ObjectInfo;
+    UINT32                  i;
+    UINT32                  TotalObjects = 0;
 
 
+    /* No argument means display summary/count of all object types */
+
+    if (!ObjTypeArg)
+    {
+        ObjectInfo = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_OBJECT_INFO));
+
+        /* Walk the namespace from the root */
+
+        (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+            ACPI_UINT32_MAX, AcpiDbWalkForObjectCounts, NULL,
+            (void *) ObjectInfo, NULL);
+
+        AcpiOsPrintf ("\nSummary of namespace objects:\n\n");
+
+        for (i = 0; i < ACPI_TOTAL_TYPES; i++)
+        {
+            AcpiOsPrintf ("%8u   %s\n", ObjectInfo->Types[i],
+                AcpiUtGetTypeName (i));
+
+            TotalObjects += ObjectInfo->Types[i];
+        }
+
+        AcpiOsPrintf ("\n%8u   Total namespace objects\n\n",
+            TotalObjects);
+
+        ACPI_FREE (ObjectInfo);
+        return (AE_OK);
+    }
+
     /* Get the object type */
 
     Type = AcpiDbMatchArgument (ObjTypeArg, AcpiDbObjectTypes);
@@ -645,7 +728,7 @@
     /* Walk the namespace from the root */
 
     (void) AcpiWalkNamespace (Type, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
-                AcpiDbWalkForSpecificObjects, NULL, (void *) &Info, NULL);
+        AcpiDbWalkForSpecificObjects, NULL, (void *) &Info, NULL);
 
     AcpiOsPrintf (
         "\nFound %u objects of type [%s] in the current ACPI Namespace\n",
@@ -689,9 +772,11 @@
     {
         if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
         {
-            AcpiOsPrintf ("Invalid Descriptor Type for Node %p [%s] - is %2.2X should be %2.2X\n",
-                Node, AcpiUtGetDescriptorName (Node), ACPI_GET_DESCRIPTOR_TYPE (Node),
-                ACPI_DESC_TYPE_NAMED);
+            AcpiOsPrintf (
+                "Invalid Descriptor Type for Node %p [%s] - "
+                "is %2.2X should be %2.2X\n",
+                Node, AcpiUtGetDescriptorName (Node),
+                ACPI_GET_DESCRIPTOR_TYPE (Node), ACPI_DESC_TYPE_NAMED);
             return (AE_OK);
         }
 
@@ -754,8 +839,8 @@
 
     /* Search all nodes in namespace */
 
-    (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
-                    AcpiDbIntegrityWalk, NULL, (void *) &Info, NULL);
+    (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+        ACPI_UINT32_MAX, AcpiDbIntegrityWalk, NULL, (void *) &Info, NULL);
 
     AcpiOsPrintf ("Verified %u namespace nodes with %u Objects\n",
         Info.Nodes, Info.Objects);
@@ -835,8 +920,9 @@
 
     /* Search all nodes in namespace */
 
-    (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
-                    AcpiDbWalkForReferences, NULL, (void *) ObjDesc, NULL);
+    (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+        ACPI_UINT32_MAX, AcpiDbWalkForReferences, NULL,
+        (void *) ObjDesc, NULL);
 }
 
 
@@ -877,7 +963,7 @@
     /* Exit if there is no _PRT under this device */
 
     Status = AcpiGetHandle (Node, METHOD_NAME__PRT,
-                ACPI_CAST_PTR (ACPI_HANDLE, &TempNode));
+        ACPI_CAST_PTR (ACPI_HANDLE, &TempNode));
     if (ACPI_FAILURE (Status))
     {
         return (AE_OK);
@@ -886,10 +972,11 @@
     /* Get the full path to this device object */
 
     Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
-    Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, FALSE);
+    Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, TRUE);
     if (ACPI_FAILURE (Status))
     {
-        AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
+        AcpiOsPrintf ("Could Not get pathname for object %p\n",
+            ObjHandle);
         return (AE_OK);
     }
 
@@ -918,7 +1005,8 @@
 
     if (Info->Valid & ACPI_VALID_ADR)
     {
-        AcpiOsPrintf ("_ADR: %8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Info->Address));
+        AcpiOsPrintf ("_ADR: %8.8X%8.8X\n",
+            ACPI_FORMAT_UINT64 (Info->Address));
     }
     else
     {
@@ -979,8 +1067,6 @@
 {
     /* Search all nodes in namespace */
 
-    (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
-                    AcpiDbBusWalk, NULL, NULL, NULL);
+    (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+        ACPI_UINT32_MAX, AcpiDbBusWalk, NULL, NULL, NULL);
 }
-
-#endif /* ACPI_DEBUGGER */
--- a/sys/external/bsd/acpica/dist/debugger/dbtest.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbtest.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,6 @@
 #include "acnamesp.h"
 #include "acpredef.h"
 
-#ifdef ACPI_DEBUGGER
 
 #define _COMPONENT          ACPI_CA_DEBUGGER
         ACPI_MODULE_NAME    ("dbtest")
@@ -124,8 +123,8 @@
  * used to read and write the various namespace objects. The point
  * is to force the AML interpreter do all of the work.
  */
-#define                     ACPI_DB_READ_METHOD     "\\_T98"
-#define                     ACPI_DB_WRITE_METHOD    "\\_T99"
+#define ACPI_DB_READ_METHOD     "\\_T98"
+#define ACPI_DB_WRITE_METHOD    "\\_T99"
 
 static ACPI_HANDLE          ReadHandle = NULL;
 static ACPI_HANDLE          WriteHandle = NULL;
@@ -283,7 +282,7 @@
     /* Walk the entire namespace, testing each supported named data object */
 
     (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
-                ACPI_UINT32_MAX, AcpiDbTestOneObject, NULL, NULL, NULL);
+        ACPI_UINT32_MAX, AcpiDbTestOneObject, NULL, NULL, NULL);
 }
 
 
@@ -695,7 +694,8 @@
         goto Exit;
     }
 
-    if (memcmp (Temp1->Buffer.Pointer, Temp3->Buffer.Pointer, ByteLength))
+    if (memcmp (Temp1->Buffer.Pointer,
+            Temp3->Buffer.Pointer, ByteLength))
     {
         AcpiOsPrintf (" MISMATCH 3: While restoring original buffer");
     }
@@ -847,7 +847,8 @@
     ReturnObj.Length  = ACPI_ALLOCATE_BUFFER;
 
     AcpiGbl_MethodExecuting = TRUE;
-    Status = AcpiEvaluateObject (ReadHandle, NULL, &ParamObjects, &ReturnObj);
+    Status = AcpiEvaluateObject (ReadHandle, NULL,
+        &ParamObjects, &ReturnObj);
     AcpiGbl_MethodExecuting = FALSE;
 
     if (ACPI_FAILURE (Status))
@@ -885,8 +886,8 @@
 
         AcpiOsPrintf (" Unsupported return object type, %s",
             AcpiUtGetTypeName (RetValue->Type));
+
         AcpiOsFree (ReturnObj.Pointer);
-
         return (AE_TYPE);
     }
 
@@ -975,10 +976,12 @@
 
     /* Search all nodes in namespace */
 
-    (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
-                AcpiDbEvaluateOnePredefinedName, NULL, (void *) &Info, NULL);
+    (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+        ACPI_UINT32_MAX, AcpiDbEvaluateOnePredefinedName, NULL,
+        (void *) &Info, NULL);
 
-    AcpiOsPrintf ("Evaluated %u predefined names in the namespace\n", Info.Count);
+    AcpiOsPrintf (
+        "Evaluated %u predefined names in the namespace\n", Info.Count);
 }
 
 
@@ -1031,7 +1034,7 @@
         return (AE_OK);
     }
 
-    Pathname = AcpiNsGetExternalPathname (Node);
+    Pathname = AcpiNsGetNormalizedPathname (Node, TRUE);
     if (!Pathname)
     {
         return (AE_OK);
@@ -1076,8 +1079,10 @@
 
             case ACPI_TYPE_STRING:
 
-                ThisParam->String.Pointer = __UNCONST("This is the default argument string");
-                ThisParam->String.Length = strlen (ThisParam->String.Pointer);
+                ThisParam->String.Pointer =
+                    __UNCONST("This is the default argument string");
+                ThisParam->String.Length =
+                    strlen (ThisParam->String.Pointer);
                 break;
 
             case ACPI_TYPE_BUFFER:
@@ -1116,7 +1121,8 @@
 
     Status = AcpiEvaluateObject (Node, NULL, &ParamObjects, &ReturnObj);
 
-    AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status));
+    AcpiOsPrintf ("%-32s returned %s\n",
+        Pathname, AcpiFormatException (Status));
     AcpiGbl_MethodExecuting = FALSE;
     ACPI_FREE (Pathname);
 
@@ -1134,5 +1140,3 @@
 
     return (Status);
 }
-
-#endif /* ACPI_DEBUGGER */
--- a/sys/external/bsd/acpica/dist/debugger/dbutils.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbutils.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,11 +47,10 @@
 #include "acdebug.h"
 
 
-#ifdef ACPI_DEBUGGER
-
 #define _COMPONENT          ACPI_CA_DEBUGGER
         ACPI_MODULE_NAME    ("dbutils")
 
+
 /* Local prototypes */
 
 #ifdef ACPI_OBSOLETE_FUNCTIONS
@@ -64,7 +63,7 @@
     UINT32                  Address);
 #endif
 
-static const char           *Converter = "0123456789ABCDEF";
+static const char                 *Gbl_HexToAscii = "0123456789ABCDEF";
 
 
 /*******************************************************************************
@@ -127,7 +126,8 @@
 
     AcpiGbl_DbOutputFlags = (UINT8) OutputFlags;
 
-    if ((OutputFlags & ACPI_DB_REDIRECTABLE_OUTPUT) && AcpiGbl_DbOutputToFile)
+    if ((OutputFlags & ACPI_DB_REDIRECTABLE_OUTPUT) &&
+        AcpiGbl_DbOutputToFile)
     {
         AcpiDbgLevel = AcpiGbl_DbDebugLevel;
     }
@@ -180,7 +180,7 @@
     case ACPI_TYPE_INTEGER:
 
         AcpiOsPrintf ("[Integer] = %8.8X%8.8X\n",
-                    ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
+            ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
         break;
 
     case ACPI_TYPE_STRING:
@@ -199,8 +199,10 @@
             {
                 AcpiOsPrintf ("\n");
             }
-            AcpiUtDebugDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
-                    ObjDesc->Buffer.Length, DB_BYTE_DISPLAY, _COMPONENT);
+
+            AcpiUtDebugDumpBuffer (
+                ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
+                ObjDesc->Buffer.Length, DB_BYTE_DISPLAY, _COMPONENT);
         }
         else
         {
@@ -211,11 +213,12 @@
     case ACPI_TYPE_PACKAGE:
 
         AcpiOsPrintf ("[Package] Contains %u Elements:\n",
-                ObjDesc->Package.Count);
+            ObjDesc->Package.Count);
 
         for (i = 0; i < ObjDesc->Package.Count; i++)
         {
-            AcpiDbDumpExternalObject (&ObjDesc->Package.Elements[i], Level+1);
+            AcpiDbDumpExternalObject (
+                &ObjDesc->Package.Elements[i], Level+1);
         }
         break;
 
@@ -335,12 +338,13 @@
      * Lookup the name.
      * (Uses root node as the search starting point)
      */
-    Status = AcpiNsLookup (NULL, InternalPath, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
-                    ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node);
+    Status = AcpiNsLookup (NULL, InternalPath, ACPI_TYPE_ANY,
+        ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE,
+        NULL, &Node);
     if (ACPI_FAILURE (Status))
     {
         AcpiOsPrintf ("Could not locate name: %s, %s\n",
-                Name, AcpiFormatException (Status));
+            Name, AcpiFormatException (Status));
     }
 
     ACPI_FREE (InternalPath);
@@ -382,7 +386,7 @@
 
     for (i = 7; i >= 0; i--)
     {
-        Buffer[i] = Converter [Value & 0x0F];
+        Buffer[i] = Gbl_HexToAscii [Value & 0x0F];
         Value = Value >> 4;
     }
 }
@@ -504,8 +508,6 @@
 
     AcpiDbgLevel |= ACPI_LV_TABLES;
     AcpiUtDebugDumpBuffer (ACPI_TO_POINTER (Address), 64, DB_BYTE_DISPLAY,
-            ACPI_UINT32_MAX);
+        ACPI_UINT32_MAX);
 }
 #endif
-
-#endif /* ACPI_DEBUGGER */
--- a/sys/external/bsd/acpica/dist/disassembler/dmbuffer.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/disassembler/dmbuffer.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -50,8 +50,6 @@
 #include "acinterp.h"
 
 
-#ifdef ACPI_DISASSEMBLER
-
 #define _COMPONENT          ACPI_CA_DEBUGGER
         ACPI_MODULE_NAME    ("dmbuffer")
 
@@ -256,7 +254,8 @@
     {
     case ACPI_DASM_RESOURCE:
 
-        AcpiDmResourceTemplate (Info, Op->Common.Parent, ByteData, ByteCount);
+        AcpiDmResourceTemplate (
+            Info, Op->Common.Parent, ByteData, ByteCount);
         break;
 
     case ACPI_DASM_STRING:
@@ -753,13 +752,17 @@
     AcpiOsPrintf (ACPI_PLD_OUTPUT08,  "PLD_Lid", PldInfo->Lid);
     AcpiOsPrintf (ACPI_PLD_OUTPUTSTR, "PLD_Panel",
         AcpiDmFindNameByIndex(PldInfo->Panel, DmPanelList));
+
     AcpiOsPrintf (ACPI_PLD_OUTPUTSTR, "PLD_VerticalPosition",
         AcpiDmFindNameByIndex(PldInfo->VerticalPosition, DmVerticalPositionList));
+
     AcpiOsPrintf (ACPI_PLD_OUTPUTSTR, "PLD_HorizontalPosition",
         AcpiDmFindNameByIndex(PldInfo->HorizontalPosition, DmHorizontalPositionList));
+
     AcpiOsPrintf (ACPI_PLD_OUTPUTSTR, "PLD_Shape",
         AcpiDmFindNameByIndex(PldInfo->Shape, DmShapeList));
     AcpiOsPrintf (ACPI_PLD_OUTPUT08,  "PLD_GroupOrientation", PldInfo->GroupOrientation);
+
     AcpiOsPrintf (ACPI_PLD_OUTPUT08,  "PLD_GroupToken", PldInfo->GroupToken);
     AcpiOsPrintf (ACPI_PLD_OUTPUT08,  "PLD_GroupPosition", PldInfo->GroupPosition);
     AcpiOsPrintf (ACPI_PLD_OUTPUT08,  "PLD_Bay", PldInfo->Bay);
@@ -773,21 +776,18 @@
     AcpiOsPrintf (ACPI_PLD_OUTPUT08,  "PLD_Reference", PldInfo->Reference);
     AcpiOsPrintf (ACPI_PLD_OUTPUT08,  "PLD_Rotation", PldInfo->Rotation);
 
-    if (ByteCount < ACPI_PLD_REV1_BUFFER_SIZE)
-    {
-        AcpiOsPrintf (ACPI_PLD_OUTPUT08P, "PLD_Order", PldInfo->Order);
-    }
-    else
+    if (ByteCount >= ACPI_PLD_REV2_BUFFER_SIZE)
     {
         AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Order", PldInfo->Order);
-    }
 
-    /* Fifth 32-bit dword */
+        /* Fifth 32-bit dword */
 
-    if (ByteCount >= ACPI_PLD_REV1_BUFFER_SIZE)
+        AcpiOsPrintf (ACPI_PLD_OUTPUT16,  "PLD_VerticalOffset", PldInfo->VerticalOffset);
+        AcpiOsPrintf (ACPI_PLD_OUTPUT16P, "PLD_HorizontalOffset", PldInfo->HorizontalOffset);
+    }
+    else /* Rev 1 buffer */
     {
-        AcpiOsPrintf (ACPI_PLD_OUTPUT16, "PLD_VerticalOffset", PldInfo->VerticalOffset);
-        AcpiOsPrintf (ACPI_PLD_OUTPUT16P, "PLD_HorizontalOffset", PldInfo->HorizontalOffset);
+        AcpiOsPrintf (ACPI_PLD_OUTPUT08P, "PLD_Order", PldInfo->Order);
     }
 
     ACPI_FREE (PldInfo);
@@ -1030,5 +1030,3 @@
         AcpiOsPrintf (" /* %s */", Info->Description);
     }
 }
-
-#endif
--- a/sys/external/bsd/acpica/dist/disassembler/dmcstyle.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/disassembler/dmcstyle.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -45,10 +45,8 @@
 #include "accommon.h"
 #include "acparser.h"
 #include "amlcode.h"
-#include "acdisasm.h"
 #include "acdebug.h"
 
-#ifdef ACPI_DISASSEMBLER
 
 #define _COMPONENT          ACPI_CA_DEBUGGER
         ACPI_MODULE_NAME    ("dmcstyle")
@@ -229,12 +227,27 @@
         Child2->Common.OperatorSymbol = OperatorSymbol;
         return (TRUE);
 
-#ifdef INDEX_SUPPORT
     case AML_INDEX_OP:
+        /*
+         * Check for constant source operand. Note: although technically
+         * legal syntax, the iASL compiler does not support this with
+         * the symbolic operators for Index(). It doesn't make sense to
+         * use Index() with a constant anyway.
+         */
+        if ((Child1->Common.AmlOpcode == AML_STRING_OP)  ||
+            (Child1->Common.AmlOpcode == AML_BUFFER_OP)  ||
+            (Child1->Common.AmlOpcode == AML_PACKAGE_OP) ||
+            (Child1->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
+        {
+            Op->Common.DisasmFlags |= ACPI_PARSEOP_CLOSING_PAREN;
+            return (FALSE);
+        }
+
+        /* Index operator is [] */
+
         Child1->Common.OperatorSymbol = " [";
         Child2->Common.OperatorSymbol = "]";
         break;
-#endif
 
     /* Unary operators */
 
@@ -444,7 +457,6 @@
     case AML_INCREMENT_OP:
         return (TRUE);
 
-#ifdef INDEX_SUPPORT
     case AML_INDEX_OP:
 
         /* Target is optional, 3rd operand */
@@ -460,7 +472,6 @@
             }
         }
         return (TRUE);
-#endif
 
     case AML_STORE_OP:
         /*
@@ -580,12 +591,18 @@
         }
         break;
 
+    case AML_INDEX_OP:
+
+        /* This is case for unsupported Index() source constants */
+
+        if (Op->Common.DisasmFlags & ACPI_PARSEOP_CLOSING_PAREN)
+        {
+            AcpiOsPrintf (")");
+        }
+        return;
 
     /* No need for parens for these */
 
-#ifdef INDEX_SUPPORT
-    case AML_INDEX_OP:
-#endif
     case AML_DECREMENT_OP:
     case AML_INCREMENT_OP:
     case AML_LNOT_OP:
@@ -668,6 +685,7 @@
     default:
 
         /* No operator string for all other opcodes */
+
         return (NULL);
     }
 
@@ -826,5 +844,3 @@
     }
     return (TRUE);
 }
-
-#endif
--- a/sys/external/bsd/acpica/dist/disassembler/dmresrc.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/disassembler/dmresrc.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
 #include "amlcode.h"
 #include "acdisasm.h"
 
-#ifdef ACPI_DISASSEMBLER
 
 #define _COMPONENT          ACPI_CA_DEBUGGER
         ACPI_MODULE_NAME    ("dbresrc")
@@ -213,6 +212,7 @@
             {
                 AcpiOsPrintf (",");
             }
+
             Previous = TRUE;
             AcpiOsPrintf ("%u", i);
         }
@@ -286,7 +286,8 @@
         Status = AcpiUtValidateResource (NULL, Aml, &ResourceIndex);
         if (ACPI_FAILURE (Status))
         {
-            AcpiOsPrintf ("/*** Could not validate Resource, type (%X) %s***/\n",
+            AcpiOsPrintf (
+                "/*** Could not validate Resource, type (%X) %s***/\n",
                 ResourceType, AcpiFormatException (Status));
             return;
         }
@@ -336,7 +337,8 @@
 
                 AcpiDmIndent (Level);
                 AcpiOsPrintf (
-                    "/*** Disassembler: inserted missing EndDependentFn () ***/\n");
+                    "/*** Disassembler: inserted "
+                    "missing EndDependentFn () ***/\n");
             }
             return;
 
@@ -444,5 +446,3 @@
      */
     return (AE_OK);
 }
-
-#endif
--- a/sys/external/bsd/acpica/dist/disassembler/dmresrcl.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/disassembler/dmresrcl.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -46,8 +46,6 @@
 #include "acdisasm.h"
 
 
-#ifdef ACPI_DISASSEMBLER
-
 #define _COMPONENT          ACPI_CA_DEBUGGER
         ACPI_MODULE_NAME    ("dbresrcl")
 
@@ -309,7 +307,8 @@
 
     if ((ResourceType > 2) && (ResourceType < 0xC0))
     {
-        AcpiOsPrintf ("/**** Invalid Resource Type: 0x%X ****/", ResourceType);
+        AcpiOsPrintf (
+            "/**** Invalid Resource Type: 0x%X ****/", ResourceType);
         return;
     }
 
@@ -329,7 +328,8 @@
 
     /* This is either a Memory, IO, or BusNumber descriptor (0,1,2) */
 
-    AcpiOsPrintf ("%s (", AcpiGbl_WordDecode [ACPI_GET_2BIT_FLAG (ResourceType)]);
+    AcpiOsPrintf ("%s (",
+        AcpiGbl_WordDecode [ACPI_GET_2BIT_FLAG (ResourceType)]);
 
     /* Decode the general and type-specific flags */
 
@@ -342,7 +342,8 @@
         AcpiDmIoFlags (Flags);
         if (ResourceType == ACPI_IO_RANGE)
         {
-            AcpiOsPrintf (" %s,", AcpiGbl_RngDecode [ACPI_GET_2BIT_FLAG (SpecificFlags)]);
+            AcpiOsPrintf (" %s,",
+                AcpiGbl_RngDecode [ACPI_GET_2BIT_FLAG (SpecificFlags)]);
         }
     }
 }
@@ -737,7 +738,8 @@
 
     /* Dump resource name and flags */
 
-    AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64, Level);
+    AcpiDmAddressCommon (
+        Resource, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64, Level);
 
     /* Dump the 5 contiguous QWORD values */
 
@@ -873,10 +875,12 @@
         AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->FixedMemory32.Flags)]);
 
     AcpiDmIndent (Level + 1);
-    AcpiDmDumpInteger32 (Resource->FixedMemory32.Address, "Address Base");
+    AcpiDmDumpInteger32 (Resource->FixedMemory32.Address,
+        "Address Base");
 
     AcpiDmIndent (Level + 1);
-    AcpiDmDumpInteger32 (Resource->FixedMemory32.AddressLength, "Address Length");
+    AcpiDmDumpInteger32 (Resource->FixedMemory32.AddressLength,
+        "Address Length");
 
     /* Insert a descriptor name */
 
@@ -1079,5 +1083,3 @@
         ACPI_ADD_PTR (UINT8, Resource, sizeof (AML_RESOURCE_LARGE_HEADER)),
         Length, Level);
 }
-
-#endif
--- a/sys/external/bsd/acpica/dist/disassembler/dmresrcl2.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/disassembler/dmresrcl2.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -50,8 +50,6 @@
 #define MpSaveSerialInfo(a, b, c)
 #endif
 
-#ifdef ACPI_DISASSEMBLER
-
 #define _COMPONENT          ACPI_CA_DEBUGGER
         ACPI_MODULE_NAME    ("dbresrcl2")
 
@@ -158,6 +156,7 @@
 
             AcpiOsPrintf (", ");
         }
+
         AcpiOsPrintf ("\n");
         AcpiDmIndent (Level + 2);
 
@@ -203,7 +202,8 @@
     AcpiDmIndent (Level + 1);
     if (Resource->Gpio.ResSourceOffset)
     {
-        DeviceName = ACPI_ADD_PTR (char, Resource, Resource->Gpio.ResSourceOffset),
+        DeviceName = ACPI_ADD_PTR (char,
+            Resource, Resource->Gpio.ResSourceOffset),
         AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
     }
 
@@ -247,13 +247,15 @@
     for (i = 0; i < PinCount; i++)
     {
         AcpiDmIndent (Level + 2);
-        AcpiOsPrintf ("0x%4.4X%s\n", PinList[i], ((i + 1) < PinCount) ? "," : "");
+        AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
+            ((i + 1) < PinCount) ? "," : "");
     }
 
     AcpiDmIndent (Level + 1);
     AcpiOsPrintf ("}\n");
 
-    MpSaveGpioInfo (Info->MappingOp, Resource, PinCount, PinList, DeviceName);
+    MpSaveGpioInfo (Info->MappingOp, Resource,
+        PinCount, PinList, DeviceName);
 }
 
 
@@ -730,5 +732,3 @@
     SerialBusResourceDispatch [Resource->CommonSerialBus.Type] (
         Info, Resource, Length, Level);
 }
-
-#endif
--- a/sys/external/bsd/acpica/dist/disassembler/dmwalk.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/disassembler/dmwalk.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -45,12 +45,9 @@
 #include "accommon.h"
 #include "acparser.h"
 #include "amlcode.h"
-#include "acdisasm.h"
 #include "acdebug.h"
 
 
-#ifdef ACPI_DISASSEMBLER
-
 #define _COMPONENT          ACPI_CA_DEBUGGER
         ACPI_MODULE_NAME    ("dmwalk")
 
@@ -117,10 +114,11 @@
         return;
     }
 
-    Info.Flags = 0;
-    Info.Level = 0;
-    Info.Count = 0;
+    memset (&Info, 0, sizeof (ACPI_OP_WALK_INFO));
     Info.WalkState = WalkState;
+    Info.StartAml = Op->Common.Aml - sizeof (ACPI_TABLE_HEADER);
+    Info.AmlOffset = Op->Common.Aml - Info.StartAml;
+
     AcpiDmWalkParseTree (Op, AcpiDmDescendingOp, AcpiDmAscendingOp, &Info);
     return;
 }
@@ -415,20 +413,40 @@
     UINT32                  AmlOffset;
 
 
-    if (AcpiGbl_DbOpt_Verbose && AcpiGbl_PreviousOp)
+    OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
+
+    /* Listing support to dump the AML code after the ASL statement */
+
+    if (AcpiGbl_DmOpt_Listing)
     {
-        /* Dump the entire statement in AML byte code */
+        /* We only care about these classes of objects */
 
-        if (Op->Common.Aml > AcpiGbl_PreviousOp->Common.Aml)
+        if ((OpInfo->Class == AML_CLASS_NAMED_OBJECT) ||
+            (OpInfo->Class == AML_CLASS_CONTROL) ||
+            (OpInfo->Class == AML_CLASS_CREATE) ||
+            ((OpInfo->Class == AML_CLASS_EXECUTE) && (!Op->Common.Next)))
         {
-            AcpiOsPrintf ("\n");
-            AcpiUtDumpBuffer (AcpiGbl_PreviousOp->Common.Aml,
-                (Op->Common.Aml - AcpiGbl_PreviousOp->Common.Aml),
-                DB_BYTE_DISPLAY, 0);
-            AcpiDmIndent (Level);
+            if (AcpiGbl_DmOpt_Listing && Info->PreviousAml)
+            {
+                /* Dump the AML byte code for the previous Op */
+
+                if (Op->Common.Aml > Info->PreviousAml)
+                {
+                    AcpiOsPrintf ("\n");
+                    AcpiUtDumpBuffer (
+                        (Info->StartAml + Info->AmlOffset),
+                        (Op->Common.Aml - Info->PreviousAml),
+                        DB_BYTE_DISPLAY,
+                        Info->AmlOffset);
+                    AcpiOsPrintf ("\n");
+                }
+
+                Info->AmlOffset = (Op->Common.Aml - Info->StartAml);
+            }
+
+            Info->PreviousAml = Op->Common.Aml;
         }
     }
-    AcpiGbl_PreviousOp = Op;
 
     if (Op->Common.DisasmFlags & ACPI_PARSEOP_IGNORE)
     {
@@ -446,11 +464,14 @@
         if (Info->WalkState)
         {
             AmlOffset = (UINT32) ACPI_PTR_DIFF (Op->Common.Aml,
-                            Info->WalkState->ParserState.AmlStart);
-            VERBOSE_PRINT ((DB_FULL_OP_INFO,
-                (Info->WalkState->MethodNode ?
-                    Info->WalkState->MethodNode->Name.Ascii : "   "),
-                AmlOffset, (UINT32) Op->Common.AmlOpcode));
+                Info->WalkState->ParserState.AmlStart);
+            if (AcpiGbl_DmOpt_Verbose)
+            {
+                AcpiOsPrintf (DB_FULL_OP_INFO,
+                    (Info->WalkState->MethodNode ?
+                        Info->WalkState->MethodNode->Name.Ascii : "   "),
+                    AmlOffset, (UINT32) Op->Common.AmlOpcode);
+            }
         }
 
         if (Op->Common.AmlOpcode == AML_SCOPE_OP)
@@ -466,40 +487,41 @@
         }
     }
     else if ((AcpiDmBlockType (Op->Common.Parent) & BLOCK_BRACE) &&
-             (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) &&
-             (Op->Common.AmlOpcode != AML_INT_BYTELIST_OP))
+         (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) &&
+         (!(Op->Common.DisasmFlags & ACPI_PARSEOP_ELSEIF)) &&
+         (Op->Common.AmlOpcode != AML_INT_BYTELIST_OP))
     {
+        /*
+         * This is a first-level element of a term list,
+         * indent a new line
+         */
+        switch (Op->Common.AmlOpcode)
+        {
+        case AML_NOOP_OP:
             /*
-             * This is a first-level element of a term list,
-             * indent a new line
+             * Optionally just ignore this opcode. Some tables use
+             * NoOp opcodes for "padding" out packages that the BIOS
+             * changes dynamically. This can leave hundreds or
+             * thousands of NoOp opcodes that if disassembled,
+             * cannot be compiled because they are syntactically
+             * incorrect.
              */
-            switch (Op->Common.AmlOpcode)
+            if (AcpiGbl_IgnoreNoopOperator)
             {
-            case AML_NOOP_OP:
-                /*
-                 * Optionally just ignore this opcode. Some tables use
-                 * NoOp opcodes for "padding" out packages that the BIOS
-                 * changes dynamically. This can leave hundreds or
-                 * thousands of NoOp opcodes that if disassembled,
-                 * cannot be compiled because they are syntactically
-                 * incorrect.
-                 */
-                if (AcpiGbl_IgnoreNoopOperator)
-                {
-                    Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
-                    return (AE_OK);
-                }
-
-                /* Fallthrough */
-
-            default:
-
-                AcpiDmIndent (Level);
-                break;
+                Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
+                return (AE_OK);
             }
 
-            Info->LastLevel = Level;
-            Info->Count = 0;
+            /* Fallthrough */
+
+        default:
+
+            AcpiDmIndent (Level);
+            break;
+        }
+
+        Info->LastLevel = Level;
+        Info->Count = 0;
     }
 
     /*
@@ -541,8 +563,6 @@
 
     /* Start the opcode argument list if necessary */
 
-    OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
-
     if ((OpInfo->Flags & AML_HAS_ARGS) ||
         (Op->Common.AmlOpcode == AML_EVENT_OP))
     {
@@ -582,7 +602,7 @@
 
                 if (Op->Common.AmlOpcode != AML_INT_NAMEDFIELD_OP)
                 {
-                    if (AcpiGbl_DbOpt_Verbose)
+                    if (AcpiGbl_DmOpt_Verbose)
                     {
                         (void) AcpiPsDisplayObjectPathname (NULL, Op);
                     }
@@ -887,8 +907,8 @@
         if (!AcpiDmCommaIfListMember (Op))
         {
             if ((AcpiDmBlockType (Op->Common.Parent) & BLOCK_BRACE) &&
-                     (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) &&
-                     (Op->Common.AmlOpcode != AML_INT_BYTELIST_OP))
+                 (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) &&
+                 (Op->Common.AmlOpcode != AML_INT_BYTELIST_OP))
             {
                 /*
                  * This is a first-level element of a term list
@@ -949,8 +969,8 @@
         if (!AcpiDmCommaIfListMember (Op))
         {
             if ((AcpiDmBlockType (Op->Common.Parent) & BLOCK_BRACE) &&
-                     (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) &&
-                     (Op->Common.AmlOpcode != AML_INT_BYTELIST_OP))
+                 (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) &&
+                 (Op->Common.AmlOpcode != AML_INT_BYTELIST_OP))
             {
                 /*
                  * This is a first-level element of a term list
@@ -1046,5 +1066,3 @@
 
     return (AE_OK);
 }
-
-#endif  /* ACPI_DISASSEMBLER */
--- a/sys/external/bsd/acpica/dist/dispatcher/dscontrol.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/dispatcher/dscontrol.c	Sat Jan 09 21:14:12 2016 +0000
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,6 +47,7 @@
 #include "amlcode.h"
 #include "acdispat.h"
 #include "acinterp.h"
+#include "acdebug.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
         ACPI_MODULE_NAME    ("dscontrol")
@@ -119,9 +120,12 @@
          * Save a pointer to the predicate for multiple executions
          * of a loop
          */
-        ControlState->Control.AmlPredicateStart = WalkState->ParserState.Aml - 1;
-        ControlState->Control.PackageEnd = WalkState->ParserState.PkgEnd;
-        ControlState->Control.Opcode = Op->Common.AmlOpcode;
+        ControlState->Control.AmlPredicateStart =
+            WalkState->ParserState.Aml - 1;
+        ControlState->Control.PackageEnd =
+            WalkState->ParserState.PkgEnd;
+        ControlState->Control.Opcode =
+            Op->Common.AmlOpcode;
 
 
         /* Push the control state on this walk's control stack */
@@ -221,7 +225,7 @@
              * loop does not implement a timeout.
              */
             ControlState->Control.LoopCount++;
-            if (ControlState->Control.LoopCount > ACPI_MAX_LOOP_ITERATIONS)
+            if (ControlState->Control.LoopCount > AcpiGbl_MaxLoopIterations)
             {
                 Status = AE_AML_INFINITE_LOOP;
                 break;
@@ -232,7 +236,8 @@
              * another time
              */
             Status = AE_CTRL_PENDING;
-            WalkState->AmlLastWhile = ControlState->Control.AmlPredicateStart;
+            WalkState->AmlLastWhile =
+                ControlState->Control.AmlPredicateStart;
             break;
         }
 
@@ -276,7 +281,8 @@
              * an arg or local), resolve it now because it may
              * cease to exist at the end of the method.
              */
-            Status = AcpiExResolveToValue (&WalkState->Operands [0], WalkState);
+            Status = AcpiExResolveToValue (
+                &WalkState->Operands [0], WalkState);
             if (ACPI_FAILURE (Status))
             {
                 return (Status);
@@ -305,11 +311,15 @@
              * Allow references created by the Index operator to return
              * unchanged.
              */
-            if ((ACPI_GET_DESCRIPTOR_TYPE (WalkState->Results->Results.ObjDesc[0]) == ACPI_DESC_TYPE_OPERAND) &&
-                ((WalkState->Results->Results.ObjDesc [0])->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
-                ((WalkState->Results->Results.ObjDesc [0])->Reference.Class != ACPI_REFCLASS_INDEX))
+            if ((ACPI_GET_DESCRIPTOR_TYPE (WalkState->Results->Results.ObjDesc[0]) ==
+                    ACPI_DESC_TYPE_OPERAND) &&
+                ((WalkState->Results->Results.ObjDesc [0])->Common.Type ==
+                    ACPI_TYPE_LOCAL_REFERENCE) &&
+                ((WalkState->Results->Results.ObjDesc [0])->Reference.Class !=
+                    ACPI_REFCLASS_INDEX))
             {
-                Status = AcpiExResolveToValue (&WalkState->Results->Results.ObjDesc [0], WalkState);
+                Status = AcpiExResolveToValue (
+                    &WalkState->Results->Results.ObjDesc [0], WalkState);
                 if (ACPI_FAILURE (Status))
                 {
                     return (Status);
@@ -327,9 +337,9 @@
                 AcpiUtRemoveReference (WalkState->Operands [0]);
             }
 
-            WalkState->Operands [0]     = NULL;
-            WalkState->NumOperands      = 0;
-            WalkState->ReturnDesc       = NULL;
+            WalkState->Operands[0] = NULL;
+            WalkState->NumOperands = 0;
+            WalkState->ReturnDesc = NULL;
         }
 
 
@@ -350,20 +360,12 @@
 
     case AML_BREAK_POINT_OP:
 
-        /*
-         * Set the single-step flag. This will cause the debugger (if present)
-         * to break to the console within the AML debugger at the start of the
-         * next AML instruction.
-         */
-        ACPI_DEBUGGER_EXEC (
-            AcpiGbl_CmSingleStep = TRUE);
-        ACPI_DEBUGGER_EXEC (
-            AcpiOsPrintf ("**break** Executed AML BreakPoint opcode\n"));
+        AcpiDbSignalBreakPoint (WalkState);
 
         /* Call to the OSL in case OS wants a piece of the action */
 
         Status = AcpiOsSignal (ACPI_SIGNAL_BREAKPOINT,
-	    __UNCONST("Executed AML Breakpoint opcode"));
+            __UNCONST("Executed AML Breakpoint opcode"));
         break;
 
     case AML_BREAK_OP:
@@ -387,7 +389,8 @@
 
         /* Was: WalkState->AmlLastWhile = WalkState->ControlState->Control.AmlPredicateStart; */
 
-        WalkState->AmlLastWhile = WalkState->ControlState->Control.PackageEnd;
+        WalkState->AmlLastWhile =
+            WalkState->ControlState->Control.PackageEnd;
 
         /* Return status depending on opcode */
 
--- a/sys/external/bsd/acpica/dist/dispatcher/dsopcode.c	Sat Jan 09 21:13:51 2016 +0000
+++ b/sys/external/bsd/acpica/dist/dispatcher/dsopcode.c	Sat Jan 09 21:14:12 2016 +0000
@@ -5,7 +5,7 @@
  *****************************************************************************/