22 April 2016. Summary of changes for version 20160422: trunk
authorchristos <christos@NetBSD.org>
Wed, 04 May 2016 18:15:53 +0000
branchtrunk
changeset 242289 d9e999bfd05d
parent 242288 75928ca7f6ef
child 242290 87f7c7f7a730
22 April 2016. Summary of changes for version 20160422: 1) ACPICA kernel-resident subsystem: Fixed a regression in the GAS (generic address structure) arbitrary bit support in AcpiHwRead/AcpiHwWrite. Problem could cause incorrect behavior and incorrect return values. Lv Zheng. ACPICA BZ 1270. ACPI 6.0: Added support for new/renamed resource macros. One new argument was added to each of these macros, and the original name has been deprecated. The AML disassembler will always disassemble to the new names. Support for the new macros was added to iASL, disassembler, resource manager, and the acpihelp utility. ACPICA BZ 1274. I2cSerialBus -> I2cSerialBusV2 SpiSerialBus -> SpiSerialBusV2 UartSerialBus -> UartSerialBusV2 ACPI 6.0: Added support for a new integer field that was appended to the package object returned by the _BIX method. This adds iASL compile-time and AML runtime error checking. ACPICA BZ 1273. ACPI 6.1: Added support for a new PCCT subtable, "HW-Reduced Comm Subspace Type2" (Headers, Disassembler, and data table compiler). Example Code and Data Size: These are the sizes for the OS-independent acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. Current Release: Non-Debug Version: 137.4K Code, 52.6K Data, 190.0K Total Debug Version: 201.5K Code, 82.2K Data, 283.7K Total Previous Release: Non-Debug Version: 137.1K Code, 51.5K Data, 188.6K Total Debug Version: 201.0K Code, 82.0K Data, 283.0K Total 2) iASL Compiler/Disassembler and Tools: iASL: Implemented an ASL grammar extension to allow/enable executable "module-level code" to be created and executed under the various operators that create new scopes. This type of AML code is already supported in all known AML interpreters, and the grammar change will appear in the next version of the ACPI specification. Simplifies the conditional runtime creation of named objects under these object types: Device PowerResource Processor Scope ThermalZone iASL: Implemented a new ASL extension, a "For" loop macro to add greater ease-of-use to the ASL language. The syntax is similar to the corresponding C operator, and is implemented with the existing AML While opcode -- thus requiring no changes to existing AML interpreters. For (Initialize, Predicate, Update) {TermList} Grammar: ForTerm := For ( Initializer // Nothing | TermArg => ComputationalData Predicate // Nothing | TermArg => ComputationalData Update // Nothing | TermArg => ComputationalData ) {TermList} iASL: The _HID/_ADR detection and validation has been enhanced to search under conditionals in order to allow these objects to be conditionally created at runtime. iASL: Fixed several issues with the constant folding feature. The improvement allows better detection and resolution of statements that can be folded at compile time. ACPICA BZ 1266. iASL/Disassembler: Fixed a couple issues with the Else{If{}...} conversion to the ASL ElseIf operator where incorrect ASL code could be generated. iASL/Disassembler: Fixed a problem with the ASL+ code disassembly where sometimes an extra (and extraneous) set of parentheses were emitted for some combinations of operators. Although this did not cause any problems with recompilation of the disassembled code, it made the code more difficult to read. David Box. ACPICA BZ 1231. iASL: Changed to ignore the unreferenced detection for predefined names of resource descriptor elements, when the resource descriptor is created/defined within a control method. iASL: Disassembler: Fix a possible fault with externally declared Buffer objects. ---------------------------------------- 18 March 2016. Summary of changes for version 20160318: 1) ACPICA kernel-resident subsystem: Added support for arbitrary bit lengths and bit offsets for registers defined by the Generic Address Structure. Previously, only aligned bit lengths of 8/16/32/64 were supported. This was sufficient for many years, but recently some machines have been seen that require arbitrary bit- level support. ACPICA BZ 1240. Lv Zheng. Fixed an issue where the \_SB._INI method sometimes must be evaluated before any _REG methods are evaluated. Lv Zheng. Implemented several changes related to ACPI table support (Headers/Disassembler/TableCompiler): NFIT: For ACPI 6.1, updated to add some additional new fields and constants. FADT: Updated a warning message and set compliance to ACPI 6.1 (Version 6). DMAR: Added new constants per the 10/2014 DMAR spec. IORT: Added new subtable per the 10/2015 IORT spec. HEST: For ACPI 6.1, added new constants and new subtable. DBG2: Added new constants per the 12/2015 DBG2 spec. FPDT: Fixed several incorrect fields, add the FPDT boot record structure. ACPICA BZ 1249. ERST/EINJ: Updated disassembler with new "Execute Timings" actions. Updated header support for the DMAR table to match the current version of the related spec. Added extensions to the ASL Concatenate operator to allow any ACPI object to be passed as an operand. Any object other than Integer/String/Buffer simply returns a string containing the object type. This extends the usefulness of the Printf macros. Previously, Concatenate would abort the control method if a non-data object was encountered. ACPICA source code: Deployed the C "const" keyword across the source code where appropriate. ACPICA BZ 732. Joerg Sonnenberger (NetBSD). Example Code and Data Size: These are the sizes for the OS-independent acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. Current Release: Non-Debug Version: 137.1K Code, 51.5K Data, 188.6K Total Debug Version: 201.0K Code, 82.0K Data, 283.0K Total Previous Release: Non-Debug Version: 136.2K Code, 51.5K Data, 187.7K Total Debug Version: 200.4K Code, 82.0K Data, 282.4K Total 2) iASL Compiler/Disassembler and Tools: iASL/Disassembler: Improved the heuristic used to determine the number of arguments for an externally defined control method (a method in another table). Although this is an improvement, there is no deterministic way to "guess" the number of method arguments. Only the ACPI 6.0 External opcode will completely solve this problem as it is deployed (automatically) in newer BIOS code. iASL/Disassembler: Fixed an ordering issue for emitted External() ASL statements that could cause errors when the disassembled file is compiled. ACPICA BZ 1243. David Box. iASL: Fixed a regression caused by the merger of the two versions of the local strtoul64. Because of a dependency on a global variable, strtoul64 could return an error for integers greater than a 32-bit value. ACPICA BZ 1260. iASL: Fixed a regression where a fault could occur for an ASL Return statement if it invokes a control method that is not resolved. ACPICA BZ 1264. AcpiXtract: Improved input file validation: detection of binary files and non-acpidump text files. ---------------------------------------- 12 February 2016. Summary of changes for version 20160212: 1) ACPICA kernel-resident subsystem: Implemented full support for the ACPI 6.1 specification (released in January). This version of the specification is available at: http://www.uefi.org/specifications Only a relatively small number of changes were required in ACPICA to support ACPI 6.1, in these areas: - New predefined names - New _HID values - A new subtable for HEST - A few other header changes for new values Ensure \_SB_._INI is executed before any _REG methods are executed. There appears to be existing BIOS code that relies on this behavior. Lv Zheng. Reverted a change made in version 20151218 which enabled method invocations to be targets of various ASL operators (SuperName and Target grammar elements). While the new behavior is supported by the ACPI specification, other AML interpreters do not support this behavior and never will. The ACPI specification will be updated for ACPI 6.2 to remove this support. Therefore, the change was reverted to the original ACPICA behavior. ACPICA now supports the GCC 6 compiler. Current Release: (Note: build changes increased sizes) Non-Debug Version: 136.2K Code, 51.5K Data, 187.7K Total Debug Version: 200.4K Code, 82.0K Data, 282.4K Total Previous Release: Non-Debug Version: 102.7K Code, 28.4K Data, 131.1K Total Debug Version: 200.4K Code, 81.9K Data, 282.3K Total 2) iASL Compiler/Disassembler and Tools: Completed full support for the ACPI 6.0 External() AML opcode. The compiler emits an external AML opcode for each ASL External statement. This opcode is used by the disassembler to assist with the disassembly of external control methods by specifying the required number of arguments for the method. AML interpreters do not use this opcode. To ensure that interpreters do not even see the opcode, a block of one or more external opcodes is surrounded by an "If(0)" construct. As this feature becomes commonly deployed in BIOS code, the ability of disassemblers to correctly disassemble AML code will be greatly improved. David Box. iASL: Implemented support for an optional cross-reference output file. The -lx option will create a the cross-reference file with the suffix "xrf". Three different types of cross-reference are created in this file: - List of object references made from within each control method - Invocation (caller) list for each user-defined control method - List of references to each non-method object in the namespace iASL: Method invocations as ASL Target operands are now disallowed and flagged as errors in preparation for ACPI 6.2 (see the description of the problem above).
sys/external/bsd/acpica/dist/changes.txt
sys/external/bsd/acpica/dist/common/acfileio.c
sys/external/bsd/acpica/dist/common/adwalk.c
sys/external/bsd/acpica/dist/common/ahids.c
sys/external/bsd/acpica/dist/common/ahpredef.c
sys/external/bsd/acpica/dist/common/dmextern.c
sys/external/bsd/acpica/dist/common/dmrestag.c
sys/external/bsd/acpica/dist/common/dmtable.c
sys/external/bsd/acpica/dist/common/dmtables.c
sys/external/bsd/acpica/dist/compiler/aslbtypes.c
sys/external/bsd/acpica/dist/compiler/aslcodegen.c
sys/external/bsd/acpica/dist/compiler/asldebug.c
sys/external/bsd/acpica/dist/compiler/asldefine.h
sys/external/bsd/acpica/dist/compiler/aslexternal.c
sys/external/bsd/acpica/dist/compiler/aslfold.c
sys/external/bsd/acpica/dist/compiler/aslglobal.h
sys/external/bsd/acpica/dist/compiler/asllength.c
sys/external/bsd/acpica/dist/compiler/asllisting.c
sys/external/bsd/acpica/dist/compiler/aslmain.c
sys/external/bsd/acpica/dist/compiler/aslmap.c
sys/external/bsd/acpica/dist/compiler/aslmapoutput.c
sys/external/bsd/acpica/dist/compiler/aslmessages.c
sys/external/bsd/acpica/dist/compiler/aslmethod.c
sys/external/bsd/acpica/dist/compiler/asloperands.c
sys/external/bsd/acpica/dist/compiler/aslopt.c
sys/external/bsd/acpica/dist/compiler/asloptions.c
sys/external/bsd/acpica/dist/compiler/aslparser.y
sys/external/bsd/acpica/dist/compiler/aslpld.c
sys/external/bsd/acpica/dist/compiler/aslprune.c
sys/external/bsd/acpica/dist/compiler/aslresource.c
sys/external/bsd/acpica/dist/compiler/aslresources.y
sys/external/bsd/acpica/dist/compiler/aslrestype2e.c
sys/external/bsd/acpica/dist/compiler/aslrestype2s.c
sys/external/bsd/acpica/dist/compiler/aslrules.y
sys/external/bsd/acpica/dist/compiler/aslstubs.c
sys/external/bsd/acpica/dist/compiler/asltokens.y
sys/external/bsd/acpica/dist/compiler/asltransform.c
sys/external/bsd/acpica/dist/compiler/asltypes.h
sys/external/bsd/acpica/dist/compiler/asltypes.y
sys/external/bsd/acpica/dist/compiler/aslxrefout.c
sys/external/bsd/acpica/dist/compiler/dttable1.c
sys/external/bsd/acpica/dist/compiler/dttable2.c
sys/external/bsd/acpica/dist/compiler/dttemplate.h
sys/external/bsd/acpica/dist/compiler/prscan.c
sys/external/bsd/acpica/dist/debugger/dbconvert.c
sys/external/bsd/acpica/dist/disassembler/dmopcode.c
sys/external/bsd/acpica/dist/disassembler/dmutils.c
sys/external/bsd/acpica/dist/dispatcher/dsmethod.c
sys/external/bsd/acpica/dist/dispatcher/dsobject.c
sys/external/bsd/acpica/dist/events/evgpeblk.c
sys/external/bsd/acpica/dist/events/evgpeinit.c
sys/external/bsd/acpica/dist/executer/exconcat.c
sys/external/bsd/acpica/dist/executer/exconvrt.c
sys/external/bsd/acpica/dist/executer/exfldio.c
sys/external/bsd/acpica/dist/executer/exmisc.c
sys/external/bsd/acpica/dist/executer/exnames.c
sys/external/bsd/acpica/dist/executer/exoparg3.c
sys/external/bsd/acpica/dist/executer/exsystem.c
sys/external/bsd/acpica/dist/executer/exutils.c
sys/external/bsd/acpica/dist/generate/unix/Makefile.common
sys/external/bsd/acpica/dist/generate/unix/Makefile.config
sys/external/bsd/acpica/dist/generate/unix/acpibin/Makefile
sys/external/bsd/acpica/dist/generate/unix/acpidump/Makefile
sys/external/bsd/acpica/dist/generate/unix/acpiexamples/Makefile
sys/external/bsd/acpica/dist/generate/unix/acpiexec/Makefile
sys/external/bsd/acpica/dist/generate/unix/acpinames/Makefile
sys/external/bsd/acpica/dist/generate/unix/acpisrc/Makefile
sys/external/bsd/acpica/dist/generate/unix/acpixtract/Makefile
sys/external/bsd/acpica/dist/generate/unix/iasl/Makefile
sys/external/bsd/acpica/dist/hardware/hwregs.c
sys/external/bsd/acpica/dist/hardware/hwxface.c
sys/external/bsd/acpica/dist/include/acevents.h
sys/external/bsd/acpica/dist/include/acoutput.h
sys/external/bsd/acpica/dist/include/acparser.h
sys/external/bsd/acpica/dist/include/acpredef.h
sys/external/bsd/acpica/dist/include/acrestyp.h
sys/external/bsd/acpica/dist/include/acstruct.h
sys/external/bsd/acpica/dist/include/actbl.h
sys/external/bsd/acpica/dist/include/actbl2.h
sys/external/bsd/acpica/dist/include/actbl3.h
sys/external/bsd/acpica/dist/include/platform/acenv.h
sys/external/bsd/acpica/dist/include/platform/acqnx.h
sys/external/bsd/acpica/dist/namespace/nsconvert.c
sys/external/bsd/acpica/dist/namespace/nsload.c
sys/external/bsd/acpica/dist/namespace/nsprepkg.c
sys/external/bsd/acpica/dist/os_specific/service_layers/osbsdtbl.c
sys/external/bsd/acpica/dist/os_specific/service_layers/osunixmap.c
sys/external/bsd/acpica/dist/parser/psargs.c
sys/external/bsd/acpica/dist/parser/psutils.c
sys/external/bsd/acpica/dist/resources/rsserial.c
sys/external/bsd/acpica/dist/tables/tbfind.c
sys/external/bsd/acpica/dist/tables/tbprint.c
sys/external/bsd/acpica/dist/tools/acpibin/abcompare.c
sys/external/bsd/acpica/dist/tools/acpidump/apdump.c
sys/external/bsd/acpica/dist/tools/acpidump/apmain.c
sys/external/bsd/acpica/dist/tools/acpiexec/aeinitfile.c
sys/external/bsd/acpica/dist/tools/acpiexec/aemain.c
sys/external/bsd/acpica/dist/tools/acpihelp/ahamlops.c
sys/external/bsd/acpica/dist/tools/acpihelp/ahaslops.c
sys/external/bsd/acpica/dist/tools/acpisrc/asfile.c
sys/external/bsd/acpica/dist/tools/acpisrc/astable.c
sys/external/bsd/acpica/dist/tools/examples/examples.c
sys/external/bsd/acpica/dist/utilities/utascii.c
sys/external/bsd/acpica/dist/utilities/utnonansi.c
sys/external/bsd/acpica/dist/utilities/utprint.c
sys/external/bsd/acpica/dist/utilities/utstring.c
sys/external/bsd/acpica/dist/utilities/utxferror.c
sys/external/bsd/acpica/dist/utilities/utxfinit.c
--- a/sys/external/bsd/acpica/dist/changes.txt	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/changes.txt	Wed May 04 18:15:53 2016 +0000
@@ -1,4 +1,237 @@
 ----------------------------------------
+22 April 2016. Summary of changes for version 20160422:
+
+1) ACPICA kernel-resident subsystem:
+
+Fixed a regression in the GAS (generic address structure) arbitrary bit 
+support in AcpiHwRead/AcpiHwWrite. Problem could cause incorrect behavior 
+and incorrect return values. Lv Zheng. ACPICA BZ 1270.
+
+ACPI 6.0: Added support for new/renamed resource macros. One new argument 
+was added to each of these macros, and the original name has been 
+deprecated. The AML disassembler will always disassemble to the new 
+names. Support for the new macros was added to iASL, disassembler, 
+resource manager, and the acpihelp utility. ACPICA BZ 1274.
+
+    I2cSerialBus  -> I2cSerialBusV2
+    SpiSerialBus  -> SpiSerialBusV2
+    UartSerialBus -> UartSerialBusV2
+
+ACPI 6.0: Added support for a new integer field that was appended to the 
+package object returned by the _BIX method. This adds iASL compile-time 
+and AML runtime error checking. ACPICA BZ 1273.
+
+ACPI 6.1: Added support for a new PCCT subtable, "HW-Reduced Comm 
+Subspace Type2" (Headers, Disassembler, and data table compiler).
+
+Example Code and Data Size: These are the sizes for the OS-independent 
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The 
+debug version of the code includes the debug output trace mechanism and 
+has a much larger code and data size.
+
+  Current Release:
+    Non-Debug Version: 137.4K Code, 52.6K Data, 190.0K Total
+    Debug Version:     201.5K Code, 82.2K Data, 283.7K Total
+  Previous Release:
+    Non-Debug Version: 137.1K Code, 51.5K Data, 188.6K Total
+    Debug Version:     201.0K Code, 82.0K Data, 283.0K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Implemented an ASL grammar extension to allow/enable executable 
+"module-level code" to be created and executed under the various 
+operators that create new scopes. This type of AML code is already 
+supported in all known AML interpreters, and the grammar change will 
+appear in the next version of the ACPI specification. Simplifies the 
+conditional runtime creation of named objects under these object types: 
+
+    Device
+    PowerResource
+    Processor
+    Scope
+    ThermalZone
+
+iASL: Implemented a new ASL extension, a "For" loop macro to add greater 
+ease-of-use to the ASL language. The syntax is similar to the 
+corresponding C operator, and is implemented with the existing AML While 
+opcode -- thus requiring no changes to existing AML interpreters.
+
+    For (Initialize, Predicate, Update) {TermList}
+
+Grammar:
+    ForTerm :=
+        For (
+            Initializer    // Nothing | TermArg => ComputationalData
+            Predicate      // Nothing | TermArg => ComputationalData
+            Update         // Nothing | TermArg => ComputationalData
+        ) {TermList}
+
+
+iASL: The _HID/_ADR detection and validation has been enhanced to search 
+under conditionals in order to allow these objects to be conditionally 
+created at runtime.
+
+iASL: Fixed several issues with the constant folding feature. The 
+improvement allows better detection and resolution of statements that can 
+be folded at compile time. ACPICA BZ 1266. 
+
+iASL/Disassembler: Fixed a couple issues with the Else{If{}...} 
+conversion to the ASL ElseIf operator where incorrect ASL code could be 
+generated.
+
+iASL/Disassembler: Fixed a problem with the ASL+ code disassembly where 
+sometimes an extra (and extraneous) set of parentheses were emitted for 
+some combinations of operators. Although this did not cause any problems 
+with recompilation of the disassembled code, it made the code more 
+difficult to read. David Box. ACPICA BZ 1231.
+
+iASL: Changed to ignore the unreferenced detection for predefined names 
+of resource descriptor elements, when the resource descriptor is 
+created/defined within a control method.
+
+iASL: Disassembler: Fix a possible fault with externally declared Buffer 
+objects.
+
+----------------------------------------
+18 March 2016. Summary of changes for version 20160318:
+
+1) ACPICA kernel-resident subsystem:
+
+Added support for arbitrary bit lengths and bit offsets for registers 
+defined by the Generic Address Structure. Previously, only aligned bit 
+lengths of 8/16/32/64 were supported. This was sufficient for many years, 
+but recently some machines have been seen that require arbitrary bit-
+level support. ACPICA BZ 1240. Lv Zheng.
+
+Fixed an issue where the \_SB._INI method sometimes must be evaluated 
+before any _REG methods are evaluated. Lv Zheng.
+
+Implemented several changes related to ACPI table support 
+(Headers/Disassembler/TableCompiler):
+NFIT: For ACPI 6.1, updated to add some additional new fields and 
+constants.
+FADT: Updated a warning message and set compliance to ACPI 6.1 (Version 
+6).
+DMAR: Added new constants per the 10/2014 DMAR spec.
+IORT: Added new subtable per the 10/2015 IORT spec.
+HEST: For ACPI 6.1, added new constants and new subtable.
+DBG2: Added new constants per the 12/2015 DBG2 spec.
+FPDT: Fixed several incorrect fields, add the FPDT boot record structure. 
+ACPICA BZ 1249.
+ERST/EINJ: Updated disassembler with new "Execute Timings" actions.
+
+Updated header support for the DMAR table to match the current version of 
+the related spec.
+
+Added extensions to the ASL Concatenate operator to allow any ACPI object 
+to be passed as an operand. Any object other than Integer/String/Buffer 
+simply returns a string containing the object type. This extends the 
+usefulness of the Printf macros. Previously, Concatenate would abort the 
+control method if a non-data object was encountered.
+
+ACPICA source code: Deployed the C "const" keyword across the source code 
+where appropriate. ACPICA BZ 732. Joerg Sonnenberger (NetBSD).
+
+Example Code and Data Size: These are the sizes for the OS-independent 
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The 
+debug version of the code includes the debug output trace mechanism and 
+has a much larger code and data size.
+
+  Current Release:
+    Non-Debug Version: 137.1K Code, 51.5K Data, 188.6K Total
+    Debug Version:     201.0K Code, 82.0K Data, 283.0K Total
+  Previous Release:
+    Non-Debug Version: 136.2K Code, 51.5K Data, 187.7K Total
+    Debug Version:     200.4K Code, 82.0K Data, 282.4K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL/Disassembler: Improved the heuristic used to determine the number of 
+arguments for an externally defined control method (a method in another 
+table). Although this is an improvement, there is no deterministic way to 
+"guess" the number of method arguments. Only the ACPI 6.0 External opcode 
+will completely solve this problem as it is deployed (automatically) in 
+newer BIOS code.
+
+iASL/Disassembler: Fixed an ordering issue for emitted External() ASL 
+statements that could cause errors when the disassembled file is 
+compiled. ACPICA BZ 1243. David Box.
+
+iASL: Fixed a regression caused by the merger of the two versions of the 
+local strtoul64. Because of a dependency on a global variable, strtoul64 
+could return an error for integers greater than a 32-bit value. ACPICA BZ 
+1260.
+
+iASL: Fixed a regression where a fault could occur for an ASL Return 
+statement if it invokes a control method that is not resolved. ACPICA BZ 
+1264.
+
+AcpiXtract: Improved input file validation: detection of binary files and 
+non-acpidump text files.
+
+----------------------------------------
+12 February 2016. Summary of changes for version 20160212:
+
+1) ACPICA kernel-resident subsystem:
+
+Implemented full support for the ACPI 6.1 specification (released in 
+January). This version of the specification is available at:  
+http://www.uefi.org/specifications
+
+Only a relatively small number of changes were required in ACPICA to 
+support ACPI 6.1, in these areas:
+- New predefined names
+- New _HID values
+- A new subtable for HEST
+- A few other header changes for new values
+
+Ensure \_SB_._INI is executed before any _REG methods are executed. There 
+appears to be existing BIOS code that relies on this behavior. Lv Zheng.
+
+Reverted a change made in version 20151218 which enabled method 
+invocations to be targets of various ASL operators (SuperName and Target 
+grammar elements). While the new behavior is supported by the ACPI 
+specification, other AML interpreters do not support this behavior and 
+never will. The ACPI specification will be updated for ACPI 6.2 to remove 
+this support. Therefore, the change was reverted to the original ACPICA 
+behavior.
+
+ACPICA now supports the GCC 6 compiler.
+
+Current Release: (Note: build changes increased sizes)
+    Non-Debug Version: 136.2K Code, 51.5K Data, 187.7K Total
+    Debug Version:     200.4K Code, 82.0K Data, 282.4K Total
+Previous Release:
+    Non-Debug Version: 102.7K Code, 28.4K Data, 131.1K Total
+    Debug Version:     200.4K Code, 81.9K Data, 282.3K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+Completed full support for the ACPI 6.0 External() AML opcode. The 
+compiler emits an external AML opcode for each ASL External statement. 
+This opcode is used by the disassembler to assist with the disassembly of 
+external control methods by specifying the required number of arguments 
+for the method. AML interpreters do not use this opcode. To ensure that 
+interpreters do not even see the opcode, a block of one or more external 
+opcodes is surrounded by an "If(0)" construct. As this feature becomes 
+commonly deployed in BIOS code, the ability of disassemblers to correctly 
+disassemble AML code will be greatly improved. David Box.
+
+iASL: Implemented support for an optional cross-reference output file. 
+The -lx option will create a the cross-reference file with the suffix 
+"xrf". Three different types of cross-reference are created in this file:
+- List of object references made from within each control method
+- Invocation (caller) list for each user-defined control method
+- List of references to each non-method object in the namespace
+
+iASL: Method invocations as ASL Target operands are now disallowed and 
+flagged as errors in preparation for ACPI 6.2 (see the description of the 
+problem above).
+
+----------------------------------------
 8 January 2016. Summary of changes for version 20160108:
 
 1) ACPICA kernel-resident subsystem:
--- a/sys/external/bsd/acpica/dist/common/acfileio.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/common/acfileio.c	Wed May 04 18:15:53 2016 +0000
@@ -112,7 +112,8 @@
     FileSize = CmGetFileSize (File);
     if (FileSize == ACPI_UINT32_MAX)
     {
-        return (AE_ERROR);
+        Status = AE_ERROR;
+        goto ErrorExit;
     }
 
     fprintf (stderr,
@@ -123,7 +124,8 @@
 
     if (FileSize < sizeof (ACPI_TABLE_HEADER))
     {
-        return (AE_BAD_HEADER);
+        Status = AE_BAD_HEADER;
+        goto ErrorExit;
     }
 
     /* Check for an non-binary file */
@@ -156,7 +158,7 @@
         }
         else if (ACPI_FAILURE (Status))
         {
-            return (Status);
+            goto ErrorExit;
         }
 
         /* Print table header for iASL/disassembler only */
@@ -203,6 +205,7 @@
         *ReturnListHead = ListHead;
     }
 
+ErrorExit:
     fclose(File);
     return (Status);
 }
@@ -409,7 +412,7 @@
 
     /* Validate the signature (limited ASCII chars) */
 
-    if (!AcpiIsValidSignature (TableHeader.Signature))
+    if (!AcpiUtValidNameseg (TableHeader.Signature))
     {
         fprintf (stderr, "Invalid table signature: 0x%8.8X\n",
             *ACPI_CAST_PTR (UINT32, TableHeader.Signature));
--- a/sys/external/bsd/acpica/dist/common/adwalk.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/common/adwalk.c	Wed May 04 18:15:53 2016 +0000
@@ -327,6 +327,7 @@
         WalkState);
     if (ACPI_FAILURE (Status))
     {
+        ACPI_FREE (WalkState);
         return;
     }
 
@@ -442,7 +443,7 @@
  *
  * DESCRIPTION: Check namepath Ops for orphaned method invocations
  *
- * Note: Experimental.
+ * Note: Parts of this are experimental, under possible further development.
  *
  ******************************************************************************/
 
@@ -508,6 +509,7 @@
                 ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
         }
         break;
+
 #endif
 
     case AML_STORE_OP:
@@ -532,7 +534,7 @@
                 /* One Arg means this is just a Store(Name,Target) */
 
                 AcpiDmAddOpToExternalList (ChildOp,
-                    ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
+                    ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, ArgCount, 0);
                 return (AE_OK);
             }
 
@@ -554,7 +556,7 @@
             (ParentOp->Common.AmlOpcode != AML_INT_METHODCALL_OP) &&
             !Op->Common.Node)
         {
-            ArgCount = AcpiDmInspectPossibleArgs (0, 0, Op->Common.Next);
+            ArgCount = AcpiDmInspectPossibleArgs (0, 0, Op);
 
             /*
              * Check if namepath is a predicate for if/while or lone parameter to
@@ -760,6 +762,7 @@
     ACPI_OPERAND_OBJECT     *Object;
     UINT32                  ParamCount = 0;
     char                    *Pathname;
+    UINT16                  Flags = 0;
 
 
     WalkState = Info->WalkState;
@@ -774,7 +777,25 @@
     {
         goto Exit;
     }
+    else if (Op->Common.Parent &&
+             Op->Common.Parent->Common.AmlOpcode == AML_EXTERNAL_OP)
+    {
+        /* External() NamePath */
 
+        Path = Op->Common.Value.String;
+        ObjectType = (ACPI_OBJECT_TYPE) Op->Common.Next->Common.Value.Integer;
+        if (ObjectType == ACPI_TYPE_METHOD)
+        {
+            ParamCount = (UINT32)
+                Op->Common.Next->Common.Next->Common.Value.Integer;
+        }
+
+        Flags |= ACPI_EXT_RESOLVED_REFERENCE | ACPI_EXT_ORIGIN_FROM_OPCODE;
+        AcpiDmAddOpToExternalList (Op, Path,
+            (UINT8) ObjectType, ParamCount, Flags);
+
+        goto Exit;
+    }
 
     /* Get the NamePath from the appropriate place */
 
@@ -837,6 +858,7 @@
     Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
         ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
         WalkState, &Node);
+
     if (ACPI_SUCCESS (Status) && (Node->Flags & ANOBJ_IS_EXTERNAL))
     {
         /* Node was created by an External() statement */
@@ -861,12 +883,12 @@
                 if (Node)
                 {
                     AcpiDmAddNodeToExternalList (Node,
-                        (UINT8) ObjectType, 0, 0);
+                        (UINT8) ObjectType, 7, Flags);
                 }
                 else
                 {
                     AcpiDmAddOpToExternalList (Op, Path,
-                        (UINT8) ObjectType, 0, 0);
+                        (UINT8) ObjectType, 7, Flags);
                 }
             }
         }
@@ -1048,40 +1070,69 @@
 {
     const ACPI_OPCODE_INFO  *OpInfo;
     UINT32                  i;
-    UINT32                  Last = 0;
-    UINT32                  Lookahead;
+    UINT32                  ArgumentCount = 0;
+    ACPI_PARSE_OBJECT       *NextOp;
+    ACPI_PARSE_OBJECT       *ExecuteOp;
 
 
-    Lookahead = (ACPI_METHOD_NUM_ARGS + TargetCount) - CurrentOpArgCount;
+    if (!Op)
+    {
+        return (0);
+    }
 
     /* Lookahead for the maximum number of possible arguments */
 
-    for (i = 0; i < Lookahead; i++)
+    NextOp = Op->Common.Next;
+
+    for (i = 0; (i < ACPI_METHOD_NUM_ARGS) && NextOp; i++)
     {
-        if (!Op)
+        OpInfo = AcpiPsGetOpcodeInfo (NextOp->Common.AmlOpcode);
+
+        /* Any one of these operators is "very probably" not a method arg */
+
+        if ((NextOp->Common.AmlOpcode == AML_STORE_OP) ||
+            (NextOp->Common.AmlOpcode == AML_NOTIFY_OP) ||
+            (OpInfo->Class == AML_CLASS_CONTROL) ||
+            (OpInfo->Class == AML_CLASS_CREATE) ||
+            (OpInfo->Class == AML_CLASS_NAMED_OBJECT))
         {
             break;
         }
 
-        OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
+        if (OpInfo->Class == AML_CLASS_EXECUTE)
+        {
+            /* Probable that this is method arg if there is no target */
+
+            ExecuteOp = NextOp->Common.Value.Arg;
+            while (ExecuteOp)
+            {
+                if ((ExecuteOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP) &&
+                    (ExecuteOp->Common.Value.Arg == NULL))
+                {
+                    /* No target, could be a method arg */
+
+                    break;
+                }
 
-        /*
-         * Any one of these operators is "very probably" not a method arg
-         */
-        if ((Op->Common.AmlOpcode == AML_STORE_OP) ||
-            (Op->Common.AmlOpcode == AML_NOTIFY_OP))
-        {
-            break;
+                if (NextOp->Common.AmlOpcode == AML_REF_OF_OP)
+                {
+                    break;
+                }
+
+                ExecuteOp = ExecuteOp->Common.Next;
+            }
+
+            if (!ExecuteOp)
+            {
+                /* Has a target, not method arg */
+
+                return (ArgumentCount);
+            }
         }
 
-        if ((OpInfo->Class != AML_CLASS_EXECUTE) &&
-            (OpInfo->Class != AML_CLASS_CONTROL))
-        {
-            Last = i+1;
-        }
-
-        Op = Op->Common.Next;
+        ArgumentCount++;
+        NextOp = NextOp->Common.Next;
     }
 
-    return (Last);
+    return (ArgumentCount);
 }
--- a/sys/external/bsd/acpica/dist/common/ahids.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/common/ahids.c	Wed May 04 18:15:53 2016 +0000
@@ -75,6 +75,10 @@
     {"ACPI000D",    "Power Meter Device"},
     {"ACPI000E",    "Time and Alarm Device"},
     {"ACPI000F",    "User Presence Detection Device"},
+    {"ACPI0010",    "Processor Container Device"},
+    {"ACPI0011",    "Generic Buttons Device"},
+    {"ACPI0012",    "NVDIMM Root Device"},
+    {"ACPI0013",    "Generic Event Device"},
     {"ADMA0F28",    "Intel Audio DMA"},
     {"AMCR0F28",    "Intel Audio Machine Driver"},
     {"ATK4001",     "Asus Radio Control Button"},
@@ -185,6 +189,7 @@
     {"PNP0C12",     "Device Bay Controller"},
     {"PNP0C14",     "Windows Management Instrumentation Device"},
     {"PNP0C15",     "Docking Station"},
+    {"PNP0C33",     "Error Device"},
     {"PNP0C40",     "Standard Button Controller"},
     {"PNP0C50",     "HID Protocol Device (I2C bus)"},
     {"PNP0C60",     "Display Sensor Device"},
--- a/sys/external/bsd/acpica/dist/common/ahpredef.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/common/ahpredef.c	Wed May 04 18:15:53 2016 +0000
@@ -140,6 +140,7 @@
     AH_PREDEF ("_FDI",    "Floppy Drive Information", "Returns a floppy drive information block"),
     AH_PREDEF ("_FDM",    "Floppy Drive Mode", "Sets a floppy drive speed"),
     AH_PREDEF ("_FIF",    "Fan Information", "Returns fan device information"),
+    AH_PREDEF ("_FIT",    "Firmware Interface Table", "Returns a list of NFIT structures"),
     AH_PREDEF ("_FIX",    "Fixed Register Resource Provider", "Returns a list of devices that implement FADT register blocks"),
     AH_PREDEF ("_FLC",    "Flow Control", "Flow control, Resource Descriptor field"),
     AH_PREDEF ("_FPS",    "Fan Performance States", "Returns a list of supported fan performance states"),
@@ -332,8 +333,10 @@
     AH_PREDEF ("_UPP",    "User Presence Polling", "Returns the recommended user presence polling interval"),
     AH_PREDEF ("_VEN",    "Vendor Data", "Resource Descriptor field"),
     AH_PREDEF ("_VPO",    "Video Post Options", "Returns the implemented video post options"),
+    AH_PREDEF ("_Wxx",    "Wake Event", "Method executed as a result of a wake event"),
     AH_PREDEF ("_WAK",    "Wake", "Inform AML that the system has just awakened"),
-    AH_PREDEF ("_Wxx",    "Wake Event", "Method executed as a result of a wake event"),
+    AH_PREDEF ("_WPC",    "Wireless Power Calibration", "Calibrate power and notify wireless device"),
+    AH_PREDEF ("_WPP",    "Wireless Power Polling", "Get recommended polling interval"),
     AH_PREDEF (NULL,      NULL, NULL)
 };
 
--- a/sys/external/bsd/acpica/dist/common/dmextern.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/common/dmextern.c	Wed May 04 18:15:53 2016 +0000
@@ -808,28 +808,39 @@
     NextExternal = AcpiGbl_ExternalList;
     while (NextExternal)
     {
+        /* Check for duplicates */
+
         if (!strcmp (ExternalPath, NextExternal->Path))
         {
-            /* Duplicate method, check that the Value (ArgCount) is the same */
-
-            if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
-                (NextExternal->Value != Value) &&
-                (Value > 0))
+            /*
+             * If this external came from an External() opcode, we are
+             * finished with this one. (No need to check any further).
+             */
+            if (NextExternal->Flags & ACPI_EXT_ORIGIN_FROM_OPCODE)
             {
-                ACPI_ERROR ((AE_INFO,
-                    "External method arg count mismatch %s: "
-                    "Current %u, attempted %u",
-                    NextExternal->Path, NextExternal->Value, Value));
+                return_ACPI_STATUS (AE_ALREADY_EXISTS);
             }
 
             /* Allow upgrade of type from ANY */
 
-            else if (NextExternal->Type == ACPI_TYPE_ANY)
+            else if ((NextExternal->Type == ACPI_TYPE_ANY) &&
+                (Type != ACPI_TYPE_ANY))
             {
                 NextExternal->Type = Type;
+            }
+
+            /* Update the argument count as necessary */
+
+            if (Value < NextExternal->Value)
+            {
                 NextExternal->Value = Value;
             }
 
+            /* Update flags. */
+
+            NextExternal->Flags |= Flags;
+            NextExternal->Flags &= ~ACPI_EXT_INTERNAL_PATH_ALLOCATED;
+
             return_ACPI_STATUS (AE_ALREADY_EXISTS);
         }
 
@@ -1077,90 +1088,62 @@
 
     AcpiDmUnresolvedWarning (1);
 
-    /* Emit any unresolved method externals in a single text block */
-
-    NextExternal = AcpiGbl_ExternalList;
-    while (NextExternal)
-    {
-        if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
-            (!(NextExternal->Flags & ACPI_EXT_RESOLVED_REFERENCE)))
-        {
-            AcpiOsPrintf ("    External (%s%s",
-                NextExternal->Path,
-                AcpiDmGetObjectTypeName (NextExternal->Type));
-
-            AcpiOsPrintf (")    // Warning: Unresolved method, "
-                "guessing %u arguments\n",
-                NextExternal->Value);
-
-            NextExternal->Flags |= ACPI_EXT_EXTERNAL_EMITTED;
-        }
-
-        NextExternal = NextExternal->Next;
-    }
-
-    AcpiOsPrintf ("\n");
-
-
-    /* Emit externals that were imported from a file */
-
     if (Gbl_ExternalRefFilename)
     {
         AcpiOsPrintf (
-            "    /*\n     * External declarations that were imported from\n"
-            "     * the reference file [%s]\n     */\n",
+            "    /*\n     * External declarations were imported from\n"
+            "     * a reference file -- %s\n     */\n\n",
             Gbl_ExternalRefFilename);
-
-        NextExternal = AcpiGbl_ExternalList;
-        while (NextExternal)
-        {
-            if (!(NextExternal->Flags & ACPI_EXT_EXTERNAL_EMITTED) &&
-                (NextExternal->Flags & ACPI_EXT_ORIGIN_FROM_FILE))
-            {
-                AcpiOsPrintf ("    External (%s%s",
-                    NextExternal->Path,
-                    AcpiDmGetObjectTypeName (NextExternal->Type));
-
-                if (NextExternal->Type == ACPI_TYPE_METHOD)
-                {
-                    AcpiOsPrintf (")    // %u Arguments\n",
-                        NextExternal->Value);
-                }
-                else
-                {
-                    AcpiOsPrintf (")\n");
-                }
-                NextExternal->Flags |= ACPI_EXT_EXTERNAL_EMITTED;
-            }
-
-            NextExternal = NextExternal->Next;
-        }
-
-        AcpiOsPrintf ("\n");
     }
 
     /*
-     * Walk the list of externals found during the AML parsing
+     * Walk and emit the list of externals found during the AML parsing
      */
     while (AcpiGbl_ExternalList)
     {
         if (!(AcpiGbl_ExternalList->Flags & ACPI_EXT_EXTERNAL_EMITTED))
         {
-            AcpiOsPrintf ("    External (%s%s",
+            AcpiOsPrintf ("    External (%s%s)",
                 AcpiGbl_ExternalList->Path,
                 AcpiDmGetObjectTypeName (AcpiGbl_ExternalList->Type));
 
-            /* For methods, add a comment with the number of arguments */
+            /* Check for "unresolved" method reference */
 
-            if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD)
+            if ((AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD) &&
+                (!(AcpiGbl_ExternalList->Flags & ACPI_EXT_RESOLVED_REFERENCE)))
             {
-                AcpiOsPrintf (")    // %u Arguments\n",
+                AcpiOsPrintf ("    // Warning: Unknown method, "
+                    "guessing %u arguments",
                     AcpiGbl_ExternalList->Value);
             }
+
+            /* Check for external from a external references file */
+
+            else if (AcpiGbl_ExternalList->Flags & ACPI_EXT_ORIGIN_FROM_FILE)
+            {
+                if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD)
+                {
+                    AcpiOsPrintf ("    // %u Arguments",
+                        AcpiGbl_ExternalList->Value);
+                }
+
+                AcpiOsPrintf ("    // From external reference file");
+            }
+
+            /* This is the normal external case */
+
             else
             {
-                AcpiOsPrintf (")\n");
+                /* For methods, add a comment with the number of arguments */
+
+                if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD)
+                {
+                    AcpiOsPrintf ("    // %u Arguments",
+                        AcpiGbl_ExternalList->Value);
+                }
             }
+
+            AcpiOsPrintf ("\n");
         }
 
         /* Free this external info block and move on to next external */
@@ -1266,76 +1249,87 @@
 the owning SSDT has been loaded via the -e option.
 #endif
 
+static char             ExternalWarningPart1[600];
+static char             ExternalWarningPart2[400];
+static char             ExternalWarningPart3[400];
+static char             ExternalWarningPart4[200];
+
 void
 AcpiDmUnresolvedWarning (
     UINT8                   Type)
 {
+    char                    *Format;
+    char                    Pad[] = "     *";
+    char                    NoPad[] = "";
+
 
     if (!AcpiGbl_NumExternalMethods)
     {
         return;
     }
 
+    if (AcpiGbl_NumExternalMethods == AcpiGbl_ResolvedExternalMethods)
+    {
+        return;
+    }
+
+    Format = Type ? Pad : NoPad;
+
+    sprintf (ExternalWarningPart1,
+        "%s iASL Warning: There %s %u external control method%s found during\n"
+        "%s disassembly, but only %u %s resolved (%u unresolved). Additional\n"
+        "%s ACPI tables may be required to properly disassemble the code. This\n"
+        "%s resulting disassembler output file may not compile because the\n"
+        "%s disassembler did not know how many arguments to assign to the\n"
+        "%s unresolved methods. Note: SSDTs can be dynamically loaded at\n"
+        "%s runtime and may or may not be available via the host OS.\n",
+        Format, (AcpiGbl_NumExternalMethods != 1 ? "were" : "was"),
+        AcpiGbl_NumExternalMethods, (AcpiGbl_NumExternalMethods != 1 ? "s" : ""),
+        Format, AcpiGbl_ResolvedExternalMethods,
+        (AcpiGbl_ResolvedExternalMethods != 1 ? "were" : "was"),
+        (AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods),
+        Format, Format, Format, Format, Format);
+
+    sprintf (ExternalWarningPart2,
+        "%s To specify the tables needed to resolve external control method\n"
+        "%s references, the -e option can be used to specify the filenames.\n"
+        "%s Example iASL invocations:\n"
+        "%s     iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n"
+        "%s     iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n"
+        "%s     iasl -e ssdt*.aml -d dsdt.aml\n",
+        Format, Format, Format, Format, Format, Format);
+
+    sprintf (ExternalWarningPart3,
+        "%s In addition, the -fe option can be used to specify a file containing\n"
+        "%s control method external declarations with the associated method\n"
+        "%s argument counts. Each line of the file must be of the form:\n"
+        "%s     External (<method pathname>, MethodObj, <argument count>)\n"
+        "%s Invocation:\n"
+        "%s     iasl -fe refs.txt -d dsdt.aml\n",
+        Format, Format, Format, Format, Format, Format);
+
+    sprintf (ExternalWarningPart4,
+        "%s The following methods were unresolved and many not compile properly\n"
+        "%s because the disassembler had to guess at the number of arguments\n"
+        "%s required for each:\n",
+        Format, Format, Format);
+
     if (Type)
     {
         if (!AcpiGbl_ExternalFileList)
         {
             /* The -e option was not specified */
 
-           AcpiOsPrintf ("    /*\n"
-                "     * iASL Warning: There were %u external control methods found during\n"
-                "     * disassembly, but additional ACPI tables to resolve these externals\n"
-                "     * were not specified. This resulting disassembler output file may not\n"
-                "     * compile because the disassembler did not know how many arguments\n"
-                "     * to assign to these methods. To specify the tables needed to resolve\n"
-                "     * external control method references, the -e option can be used to\n"
-                "     * specify the filenames. Note: SSDTs can be dynamically loaded at\n"
-                "     * runtime and may or may not be available via the host OS.\n"
-                "     * Example iASL invocations:\n"
-                "     *     iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n"
-                "     *     iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n"
-                "     *     iasl -e ssdt*.aml -d dsdt.aml\n"
-                "     *\n"
-                "     * In addition, the -fe option can be used to specify a file containing\n"
-                "     * control method external declarations with the associated method\n"
-                "     * argument counts. Each line of the file must be of the form:\n"
-                "     *     External (<method pathname>, MethodObj, <argument count>)\n"
-                "     * Invocation:\n"
-                "     *     iasl -fe refs.txt -d dsdt.aml\n"
-                "     *\n"
-                "     * The following methods were unresolved and many not compile properly\n"
-                "     * because the disassembler had to guess at the number of arguments\n"
-                "     * required for each:\n"
-                "     */\n",
-               AcpiGbl_NumExternalMethods);
+           AcpiOsPrintf ("    /*\n%s     *\n%s     *\n%s     *\n%s     */\n",
+               ExternalWarningPart1, ExternalWarningPart2, ExternalWarningPart3,
+               ExternalWarningPart4);
         }
-        else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods)
+        else
         {
             /* The -e option was specified, but there are still some unresolved externals */
 
-            AcpiOsPrintf ("    /*\n"
-                "     * iASL Warning: There were %u external control methods found during\n"
-                "     * disassembly, but only %u %s resolved (%u unresolved). Additional\n"
-                "     * ACPI tables may be required to properly disassemble the code. This\n"
-                "     * resulting disassembler output file may not compile because the\n"
-                "     * disassembler did not know how many arguments to assign to the\n"
-                "     * unresolved methods. Note: SSDTs can be dynamically loaded at\n"
-                "     * runtime and may or may not be available via the host OS.\n"
-                "     *\n"
-                "     * If necessary, the -fe option can be used to specify a file containing\n"
-                "     * control method external declarations with the associated method\n"
-                "     * argument counts. Each line of the file must be of the form:\n"
-                "     *     External (<method pathname>, MethodObj, <argument count>)\n"
-                "     * Invocation:\n"
-                "     *     iasl -fe refs.txt -d dsdt.aml\n"
-                "     *\n"
-                "     * The following methods were unresolved and many not compile properly\n"
-                "     * because the disassembler had to guess at the number of arguments\n"
-                "     * required for each:\n"
-                "     */\n",
-                AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods,
-                (AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"),
-                (AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods));
+            AcpiOsPrintf ("    /*\n%s     *\n%s     *\n%s     */\n",
+               ExternalWarningPart1, ExternalWarningPart3, ExternalWarningPart4);
         }
     }
     else
@@ -1344,50 +1338,15 @@
         {
             /* The -e option was not specified */
 
-            fprintf (stderr, "\n"
-                "iASL Warning: There were %u external control methods found during\n"
-                "disassembly, but additional ACPI tables to resolve these externals\n"
-                "were not specified. The resulting disassembler output file may not\n"
-                "compile because the disassembler did not know how many arguments\n"
-                "to assign to these methods. To specify the tables needed to resolve\n"
-                "external control method references, the -e option can be used to\n"
-                "specify the filenames. Note: SSDTs can be dynamically loaded at\n"
-                "runtime and may or may not be available via the host OS.\n"
-                "Example iASL invocations:\n"
-                "    iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n"
-                "    iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n"
-                "    iasl -e ssdt*.aml -d dsdt.aml\n"
-                "\n"
-                "In addition, the -fe option can be used to specify a file containing\n"
-                "control method external declarations with the associated method\n"
-                "argument counts. Each line of the file must be of the form:\n"
-                "    External (<method pathname>, MethodObj, <argument count>)\n"
-                "Invocation:\n"
-                "    iasl -fe refs.txt -d dsdt.aml\n",
-                AcpiGbl_NumExternalMethods);
+            fprintf (stderr, "\n%s\n%s\n%s\n",
+               ExternalWarningPart1, ExternalWarningPart2, ExternalWarningPart3);
         }
-        else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods)
+        else
         {
             /* The -e option was specified, but there are still some unresolved externals */
 
-            fprintf (stderr, "\n"
-                "iASL Warning: There were %u external control methods found during\n"
-                "disassembly, but only %u %s resolved (%u unresolved). Additional\n"
-                "ACPI tables may be required to properly disassemble the code. The\n"
-                "resulting disassembler output file may not compile because the\n"
-                "disassembler did not know how many arguments to assign to the\n"
-                "unresolved methods. Note: SSDTs can be dynamically loaded at\n"
-                "runtime and may or may not be available via the host OS.\n"
-                "\n"
-                "If necessary, the -fe option can be used to specify a file containing\n"
-                "control method external declarations with the associated method\n"
-                "argument counts. Each line of the file must be of the form:\n"
-                "    External (<method pathname>, MethodObj, <argument count>)\n"
-                "Invocation:\n"
-                "    iasl -fe refs.txt -d dsdt.aml\n",
-                AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods,
-                (AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"),
-                (AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods));
+            fprintf (stderr, "\n%s\n%s\n",
+               ExternalWarningPart1, ExternalWarningPart3);
         }
     }
 }
--- a/sys/external/bsd/acpica/dist/common/dmrestag.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/common/dmrestag.c	Wed May 04 18:15:53 2016 +0000
@@ -279,6 +279,7 @@
 static const ACPI_RESOURCE_TAG      AcpiDmI2cSerialBusTags[] =
 {
     {( 6 * 8) + 0,  ACPI_RESTAG_SLAVEMODE},
+    {( 6 * 8) + 2,  ACPI_RESTAG_INTERRUPTSHARE},    /* V2 - ACPI 6.0 */
     {( 7 * 8) + 0,  ACPI_RESTAG_MODE},
     {(12 * 8),      ACPI_RESTAG_SPEED},
     {(16 * 8),      ACPI_RESTAG_ADDRESS},
@@ -288,6 +289,7 @@
 static const ACPI_RESOURCE_TAG      AcpiDmSpiSerialBusTags[] =
 {
     {( 6 * 8) + 0,  ACPI_RESTAG_SLAVEMODE},
+    {( 6 * 8) + 2,  ACPI_RESTAG_INTERRUPTSHARE},    /* V2 - ACPI 6.0 */
     {( 7 * 8) + 0,  ACPI_RESTAG_MODE},
     {( 7 * 8) + 1,  ACPI_RESTAG_DEVICEPOLARITY},
     {(12 * 8),      ACPI_RESTAG_SPEED},
@@ -300,7 +302,8 @@
 
 static const ACPI_RESOURCE_TAG      AcpiDmUartSerialBusTags[] =
 {
-    {( 6 * 8) + 0,  ACPI_RESTAG_SLAVEMODE}, /* Note: not part of original macro */
+    {( 6 * 8) + 0,  ACPI_RESTAG_SLAVEMODE},         /* Note: not part of original macro */
+    {( 6 * 8) + 2,  ACPI_RESTAG_INTERRUPTSHARE},    /* V2 - ACPI 6.0 */
     {( 7 * 8) + 0,  ACPI_RESTAG_FLOWCONTROL},
     {( 7 * 8) + 2,  ACPI_RESTAG_STOPBITS},
     {( 7 * 8) + 4,  ACPI_RESTAG_LENGTH},
--- a/sys/external/bsd/acpica/dist/common/dmtable.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/common/dmtable.c	Wed May 04 18:15:53 2016 +0000
@@ -58,15 +58,6 @@
     char                    *Signature);
 
 
-/* Local Prototypes */
-
-static void
-AcpiDmCheckAscii (
-    UINT8                   *Target,
-    char                    *RepairedName,
-    UINT32                  Count);
-
-
 /* Common format strings for commented values */
 
 #define UINT8_FORMAT        "%2.2X [%s]\n"
@@ -118,6 +109,7 @@
     "Check Busy Status",
     "Get Command Status",
     "Set Error Type With Address",
+    "Get Execute Timings",
     "Unknown Action"
 };
 
@@ -150,6 +142,7 @@
     "Get Error Address Range",
     "Get Error Address Length",
     "Get Error Attributes",
+    "Execute Timings",
     "Unknown Action"
 };
 
@@ -196,6 +189,7 @@
     "PCI Express AER (AER Endpoint)",
     "PCI Express/PCI-X Bridge AER",
     "Generic Hardware Error Source",
+    "Generic Hardware Error Source V2",
     "Unknown Subtable Type"         /* Reserved */
 };
 
@@ -208,6 +202,10 @@
     "NMI",
     "CMCI",                         /* ACPI 5.0 */
     "MCE",                          /* ACPI 5.0 */
+    "GPIO",                         /* ACPI 6.0 */
+    "SEA",                          /* ACPI 6.1 */
+    "SEI",                          /* ACPI 6.1 */
+    "GSIV",                         /* ACPI 6.1 */
     "Unknown Notify Type"           /* Reserved */
 };
 
@@ -248,6 +246,7 @@
 {
     "Generic Communications Subspace",  /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */
     "HW-Reduced Comm Subspace",         /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE */
+    "HW-Reduced Comm Subspace Type2",   /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 */
     "Unknown Subtable Type"             /* Reserved */
 };
 
@@ -1052,7 +1051,7 @@
 
         case ACPI_DMT_SIG:
 
-            AcpiDmCheckAscii (Target, RepairedName, 4);
+            AcpiUtCheckAndRepairAscii (Target, RepairedName, 4);
             AcpiOsPrintf ("\"%.4s\"    ", RepairedName);
 
             TableData = AcpiAhGetTableInfo (ACPI_CAST_PTR (char, Target));
@@ -1068,19 +1067,19 @@
 
         case ACPI_DMT_NAME4:
 
-            AcpiDmCheckAscii (Target, RepairedName, 4);
+            AcpiUtCheckAndRepairAscii (Target, RepairedName, 4);
             AcpiOsPrintf ("\"%.4s\"\n", RepairedName);
             break;
 
         case ACPI_DMT_NAME6:
 
-            AcpiDmCheckAscii (Target, RepairedName, 6);
+            AcpiUtCheckAndRepairAscii (Target, RepairedName, 6);
             AcpiOsPrintf ("\"%.6s\"\n", RepairedName);
             break;
 
         case ACPI_DMT_NAME8:
 
-            AcpiDmCheckAscii (Target, RepairedName, 8);
+            AcpiUtCheckAndRepairAscii (Target, RepairedName, 8);
             AcpiOsPrintf ("\"%.8s\"\n", RepairedName);
             break;
 
@@ -1483,42 +1482,3 @@
 
     return (AE_OK);
 }
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiDmCheckAscii
- *
- * PARAMETERS:  Name                - Ascii string
- *              Count               - Number of characters to check
- *
- * RETURN:      None
- *
- * DESCRIPTION: Ensure that the requested number of characters are printable
- *              Ascii characters. Sets non-printable and null chars to <space>.
- *
- ******************************************************************************/
-
-static void
-AcpiDmCheckAscii (
-    UINT8                   *Name,
-    char                    *RepairedName,
-    UINT32                  Count)
-{
-    UINT32                  i;
-
-
-    for (i = 0; i < Count; i++)
-    {
-        RepairedName[i] = (char) Name[i];
-
-        if (!Name[i])
-        {
-            return;
-        }
-        if (!isprint (Name[i]))
-        {
-            RepairedName[i] = ' ';
-        }
-    }
-}
--- a/sys/external/bsd/acpica/dist/common/dmtables.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/common/dmtables.c	Wed May 04 18:15:53 2016 +0000
@@ -141,10 +141,14 @@
     char                    *Filename,
     ACPI_TABLE_HEADER       *Table)
 {
-    char                    *NewFilename;
     UINT8                   Checksum;
 
 
+    /* Reset globals for External statements */
+
+    AcpiGbl_NumExternalMethods = 0;
+    AcpiGbl_ResolvedExternalMethods = 0;
+
     /*
      * Print file header and dump original table header
      */
@@ -179,11 +183,10 @@
 
         break;
     }
-    AcpiOsPrintf ("\n");
 
     /* Print and validate the table checksum */
 
-    AcpiOsPrintf (" *     Checksum         0x%2.2X",        Table->Checksum);
+    AcpiOsPrintf ("\n *     Checksum         0x%2.2X",        Table->Checksum);
 
     Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), Table->Length);
     if (Checksum)
@@ -200,33 +203,16 @@
     AcpiOsPrintf (" *     Compiler Version 0x%8.8X (%u)\n", Table->AslCompilerRevision, Table->AslCompilerRevision);
     AcpiOsPrintf (" */\n");
 
-    /* Create AML output filename based on input filename */
-
-    if (Filename)
-    {
-        NewFilename = FlGenerateFilename (Filename, "aml");
-    }
-    else
-    {
-        NewFilename = UtStringCacheCalloc (9);
-        if (NewFilename)
-        {
-            strncat (NewFilename, Table->Signature, 4);
-            strcat (NewFilename, ".aml");
-        }
-    }
-
-    if (!NewFilename)
-    {
-        AcpiOsPrintf (" **** Could not generate AML output filename\n");
-        return;
-    }
-
-    /* Open the ASL definition block */
-
+    /*
+     * Open the ASL definition block.
+     *
+     * Note: the AMLFilename string is left zero-length in order to just let
+     * the compiler create it when the disassembled file is compiled. This
+     * makes it easier to rename the disassembled ASL file if needed.
+     */
     AcpiOsPrintf (
-        "DefinitionBlock (\"%s\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
-        NewFilename, Table->Signature, Table->Revision,
+        "DefinitionBlock (\"\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
+        Table->Signature, Table->Revision,
         Table->OemId, Table->OemTableId, Table->OemRevision);
 }
 
--- a/sys/external/bsd/acpica/dist/compiler/aslbtypes.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslbtypes.c	Wed May 04 18:15:53 2016 +0000
@@ -408,12 +408,25 @@
         Node = Op->Asl.Node;
         if (!Node)
         {
+            /* These are not expected to have a node at this time */
+
+            if ((Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEWORDFIELD) ||
+                (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEDWORDFIELD) ||
+                (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEQWORDFIELD) ||
+                (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEBYTEFIELD) ||
+                (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEBITFIELD) ||
+                (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEFIELD)    ||
+                (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF))
+            {
+                return (ACPI_UINT32_MAX - 1);
+            }
+
             DbgPrint (ASL_DEBUG_OUTPUT,
                 "No attached Nsnode: [%s] at line %u name [%s], "
-                "ignoring typecheck\n",
+                "ignoring typecheck. Parent [%s]\n",
                 Op->Asl.ParseOpName, Op->Asl.LineNumber,
-                Op->Asl.ExternalName);
-            return (ACPI_UINT32_MAX);
+                Op->Asl.ExternalName, Op->Asl.Parent->Asl.ParseOpName);
+            return (ACPI_UINT32_MAX - 1);
         }
 
         ThisNodeBtype = AnMapEtypeToBtype (Node->Type);
--- a/sys/external/bsd/acpica/dist/compiler/aslcodegen.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslcodegen.c	Wed May 04 18:15:53 2016 +0000
@@ -97,22 +97,16 @@
     void)
 {
 
-    DbgPrint (ASL_DEBUG_OUTPUT, "\nWriting AML\n\n");
-
     /* Generate the AML output file */
 
     FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0);
     Gbl_SourceLine = 0;
     Gbl_NextError = Gbl_ErrorLog;
 
-    TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
+    TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
         CgAmlWriteWalk, NULL, NULL);
 
-    DbgPrint (ASL_TREE_OUTPUT,
-        "%*s Value    P_Op A_Op OpLen PByts Len  SubLen PSubLen OpPtr"
-        "    Parent   Child    Next     Flags    AcTyp    Final Col L#  EL#  LL#  ELL#\n",
-        76, " ");
-
+    DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER2);
     CgCloseTable ();
 }
 
@@ -136,40 +130,43 @@
     void                    *Context)
 {
 
-    /*
-     * Print header at level 0. Alignment assumes 32-bit pointers
-     */
+    /* Generate the AML for this node */
+
+    CgWriteNode (Op);
+
+    if (!Gbl_DebugFlag)
+    {
+        return (AE_OK);
+    }
+
+    /* Print header at level 0. Alignment assumes 32-bit pointers */
+
     if (!Level)
     {
         DbgPrint (ASL_TREE_OUTPUT,
-            "Final parse tree used for AML output:\n");
-        DbgPrint (ASL_TREE_OUTPUT,
-            "%*s Value    P_Op A_Op OpLen PByts Len  SubLen PSubLen OpPtr"
-            "    Parent   Child    Next     Flags    AcTyp    Final Col L#  EL#  LL#  ELL#\n",
-            76, " ");
+            "\nFinal parse tree used for AML output:\n");
+        DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER2);
     }
 
-    /* Debug output */
-
-    DbgPrint (ASL_TREE_OUTPUT,
-        "%5.5d [%2d]", Op->Asl.LogicalLineNumber, Level);
-    UtPrintFormattedName (Op->Asl.ParseOpcode, Level);
+    /* Dump ParseOp name and possible value */
 
-    if (Op->Asl.ParseOpcode == PARSEOP_NAMESEG    ||
-        Op->Asl.ParseOpcode == PARSEOP_NAMESTRING ||
-        Op->Asl.ParseOpcode == PARSEOP_METHODCALL)
+    switch (Op->Asl.ParseOpcode)
     {
-        DbgPrint (ASL_TREE_OUTPUT,
-            "%10.32s      ", Op->Asl.ExternalName);
-    }
-    else
-    {
-        DbgPrint (ASL_TREE_OUTPUT, "                ");
+    case PARSEOP_NAMESEG:
+    case PARSEOP_NAMESTRING:
+    case PARSEOP_METHODCALL:
+    case PARSEOP_STRING_LITERAL:
+
+        UtDumpStringOp (Op, Level);
+        break;
+
+    default:
+
+        UtDumpBasicOp (Op, Level);
+        break;
     }
 
-    DbgPrint (ASL_TREE_OUTPUT,
-        "%08X %04X %04X %01X     %04X  %04X %04X   %04X    "
-        "%08X %08X %08X %08X %08X %08X %04X  %02d  %02d   %02d   %02d   %02d\n",
+    DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_DEBUG2,
         /* 1  */ (UINT32) Op->Asl.Value.Integer,
         /* 2  */ Op->Asl.ParseOpcode,
         /* 3  */ Op->Asl.AmlOpcode,
@@ -191,9 +188,6 @@
         /* 19 */ Op->Asl.LogicalLineNumber,
         /* 20 */ Op->Asl.EndLogicalLine);
 
-    /* Generate the AML for this node */
-
-    CgWriteNode (Op);
     return (AE_OK);
 }
 
@@ -558,7 +552,7 @@
 
     /* Process all definition blocks */
 
-    Op = RootNode->Asl.Child;
+    Op = Gbl_ParseTreeRoot->Asl.Child;
     while (Op)
     {
         CgUpdateHeader (Op);
@@ -590,13 +584,18 @@
     /* TBD: this may not be the best place for this check */
 
     if ((Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)  ||
-        (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL)     ||
         (Op->Asl.ParseOpcode == PARSEOP_INCLUDE)      ||
         (Op->Asl.ParseOpcode == PARSEOP_INCLUDE_END))
     {
         return;
     }
 
+    if ((Op->Asl.ParseOpcode == PARSEOP_EXTERNAL) &&
+        Gbl_DoExternals == FALSE)
+    {
+        return;
+    }
+
     Op->Asl.FinalAmlLength = 0;
 
     switch (Op->Asl.AmlOpcode)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asldebug.c	Wed May 04 18:15:53 2016 +0000
@@ -0,0 +1,253 @@
+/******************************************************************************
+ *
+ * Module Name: asldebug -- Debug output support
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2016, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ *    of any contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include "aslcompiler.h"
+#include "aslcompiler.y.h"
+
+
+#define _COMPONENT          ACPI_COMPILER
+        ACPI_MODULE_NAME    ("asldebug")
+
+
+/* Local prototypes */
+
+static void
+UtDumpParseOpName (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    UINT32                  DataLength);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    UtDumpIntegerOp
+ *
+ * PARAMETERS:  Op                  - Current parse op
+ *              Level               - Current output indentation level
+ *              IntegerLength       - Output length of the integer (2/4/8/16)
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Emit formatted debug output for "integer" ops.
+ *              Note: IntegerLength must be one of 2,4,8,16.
+ *
+ ******************************************************************************/
+
+void
+UtDumpIntegerOp (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    UINT32                  IntegerLength)
+{
+
+    /* Emit the ParseOp name, leaving room for the integer */
+
+    UtDumpParseOpName (Op, Level, IntegerLength);
+
+    /* Emit the integer based upon length */
+
+    switch (IntegerLength)
+    {
+    case 2: /* Byte */
+    case 4: /* Word */
+    case 8: /* Dword */
+
+        DbgPrint (ASL_TREE_OUTPUT,
+            "%*.*X", IntegerLength, IntegerLength, Op->Asl.Value.Integer);
+        break;
+
+    case 16: /* Qword and Integer */
+
+        DbgPrint (ASL_TREE_OUTPUT,
+            "%8.8X%8.8X", ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer));
+        break;
+
+    default:
+        break;
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    UtDumpStringOp
+ *
+ * PARAMETERS:  Op                  - Current parse op
+ *              Level               - Current output indentation level
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Emit formatted debug output for String/Pathname ops.
+ *
+ ******************************************************************************/
+
+void
+UtDumpStringOp (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level)
+{
+    char                    *String;
+
+
+    String = Op->Asl.Value.String;
+
+    if (Op->Asl.ParseOpcode != PARSEOP_STRING_LITERAL)
+    {
+        /*
+         * For the "path" ops NAMEPATH, NAMESEG, METHODCALL -- if the
+         * ExternalName is valid, it takes precedence. In these cases the
+         * Value.String is the raw "internal" name from the AML code, which
+         * we don't want to use, because it contains non-ascii characters.
+         */
+        if (Op->Asl.ExternalName)
+        {
+            String = Op->Asl.ExternalName;
+        }
+    }
+
+    if (!String)
+    {
+        DbgPrint (ASL_TREE_OUTPUT,
+            " ERROR: Could not find a valid String/Path pointer\n");
+        return;
+    }
+
+    /* Emit the ParseOp name, leaving room for the string */
+
+    UtDumpParseOpName (Op, Level, strlen (String));
+    DbgPrint (ASL_TREE_OUTPUT, "%s", String);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    UtDumpBasicOp
+ *
+ * PARAMETERS:  Op                  - Current parse op
+ *              Level               - Current output indentation level
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Generic formatted debug output for "basic" ops that have no
+ *              associated strings or integer values.
+ *
+ ******************************************************************************/
+
+void
+UtDumpBasicOp (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level)
+{
+
+    /* Just print out the ParseOp name, there is no extra data */
+
+    UtDumpParseOpName (Op, Level, 0);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    UtDumpParseOpName
+ *
+ * PARAMETERS:  Op                  - Current parse op
+ *              Level               - Current output indentation level
+ *              DataLength          - Length of data to appear after the name
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Indent and emit the ascii ParseOp name for the op
+ *
+ ******************************************************************************/
+
+static void
+UtDumpParseOpName (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    UINT32                  DataLength)
+{
+    char                    *ParseOpName;
+    UINT32                  IndentLength;
+    UINT32                  NameLength;
+    UINT32                  LineLength;
+    UINT32                  PaddingLength;
+
+
+    /* Emit the LineNumber/IndentLevel prefix on each output line */
+
+    DbgPrint (ASL_TREE_OUTPUT,
+        "%5.5d [%2d]", Op->Asl.LogicalLineNumber, Level);
+
+    ParseOpName = UtGetOpName (Op->Asl.ParseOpcode);
+
+    /* Calculate various lengths for output alignment */
+
+    IndentLength = Level * DEBUG_SPACES_PER_INDENT;
+    NameLength = strlen (ParseOpName);
+    LineLength = IndentLength + 1 + NameLength + 1 + DataLength;
+    PaddingLength = (DEBUG_MAX_LINE_LENGTH + 1) - LineLength;
+
+    /* Parse tree indentation is based upon the nesting/indent level */
+
+    if (Level)
+    {
+        DbgPrint (ASL_TREE_OUTPUT, "%*s", IndentLength, " ");
+    }
+
+    /* Emit the actual name here */
+
+    DbgPrint (ASL_TREE_OUTPUT, " %s", ParseOpName);
+
+    /* Emit extra padding blanks for alignment of later data items */
+
+    if (LineLength > DEBUG_MAX_LINE_LENGTH)
+    {
+        /* Split a long line immediately after the ParseOpName string */
+
+        DbgPrint (ASL_TREE_OUTPUT, "\n%*s",
+            (DEBUG_FULL_LINE_LENGTH - DataLength), " ");
+    }
+    else
+    {
+        DbgPrint (ASL_TREE_OUTPUT, "%*s", PaddingLength, " ");
+    }
+}
--- a/sys/external/bsd/acpica/dist/compiler/asldefine.h	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asldefine.h	Wed May 04 18:15:53 2016 +0000
@@ -54,7 +54,7 @@
 #define ASL_CREATOR_ID              "INTL"
 #define ASL_DEFINE                  "__IASL__"
 
-#define ASL_COMPLIANCE              "Supports ACPI Specification Revision 6.0"
+#define ASL_COMPLIANCE              "Supports ACPI Specification Revision 6.1"
 
 
 /* Configuration constants */
@@ -118,8 +118,7 @@
 #define ASL_ABORT                   TRUE
 #define ASL_NO_ABORT                FALSE
 #define ASL_EOF                     ACPI_UINT32_MAX
-#define ASL_WITHIN_COMMENT          (ACPI_UINT32_MAX -1)
-#define ASL_BLANK_LINE              (ACPI_UINT32_MAX -1)
+#define ASL_IGNORE_LINE            (ACPI_UINT32_MAX -1)
 
 
 /* Listings */
@@ -156,4 +155,34 @@
 #define RsCreateQwordField(Op, Name, ByteOffset) \
     RsCreateResourceField (Op, Name, ByteOffset, 0, 64);
 
+
+/*
+ * Macros for debug output
+ */
+
+#define DEBUG_MAX_LINE_LENGTH       61
+#define DEBUG_SPACES_PER_INDENT     3
+#define DEBUG_FULL_LINE_LENGTH      71
+
+#define ASL_PARSE_TREE_FULL_LINE    "\n%71.71s"
+
+/* Header/Trailer for original parse tree directly from the parser */
+
+#define ASL_PARSE_TREE_HEADER1 \
+    "%*s Value P_Op Flags     Line#  End# LogL# EndL#\n", 65, " "
+
+#define ASL_PARSE_TREE_DEBUG1 \
+    " %4.4X %8.8X %5d %5d %5d %5d"
+
+/* Header/Trailer for processed parse tree used for AML generation */
+
+#define ASL_PARSE_TREE_HEADER2 \
+    "%*s NameString Value    P_Op A_Op OpLen PByts Len  SubLen PSubLen OpPtr"\
+    "    Parent   Child    Next     Flags    AcTyp    Final Col"\
+    " Line#  End# LogL# EndL#\n", 60, " "
+
+#define ASL_PARSE_TREE_DEBUG2 \
+    " %08X %04X %04X %01X     %04X  %04X %05X  %05X   "\
+    "%08X %08X %08X %08X %08X %08X %04X  %02d  %5d %5d %5d %5d\n"
+
 #endif /* ASLDEFINE.H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslexternal.c	Wed May 04 18:15:53 2016 +0000
@@ -0,0 +1,498 @@
+/******************************************************************************
+ *
+ * Module Name: aslexternal - ASL External opcode compiler support
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2016, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ *    of any contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include "aslcompiler.h"
+#include "aslcompiler.y.h"
+#include "acparser.h"
+#include "amlcode.h"
+#include "acnamesp.h"
+
+
+#define _COMPONENT          ACPI_COMPILER
+        ACPI_MODULE_NAME    ("aslexternal")
+
+
+/* Local prototypes */
+
+static void
+ExInsertArgCount (
+    ACPI_PARSE_OBJECT       *Op);
+
+static void
+ExMoveExternals (
+    ACPI_PARSE_OBJECT       *DefinitionBlockOp);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    ExDoExternal
+ *
+ * PARAMETERS:  Op                  - Current Parse node
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Add an External() definition to the global list. This list
+ *              is used to generate External opcodes.
+ *
+ ******************************************************************************/
+
+void
+ExDoExternal (
+    ACPI_PARSE_OBJECT       *Op)
+{
+    ACPI_PARSE_OBJECT       *ListOp;
+    ACPI_PARSE_OBJECT       *Prev;
+    ACPI_PARSE_OBJECT       *Next;
+    ACPI_PARSE_OBJECT       *ArgCountOp;
+
+
+    ArgCountOp = Op->Asl.Child->Asl.Next->Asl.Next;
+    ArgCountOp->Asl.AmlOpcode = AML_RAW_DATA_BYTE;
+    ArgCountOp->Asl.ParseOpcode = PARSEOP_BYTECONST;
+    ArgCountOp->Asl.Value.Integer = 0;
+    UtSetParseOpName (ArgCountOp);
+
+    /* Create new list node of arbitrary type */
+
+    ListOp = TrAllocateNode (PARSEOP_DEFAULT_ARG);
+
+    /* Store External node as child */
+
+    ListOp->Asl.Child = Op;
+    ListOp->Asl.Next = NULL;
+
+    if (Gbl_ExternalsListHead)
+    {
+        /* Link new External to end of list */
+
+        Prev = Gbl_ExternalsListHead;
+        Next = Prev;
+        while (Next)
+        {
+            Prev = Next;
+            Next = Next->Asl.Next;
+        }
+
+        Prev->Asl.Next = ListOp;
+    }
+    else
+    {
+        Gbl_ExternalsListHead = ListOp;
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    ExInsertArgCount
+ *
+ * PARAMETERS:  Op              - Op for a method invocation
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Obtain the number of arguments for a control method -- from
+ *              the actual invocation.
+ *
+ ******************************************************************************/
+
+static void
+ExInsertArgCount (
+    ACPI_PARSE_OBJECT       *Op)
+{
+    ACPI_PARSE_OBJECT       *Next;
+    ACPI_PARSE_OBJECT       *NameOp;
+    ACPI_PARSE_OBJECT       *Child;
+    ACPI_PARSE_OBJECT       *ArgCountOp;
+    char *                  ExternalName;
+    char *                  CallName;
+    UINT16                  ArgCount = 0;
+    ACPI_STATUS             Status;
+
+
+    CallName = AcpiNsGetNormalizedPathname (Op->Asl.Node, TRUE);
+
+    Next = Gbl_ExternalsListHead;
+    while (Next)
+    {
+        ArgCount = 0;
+
+        /* Skip if External node already handled */
+
+        if (Next->Asl.Child->Asl.CompileFlags & NODE_VISITED)
+        {
+            Next = Next->Asl.Next;
+            continue;
+        }
+
+        NameOp = Next->Asl.Child->Asl.Child;
+        ExternalName = AcpiNsGetNormalizedPathname (NameOp->Asl.Node, TRUE);
+
+        if (strcmp (CallName, ExternalName))
+        {
+            ACPI_FREE (ExternalName);
+            Next = Next->Asl.Next;
+            continue;
+        }
+
+        Next->Asl.Child->Asl.CompileFlags |= NODE_VISITED;
+
+        /*
+         * Since we will reposition Externals to the Root, set Namepath
+         * to the fully qualified name and recalculate the aml length
+         */
+        Status = UtInternalizeName (ExternalName,
+            &NameOp->Asl.Value.String);
+
+        ACPI_FREE (ExternalName);
+        if (ACPI_FAILURE (Status))
+        {
+            AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL,
+                NULL, "- Could not Internalize External");
+            break;
+        }
+
+        NameOp->Asl.AmlLength = strlen (NameOp->Asl.Value.String);
+
+        /* Get argument count */
+
+        Child = Op->Asl.Child;
+        while (Child)
+        {
+            ArgCount++;
+            Child = Child->Asl.Next;
+        }
+
+        /* Setup ArgCount operand */
+
+        ArgCountOp = Next->Asl.Child->Asl.Child->Asl.Next->Asl.Next;
+        ArgCountOp->Asl.Value.Integer = ArgCount;
+        break;
+    }
+
+    ACPI_FREE (CallName);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    ExAmlExternalWalkBegin
+ *
+ * PARAMETERS:  ASL_WALK_CALLBACK
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Parse tree walk to create external opcode list for methods.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+ExAmlExternalWalkBegin (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context)
+{
+
+    /* External list head saved in the definition block op */
+
+    if (Op->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK)
+    {
+        Gbl_ExternalsListHead = Op->Asl.Value.Arg;
+    }
+
+    if (!Gbl_ExternalsListHead)
+    {
+        return (AE_OK);
+    }
+
+    if (Op->Asl.ParseOpcode != PARSEOP_METHODCALL)
+    {
+        return (AE_OK);
+    }
+
+    /*
+     * The NameOp child under an ExternalOp gets turned into PARSE_METHODCALL
+     * by XfNamespaceLocateBegin(). Ignore these.
+     */
+    if (Op->Asl.Parent &&
+        Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_EXTERNAL)
+    {
+        return (AE_OK);
+    }
+
+    ExInsertArgCount (Op);
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    ExAmlExternalWalkEnd
+ *
+ * PARAMETERS:  ASL_WALK_CALLBACK
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Parse tree walk to create external opcode list for methods.
+ *              Here, we just want to catch the case where a definition block
+ *              has been completed. Then we move all of the externals into
+ *              a single block in the parse tree and thus the AML code.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+ExAmlExternalWalkEnd (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context)
+{
+
+    if (Op->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK)
+    {
+        /*
+         * Process any existing external list. (Support for
+         * multiple definition blocks in a single file/compile)
+         */
+        ExMoveExternals (Op);
+        Gbl_ExternalsListHead = NULL;
+    }
+
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    ExMoveExternals
+ *
+ * PARAMETERS:  DefinitionBlockOp       - Op for current definition block
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Move all externals present in the source file into a single
+ *              block of AML code, surrounded by an "If (0)" to prevent
+ *              AML interpreters from attempting to execute the External
+ *              opcodes.
+ *
+ ******************************************************************************/
+
+static void
+ExMoveExternals (
+    ACPI_PARSE_OBJECT       *DefinitionBlockOp)
+{
+    ACPI_PARSE_OBJECT       *ParentOp;
+    ACPI_PARSE_OBJECT       *ExternalOp;
+    ACPI_PARSE_OBJECT       *PredicateOp;
+    ACPI_PARSE_OBJECT       *NextOp;
+    ACPI_PARSE_OBJECT       *Prev;
+    ACPI_PARSE_OBJECT       *Next;
+    ACPI_OBJECT_TYPE        ObjType;
+    UINT32                  i;
+
+
+    if (!Gbl_ExternalsListHead)
+    {
+        return;
+    }
+
+    /* Remove the External nodes from the tree */
+
+    NextOp = Gbl_ExternalsListHead;
+    while (NextOp)
+    {
+        /*
+         * The External is stored in child pointer of each node in the
+         * list
+         */
+        ExternalOp = NextOp->Asl.Child;
+
+        /* Set line numbers (for listings, etc.) */
+
+        ExternalOp->Asl.LineNumber = 0;
+        ExternalOp->Asl.LogicalLineNumber = 0;
+
+        Next = ExternalOp->Asl.Child;
+        Next->Asl.LineNumber = 0;
+        Next->Asl.LogicalLineNumber = 0;
+
+        Next = Next->Asl.Next;
+        Next->Asl.LineNumber = 0;
+        Next->Asl.LogicalLineNumber = 0;
+
+        Next = Next->Asl.Next;
+        Next->Asl.LineNumber = 0;
+        Next->Asl.LogicalLineNumber = 0;
+
+        Next = Next->Asl.Next;
+        Next->Asl.LineNumber = 0;
+        Next->Asl.LogicalLineNumber = 0;
+
+        ParentOp = ExternalOp->Asl.Parent;
+        Prev = Next = ParentOp->Asl.Child;
+
+        /* Now find the External node's position in parse tree */
+
+        while (Next != ExternalOp)
+        {
+            Prev = Next;
+            Next = Next->Asl.Next;
+        }
+
+        /* Remove the External from the parse tree */
+
+        if (Prev == ExternalOp)
+        {
+            /* External was the first child node */
+
+            ParentOp->Asl.Child = ExternalOp->Asl.Next;
+        }
+
+        Prev->Asl.Next = ExternalOp->Asl.Next;
+        ExternalOp->Asl.Next = NULL;
+        ExternalOp->Asl.Parent = Gbl_ExternalsListHead;
+
+        /* Point the External to the next in the list */
+
+        if (NextOp->Asl.Next)
+        {
+            ExternalOp->Asl.Next = NextOp->Asl.Next->Asl.Child;
+        }
+
+        NextOp = NextOp->Asl.Next;
+    }
+
+    /*
+     * Loop again to remove MethodObj Externals for which
+     * a MethodCall was not found (dead external reference)
+     */
+    Prev = Gbl_ExternalsListHead->Asl.Child;
+    Next = Prev;
+    while (Next)
+    {
+        ObjType = (ACPI_OBJECT_TYPE)
+            Next->Asl.Child->Asl.Next->Asl.Value.Integer;
+
+        if (ObjType == ACPI_TYPE_METHOD &&
+            !(Next->Asl.CompileFlags & NODE_VISITED))
+        {
+            if (Next == Prev)
+            {
+                Gbl_ExternalsListHead->Asl.Child = Next->Asl.Next;
+                Next->Asl.Next = NULL;
+                Prev = Gbl_ExternalsListHead->Asl.Child;
+                Next = Prev;
+                continue;
+            }
+            else
+            {
+                Prev->Asl.Next = Next->Asl.Next;
+                Next->Asl.Next = NULL;
+                Next = Prev->Asl.Next;
+                continue;
+            }
+        }
+
+        Prev = Next;
+        Next = Next->Asl.Next;
+    }
+
+    /* If list is now empty, don't bother to make If (0) block */
+
+    if (!Gbl_ExternalsListHead->Asl.Child)
+    {
+        return;
+    }
+
+    /* Convert Gbl_ExternalsListHead parent to If(). */
+
+    Gbl_ExternalsListHead->Asl.ParseOpcode = PARSEOP_IF;
+    Gbl_ExternalsListHead->Asl.AmlOpcode = AML_IF_OP;
+    Gbl_ExternalsListHead->Asl.CompileFlags = NODE_AML_PACKAGE;
+    UtSetParseOpName (Gbl_ExternalsListHead);
+
+    /* Create a Zero op for the If predicate */
+
+    PredicateOp = TrAllocateNode (PARSEOP_ZERO);
+    PredicateOp->Asl.AmlOpcode = AML_ZERO_OP;
+
+    PredicateOp->Asl.Parent = Gbl_ExternalsListHead;
+    PredicateOp->Asl.Child = NULL;
+    PredicateOp->Asl.Next = Gbl_ExternalsListHead->Asl.Child;
+    Gbl_ExternalsListHead->Asl.Child = PredicateOp;
+
+    /* Set line numbers (for listings, etc.) */
+
+    Gbl_ExternalsListHead->Asl.LineNumber = 0;
+    Gbl_ExternalsListHead->Asl.LogicalLineNumber = 0;
+
+    PredicateOp->Asl.LineNumber = 0;
+    PredicateOp->Asl.LogicalLineNumber = 0;
+
+    /* Insert block back in the list */
+
+    Prev = DefinitionBlockOp->Asl.Child;
+    Next = Prev;
+
+    /* Find last default arg */
+
+    for (i = 0; i < 6; i++)
+    {
+        Prev = Next;
+        Next = Prev->Asl.Next;
+    }
+
+    if (Next)
+    {
+        /* Definition Block is not empty */
+
+        Gbl_ExternalsListHead->Asl.Next = Next;
+    }
+    else
+    {
+        /* Definition Block is empty. */
+
+        Gbl_ExternalsListHead->Asl.Next = NULL;
+    }
+
+    Prev->Asl.Next = Gbl_ExternalsListHead;
+    Gbl_ExternalsListHead->Asl.Parent = Prev->Asl.Parent;
+}
--- a/sys/external/bsd/acpica/dist/compiler/aslfold.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslfold.c	Wed May 04 18:15:53 2016 +0000
@@ -101,6 +101,7 @@
  * RETURN:      Status
  *
  * DESCRIPTION: Reduce an Op and its subtree to a constant if possible.
+ *              Called during ascent of the parse tree.
  *
  ******************************************************************************/
 
@@ -192,9 +193,7 @@
         OpcUpdateIntegerNode (Op, 0);
     }
 
-    /* Abort the walk of this subtree, we are done with it */
-
-    return (AE_CTRL_DEPTH);
+    return (AE_OK);
 }
 
 
@@ -207,7 +206,7 @@
  * RETURN:      Status
  *
  * DESCRIPTION: Check one Op for a reducible type 3/4/5 AML opcode.
- *              This is performed via a downward walk of the parse subtree.
+ *              This is performed via an upward walk of the parse subtree.
  *
  ******************************************************************************/
 
@@ -373,7 +372,6 @@
         goto CleanupAndExit;
     }
 
-
     /* Debug output */
 
     DbgPrint (ASL_PARSE_OUTPUT, "TYPE_345");
@@ -519,9 +517,6 @@
     ACPI_STATUS             Status;
 
 
-    DbgPrint (ASL_PARSE_OUTPUT,
-        "Reduction/Transform to StoreOp: Store(Constant, Target)\n");
-
     /* Extract the operands */
 
     Child1 = Op->Asl.Child;
@@ -543,6 +538,10 @@
         }
     }
 
+    DbgPrint (ASL_PARSE_OUTPUT,
+        "Reduction/Transform to StoreOp: Store(%s, %s)\n",
+        Child1->Asl.ParseOpName, Child2->Asl.ParseOpName);
+
     /*
      * Create a NULL (zero) target so that we can use the
      * interpreter to evaluate the expression.
--- a/sys/external/bsd/acpica/dist/compiler/aslglobal.h	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslglobal.h	Wed May 04 18:15:53 2016 +0000
@@ -83,7 +83,8 @@
     {NULL, NULL, "ASM Include:  ", "Assembly Header Output"},
     {NULL, NULL, "C Include:    ", "C Header Output"},
     {NULL, NULL, "Offset Table: ", "C Offset Table Output"},
-    {NULL, NULL, "Device Map:   ", "Device Map Output"}
+    {NULL, NULL, "Device Map:   ", "Device Map Output"},
+    {NULL, NULL, "Cross Ref:    ", "Cross-reference Output"}
 };
 
 #else
@@ -149,6 +150,7 @@
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_PreprocessorOutputFlag, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_KeepPreprocessorTempFile, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DebugFlag, FALSE);
+ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_CrossReferenceOutput, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_AsmOutputFlag, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_C_OutputFlag, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_C_OffsetTableFlag, FALSE);
@@ -179,6 +181,7 @@
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_PruneParseTree, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DoTypechecking, TRUE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_EnableReferenceTypechecking, FALSE);
+ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DoExternals, TRUE);
 
 
 #define HEX_OUTPUT_NONE             0
@@ -240,14 +243,16 @@
 
 ASL_EXTERN UINT8                    ASL_INIT_GLOBAL (Gbl_RevisionOverride, 0);
 ASL_EXTERN UINT8                    ASL_INIT_GLOBAL (Gbl_TempCount, 0);
-ASL_EXTERN ACPI_PARSE_OBJECT        ASL_INIT_GLOBAL (*RootNode, NULL);
+ASL_EXTERN ACPI_PARSE_OBJECT        ASL_INIT_GLOBAL (*Gbl_ParseTreeRoot, NULL);
+ASL_EXTERN ACPI_PARSE_OBJECT        ASL_INIT_GLOBAL (*Gbl_ExternalsListHead, NULL);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_TableLength, 0);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_SourceLine, 0);
 ASL_EXTERN ASL_LISTING_NODE         ASL_INIT_GLOBAL (*Gbl_ListingNode, NULL);
-ASL_EXTERN ACPI_PARSE_OBJECT        *Gbl_FirstLevelInsertionNode;
 ASL_EXTERN UINT8                    ASL_INIT_GLOBAL (Gbl_FileType, 0);
 ASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_Signature, NULL);
 
+ASL_EXTERN ACPI_PARSE_OBJECT        *Gbl_FirstLevelInsertionNode;
+
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_CurrentHexColumn, 0);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_CurrentAmlOffset, 0);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_CurrentLine, 0);
@@ -268,7 +273,7 @@
 
 /* Event timing */
 
-#define ASL_NUM_EVENTS              20
+#define ASL_NUM_EVENTS              24
 ASL_EXTERN ASL_EVENT_INFO           AslGbl_Events[ASL_NUM_EVENTS];
 ASL_EXTERN UINT8                    AslGbl_NextEvent;
 ASL_EXTERN UINT8                    AslGbl_NamespaceEvent;
--- a/sys/external/bsd/acpica/dist/compiler/asllength.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asllength.c	Wed May 04 18:15:53 2016 +0000
@@ -399,7 +399,6 @@
         break;
 
     case PARSEOP_DEFAULT_ARG:
-    case PARSEOP_EXTERNAL:
     case PARSEOP_INCLUDE:
     case PARSEOP_INCLUDE_END:
 
@@ -407,6 +406,14 @@
 
         break;
 
+    case PARSEOP_EXTERNAL:
+
+        if (Gbl_DoExternals == TRUE)
+        {
+            CgGenerateAmlOpcodeLength (Op);
+        }
+        break;
+
     default:
 
         CgGenerateAmlOpcodeLength (Op);
--- a/sys/external/bsd/acpica/dist/compiler/asllisting.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asllisting.c	Wed May 04 18:15:53 2016 +0000
@@ -163,16 +163,16 @@
 
         LsDoOffsetTableHeader (FileId);
 
-        TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, LsAmlOffsetWalk,
-            NULL, (void *) ACPI_TO_POINTER (FileId));
+        TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
+            LsAmlOffsetWalk, NULL, (void *) ACPI_TO_POINTER (FileId));
         LsDoOffsetTableFooter (FileId);
         return;
     }
 
     /* Process all parse nodes */
 
-    TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, LsAmlListingWalk,
-        NULL, (void *) ACPI_TO_POINTER (FileId));
+    TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
+        LsAmlListingWalk, NULL, (void *) ACPI_TO_POINTER (FileId));
 
     /* Final processing */
 
@@ -258,8 +258,12 @@
     }
 
     DbgPrint (ASL_TREE_OUTPUT, "\nOriginal parse tree from parser:\n\n");
-    TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
+    DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER1);
+
+    TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
         LsTreeWriteWalk, NULL, NULL);
+
+    DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER1);
 }
 
 
@@ -270,43 +274,69 @@
     void                    *Context)
 {
 
-    /* Debug output */
+    /* Dump ParseOp name and possible value */
 
-    DbgPrint (ASL_TREE_OUTPUT,
-        "%5.5d [%2d]", Op->Asl.LogicalLineNumber, Level);
-
-    UtPrintFormattedName (Op->Asl.ParseOpcode, Level);
-
-    if (Op->Asl.ParseOpcode == PARSEOP_NAMESEG)
+    switch (Op->Asl.ParseOpcode)
     {
-        DbgPrint (ASL_TREE_OUTPUT,
-            "%10.4s      ", Op->Asl.Value.Name);
-    }
-    else if ((Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) ||
-        (Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
-    {
-        DbgPrint (ASL_TREE_OUTPUT,
-            "%10.32s      ", Op->Asl.Value.String);
-    }
-    else if (Op->Asl.ParseOpcode == PARSEOP_INCLUDE)
-    {
+        case PARSEOP_NAMESEG:
+        case PARSEOP_NAMESTRING:
+        case PARSEOP_METHODCALL:
+        case PARSEOP_STRING_LITERAL:
+
+        UtDumpStringOp (Op, Level);
+        break;
+
+    case PARSEOP_BYTECONST:
+
+        UtDumpIntegerOp (Op, Level, 2);
+        break;
+
+    case PARSEOP_WORDCONST:
+    case PARSEOP_PACKAGE_LENGTH:
+
+        UtDumpIntegerOp (Op, Level, 4);
+        break;
+
+    case PARSEOP_DWORDCONST:
+    case PARSEOP_EISAID:
+
+        UtDumpIntegerOp (Op, Level, 8);
+        break;
+
+    case PARSEOP_QWORDCONST:
+    case PARSEOP_INTEGER:
+    case PARSEOP_ONE:
+    case PARSEOP_ZERO:
+    case PARSEOP_ONES:
+
+        UtDumpIntegerOp (Op, Level, 16);
+        break;
+
+    case PARSEOP_INCLUDE:
+
         DbgPrint (ASL_TREE_OUTPUT,
             "Open: %s\n", Op->Asl.Value.String);
         return (AE_OK);
-    }
-    else if (Op->Asl.ParseOpcode == PARSEOP_INCLUDE_END)
-    {
+
+    case PARSEOP_INCLUDE_END:
+
         DbgPrint (ASL_TREE_OUTPUT,
             "Close: %s\n", Op->Asl.Filename);
         return (AE_OK);
-    }
-    else
-    {
-        DbgPrint (ASL_TREE_OUTPUT, "                ");
+
+    default:
+
+        UtDumpBasicOp (Op, Level);
+        break;
     }
 
-    DbgPrint (ASL_TREE_OUTPUT, "    (%.4X) Flags %8.8X",
-        Op->Asl.ParseOpcode, Op->Asl.CompileFlags);
+    /* Dump the remaining data */
+
+    DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_DEBUG1,
+        Op->Asl.ParseOpcode, Op->Asl.CompileFlags,
+        Op->Asl.LineNumber, Op->Asl.EndLine,
+        Op->Asl.LogicalLineNumber, Op->Asl.EndLogicalLine);
+
     TrPrintNodeCompileFlags (Op->Asl.CompileFlags);
     DbgPrint (ASL_TREE_OUTPUT, "\n");
     return (AE_OK);
@@ -399,6 +429,9 @@
     {
     case PARSEOP_DEFINITION_BLOCK:
 
+        /* Always start a definition block at AML offset zero */
+
+        Gbl_CurrentAmlOffset = 0;
         LsWriteSourceLines (Op->Asl.EndLine, Op->Asl.EndLogicalLine, FileId);
 
         /* Use the table Signature and TableId to build a unique name */
--- a/sys/external/bsd/acpica/dist/compiler/aslmain.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslmain.c	Wed May 04 18:15:53 2016 +0000
@@ -73,36 +73,6 @@
 AslInitialize (
     void);
 
-UINT8
-AcpiIsBigEndianMachine (
-    void);
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiIsBigEndianMachine
- *
- * PARAMETERS:  None
- *
- * RETURN:      TRUE if machine is big endian
- *              FALSE if machine is little endian
- *
- * DESCRIPTION: Detect whether machine is little endian or big endian.
- *
- ******************************************************************************/
-
-UINT8
-AcpiIsBigEndianMachine (
-    void)
-{
-    union {
-        UINT32              Integer;
-        UINT8               Bytes[4];
-    } Overlay = {0xFF000000};
-
-    return (Overlay.Bytes[0]); /* Returns 0xFF (TRUE) for big endian */
-}
-
 
 /*******************************************************************************
  *
@@ -177,6 +147,7 @@
     ACPI_OPTION ("-lm",             "Create hardware summary map file (*.map)");
     ACPI_OPTION ("-ln",             "Create namespace file (*.nsp)");
     ACPI_OPTION ("-ls",             "Create combined source file (expanded includes) (*.src)");
+    ACPI_OPTION ("-lx",             "Create cross-reference file (*.xrf)");
 
     printf ("\nData Table Compiler:\n");
     ACPI_OPTION ("-G",              "Compile custom table that contains generic operators");
@@ -303,6 +274,12 @@
 
     AcpiGbl_DmOpt_Verbose = FALSE;
 
+    /* Default integer width is 64 bits */
+
+    AcpiGbl_IntegerBitWidth = 64;
+    AcpiGbl_IntegerNybbleWidth = 16;
+    AcpiGbl_IntegerByteWidth = 8;
+
     for (i = 0; i < ASL_NUM_FILES; i++)
     {
         Gbl_Files[i].Handle = NULL;
@@ -346,7 +323,7 @@
      * be little-endian, and support for big-endian machines needs to
      * be implemented.
      */
-    if (AcpiIsBigEndianMachine ())
+    if (UtIsBigEndianMachine ())
     {
         fprintf (stderr,
             "iASL is not currently supported on big-endian machines.\n");
--- a/sys/external/bsd/acpica/dist/compiler/aslmap.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslmap.c	Wed May 04 18:15:53 2016 +0000
@@ -238,6 +238,7 @@
 /* GPIOINT */                   OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP,         0,                              0,                  0),
 /* GPIOIO */                    OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP,         0,                              0,                  0),
 /* I2CSERIALBUS */              OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP,         0,                              0,                  0),
+/* I2CSERIALBUSV2 */            OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP,         0,                              0,                  0),
 /* IF */                        OP_TABLE_ENTRY (AML_IF_OP,                  0,                              NODE_AML_PACKAGE,   0),
 /* INCLUDE */                   OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP,         0,                              0,                  0),
 /* INCLUDE_END */               OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP,         0,                              0,                  0),
@@ -314,22 +315,22 @@
 /* NOT */                       OP_TABLE_ENTRY (AML_BIT_NOT_OP,             0,                              0,                  ACPI_BTYPE_INTEGER),
 /* NOTIFY */                    OP_TABLE_ENTRY (AML_NOTIFY_OP,              0,                              0,                  0),
 /* OBJECTTYPE */                OP_TABLE_ENTRY (AML_OBJECT_TYPE_OP,         0,                              0,                  ACPI_BTYPE_INTEGER),
-/* OBJECTTYPE_BFF */            OP_TABLE_ENTRY (AML_BYTE_OP,                ACPI_TYPE_BUFFER_FIELD,         0,                  0),
-/* OBJECTTYPE_BUF */            OP_TABLE_ENTRY (AML_BYTE_OP,                ACPI_TYPE_BUFFER,               0,                  0),
-/* OBJECTTYPE_DDB */            OP_TABLE_ENTRY (AML_BYTE_OP,                ACPI_TYPE_DDB_HANDLE,           0,                  0),
-/* OBJECTTYPE_DEV */            OP_TABLE_ENTRY (AML_BYTE_OP,                ACPI_TYPE_DEVICE,               0,                  0),
-/* OBJECTTYPE_EVT */            OP_TABLE_ENTRY (AML_BYTE_OP,                ACPI_TYPE_EVENT,                0,                  0),
-/* OBJECTTYPE_FLD */            OP_TABLE_ENTRY (AML_BYTE_OP,                ACPI_TYPE_FIELD_UNIT,           0,                  0),
-/* OBJECTTYPE_INT */            OP_TABLE_ENTRY (AML_BYTE_OP,                ACPI_TYPE_INTEGER,              0,                  0),
-/* OBJECTTYPE_MTH */            OP_TABLE_ENTRY (AML_BYTE_OP,                ACPI_TYPE_METHOD,               0,                  0),
-/* OBJECTTYPE_MTX */            OP_TABLE_ENTRY (AML_BYTE_OP,                ACPI_TYPE_MUTEX,                0,                  0),
-/* OBJECTTYPE_OPR */            OP_TABLE_ENTRY (AML_BYTE_OP,                ACPI_TYPE_REGION,               0,                  0),
-/* OBJECTTYPE_PKG */            OP_TABLE_ENTRY (AML_BYTE_OP,                ACPI_TYPE_PACKAGE,              0,                  0),
-/* OBJECTTYPE_POW */            OP_TABLE_ENTRY (AML_BYTE_OP,                ACPI_TYPE_POWER,                0,                  0),
-/* OBJECTTYPE_PRO */            OP_TABLE_ENTRY (AML_BYTE_OP,                ACPI_TYPE_PROCESSOR,            0,                  0),
-/* OBJECTTYPE_STR */            OP_TABLE_ENTRY (AML_BYTE_OP,                ACPI_TYPE_STRING,               0,                  0),
-/* OBJECTTYPE_THZ */            OP_TABLE_ENTRY (AML_BYTE_OP,                ACPI_TYPE_THERMAL,              0,                  0),
-/* OBJECTTYPE_UNK */            OP_TABLE_ENTRY (AML_BYTE_OP,                ACPI_TYPE_ANY,                  0,                  0),
+/* OBJECTTYPE_BFF */            OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_TYPE_BUFFER_FIELD,         0,                  0),
+/* OBJECTTYPE_BUF */            OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_TYPE_BUFFER,               0,                  0),
+/* OBJECTTYPE_DDB */            OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_TYPE_DDB_HANDLE,           0,                  0),
+/* OBJECTTYPE_DEV */            OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_TYPE_DEVICE,               0,                  0),
+/* OBJECTTYPE_EVT */            OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_TYPE_EVENT,                0,                  0),
+/* OBJECTTYPE_FLD */            OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_TYPE_FIELD_UNIT,           0,                  0),
+/* OBJECTTYPE_INT */            OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_TYPE_INTEGER,              0,                  0),
+/* OBJECTTYPE_MTH */            OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_TYPE_METHOD,               0,                  0),
+/* OBJECTTYPE_MTX */            OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_TYPE_MUTEX,                0,                  0),
+/* OBJECTTYPE_OPR */            OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_TYPE_REGION,               0,                  0),
+/* OBJECTTYPE_PKG */            OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_TYPE_PACKAGE,              0,                  0),
+/* OBJECTTYPE_POW */            OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_TYPE_POWER,                0,                  0),
+/* OBJECTTYPE_PRO */            OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_TYPE_PROCESSOR,            0,                  0),
+/* OBJECTTYPE_STR */            OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_TYPE_STRING,               0,                  0),
+/* OBJECTTYPE_THZ */            OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_TYPE_THERMAL,              0,                  0),
+/* OBJECTTYPE_UNK */            OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_TYPE_ANY,                  0,                  0),
 /* OFFSET */                    OP_TABLE_ENTRY (AML_INT_RESERVEDFIELD_OP,   0,                              0,                  0),
 /* ONE */                       OP_TABLE_ENTRY (AML_ONE_OP,                 0,                              0,                  ACPI_BTYPE_INTEGER),
 /* ONES */                      OP_TABLE_ENTRY (AML_ONES_OP,                0,                              0,                  ACPI_BTYPE_INTEGER),
@@ -395,6 +396,7 @@
 /* SLAVEMODE_DEVICEINIT */      OP_TABLE_ENTRY (AML_BYTE_OP,                1,                              0,                  0),
 /* SLEEP */                     OP_TABLE_ENTRY (AML_SLEEP_OP,               0,                              0,                  0),
 /* SPISERIALBUS */              OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP,         0,                              0,                  0),
+/* SPISERIALBUSV2 */            OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP,         0,                              0,                  0),
 /* STALL */                     OP_TABLE_ENTRY (AML_STALL_OP,               0,                              0,                  0),
 /* STARTDEPENDENTFN */          OP_TABLE_ENTRY (AML_BYTE_OP,                0,                              0,                  0),
 /* STARTDEPENDENTFN_NOPRI */    OP_TABLE_ENTRY (AML_BYTE_OP,                0,                              0,                  0),
@@ -420,6 +422,7 @@
 /* TYPE_STATIC */               OP_TABLE_ENTRY (AML_BYTE_OP,                0,                              0,                  0),
 /* TYPE_TRANSLATION */          OP_TABLE_ENTRY (AML_BYTE_OP,                1,                              0,                  0),
 /* UART_SERIALBUS */            OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP,         0,                              0,                  0),
+/* UART_SERIALBUSV2 */          OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP,         0,                              0,                  0),
 /* UNICODE */                   OP_TABLE_ENTRY (AML_BUFFER_OP,              0,                              NODE_AML_PACKAGE,   0),
 /* UNLOAD */                    OP_TABLE_ENTRY (AML_UNLOAD_OP,              0,                              0,                  0),
 /* UPDATERULE_ONES */           OP_TABLE_ENTRY (AML_BYTE_OP,                AML_FIELD_UPDATE_WRITE_AS_ONES, 0,                  0),
--- a/sys/external/bsd/acpica/dist/compiler/aslmapoutput.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslmapoutput.c	Wed May 04 18:15:53 2016 +0000
@@ -533,7 +533,7 @@
 
     /* Walk the entire parse tree */
 
-    TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
+    TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
         MpNamespaceXrefBegin, NULL, Info);
 
     if (!Info->References)
--- a/sys/external/bsd/acpica/dist/compiler/aslmessages.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslmessages.c	Wed May 04 18:15:53 2016 +0000
@@ -130,7 +130,7 @@
 /*    ASL_MSG_HID_SUFFIX */                 "_HID suffix must be all hex digits",
 /*    ASL_MSG_INCLUDE_FILE_OPEN */          "Could not open include file",
 /*    ASL_MSG_INPUT_FILE_OPEN */            "Could not open input file",
-/*    ASL_MSG_INTEGER_LENGTH */             "64-bit integer in 32-bit table, truncating (DSDT version < 2)",
+/*    ASL_MSG_INTEGER_LENGTH */             "64-bit integer in 32-bit table, truncating (DSDT or SSDT version < 2)",
 /*    ASL_MSG_INTEGER_OPTIMIZATION */       "Integer optimized to single-byte AML opcode",
 /*    ASL_MSG_INTERRUPT_LIST */             "Too many interrupts (16 max)",
 /*    ASL_MSG_INTERRUPT_NUMBER */           "Invalid interrupt number (must be 0-15)",
@@ -224,7 +224,7 @@
 /*    ASL_MSG_TAG_SMALLER */                "ResourceTag smaller than Field",
 /*    ASL_MSG_TIMEOUT */                    "Result is not used, possible operator timeout will be missed",
 /*    ASL_MSG_TOO_MANY_TEMPS */             "Method requires too many temporary variables (_T_x)",
-/*    ASL_MSG_TRUNCATION */                 "64-bit return value will be truncated to 32 bits (DSDT version < 2)",
+/*    ASL_MSG_TRUNCATION */                 "64-bit return value will be truncated to 32 bits (DSDT or SSDT version < 2)",
 /*    ASL_MSG_UNKNOWN_RESERVED_NAME */      "Unknown reserved name",
 /*    ASL_MSG_UNREACHABLE_CODE */           "Statement is unreachable",
 /*    ASL_MSG_UNSUPPORTED */                "Unsupported feature",
--- a/sys/external/bsd/acpica/dist/compiler/aslmethod.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslmethod.c	Wed May 04 18:15:53 2016 +0000
@@ -53,7 +53,7 @@
 
 /* Local prototypes */
 
-void
+static void
 MtCheckNamedObjectInMethod (
     ACPI_PARSE_OBJECT       *Op,
     ASL_METHOD_INFO         *MethodInfo);
@@ -93,6 +93,13 @@
     UINT8                   ActualArgs = 0;
 
 
+    /* Build cross-reference output file if requested */
+
+    if (Gbl_CrossReferenceOutput)
+    {
+        OtXrefWalkPart1 (Op, Level, MethodInfo);
+    }
+
     switch (Op->Asl.ParseOpcode)
     {
     case PARSEOP_METHOD:
@@ -399,10 +406,8 @@
 
     case PARSEOP_DEVICE:
 
-        Next = Op->Asl.Child;
-
-        if (!ApFindNameInScope (METHOD_NAME__HID, Next) &&
-            !ApFindNameInScope (METHOD_NAME__ADR, Next))
+        if (!ApFindNameInDeviceTree (METHOD_NAME__HID, Op) &&
+            !ApFindNameInDeviceTree (METHOD_NAME__ADR, Op))
         {
             AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
                 "Device object requires a _HID or _ADR in same scope");
@@ -493,7 +498,7 @@
  *
  ******************************************************************************/
 
-void
+static void
 MtCheckNamedObjectInMethod (
     ACPI_PARSE_OBJECT       *Op,
     ASL_METHOD_INFO         *MethodInfo)
--- a/sys/external/bsd/acpica/dist/compiler/asloperands.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asloperands.c	Wed May 04 18:15:53 2016 +0000
@@ -1049,15 +1049,12 @@
     ACPI_PARSE_OBJECT       *Child = NULL;
 
 
-    if (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL)
-    {
-        Child = UtGetArg (Op, 0);
-    }
-    else switch (Op->Asl.AmlOpcode)
+    switch (Op->Asl.AmlOpcode)
     {
     case AML_DATA_REGION_OP:
     case AML_DEVICE_OP:
     case AML_EVENT_OP:
+    case AML_EXTERNAL_OP:
     case AML_METHOD_OP:
     case AML_MUTEX_OP:
     case AML_REGION_OP:
@@ -1188,9 +1185,6 @@
     case PARSEOP_NAMESTRING:
     case PARSEOP_METHODCALL:
     case PARSEOP_STRING_LITERAL:
-
-        break;
-
     default:
 
         break;
--- a/sys/external/bsd/acpica/dist/compiler/aslopt.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslopt.c	Wed May 04 18:15:53 2016 +0000
@@ -217,7 +217,7 @@
     UINT32                  Index;
     UINT32                  NumCarats;
     UINT32                  i;
-    char                    *NewPath;
+    char                    *NewPathInternal;
     char                    *NewPathExternal;
     ACPI_NAMESPACE_NODE     *Node;
     ACPI_GENERIC_STATE      ScopeInfo;
@@ -253,11 +253,11 @@
     {
         /* Compare two single NameSegs */
 
+        Index = (NumCommonSegments * ACPI_PATH_SEGMENT_LENGTH) + 1;
+
         if (!ACPI_COMPARE_NAME (
-            &((char *) TargetPath->Pointer)[
-                (NumCommonSegments * ACPI_PATH_SEGMENT_LENGTH) + 1],
-            &((char *) CurrentPath->Pointer)[
-                (NumCommonSegments * ACPI_PATH_SEGMENT_LENGTH) + 1]))
+            &(ACPI_CAST_PTR (char, TargetPath->Pointer)) [Index],
+            &(ACPI_CAST_PTR (char, CurrentPath->Pointer)) [Index]))
         {
             /* Mismatch */
 
@@ -297,8 +297,8 @@
     /*
      * Construct a new target string
      */
-    NewPathExternal = ACPI_ALLOCATE_ZEROED (
-        TargetPath->Length + NumCarats + 1);
+    NewPathExternal =
+        ACPI_ALLOCATE_ZEROED (TargetPath->Length + NumCarats + 1);
 
     /* Insert the Carats into the Target string */
 
@@ -315,7 +315,8 @@
 
     /* Special handling for exact subpath in a name declaration */
 
-    if (IsDeclaration && SubPath && (CurrentPath->Length > TargetPath->Length))
+    if (IsDeclaration && SubPath &&
+        (CurrentPath->Length > TargetPath->Length))
     {
         /*
          * The current path is longer than the target, and the target is a
@@ -341,7 +342,8 @@
         Index = TargetPath->Length;
     }
 
-    strcpy (&NewPathExternal[i], &((char *) TargetPath->Pointer)[Index]);
+    strcpy (&NewPathExternal[i],
+        &(ACPI_CAST_PTR (char, TargetPath->Pointer))[Index]);
     ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, " %-24s", NewPathExternal));
 
     /*
@@ -349,22 +351,24 @@
      * string to make sure that this is in fact an optimization. If the
      * original string is already optimal, there is no point in continuing.
      */
-    Status = AcpiNsInternalizeName (NewPathExternal, &NewPath);
+    Status = AcpiNsInternalizeName (NewPathExternal, &NewPathInternal);
     if (ACPI_FAILURE (Status))
     {
         AslCoreSubsystemError (Op, Status, "Internalizing new NamePath",
             ASL_NO_ABORT);
-        ACPI_FREE (NewPathExternal);
-        return (Status);
+        goto Cleanup;
     }
 
-    if (strlen (NewPath) >= AmlNameStringLength)
+    if (strlen (NewPathInternal) >= AmlNameStringLength)
     {
         ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
             " NOT SHORTER (New %u old %u)",
-            (UINT32) strlen (NewPath), (UINT32) AmlNameStringLength));
-        ACPI_FREE (NewPathExternal);
-        return (AE_NOT_FOUND);
+            (UINT32) strlen (NewPathInternal),
+            (UINT32) AmlNameStringLength));
+
+        ACPI_FREE (NewPathInternal);
+        Status = AE_NOT_FOUND;
+        goto Cleanup;
     }
 
     /*
@@ -372,7 +376,7 @@
      * looking for. This is simply a sanity check on the new
      * path that has been created.
      */
-    Status = AcpiNsLookup (&ScopeInfo,  NewPath,
+    Status = AcpiNsLookup (&ScopeInfo, NewPathInternal,
         ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
         ACPI_NS_DONT_OPEN_SCOPE, WalkState, &(Node));
     if (ACPI_SUCCESS (Status))
@@ -385,7 +389,7 @@
 
             AslError (ASL_OPTIMIZATION, ASL_MSG_NAME_OPTIMIZATION,
                 Op, NewPathExternal);
-            *ReturnNewPath = NewPath;
+            *ReturnNewPath = NewPathInternal;
         }
         else
         {
@@ -401,11 +405,15 @@
     {
         /* The lookup failed, we obviously cannot use this optimization */
 
+        ACPI_FREE (NewPathInternal);
+
         ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, " ***** NOT FOUND"));
         AslError (ASL_WARNING, ASL_MSG_COMPILER_INTERNAL, Op,
             "Not using optimized name - did not find node");
     }
 
+Cleanup:
+
     ACPI_FREE (NewPathExternal);
     return (Status);
 }
--- a/sys/external/bsd/acpica/dist/compiler/asloptions.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asloptions.c	Wed May 04 18:15:53 2016 +0000
@@ -490,6 +490,13 @@
             Gbl_SourceOutputFlag = TRUE;
             break;
 
+        case 'x':
+
+            /* Produce cross-reference file */
+
+            Gbl_CrossReferenceOutput = TRUE;
+            break;
+
         default:
 
             printf ("Unknown option: -l%s\n", AcpiGbl_Optarg);
@@ -532,6 +539,13 @@
             Gbl_CompileTimesFlag = TRUE;
             break;
 
+        case 'e':
+
+            /* Disable External opcode generation */
+
+            Gbl_DoExternals = FALSE;
+            break;
+
         case 'f':
 
             /* Disable folding on "normal" expressions */
--- a/sys/external/bsd/acpica/dist/compiler/aslparser.y	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslparser.y	Wed May 04 18:15:53 2016 +0000
@@ -58,7 +58,7 @@
  * each list element and possibly overflow on very large lists (>4000 items).
  * This dramatically reduces use of the parse stack overall.
  *
- *      ArgList, TermList, Objectlist, ByteList, DWordList, PackageList,
+ *      ArgList, TermList, ByteList, DWordList, PackageList,
  *      ResourceMacroList, and FieldUnitList
  */
 
@@ -99,7 +99,7 @@
  * These shift/reduce conflicts are expected. There should be zero
  * reduce/reduce conflicts.
  */
-%expect 89
+%expect 101
 
 /*! [Begin] no source code translation */
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslpld.c	Wed May 04 18:15:53 2016 +0000
@@ -0,0 +1,729 @@
+/******************************************************************************
+ *
+ * Module Name: aslpld - Implementation of ASL ToPLD macro
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2016, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ *    of any contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include "aslcompiler.h"
+#include "aslcompiler.y.h"
+#include "amlcode.h"
+
+#define _COMPONENT          ACPI_COMPILER
+        ACPI_MODULE_NAME    ("aslpld")
+
+
+/* Local prototypes */
+
+static UINT8 *
+OpcEncodePldBuffer (
+    ACPI_PLD_INFO           *PldInfo);
+
+static BOOLEAN
+OpcFindName (
+    const char              **List,
+    char                    *Name,
+    UINT32                  *Index);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    OpcDoPld
+ *
+ * PARAMETERS:  Op                  - Current parse node
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Convert ToPLD macro to 20-byte buffer
+ *
+ * The ToPLD parse tree looks like this:
+ *
+ *      TOPLD
+ *          PLD_REVISION
+ *              INTEGER
+ *          PLD_IGNORECOLOR
+ *              INTEGER
+ *          ...
+ *          etc.
+ *
+ ******************************************************************************/
+
+void
+OpcDoPld (
+    ACPI_PARSE_OBJECT       *Op)
+{
+    ACPI_PLD_INFO           PldInfo;
+    UINT8                   *Buffer;
+    ACPI_PARSE_OBJECT       *ThisOp;
+    ACPI_PARSE_OBJECT       *NewOp;
+    UINT16                  ParseOpcode;
+    UINT32                  Value;
+
+
+    if (!Op)
+    {
+        AslError (ASL_ERROR, ASL_MSG_NOT_EXIST, Op, NULL);
+        return;
+    }
+
+    if (Op->Asl.ParseOpcode != PARSEOP_TOPLD)
+    {
+        AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, Op, NULL);
+        return;
+    }
+
+    memset (&PldInfo, 0, sizeof (ACPI_PLD_INFO));
+
+    /* Traverse the list of PLD Ops (one per PLD field) */
+
+    ThisOp = Op->Asl.Child;
+    while (ThisOp)
+    {
+        /* Get child values */
+
+        ParseOpcode = ThisOp->Asl.Child->Asl.ParseOpcode;
+        Value = (UINT32) ThisOp->Asl.Child->Asl.Value.Integer;
+
+        switch (ThisOp->Asl.ParseOpcode)
+        {
+        case PARSEOP_PLD_REVISION:
+
+            if (ParseOpcode != PARSEOP_INTEGER)
+            {
+                AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ThisOp, NULL);
+                break;
+            }
+
+            if (Value > 127)
+            {
+                AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                break;
+            }
+
+            PldInfo.Revision = (UINT8) Value;
+            break;
+
+        case PARSEOP_PLD_IGNORECOLOR:
+
+            if (ParseOpcode != PARSEOP_INTEGER)
+            {
+                AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ThisOp, NULL);
+                break;
+            }
+
+            if (Value > 1)
+            {
+                AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                break;
+            }
+
+            PldInfo.IgnoreColor = (UINT8) Value;
+            break;
+
+        case PARSEOP_PLD_RED:
+        case PARSEOP_PLD_GREEN:
+        case PARSEOP_PLD_BLUE:
+
+            if (ParseOpcode != PARSEOP_INTEGER)
+            {
+                AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                break;
+            }
+
+            if (Value > 255)
+            {
+                AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                break;
+            }
+
+            if (ThisOp->Asl.ParseOpcode == PARSEOP_PLD_RED)
+            {
+                PldInfo.Red = (UINT8) Value;
+            }
+            else if (ThisOp->Asl.ParseOpcode == PARSEOP_PLD_GREEN)
+            {
+                PldInfo.Green = (UINT8) Value;
+            }
+            else /* PARSEOP_PLD_BLUE */
+            {
+                PldInfo.Blue = (UINT8) Value;
+            }
+            break;
+
+        case PARSEOP_PLD_WIDTH:
+        case PARSEOP_PLD_HEIGHT:
+
+            if (ParseOpcode != PARSEOP_INTEGER)
+            {
+                AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ThisOp, NULL);
+                break;
+            }
+
+            if (Value > 65535)
+            {
+                AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                break;
+            }
+
+            if (ThisOp->Asl.ParseOpcode == PARSEOP_PLD_WIDTH)
+            {
+                PldInfo.Width = (UINT16) Value;
+            }
+            else /* PARSEOP_PLD_HEIGHT */
+            {
+                PldInfo.Height = (UINT16) Value;
+            }
+
+            break;
+
+        case PARSEOP_PLD_USERVISIBLE:
+        case PARSEOP_PLD_DOCK:
+        case PARSEOP_PLD_LID:
+
+            if (ParseOpcode != PARSEOP_INTEGER)
+            {
+                AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ThisOp, NULL);
+                break;
+            }
+
+            if (Value > 1)
+            {
+                AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                break;
+            }
+
+            if (ThisOp->Asl.ParseOpcode == PARSEOP_PLD_USERVISIBLE)
+            {
+                PldInfo.UserVisible = (UINT8) Value;
+            }
+            else if (ThisOp->Asl.ParseOpcode == PARSEOP_PLD_DOCK)
+            {
+                PldInfo.Dock = (UINT8) Value;
+            }
+            else
+            {
+                PldInfo.Lid = (UINT8) Value;
+            }
+
+            break;
+
+        case PARSEOP_PLD_PANEL:
+
+            if (ParseOpcode == PARSEOP_INTEGER)
+            {
+                if (Value > 6)
+                {
+                    AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                    break;
+                }
+            }
+            else /* PARSEOP_STRING */
+            {
+                if (!OpcFindName (AcpiGbl_PldPanelList,
+                    ThisOp->Asl.Child->Asl.Value.String,
+                    &Value))
+                {
+                    AslError (ASL_ERROR, ASL_MSG_INVALID_OPERAND, ThisOp, NULL);
+                    break;
+                }
+            }
+
+            PldInfo.Panel = (UINT8) Value;
+            break;
+
+        case PARSEOP_PLD_VERTICALPOSITION:
+
+            if (ParseOpcode == PARSEOP_INTEGER)
+            {
+                if (Value > 2)
+                {
+                    AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                    break;
+                }
+            }
+            else /* PARSEOP_STRING */
+            {
+                if (!OpcFindName (AcpiGbl_PldVerticalPositionList,
+                    ThisOp->Asl.Child->Asl.Value.String,
+                    &Value))
+                {
+                    AslError (ASL_ERROR, ASL_MSG_INVALID_OPERAND, ThisOp, NULL);
+                    break;
+                }
+            }
+
+            PldInfo.VerticalPosition = (UINT8) Value;
+            break;
+
+        case PARSEOP_PLD_HORIZONTALPOSITION:
+
+            if (ParseOpcode == PARSEOP_INTEGER)
+            {
+                if (Value > 2)
+                {
+                    AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                    break;
+                }
+            }
+            else /* PARSEOP_STRING */
+            {
+                if (!OpcFindName (AcpiGbl_PldHorizontalPositionList,
+                    ThisOp->Asl.Child->Asl.Value.String,
+                    &Value))
+                {
+                    AslError (ASL_ERROR, ASL_MSG_INVALID_OPERAND, ThisOp, NULL);
+                    break;
+                }
+            }
+
+            PldInfo.HorizontalPosition = (UINT8) Value;
+            break;
+
+        case PARSEOP_PLD_SHAPE:
+
+            if (ParseOpcode == PARSEOP_INTEGER)
+            {
+                if (Value > 8)
+                {
+                    AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                    break;
+                }
+            }
+            else /* PARSEOP_STRING */
+            {
+                if (!OpcFindName (AcpiGbl_PldShapeList,
+                    ThisOp->Asl.Child->Asl.Value.String,
+                    &Value))
+                {
+                    AslError (ASL_ERROR, ASL_MSG_INVALID_OPERAND, ThisOp, NULL);
+                    break;
+                }
+            }
+
+            PldInfo.Shape = (UINT8) Value;
+            break;
+
+        case PARSEOP_PLD_GROUPORIENTATION:
+
+            if (ParseOpcode != PARSEOP_INTEGER)
+            {
+                AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ThisOp, NULL);
+                break;
+            }
+
+            if (Value > 1)
+            {
+                AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                break;
+            }
+
+            PldInfo.GroupOrientation = (UINT8) Value;
+            break;
+
+        case PARSEOP_PLD_GROUPTOKEN:
+        case PARSEOP_PLD_GROUPPOSITION:
+
+            if (ParseOpcode != PARSEOP_INTEGER)
+            {
+                AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ThisOp, NULL);
+                break;
+            }
+
+            if (Value > 255)
+            {
+                AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                break;
+            }
+
+            if (ThisOp->Asl.ParseOpcode == PARSEOP_PLD_GROUPTOKEN)
+            {
+                PldInfo.GroupToken = (UINT8) Value;
+            }
+            else /* PARSEOP_PLD_GROUPPOSITION */
+            {
+                PldInfo.GroupPosition = (UINT8) Value;
+            }
+
+            break;
+
+        case PARSEOP_PLD_BAY:
+        case PARSEOP_PLD_EJECTABLE:
+        case PARSEOP_PLD_EJECTREQUIRED:
+
+            if (ParseOpcode != PARSEOP_INTEGER)
+            {
+                AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ThisOp, NULL);
+                break;
+            }
+
+            if (Value > 1)
+            {
+                AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                break;
+            }
+
+            if (ThisOp->Asl.ParseOpcode == PARSEOP_PLD_BAY)
+            {
+                PldInfo.Bay = (UINT8) Value;
+            }
+            else if (ThisOp->Asl.ParseOpcode == PARSEOP_PLD_EJECTABLE)
+            {
+                PldInfo.Ejectable = (UINT8) Value;
+            }
+            else /* PARSEOP_PLD_EJECTREQUIRED */
+            {
+                PldInfo.OspmEjectRequired = (UINT8) Value;
+            }
+
+            break;
+
+        case PARSEOP_PLD_CABINETNUMBER:
+        case PARSEOP_PLD_CARDCAGENUMBER:
+
+            if (ParseOpcode != PARSEOP_INTEGER)
+            {
+                AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ThisOp, NULL);
+                break;
+            }
+
+            if (Value > 255)
+            {
+                AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                break;
+            }
+
+            if (ThisOp->Asl.ParseOpcode == PARSEOP_PLD_CABINETNUMBER)
+            {
+                PldInfo.CabinetNumber = (UINT8) Value;
+            }
+            else /* PARSEOP_PLD_CARDCAGENUMBER */
+            {
+                PldInfo.CardCageNumber = (UINT8) Value;
+            }
+
+            break;
+
+        case PARSEOP_PLD_REFERENCE:
+
+            if (ParseOpcode != PARSEOP_INTEGER)
+            {
+                AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ThisOp, NULL);
+                break;
+            }
+
+            if (Value > 1)
+            {
+                AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                break;
+            }
+
+            PldInfo.Reference = (UINT8) Value;
+            break;
+
+        case PARSEOP_PLD_ROTATION:
+
+            if (ParseOpcode != PARSEOP_INTEGER)
+            {
+                AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ThisOp, NULL);
+                break;
+            }
+
+            if (Value > 7)
+            {
+                switch (Value)
+                {
+                case 45:
+
+                    Value = 1;
+                    break;
+
+                case 90:
+
+                    Value = 2;
+                    break;
+
+                case 135:
+
+                    Value = 3;
+                    break;
+
+                case 180:
+
+                    Value = 4;
+                    break;
+
+                case 225:
+
+                    Value = 5;
+                    break;
+
+                case 270:
+
+                    Value = 6;
+                    break;
+
+                case 315:
+
+                    Value = 7;
+                    break;
+
+                default:
+
+                    AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                    break;
+                }
+            }
+
+            PldInfo.Rotation = (UINT8) Value;
+            break;
+
+        case PARSEOP_PLD_ORDER:
+
+            if (ParseOpcode != PARSEOP_INTEGER)
+            {
+                AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ThisOp, NULL);
+                break;
+            }
+
+            if (Value > 31)
+            {
+                AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                break;
+            }
+
+            PldInfo.Order = (UINT8) Value;
+            break;
+
+        case PARSEOP_PLD_VERTICALOFFSET:
+        case PARSEOP_PLD_HORIZONTALOFFSET:
+
+            if (ParseOpcode != PARSEOP_INTEGER)
+            {
+                AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ThisOp, NULL);
+                break;
+            }
+
+            if (Value > 65535)
+            {
+                AslError (ASL_ERROR, ASL_MSG_RANGE, ThisOp, NULL);
+                break;
+            }
+
+            if (ThisOp->Asl.ParseOpcode == PARSEOP_PLD_VERTICALOFFSET)
+            {
+                PldInfo.VerticalOffset = (UINT16) Value;
+            }
+            else /* PARSEOP_PLD_HORIZONTALOFFSET */
+            {
+                PldInfo.HorizontalOffset = (UINT16) Value;
+            }
+
+            break;
+
+        default:
+
+            AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ThisOp, NULL);
+            break;
+        }
+
+        ThisOp = ThisOp->Asl.Next;
+    }
+
+    Buffer = OpcEncodePldBuffer (&PldInfo);
+
+    /* Change Op to a Buffer */
+
+    Op->Asl.ParseOpcode = PARSEOP_BUFFER;
+    Op->Common.AmlOpcode = AML_BUFFER_OP;
+
+    /* Disable further optimization */
+
+    Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
+    UtSetParseOpName (Op);
+
+    /* Child node is the buffer length */
+
+    NewOp = TrAllocateNode (PARSEOP_INTEGER);
+
+    NewOp->Asl.AmlOpcode = AML_BYTE_OP;
+    NewOp->Asl.Value.Integer = 20;
+    NewOp->Asl.Parent = Op;
+
+    Op->Asl.Child = NewOp;
+    Op = NewOp;
+
+    /* Peer to the child is the raw buffer data */
+
+    NewOp = TrAllocateNode (PARSEOP_RAW_DATA);
+    NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
+    NewOp->Asl.AmlLength = 20;
+    NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
+    NewOp->Asl.Parent = Op->Asl.Parent;
+
+    Op->Asl.Next = NewOp;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    OpcEncodePldBuffer
+ *
+ * PARAMETERS:  PldInfo             - _PLD buffer struct (Using local struct)
+ *
+ * RETURN:      Encode _PLD buffer suitable for return value from _PLD
+ *
+ * DESCRIPTION: Bit-packs a _PLD buffer struct.
+ *
+ ******************************************************************************/
+
+static UINT8 *
+OpcEncodePldBuffer (
+    ACPI_PLD_INFO           *PldInfo)
+{
+    UINT32                  *Buffer;
+    UINT32                  Dword;
+
+
+    Buffer = ACPI_ALLOCATE_ZEROED (ACPI_PLD_BUFFER_SIZE);
+    if (!Buffer)
+    {
+        return (NULL);
+    }
+
+    /* First 32 bits */
+
+    Dword = 0;
+    ACPI_PLD_SET_REVISION       (&Dword, PldInfo->Revision);
+    ACPI_PLD_SET_IGNORE_COLOR   (&Dword, PldInfo->IgnoreColor);
+    ACPI_PLD_SET_RED            (&Dword, PldInfo->Red);
+    ACPI_PLD_SET_GREEN          (&Dword, PldInfo->Green);
+    ACPI_PLD_SET_BLUE           (&Dword, PldInfo->Blue);
+    ACPI_MOVE_32_TO_32          (&Buffer[0], &Dword);
+
+    /* Second 32 bits */
+
+    Dword = 0;
+    ACPI_PLD_SET_WIDTH          (&Dword, PldInfo->Width);
+    ACPI_PLD_SET_HEIGHT         (&Dword, PldInfo->Height);
+    ACPI_MOVE_32_TO_32          (&Buffer[1], &Dword);
+
+    /* Third 32 bits */
+
+    Dword = 0;
+    ACPI_PLD_SET_USER_VISIBLE   (&Dword, PldInfo->UserVisible);
+    ACPI_PLD_SET_DOCK           (&Dword, PldInfo->Dock);
+    ACPI_PLD_SET_LID            (&Dword, PldInfo->Lid);
+    ACPI_PLD_SET_PANEL          (&Dword, PldInfo->Panel);
+    ACPI_PLD_SET_VERTICAL       (&Dword, PldInfo->VerticalPosition);
+    ACPI_PLD_SET_HORIZONTAL     (&Dword, PldInfo->HorizontalPosition);
+    ACPI_PLD_SET_SHAPE          (&Dword, PldInfo->Shape);
+    ACPI_PLD_SET_ORIENTATION    (&Dword, PldInfo->GroupOrientation);
+    ACPI_PLD_SET_TOKEN          (&Dword, PldInfo->GroupToken);
+    ACPI_PLD_SET_POSITION       (&Dword, PldInfo->GroupPosition);
+    ACPI_PLD_SET_BAY            (&Dword, PldInfo->Bay);
+    ACPI_MOVE_32_TO_32          (&Buffer[2], &Dword);
+
+    /* Fourth 32 bits */
+
+    Dword = 0;
+    ACPI_PLD_SET_EJECTABLE      (&Dword, PldInfo->Ejectable);
+    ACPI_PLD_SET_OSPM_EJECT     (&Dword, PldInfo->OspmEjectRequired);
+    ACPI_PLD_SET_CABINET        (&Dword, PldInfo->CabinetNumber);
+    ACPI_PLD_SET_CARD_CAGE      (&Dword, PldInfo->CardCageNumber);
+    ACPI_PLD_SET_REFERENCE      (&Dword, PldInfo->Reference);
+    ACPI_PLD_SET_ROTATION       (&Dword, PldInfo->Rotation);
+    ACPI_PLD_SET_ORDER          (&Dword, PldInfo->Order);
+    ACPI_MOVE_32_TO_32          (&Buffer[3], &Dword);
+
+    /* Revision 2 adds an additional DWORD */
+
+    if (PldInfo->Revision >= 2)
+    {
+        /* Fifth 32 bits */
+
+        Dword = 0;
+        ACPI_PLD_SET_VERT_OFFSET    (&Dword, PldInfo->VerticalOffset);
+        ACPI_PLD_SET_HORIZ_OFFSET   (&Dword, PldInfo->HorizontalOffset);
+        ACPI_MOVE_32_TO_32          (&Buffer[4], &Dword);
+    }
+
+    return (ACPI_CAST_PTR (UINT8, Buffer));
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    OpcFindName
+ *
+ * PARAMETERS:  List                - Array of char strings to be searched
+ *              Name                - Char string to string for
+ *              Index               - Index value to set if found
+ *
+ * RETURN:      TRUE if any names matched, FALSE otherwise
+ *
+ * DESCRIPTION: Match PLD name to value in lookup table. Sets Value to
+ *              equivalent parameter value.
+ *
+ ******************************************************************************/
+
+static BOOLEAN
+OpcFindName (
+    const char              **List,
+    char                    *Name,
+    UINT32                  *Index)
+{
+    const char              *NameString;
+    UINT32                  i;
+
+
+    AcpiUtStrupr (Name);
+
+    for (i = 0, NameString = List[0];
+            NameString;
+            i++, NameString = List[i])
+    {
+        if (!(strncmp (NameString, Name, strlen (Name))))
+        {
+            *Index = i;
+            return (TRUE);
+        }
+    }
+
+    return (FALSE);
+}
--- a/sys/external/bsd/acpica/dist/compiler/aslprune.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslprune.c	Wed May 04 18:15:53 2016 +0000
@@ -122,7 +122,7 @@
 
     AcpiOsPrintf ("\nRemoving Objects:\n");
 
-    TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
+    TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
         PrTreePruneWalk, NULL, ACPI_CAST_PTR (void, &PruneObj));
 
     AcpiOsPrintf ("\n%u Total Objects Removed\n", PruneObj.Count);
--- a/sys/external/bsd/acpica/dist/compiler/aslresource.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslresource.c	Wed May 04 18:15:53 2016 +0000
@@ -865,16 +865,19 @@
         break;
 
     case PARSEOP_I2C_SERIALBUS:
+    case PARSEOP_I2C_SERIALBUS_V2:
 
         Rnode = RsDoI2cSerialBusDescriptor (Info);
         break;
 
     case PARSEOP_SPI_SERIALBUS:
+    case PARSEOP_SPI_SERIALBUS_V2:
 
         Rnode = RsDoSpiSerialBusDescriptor (Info);
         break;
 
     case PARSEOP_UART_SERIALBUS:
+    case PARSEOP_UART_SERIALBUS_V2:
 
         Rnode = RsDoUartSerialBusDescriptor (Info);
         break;
--- a/sys/external/bsd/acpica/dist/compiler/aslresources.y	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslresources.y	Wed May 04 18:15:53 2016 +0000
@@ -392,6 +392,7 @@
     | GpioIntTerm                   {}
     | GpioIoTerm                    {}
     | I2cSerialBusTerm              {}
+    | I2cSerialBusTermV2            {}
     | InterruptTerm                 {}
     | IOTerm                        {}
     | IRQNoFlagsTerm                {}
@@ -404,9 +405,11 @@
     | QWordSpaceTerm                {}
     | RegisterTerm                  {}
     | SpiSerialBusTerm              {}
+    | SpiSerialBusTermV2            {}
     | StartDependentFnNoPriTerm     {}
     | StartDependentFnTerm          {}
     | UartSerialBusTerm             {}
+    | UartSerialBusTermV2           {}
     | VendorLongTerm                {}
     | VendorShortTerm               {}
     | WordBusNumberTerm             {}
@@ -630,11 +633,30 @@
         OptionalResourceType        /* 12: ResourceType */
         OptionalNameString          /* 13: DescriptorName */
         OptionalBuffer_Last         /* 14: VendorData */
-        ')'                         {$$ = TrLinkChildren ($<n>3,9,$4,$5,$7,$8,$10,$11,$12,$13,$14);}
+        ')'                         {$$ = TrLinkChildren ($<n>3,10,$4,$5,$7,$8,$10,$11,$12,$13,
+                                        TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$14);}
     | PARSEOP_I2C_SERIALBUS '('
         error ')'                   {$$ = AslDoError(); yyclearin;}
     ;
 
+I2cSerialBusTermV2
+    : PARSEOP_I2C_SERIALBUS_V2 '('  {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS_V2);}
+        WordConstExpr               /* 04: SlaveAddress */
+        OptionalSlaveMode           /* 05: SlaveMode */
+        ',' DWordConstExpr          /* 07: ConnectionSpeed */
+        OptionalAddressingMode      /* 08: AddressingMode */
+        ',' StringData              /* 10: ResourceSource */
+        OptionalByteConstExpr       /* 11: ResourceSourceIndex */
+        OptionalResourceType        /* 12: ResourceType */
+        OptionalNameString          /* 13: DescriptorName */
+        OptionalShareType           /* 14: Share */
+        OptionalBuffer_Last         /* 15: VendorData */
+        ')'                         {$$ = TrLinkChildren ($<n>3,10,$4,$5,$7,$8,$10,$11,$12,$13,
+                                        $14,$15);}
+    | PARSEOP_I2C_SERIALBUS_V2 '('
+        error ')'                   {$$ = AslDoError(); yyclearin;}
+    ;
+
 InterruptTerm
     : PARSEOP_INTERRUPT '('         {$<n>$ = TrCreateLeafNode (PARSEOP_INTERRUPT);}
         OptionalResourceType_First
@@ -815,11 +837,34 @@
         OptionalResourceType        /* 19: ResourceType */
         OptionalNameString          /* 20: DescriptorName */
         OptionalBuffer_Last         /* 21: VendorData */
-        ')'                         {$$ = TrLinkChildren ($<n>3,13,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21);}
+        ')'                         {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,
+                                        TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$21);}
     | PARSEOP_SPI_SERIALBUS '('
         error ')'                   {$$ = AslDoError(); yyclearin;}
     ;
 
+SpiSerialBusTermV2
+    : PARSEOP_SPI_SERIALBUS_V2 '('  {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS_V2);}
+        WordConstExpr               /* 04: DeviceSelection */
+        OptionalDevicePolarity      /* 05: DevicePolarity */
+        OptionalWireMode            /* 06: WireMode */
+        ',' ByteConstExpr           /* 08: DataBitLength */
+        OptionalSlaveMode           /* 09: SlaveMode */
+        ',' DWordConstExpr          /* 11: ConnectionSpeed */
+        ',' ClockPolarityKeyword    /* 13: ClockPolarity */
+        ',' ClockPhaseKeyword       /* 15: ClockPhase */
+        ',' StringData              /* 17: ResourceSource */
+        OptionalByteConstExpr       /* 18: ResourceSourceIndex */
+        OptionalResourceType        /* 19: ResourceType */
+        OptionalNameString          /* 20: DescriptorName */
+        OptionalShareType           /* 21: Share */
+        OptionalBuffer_Last         /* 22: VendorData */
+        ')'                         {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,
+                                        $21,$22);}
+    | PARSEOP_SPI_SERIALBUS_V2 '('
+        error ')'                   {$$ = AslDoError(); yyclearin;}
+    ;
+
 StartDependentFnNoPriTerm
     : PARSEOP_STARTDEPENDENTFN_NOPRI '('    {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);}
         ')' '{'
@@ -854,11 +899,35 @@
         OptionalResourceType        /* 19: ResourceType */
         OptionalNameString          /* 20: DescriptorName */
         OptionalBuffer_Last         /* 21: VendorData */
-        ')'                         {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21);}
+        ')'                         {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,
+                                        TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$21);}
     | PARSEOP_UART_SERIALBUS '('
         error ')'                   {$$ = AslDoError(); yyclearin;}
     ;
 
+UartSerialBusTermV2
+    : PARSEOP_UART_SERIALBUS_V2 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS_V2);}
+        DWordConstExpr              /* 04: ConnectionSpeed */
+        OptionalBitsPerByte         /* 05: BitsPerByte */
+        OptionalStopBits            /* 06: StopBits */
+        ',' ByteConstExpr           /* 08: LinesInUse */
+        OptionalEndian              /* 09: Endianess */
+        OptionalParityType          /* 10: Parity */
+        OptionalFlowControl         /* 11: FlowControl */
+        ',' WordConstExpr           /* 13: Rx BufferSize */
+        ',' WordConstExpr           /* 15: Tx BufferSize */
+        ',' StringData              /* 17: ResourceSource */
+        OptionalByteConstExpr       /* 18: ResourceSourceIndex */
+        OptionalResourceType        /* 19: ResourceType */
+        OptionalNameString          /* 20: DescriptorName */
+        OptionalShareType           /* 21: Share */
+        OptionalBuffer_Last         /* 22: VendorData */
+        ')'                         {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,
+                                        $21,$22);}
+    | PARSEOP_UART_SERIALBUS_V2 '('
+        error ')'                   {$$ = AslDoError(); yyclearin;}
+    ;
+
 VendorLongTerm
     : PARSEOP_VENDORLONG '('        {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORLONG);}
         OptionalNameString_First
--- a/sys/external/bsd/acpica/dist/compiler/aslrestype2e.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslrestype2e.c	Wed May 04 18:15:53 2016 +0000
@@ -143,7 +143,7 @@
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity));
             GranOp = InitializerOp;
-           break;
+            break;
 
         case 6: /* Address Min */
 
--- a/sys/external/bsd/acpica/dist/compiler/aslrestype2s.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslrestype2s.c	Wed May 04 18:15:53 2016 +0000
@@ -338,13 +338,6 @@
     Descriptor->Gpio.ResSourceOffset = (UINT16)
         ACPI_PTR_DIFF (ResourceSource, Descriptor);
 
-    DbgPrint (ASL_DEBUG_OUTPUT,
-        "%16s - Actual: %.2X, Base: %.2X, ResLen: "
-        "%.2X, VendLen: %.2X, IntLen: %.2X\n",
-        "GpioInt", Descriptor->Gpio.ResourceLength,
-        (UINT16) sizeof (AML_RESOURCE_GPIO),
-        ResSourceLength, VendorLength, InterruptLength);
-
     /* Process all child initialization nodes */
 
     for (i = 0; InitializerOp; i++)
@@ -554,13 +547,6 @@
     Descriptor->Gpio.ResSourceOffset = (UINT16)
         ACPI_PTR_DIFF (ResourceSource, Descriptor);
 
-    DbgPrint (ASL_DEBUG_OUTPUT,
-        "%16s - Actual: %.2X, Base: %.2X, ResLen: "
-        "%.2X, VendLen: %.2X, IntLen: %.2X\n",
-        "GpioIo", Descriptor->Gpio.ResourceLength,
-        (UINT16) sizeof (AML_RESOURCE_GPIO),
-        ResSourceLength, VendorLength, InterruptLength);
-
     /* Process all child initialization nodes */
 
     for (i = 0; InitializerOp; i++)
@@ -748,18 +734,16 @@
     Descriptor->I2cSerialBus.Type = AML_RESOURCE_I2C_SERIALBUSTYPE;
     Descriptor->I2cSerialBus.TypeDataLength = AML_RESOURCE_I2C_MIN_DATA_LEN + VendorLength;
 
+    if (Info->DescriptorTypeOp->Asl.ParseOpcode == PARSEOP_I2C_SERIALBUS_V2)
+    {
+        Descriptor->I2cSerialBus.RevisionId = 2;
+    }
+
     /* Build pointers to optional areas */
 
     VendorData = ACPI_ADD_PTR (UINT8, Descriptor, sizeof (AML_RESOURCE_I2C_SERIALBUS));
     ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength);
 
-    DbgPrint (ASL_DEBUG_OUTPUT,
-        "%16s - Actual: %.2X, Base: %.2X, ResLen: "
-        "%.2X, VendLen: %.2X, TypLen: %.2X\n",
-        "I2cSerialBus", Descriptor->I2cSerialBus.ResourceLength,
-        (UINT16) sizeof (AML_RESOURCE_I2C_SERIALBUS), ResSourceLength,
-        VendorLength, Descriptor->I2cSerialBus.TypeDataLength);
-
     /* Process all child initialization nodes */
 
     for (i = 0; InitializerOp; i++)
@@ -824,7 +808,18 @@
             UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
             break;
 
-        case 8: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
+        case 8:
+            /*
+             * Connection Share - Added for V2 (ACPI 6.0) version of the descriptor
+             * Note: For V1, the share bit will be zero (Op is DEFAULT_ARG from
+             * the ASL parser)
+             */
+            RsSetFlagBits (&Descriptor->I2cSerialBus.Flags, InitializerOp, 2, 0);
+            RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE,
+                CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.Flags), 2);
+            break;
+
+        case 9: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
 
             RsGetVendorData (InitializerOp, VendorData,
                 CurrentByteOffset + sizeof (AML_RESOURCE_I2C_SERIALBUS));
@@ -898,19 +893,17 @@
     Descriptor->SpiSerialBus.Type = AML_RESOURCE_SPI_SERIALBUSTYPE;
     Descriptor->SpiSerialBus.TypeDataLength = AML_RESOURCE_SPI_MIN_DATA_LEN + VendorLength;
 
+    if (Info->DescriptorTypeOp->Asl.ParseOpcode == PARSEOP_SPI_SERIALBUS_V2)
+    {
+        Descriptor->I2cSerialBus.RevisionId = 2;
+    }
+
     /* Build pointers to optional areas */
 
     VendorData = ACPI_ADD_PTR (UINT8, Descriptor,
         sizeof (AML_RESOURCE_SPI_SERIALBUS));
     ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength);
 
-    DbgPrint (ASL_DEBUG_OUTPUT,
-        "%16s - Actual: %.2X, Base: %.2X, ResLen: "
-        "%.2X, VendLen: %.2X, TypLen: %.2X\n",
-        "SpiSerialBus", Descriptor->SpiSerialBus.ResourceLength,
-        (UINT16) sizeof (AML_RESOURCE_SPI_SERIALBUS), ResSourceLength,
-        VendorLength, Descriptor->SpiSerialBus.TypeDataLength);
-
     /* Process all child initialization nodes */
 
     for (i = 0; InitializerOp; i++)
@@ -1003,7 +996,18 @@
             UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
             break;
 
-        case 12: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
+        case 12:
+            /*
+             * Connection Share - Added for V2 (ACPI 6.0) version of the descriptor
+             * Note: For V1, the share bit will be zero (Op is DEFAULT_ARG from
+             * the ASL parser)
+             */
+            RsSetFlagBits (&Descriptor->SpiSerialBus.Flags, InitializerOp, 2, 0);
+            RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE,
+                CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.Flags), 2);
+            break;
+
+        case 13: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
 
             RsGetVendorData (InitializerOp, VendorData,
                 CurrentByteOffset + sizeof (AML_RESOURCE_SPI_SERIALBUS));
@@ -1077,18 +1081,16 @@
     Descriptor->UartSerialBus.Type = AML_RESOURCE_UART_SERIALBUSTYPE;
     Descriptor->UartSerialBus.TypeDataLength = AML_RESOURCE_UART_MIN_DATA_LEN + VendorLength;
 
+    if (Info->DescriptorTypeOp->Asl.ParseOpcode == PARSEOP_UART_SERIALBUS_V2)
+    {
+        Descriptor->I2cSerialBus.RevisionId = 2;
+    }
+
     /* Build pointers to optional areas */
 
     VendorData = ACPI_ADD_PTR (UINT8, Descriptor, sizeof (AML_RESOURCE_UART_SERIALBUS));
     ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength);
 
-    DbgPrint (ASL_DEBUG_OUTPUT,
-        "%16s - Actual: %.2X, Base: %.2X, ResLen: "
-        "%.2X, VendLen: %.2X, TypLen: %.2X\n",
-        "UartSerialBus", Descriptor->UartSerialBus.ResourceLength,
-        (UINT16) sizeof (AML_RESOURCE_UART_SERIALBUS), ResSourceLength,
-        VendorLength, Descriptor->UartSerialBus.TypeDataLength);
-
     /* Process all child initialization nodes */
 
     for (i = 0; InitializerOp; i++)
@@ -1198,7 +1200,18 @@
             UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
             break;
 
-        case 13: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
+        case 13:
+            /*
+             * Connection Share - Added for V2 (ACPI 6.0) version of the descriptor
+             * Note: For V1, the share bit will be zero (Op is DEFAULT_ARG from
+             * the ASL parser)
+             */
+            RsSetFlagBits (&Descriptor->UartSerialBus.Flags, InitializerOp, 2, 0);
+            RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE,
+                CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.Flags), 2);
+            break;
+
+        case 14: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
 
             RsGetVendorData (InitializerOp, VendorData,
                 CurrentByteOffset + sizeof (AML_RESOURCE_UART_SERIALBUS));
--- a/sys/external/bsd/acpica/dist/compiler/aslrules.y	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslrules.y	Wed May 04 18:15:53 2016 +0000
@@ -74,6 +74,10 @@
  * {ObjectList} portion of the DefinitionBlockTerm in ACPI 2.0 to the
  * original use of {TermList} instead (see below.) This allows the use
  * of Type1 and Type2 opcodes at module level.
+ *
+ * 04/2016: The module-level code is now allowed in the following terms:
+ * DeviceTerm, PowerResTerm, ProcessorTerm, ScopeTerm, ThermalZoneTerm.
+ * The ObjectList term is obsolete and has been removed.
  */
 DefinitionBlockTerm
     : PARSEOP_DEFINITION_BLOCK '('  {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITION_BLOCK);}
@@ -189,12 +193,6 @@
         AmlPackageLengthTerm        {$$ = TrLinkChildNode ($1,$3);}
     ;
 
-ObjectList
-    :                               {$$ = NULL;}
-    | ObjectList Object             {$$ = TrLinkPeerNode ($1,$2);}
-    | error                         {$$ = AslDoError(); yyclearin;}
-    ;
-
 Object
     : CompilerDirective             {}
     | NamedObject                   {}
@@ -469,7 +467,6 @@
     | RefOfTerm                     {}
     | DerefOfTerm                   {}
     | IndexTerm                     {}
-
 /*    | MethodInvocationTerm          {} */  /* Caused reduce/reduce with Type6Opcode->MethodInvocationTerm */
     ;
 
@@ -490,6 +487,7 @@
     | BreakPointTerm                {}
     | ContinueTerm                  {}
     | FatalTerm                     {}
+    | ForTerm                       {}
     | ElseIfTerm                    {}
     | LoadTerm                      {}
     | NoOpTerm                      {}
@@ -698,7 +696,7 @@
 
 BufferTerm
     : PARSEOP_BUFFER '('            {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER);}
-        OptionalTermArg
+        OptionalBufferLength
         ')' '{'
             BufferTermData '}'      {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
     | PARSEOP_BUFFER '('
@@ -879,7 +877,7 @@
     : PARSEOP_DEVICE '('            {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);}
         NameString
         ')' '{'
-            ObjectList '}'          {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
+            TermList '}'            {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
     | PARSEOP_DEVICE '('
         error ')'                   {$$ = AslDoError(); yyclearin;}
     ;
@@ -990,6 +988,23 @@
         error ')'                   {$$ = AslDoError(); yyclearin;}
     ;
 
+    /* Convert a For() loop to a While() loop */
+ForTerm
+    : PARSEOP_FOR '('               {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);}
+        OptionalTermArg ','         {}
+        OptionalPredicate ','
+        OptionalTermArg             {$<n>$ = TrLinkPeerNode ($4,$<n>3);
+                                        TrSetParent ($9,$<n>3);}                /* New parent is WHILE */
+        ')' '{' TermList '}'        {$<n>$ = TrLinkChildren ($<n>3,2,$7,$13);}
+                                    {$<n>$ = TrLinkPeerNode ($13,$9);
+                                        $$ = $<n>10;}
+    ;
+
+OptionalPredicate
+    :                               {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, 1);}
+    | TermArg                       {$$ = $1;}
+    ;
+
 FprintfTerm
     : PARSEOP_FPRINTF '('            {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);}
         TermArg ','
@@ -1362,7 +1377,7 @@
         ',' ByteConstExpr
         ',' WordConstExpr
         ')' '{'
-            ObjectList '}'          {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);}
+            TermList '}'            {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);}
     | PARSEOP_POWERRESOURCE '('
         error ')'                   {$$ = AslDoError(); yyclearin;}
     ;
@@ -1390,7 +1405,7 @@
         OptionalDWordConstExpr
         OptionalByteConstExpr
         ')' '{'
-            ObjectList '}'          {$$ = TrLinkChildren ($<n>3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);}
+            TermList '}'            {$$ = TrLinkChildren ($<n>3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);}
     | PARSEOP_PROCESSOR '('
         error ')'                   {$$ = AslDoError(); yyclearin;}
     ;
@@ -1445,7 +1460,7 @@
     : PARSEOP_SCOPE '('             {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);}
         NameString
         ')' '{'
-            ObjectList '}'          {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
+            TermList '}'            {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
     | PARSEOP_SCOPE '('
         error ')'                   {$$ = AslDoError(); yyclearin;}
     ;
@@ -1534,7 +1549,7 @@
     : PARSEOP_THERMALZONE '('       {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);}
         NameString
         ')' '{'
-            ObjectList '}'          {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
+            TermList '}'            {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
     | PARSEOP_THERMALZONE '('
         error ')'                   {$$ = AslDoError(); yyclearin;}
     ;
@@ -1716,6 +1731,11 @@
     ;
 
 OptionalTermArg
+    :                               {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);}
+    | TermArg                       {$$ = $1;}
+    ;
+
+OptionalBufferLength
     :                               {$$ = NULL;}
     | TermArg                       {$$ = $1;}
     ;
--- a/sys/external/bsd/acpica/dist/compiler/aslstubs.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslstubs.c	Wed May 04 18:15:53 2016 +0000
@@ -64,6 +64,13 @@
 }
 
 ACPI_STATUS
+AcpiNsInitializeObjects (
+    void)
+{
+    return (AE_OK);
+}
+
+ACPI_STATUS
 AcpiHwReadPort (
     ACPI_IO_ADDRESS         Address,
     UINT32                  *Value,
@@ -120,6 +127,13 @@
 }
 
 ACPI_STATUS
+AcpiEvInstallRegionHandlers (
+    void)
+{
+    return (AE_OK);
+}
+
+ACPI_STATUS
 AcpiEvQueueNotifyRequest (
     ACPI_NAMESPACE_NODE     *Node,
     UINT32                  NotifyValue)
--- a/sys/external/bsd/acpica/dist/compiler/asltokens.y	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asltokens.y	Wed May 04 18:15:53 2016 +0000
@@ -166,6 +166,7 @@
 %token <i> PARSEOP_GPIO_INT
 %token <i> PARSEOP_GPIO_IO
 %token <i> PARSEOP_I2C_SERIALBUS
+%token <i> PARSEOP_I2C_SERIALBUS_V2
 %token <i> PARSEOP_IF
 %token <i> PARSEOP_INCLUDE
 %token <i> PARSEOP_INCLUDE_END
@@ -323,6 +324,7 @@
 %token <i> PARSEOP_SLAVEMODE_DEVICEINIT
 %token <i> PARSEOP_SLEEP
 %token <i> PARSEOP_SPI_SERIALBUS
+%token <i> PARSEOP_SPI_SERIALBUS_V2
 %token <i> PARSEOP_STALL
 %token <i> PARSEOP_STARTDEPENDENTFN
 %token <i> PARSEOP_STARTDEPENDENTFN_NOPRI
@@ -348,6 +350,7 @@
 %token <i> PARSEOP_TYPE_STATIC
 %token <i> PARSEOP_TYPE_TRANSLATION
 %token <i> PARSEOP_UART_SERIALBUS
+%token <i> PARSEOP_UART_SERIALBUS_V2
 %token <i> PARSEOP_UNICODE
 %token <i> PARSEOP_UNLOAD
 %token <i> PARSEOP_UPDATERULE_ONES
@@ -457,8 +460,11 @@
 %left <i>  PARSEOP_EXP_INDEX_LEFT
 %right <i> PARSEOP_EXP_INDEX_RIGHT
 
+/* Macros */
+
 %token <i> PARSEOP_PRINTF
 %token <i> PARSEOP_FPRINTF
+%token <i> PARSEOP_FOR
 
 /* Specific parentheses tokens are not used at this time */
            /* PARSEOP_EXP_PAREN_OPEN */
--- a/sys/external/bsd/acpica/dist/compiler/asltransform.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asltransform.c	Wed May 04 18:15:53 2016 +0000
@@ -249,7 +249,7 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    TrAmlTransformWalk
+ * FUNCTION:    TrAmlTransformWalkBegin
  *
  * PARAMETERS:  ASL_WALK_CALLBACK
  *
@@ -261,7 +261,7 @@
  ******************************************************************************/
 
 ACPI_STATUS
-TrAmlTransformWalk (
+TrAmlTransformWalkBegin (
     ACPI_PARSE_OBJECT       *Op,
     UINT32                  Level,
     void                    *Context)
@@ -274,6 +274,38 @@
 
 /*******************************************************************************
  *
+ * FUNCTION:    TrAmlTransformWalkEnd
+ *
+ * PARAMETERS:  ASL_WALK_CALLBACK
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Parse tree walk to generate both the AML opcodes and the AML
+ *              operands.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+TrAmlTransformWalkEnd (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context)
+{
+
+    /* Save possible Externals list in the DefintionBlock Op */
+
+    if (Op->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK)
+    {
+        Op->Asl.Value.Arg = Gbl_ExternalsListHead;
+        Gbl_ExternalsListHead = NULL;
+    }
+
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    TrTransformSubtree
  *
  * PARAMETERS:  Op        - The parent parse node
@@ -316,6 +348,15 @@
         Gbl_TempCount = 0;
         break;
 
+    case PARSEOP_EXTERNAL:
+
+        if (Gbl_DoExternals == TRUE)
+        {
+            ExDoExternal (Op);
+        }
+
+        break;
+
     default:
 
         /* Nothing to do here for other opcodes */
@@ -347,6 +388,10 @@
     UINT32                  i;
 
 
+    /* Reset external list when starting a definition block */
+
+    Gbl_ExternalsListHead = NULL;
+
     Next = Op->Asl.Child;
     for (i = 0; i < 5; i++)
     {
--- a/sys/external/bsd/acpica/dist/compiler/asltypes.h	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asltypes.h	Wed May 04 18:15:53 2016 +0000
@@ -81,6 +81,7 @@
 typedef struct asl_method_info
 {
     ACPI_PARSE_OBJECT       *Op;
+    ACPI_PARSE_OBJECT       *CurrentOp;
     struct asl_method_info  *Next;
     UINT32                  ValidArgTypes[ACPI_METHOD_NUM_ARGS];
     UINT32                  ValidReturnTypes;
@@ -171,12 +172,13 @@
     ASL_FILE_ASM_INCLUDE_OUTPUT,/* .inc */
     ASL_FILE_C_INCLUDE_OUTPUT,  /* .h   */
     ASL_FILE_C_OFFSET_OUTPUT,   /* .offset.h */
-    ASL_FILE_MAP_OUTPUT         /* .map */
+    ASL_FILE_MAP_OUTPUT,        /* .map */
+    ASL_FILE_XREF_OUTPUT        /* .xrf */
 
 } ASL_FILE_TYPES;
 
 
-#define ASL_MAX_FILE_TYPE       16
+#define ASL_MAX_FILE_TYPE       17
 #define ASL_NUM_FILES           (ASL_MAX_FILE_TYPE + 1)
 
 /* Name suffixes used to create filenames for output files */
@@ -196,6 +198,7 @@
 #define FILE_SUFFIX_C_INCLUDE       "h"
 #define FILE_SUFFIX_C_OFFSET        "offset.h"
 #define FILE_SUFFIX_MAP             "map"
+#define FILE_SUFFIX_XREF            "xrf"
 
 
 /* Cache block structure for ParseOps and Strings */
@@ -316,4 +319,21 @@
 #define ASL_ARG_INITIALIZED     (1<<3)
 #define ASL_ARG_REFERENCED      (1<<4)
 
+/* Info used to track method counts for cross reference output file */
+
+typedef struct asl_xref_info
+{
+    UINT32                  ThisMethodInvocations;
+    UINT32                  TotalPredefinedMethods;
+    UINT32                  TotalUserMethods;
+    UINT32                  TotalUnreferenceUserMethods;
+    UINT32                  ThisObjectReferences;
+    UINT32                  TotalObjects;
+    UINT32                  TotalUnreferencedObjects;
+    ACPI_PARSE_OBJECT       *MethodOp;
+    ACPI_PARSE_OBJECT       *CurrentMethodOp;
+
+} ASL_XREF_INFO;
+
+
 #endif  /* __ASLTYPES_H */
--- a/sys/external/bsd/acpica/dist/compiler/asltypes.y	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asltypes.y	Wed May 04 18:15:53 2016 +0000
@@ -62,7 +62,6 @@
 %type <n> NamedObject
 %type <n> NameSpaceModifier
 %type <n> Object
-%type <n> ObjectList
 %type <n> PackageData
 %type <n> ParameterTypePackage
 %type <n> ParameterTypePackageList
@@ -295,6 +294,7 @@
 %type <n> PrintfArgList
 %type <n> PrintfTerm
 %type <n> FprintfTerm
+%type <n> ForTerm
 
 /* Resource Descriptors */
 
@@ -312,6 +312,7 @@
 %type <n> GpioIntTerm
 %type <n> GpioIoTerm
 %type <n> I2cSerialBusTerm
+%type <n> I2cSerialBusTermV2
 %type <n> InterruptTerm
 %type <n> IOTerm
 %type <n> IRQNoFlagsTerm
@@ -326,9 +327,11 @@
 %type <n> QWordSpaceTerm
 %type <n> RegisterTerm
 %type <n> SpiSerialBusTerm
+%type <n> SpiSerialBusTermV2
 %type <n> StartDependentFnNoPriTerm
 %type <n> StartDependentFnTerm
 %type <n> UartSerialBusTerm
+%type <n> UartSerialBusTermV2
 %type <n> VendorLongTerm
 %type <n> VendorShortTerm
 %type <n> WordBusNumberTerm
@@ -347,6 +350,7 @@
 %type <n> OptionalAddressRange
 %type <n> OptionalBitsPerByte
 %type <n> OptionalBuffer_Last
+%type <n> OptionalBufferLength
 %type <n> OptionalByteConstExpr
 %type <n> OptionalCount
 %type <n> OptionalDecodeType
@@ -366,6 +370,7 @@
 %type <n> OptionalParameterTypePackage
 %type <n> OptionalParameterTypesPackage
 %type <n> OptionalParityType
+%type <n> OptionalPredicate
 %type <n> OptionalQWordConstExpr
 %type <n> OptionalRangeType
 %type <n> OptionalReference
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslxrefout.c	Wed May 04 18:15:53 2016 +0000
@@ -0,0 +1,814 @@
+/******************************************************************************
+ *
+ * Module Name: aslxrefout.c - support for optional cross-reference file
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2016, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ *    of any contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include "aslcompiler.h"
+#include "aslcompiler.y.h"
+#include "acnamesp.h"
+#include "acparser.h"
+#include "amlcode.h"
+
+#define _COMPONENT          ACPI_COMPILER
+        ACPI_MODULE_NAME    ("aslxrefout")
+
+
+/* Local prototypes */
+
+static ACPI_STATUS
+OtXrefWalkPart2 (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context);
+
+static ACPI_STATUS
+OtXrefWalkPart3 (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context);
+
+static ACPI_STATUS
+OtXrefAnalysisWalkPart1 (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context);
+
+
+static ACPI_STATUS
+OtXrefAnalysisWalkPart2 (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context);
+
+static ACPI_STATUS
+OtXrefAnalysisWalkPart3 (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    OtPrintHeaders
+ *
+ * PARAMETERS:  Message             - Main header message
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Emits the main header message along with field descriptions
+ *
+ ******************************************************************************/
+
+void
+OtPrintHeaders (
+    char                    *Message)
+{
+    UINT32                  Length;
+
+
+    Length = strlen (Message);
+
+    FlPrintFile (ASL_FILE_XREF_OUTPUT, "\n\n%s\n", Message);
+    while (Length)
+    {
+        FlPrintFile (ASL_FILE_XREF_OUTPUT, "-");
+        Length--;
+    }
+
+    FlPrintFile (ASL_FILE_XREF_OUTPUT, "\n\nLineno   %-40s Description\n",
+        "Full Pathname");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    OtCreateXrefFile
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION  Main entry point for parts 2 and 3 of the cross-reference
+ *              file.
+ *
+ ******************************************************************************/
+
+void
+OtCreateXrefFile (
+    void)
+{
+    ASL_XREF_INFO           XrefInfo;
+
+
+    /* Build cross-reference output file if requested */
+
+    if (!Gbl_CrossReferenceOutput)
+    {
+        return;
+    }
+
+    memset (&XrefInfo, 0, sizeof (ASL_XREF_INFO));
+
+    /* Cross-reference output file, part 2 (Method invocations) */
+
+    OtPrintHeaders ("Part 2: Method Reference Map "
+        "(Invocations of each user-defined control method)");
+
+    TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
+        OtXrefWalkPart2, NULL, &XrefInfo);
+
+    /* Cross-reference output file, part 3 (All other object refs) */
+
+    OtPrintHeaders ("Part 3: Full Object Reference Map "
+        "(Methods that reference each object in namespace");
+
+    TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
+        OtXrefWalkPart3, NULL, &XrefInfo);
+
+    /* Cross-reference summary */
+
+    FlPrintFile (ASL_FILE_XREF_OUTPUT, "\n\nObject Summary\n");
+
+    FlPrintFile (ASL_FILE_XREF_OUTPUT,
+        "\nTotal methods:                   %u\n",
+        XrefInfo.TotalPredefinedMethods + XrefInfo.TotalUserMethods);
+    FlPrintFile (ASL_FILE_XREF_OUTPUT,
+        "Total predefined methods:        %u\n",
+        XrefInfo.TotalPredefinedMethods);
+
+    FlPrintFile (ASL_FILE_XREF_OUTPUT,
+        "\nTotal user methods:              %u\n",
+        XrefInfo.TotalUserMethods);
+    FlPrintFile (ASL_FILE_XREF_OUTPUT,
+        "Total unreferenced user methods  %u\n",
+        XrefInfo.TotalUnreferenceUserMethods);
+
+    FlPrintFile (ASL_FILE_XREF_OUTPUT,
+        "\nTotal defined objects:           %u\n",
+        XrefInfo.TotalObjects);
+    FlPrintFile (ASL_FILE_XREF_OUTPUT,
+        "Total unreferenced objects:      %u\n",
+        XrefInfo.TotalUnreferencedObjects);
+}
+
+
+/*
+ * Part 1 of the cross reference file. This part emits the namespace objects
+ * that are referenced by each control method in the namespace.
+ *
+ * Part 2 and 3 are below part 1.
+ */
+
+/*******************************************************************************
+ *
+ * FUNCTION:    OtXrefWalkPart1
+ *
+ * PARAMETERS:  Op                      - Current parse Op
+ *              Level                   - Current tree nesting level
+ *              MethodInfo              - Info block for the current method
+ *
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Entry point for the creation of the method call reference map.
+ *              For each control method in the namespace, all other methods
+ *              that invoke the method are listed. Predefined names/methods
+ *              that start with an underscore are ignored, because these are
+ *              essentially external/public interfaces.
+
+ * DESCRIPTION: Entry point for the creation of the object reference map.
+ *              For each control method in the namespace, all objects that
+ *              are referenced by the method are listed.
+ *
+ *              Called during a normal namespace walk, once per namespace
+ *              object. (MtMethodAnalysisWalkBegin)
+ *
+ ******************************************************************************/
+
+void
+OtXrefWalkPart1 (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    ASL_METHOD_INFO         *MethodInfo)
+{
+    ACPI_NAMESPACE_NODE     *Node;
+    ACPI_PARSE_OBJECT       *NextOp;
+    ACPI_PARSE_OBJECT       *FieldOp;
+    char                    *ParentPath;
+    UINT32                  Length;
+    ACPI_STATUS             Status;
+
+
+    switch (Op->Asl.ParseOpcode)
+    {
+    case PARSEOP_NAMESEG:
+    case PARSEOP_NAMESTRING:
+    case PARSEOP_METHODCALL:
+
+        if (!MethodInfo ||
+            (MethodInfo->Op->Asl.Child == Op) ||
+            !Op->Asl.Node)
+        {
+            break;
+        }
+
+        MethodInfo->CurrentOp = Op;
+        Node = Op->Asl.Node;
+
+        /* Find all objects referenced by this method */
+
+        Status = TrWalkParseTree (MethodInfo->Op, ASL_WALK_VISIT_DOWNWARD,
+            OtXrefAnalysisWalkPart1, NULL, MethodInfo);
+
+        if (Status == AE_CTRL_TERMINATE)
+        {
+            ParentPath = AcpiNsGetNormalizedPathname (Node, TRUE);
+
+            FlPrintFile (ASL_FILE_XREF_OUTPUT, "            %-40s %s",
+                ParentPath, AcpiUtGetTypeName (Node->Type));
+            ACPI_FREE (ParentPath);
+
+            switch (Node->Type)
+            {
+                /* Handle externals */
+
+            case ACPI_TYPE_ANY:
+            case ACPI_TYPE_FIELD_UNIT:
+
+                FlPrintFile (ASL_FILE_XREF_OUTPUT, " <External Object>");
+                break;
+
+            case ACPI_TYPE_INTEGER:
+
+                FlPrintFile (ASL_FILE_XREF_OUTPUT, " %8.8X%8.8X",
+                    ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer));
+                break;
+
+            case ACPI_TYPE_METHOD:
+
+                FlPrintFile (ASL_FILE_XREF_OUTPUT, " Invocation (%u args)",
+                    Node->ArgCount);
+                break;
+
+            case ACPI_TYPE_BUFFER_FIELD:
+
+                NextOp = Node->Op;              /* Create Buffer Field Op */
+                switch (NextOp->Asl.ParseOpcode)
+                {
+                case PARSEOP_CREATEBITFIELD:
+                    Length = 1;
+                    break;
+
+                case PARSEOP_CREATEBYTEFIELD:
+                    Length = 8;
+                    break;
+
+                case PARSEOP_CREATEWORDFIELD:
+                    Length = 16;
+                    break;
+
+                case PARSEOP_CREATEDWORDFIELD:
+                    Length = 32;
+                    break;
+
+                case PARSEOP_CREATEQWORDFIELD:
+                    Length = 64;
+                    break;
+
+                default:
+                    Length = 0;
+                    break;
+                }
+
+                NextOp = NextOp->Asl.Child;     /* Buffer name */
+
+                if (!NextOp->Asl.ExternalName)
+                {
+                    FlPrintFile (ASL_FILE_XREF_OUTPUT, " in Arg/Local");
+                }
+                else
+                {
+                    ParentPath = AcpiNsGetNormalizedPathname (
+                        NextOp->Asl.Node, TRUE);
+
+                    FlPrintFile (ASL_FILE_XREF_OUTPUT, " (%.2u bit) in Buffer %s",
+                        Length, ParentPath);
+                    ACPI_FREE (ParentPath);
+                }
+                break;
+
+            case ACPI_TYPE_LOCAL_REGION_FIELD:
+
+                NextOp = Node->Op;
+                FieldOp = NextOp->Asl.Parent;
+                NextOp = FieldOp->Asl.Child;
+
+                ParentPath = AcpiNsGetNormalizedPathname (
+                    NextOp->Asl.Node, TRUE);
+
+                FlPrintFile (ASL_FILE_XREF_OUTPUT, " (%.2u bit) in Region %s",
+                    (UINT32) Node->Op->Asl.Child->Asl.Value.Integer,
+                    ParentPath);
+                ACPI_FREE (ParentPath);
+
+                if (FieldOp->Asl.ParseOpcode == PARSEOP_FIELD)
+                {
+                    Node = NextOp->Asl.Node;        /* Region node */
+                    NextOp = Node->Op;              /* PARSEOP_REGION */
+                    NextOp = NextOp->Asl.Child;     /* Region name */
+                    NextOp = NextOp->Asl.Next;
+
+                    /* Get region space/addr/len? */
+
+                    FlPrintFile (ASL_FILE_XREF_OUTPUT, " (%s)",
+                        AcpiUtGetRegionName ((UINT8)
+                        NextOp->Asl.Value.Integer));
+                }
+                break;
+
+            default:
+                break;
+            }
+
+            FlPrintFile (ASL_FILE_XREF_OUTPUT, "\n");
+        }
+        break;
+
+    case PARSEOP_METHOD:
+
+        ParentPath = AcpiNsGetNormalizedPathname (Op->Asl.Node, TRUE);
+
+        FlPrintFile (ASL_FILE_XREF_OUTPUT,
+            "\n[%5u]  %-40s %s Declaration (%u args)\n",
+            Op->Asl.LogicalLineNumber, ParentPath,
+            AcpiUtGetTypeName (Op->Asl.Node->Type), Op->Asl.Node->ArgCount);
+
+        ACPI_FREE (ParentPath);
+        break;
+
+    default:
+        break;
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    OtXrefAnalysisWalkPart1
+ *
+ * PARAMETERS:  ASL_WALK_CALLBACK
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Secondary walk for cross-reference part 1.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+OtXrefAnalysisWalkPart1 (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context)
+{
+    ASL_METHOD_INFO         *MethodInfo = (ASL_METHOD_INFO *) Context;
+    ACPI_PARSE_OBJECT       *Next;
+
+
+    /* Only interested in name string Ops -- ignore all others */
+
+    if ((Op->Asl.ParseOpcode != PARSEOP_NAMESEG) &&
+        (Op->Asl.ParseOpcode != PARSEOP_NAMESTRING) &&
+        (Op->Asl.ParseOpcode != PARSEOP_METHODCALL))
+    {
+        return (AE_OK);
+    }
+
+    /* No node means a locally declared object -- ignore */
+
+    if (!Op->Asl.Node)
+    {
+        return (AE_OK);
+    }
+
+    /* When we encounter the source Op, we are done */
+
+    Next = MethodInfo->CurrentOp;
+    if (Next == Op)
+    {
+        return (AE_CTRL_TERMINATE);
+    }
+
+    /* If we have a name match, this Op is a duplicate */
+
+    if ((Next->Asl.ParseOpcode == PARSEOP_NAMESEG)      ||
+        (Next->Asl.ParseOpcode == PARSEOP_NAMESTRING)   ||
+        (Next->Asl.ParseOpcode == PARSEOP_METHODCALL))
+    {
+        if (!strcmp (Op->Asl.ExternalName, Next->Asl.ExternalName))
+        {
+            return (AE_ALREADY_EXISTS);
+        }
+    }
+
+    return (AE_OK);
+}
+
+
+/*
+ * Part 2 of the cross reference file. This part emits the names of each
+ * non-predefined method in the namespace (user methods), along with the
+ * names of each control method that references that method.
+ */
+
+/*******************************************************************************
+ *
+ * FUNCTION:    OtXrefWalkPart2
+ *
+ * PARAMETERS:  ASL_WALK_CALLBACK
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: For each control method in the namespace, we will re-walk the
+ *              namespace to find each and every invocation of that control
+ *              method. Brute force, but does not matter, even for large
+ *              namespaces. Ignore predefined names (start with underscore).
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+OtXrefWalkPart2 (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context)
+{
+    ASL_XREF_INFO           *XrefInfo = (ASL_XREF_INFO *) Context;
+    ACPI_NAMESPACE_NODE     *Node;
+    char                    *ParentPath;
+
+
+    /* Looking for Method Declaration Ops only */
+
+    if (!Op->Asl.Node ||
+        (Op->Asl.ParseOpcode != PARSEOP_METHOD))
+    {
+        return (AE_OK);
+    }
+
+    /* Ignore predefined names */
+
+    if (Op->Asl.Node->Name.Ascii[0] == '_')
+    {
+        XrefInfo->TotalPredefinedMethods++;
+        return (AE_OK);
+    }
+
+    Node = Op->Asl.Node;
+    ParentPath = AcpiNsGetNormalizedPathname (Node, TRUE);
+
+    FlPrintFile (ASL_FILE_XREF_OUTPUT,
+        "\n[%5u]  %-40s %s Declaration (%u args)\n",
+        Op->Asl.LogicalLineNumber, ParentPath,
+        AcpiUtGetTypeName (Node->Type), Node->ArgCount);
+
+    XrefInfo->TotalUserMethods++;
+    XrefInfo->ThisMethodInvocations = 0;
+    XrefInfo->MethodOp = Op;
+
+    (void) TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
+        OtXrefAnalysisWalkPart2, NULL, XrefInfo);
+
+    if (!XrefInfo->ThisMethodInvocations)
+    {
+        FlPrintFile (ASL_FILE_XREF_OUTPUT,
+            "            Zero invocations of this method in this module\n");
+        XrefInfo->TotalUnreferenceUserMethods++;
+    }
+    else
+    {
+        FlPrintFile (ASL_FILE_XREF_OUTPUT,
+            "            %u invocations of method %s in this module\n",
+            XrefInfo->ThisMethodInvocations, ParentPath);
+    }
+
+    ACPI_FREE (ParentPath);
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    OtXrefAnalysisWalkPart2
+ *
+ * PARAMETERS:  ASL_WALK_CALLBACK
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: For every Op that is a method invocation, emit a reference
+ *              line if the Op is invoking the target method.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+OtXrefAnalysisWalkPart2 (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context)
+{
+    ASL_XREF_INFO           *XrefInfo = (ASL_XREF_INFO *) Context;
+    ACPI_PARSE_OBJECT       *CallerOp;
+    char                    *CallerFullPathname;
+
+
+    /* Looking for MethodCall Ops only */
+
+    if (!Op->Asl.Node ||
+        (Op->Asl.ParseOpcode != PARSEOP_METHODCALL))
+    {
+        return (AE_OK);
+    }
+
+    /* If not a match to the target method, we are done */
+
+    if (Op->Asl.Node != XrefInfo->MethodOp->Asl.Node)
+    {
+        return (AE_CTRL_DEPTH);
+    }
+
+    /* Find parent method to get method caller namepath */
+
+    CallerOp = Op->Asl.Parent;
+    while (CallerOp &&
+        (CallerOp->Asl.ParseOpcode != PARSEOP_METHOD))
+    {
+        CallerOp = CallerOp->Asl.Parent;
+    }
+
+    /* There is no parent method for External() statements */
+
+    if (!CallerOp)
+    {
+        return (AE_OK);
+    }
+
+    CallerFullPathname = AcpiNsGetNormalizedPathname (
+        CallerOp->Asl.Node, TRUE);
+
+    FlPrintFile (ASL_FILE_XREF_OUTPUT,
+        "[%5u]     %-40s Invocation path: %s\n",
+        Op->Asl.LogicalLineNumber, CallerFullPathname,
+        Op->Asl.ExternalName);
+
+    ACPI_FREE (CallerFullPathname);
+    XrefInfo->ThisMethodInvocations++;
+    return (AE_OK);
+}
+
+
+/*
+ * Part 3 of the cross reference file. This part emits the names of each
+ * non-predefined method in the namespace (user methods), along with the
+ * names of each control method that references that method.
+ */
+
+/*******************************************************************************
+ *
+ * FUNCTION:    OtXrefWalkPart3
+ *
+ * PARAMETERS:  ASL_WALK_CALLBACK
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Cross-reference part 3. references to objects other than
+ *              control methods.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+OtXrefWalkPart3 (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context)
+{
+    ASL_XREF_INFO           *XrefInfo = (ASL_XREF_INFO *) Context;
+    ACPI_NAMESPACE_NODE     *Node;
+    char                    *ParentPath;
+    const ACPI_OPCODE_INFO  *OpInfo;
+
+
+    /* Ignore method declarations */
+
+    if (!Op->Asl.Node ||
+        (Op->Asl.ParseOpcode == PARSEOP_METHOD))
+    {
+        return (AE_OK);
+    }
+
+    OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
+    if (!(OpInfo->Class & AML_CLASS_NAMED_OBJECT))
+    {
+        return (AE_OK);
+    }
+
+    /* Only care about named object creation opcodes */
+
+    if ((Op->Asl.ParseOpcode != PARSEOP_NAME) &&
+        (Op->Asl.ParseOpcode != PARSEOP_DEVICE) &&
+        (Op->Asl.ParseOpcode != PARSEOP_MUTEX) &&
+        (Op->Asl.ParseOpcode != PARSEOP_OPERATIONREGION) &&
+        (Op->Asl.ParseOpcode != PARSEOP_FIELD) &&
+        (Op->Asl.ParseOpcode != PARSEOP_EVENT))
+    {
+        return (AE_OK);
+    }
+
+    /* Ignore predefined names */
+
+    if (Op->Asl.Node->Name.Ascii[0] == '_')
+    {
+        return (AE_OK);
+    }
+
+    Node = Op->Asl.Node;
+    ParentPath = AcpiNsGetNormalizedPathname (Node, TRUE);
+
+    FlPrintFile (ASL_FILE_XREF_OUTPUT,
+        "\n[%5u]  %-40s %s Declaration\n",
+        Op->Asl.LogicalLineNumber, ParentPath,
+        AcpiUtGetTypeName (Node->Type));
+    ACPI_FREE (ParentPath);
+
+    XrefInfo->MethodOp = Op;
+    XrefInfo->ThisObjectReferences = 0;
+    XrefInfo->TotalObjects = 0;
+
+    (void) TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
+        OtXrefAnalysisWalkPart3, NULL, XrefInfo);
+
+    if (!XrefInfo->ThisObjectReferences)
+    {
+        FlPrintFile (ASL_FILE_XREF_OUTPUT,
+            "            Zero references to this object in this module\n");
+        XrefInfo->TotalUnreferencedObjects++;
+    }
+    else
+    {
+        FlPrintFile (ASL_FILE_XREF_OUTPUT,
+            "            %u references to this object in this module\n",
+            XrefInfo->ThisObjectReferences, ParentPath);
+    }
+
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    OtXrefAnalysisWalkPart3
+ *
+ * PARAMETERS:  ASL_WALK_CALLBACK
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Secondary walk for cross-reference part 3.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+OtXrefAnalysisWalkPart3 (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context)
+{
+    ASL_XREF_INFO           *XrefInfo = (ASL_XREF_INFO *) Context;
+    char                    *CallerFullPathname = NULL;
+    ACPI_PARSE_OBJECT       *CallerOp;
+    const char              *Operator;
+
+
+    if (!Op->Asl.Node)
+    {
+        return (AE_OK);
+    }
+
+    XrefInfo->TotalObjects++;
+
+    /* Ignore Op that actually defined the object */
+
+    if (Op == XrefInfo->MethodOp)
+    {
+        return (AE_OK);
+    }
+
+    /* Only interested in Ops that reference the target node */
+
+    if (Op->Asl.Node != XrefInfo->MethodOp->Asl.Node)
+    {
+        return (AE_OK);
+    }
+
+    /* Find parent "open scope" object to get method caller namepath */
+
+    CallerOp = Op->Asl.Parent;
+    while (CallerOp &&
+        (CallerOp->Asl.ParseOpcode != PARSEOP_NAME) &&
+        (CallerOp->Asl.ParseOpcode != PARSEOP_METHOD) &&
+        (CallerOp->Asl.ParseOpcode != PARSEOP_DEVICE) &&
+        (CallerOp->Asl.ParseOpcode != PARSEOP_POWERRESOURCE) &&
+        (CallerOp->Asl.ParseOpcode != PARSEOP_PROCESSOR) &&
+        (CallerOp->Asl.ParseOpcode != PARSEOP_THERMALZONE))
+    {
+        CallerOp = CallerOp->Asl.Parent;
+    }
+
+    if (CallerOp == XrefInfo->CurrentMethodOp)
+    {
+        return (AE_OK);
+    }
+
+    /* Null CallerOp means the caller is at the namespace root */
+
+    if (CallerOp)
+    {
+        CallerFullPathname = AcpiNsGetNormalizedPathname (
+            CallerOp->Asl.Node, TRUE);
+    }
+
+    /* There are some special cases for the oddball operators */
+
+    if (Op->Asl.ParseOpcode == PARSEOP_SCOPE)
+    {
+        Operator = "Scope";
+    }
+    else if (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_ALIAS)
+    {
+        Operator = "Alias";
+    }
+    else if (!CallerOp)
+    {
+        Operator = "ModLevel";
+    }
+    else
+    {
+        Operator = AcpiUtGetTypeName (CallerOp->Asl.Node->Type);
+    }
+
+    FlPrintFile (ASL_FILE_XREF_OUTPUT,
+        "[%5u]     %-40s %-8s via path: %s, Operator: %s\n",
+        Op->Asl.LogicalLineNumber,
+        CallerFullPathname ? CallerFullPathname : "<root>",
+        Operator,
+        Op->Asl.ExternalName,
+        Op->Asl.Parent->Asl.ParseOpName);
+
+    if (!CallerOp)
+    {
+        CallerOp = ACPI_TO_POINTER (0xFFFFFFFF);
+    }
+
+    if (CallerFullPathname)
+    {
+        ACPI_FREE (CallerFullPathname);
+    }
+
+    XrefInfo->CurrentMethodOp = CallerOp;
+    XrefInfo->ThisObjectReferences++;
+    return (AE_OK);
+}
--- a/sys/external/bsd/acpica/dist/compiler/dttable1.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/dttable1.c	Wed May 04 18:15:53 2016 +0000
@@ -1243,8 +1243,8 @@
     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.
+     * Using ACPI_SUB_PTR, We needn't define a separate structure. Care
+     * should be taken to avoid accessing ACPI_TABLE_HEADER fields.
      */
     Iort = ACPI_SUB_PTR (ACPI_TABLE_IORT,
         Subtable->Buffer, sizeof (ACPI_TABLE_HEADER));
@@ -1475,6 +1475,19 @@
             IortSmmu->PmuInterruptCount = PmuIrptNumber;
             break;
 
+        case ACPI_IORT_NODE_SMMU_V3:
+
+            Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort4,
+                &Subtable, TRUE);
+            if (ACPI_FAILURE (Status))
+            {
+                return (Status);
+            }
+
+            DtInsertSubtable (ParentTable, Subtable);
+            NodeLength += Subtable->Length;
+            break;
+
         default:
 
             DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IORT");
--- a/sys/external/bsd/acpica/dist/compiler/dttable2.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/dttable2.c	Wed May 04 18:15:53 2016 +0000
@@ -758,6 +758,11 @@
             InfoTable = AcpiDmTableInfoPcct1;
             break;
 
+        case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2:
+
+            InfoTable = AcpiDmTableInfoPcct2;
+            break;
+
         default:
 
             DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PCCT");
@@ -976,7 +981,7 @@
     DT_FIELD                **PFieldList)
 {
     ACPI_STATUS             Status;
-    ACPI_S3PT_HEADER        *S3ptHeader;
+    ACPI_FPDT_HEADER        *S3ptHeader;
     DT_SUBTABLE             *Subtable;
     DT_SUBTABLE             *ParentTable;
     ACPI_DMTABLE_INFO       *InfoTable;
@@ -1006,7 +1011,7 @@
         DtInsertSubtable (ParentTable, Subtable);
         DtPushSubtable (Subtable);
 
-        S3ptHeader = ACPI_CAST_PTR (ACPI_S3PT_HEADER, Subtable->Buffer);
+        S3ptHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
 
         switch (S3ptHeader->Type)
         {
--- a/sys/external/bsd/acpica/dist/compiler/dttemplate.h	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/dttemplate.h	Wed May 04 18:15:53 2016 +0000
@@ -543,11 +543,11 @@
 
 const unsigned char TemplateIort[] =
 {
-    0x49,0x4F,0x52,0x54,0x0C,0x01,0x00,0x00,  /* 00000000    "IORT...." */
-    0x00,0xBC,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
+    0x49,0x4F,0x52,0x54,0x48,0x01,0x00,0x00,  /* 00000000    "IORTH..." */
+    0x00,0x02,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
     0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45,  /* 00000010    "TEMPLATE" */
     0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
-    0x10,0x04,0x15,0x20,0x04,0x00,0x00,0x00,  /* 00000020    "... ...." */
+    0x12,0x02,0x16,0x20,0x05,0x00,0x00,0x00,  /* 00000020    "... ...." */
     0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000028    "4......." */
     0x00,0x00,0x00,0x00,0x00,0x2C,0x00,0x00,  /* 00000030    ".....,.." */
     0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000038    "........" */
@@ -576,7 +576,14 @@
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000F0    "........" */
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000F8    "........" */
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000100    "........" */
-    0x00,0x00,0x00,0x00                       /* 00000108    "...."     */
+    0x00,0x00,0x00,0x00,0x04,0x3C,0x00,0x00,  /* 00000108    ".....<.." */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000110    "........" */
+    0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000118    "<......." */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000120    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000128    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000130    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000138    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00   /* 00000140    "........" */
 };
 
 const unsigned char TemplateIvrs[] =
@@ -837,28 +844,39 @@
 
 const unsigned char TemplatePcct[] =
 {
-    0x50,0x43,0x43,0x54,0xAC,0x00,0x00,0x00,  /* 00000000    "PCCT...." */
-    0x01,0xCF,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
-    0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65,  /* 00000010    "Template" */
+    0x50,0x43,0x43,0x54,0x06,0x01,0x00,0x00,  /* 00000000    "PCCT...." */
+    0x01,0xE3,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
+    0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45,  /* 00000010    "TEMPLATE" */
     0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
-    0x27,0x06,0x14,0x20,0x01,0x00,0x00,0x00,  /* 00000020    "'.. ...." */
+    0x18,0x03,0x16,0x20,0x01,0x00,0x00,0x00,  /* 00000020    "... ...." */
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000028    "........" */
     0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000030    ".>......" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000038    "........" */
-    0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000040    "........" */
-    0x01,0x32,0x00,0x03,0x00,0x00,0x00,0x00,  /* 00000048    ".2......" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000050    "........" */
-    0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,  /* 00000058    "........" */
-    0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x00,0x00,  /* 00000060    "........" */
-    0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x3E,  /* 00000068    ".......>" */
-    0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000070    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,  /* 00000078    "........" */
+    0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,  /* 00000038    "........" */
+    0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,  /* 00000040    """""""""" */
+    0x01,0x32,0x00,0x03,0x33,0x33,0x33,0x33,  /* 00000048    ".2..3333" */
+    0x33,0x33,0x33,0x33,0x44,0x44,0x44,0x44,  /* 00000050    "3333DDDD" */
+    0x44,0x44,0x44,0x44,0x55,0x55,0x55,0x55,  /* 00000058    "DDDDUUUU" */
+    0x55,0x55,0x55,0x55,0x66,0x66,0x66,0x66,  /* 00000060    "UUUUffff" */
+    0x77,0x77,0x77,0x77,0x88,0x88,0x01,0x3E,  /* 00000068    "wwww...>" */
+    0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000070    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000078    "........" */
     0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x32,  /* 00000080    ".......2" */
-    0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000088    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000090    "........" */
-    0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,  /* 00000098    "........" */
-    0xFF,0xFF,0x01,0x00,0x00,0x00,0x01,0x00,  /* 000000A0    "........" */
-    0x00,0x00,0x01,0x00                       /* 000000A8    "...."     */
+    0x00,0x03,0x44,0x44,0x44,0x44,0x44,0x44,  /* 00000088    "..DDDDDD" */
+    0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,  /* 00000090    "DDDDDDDD" */
+    0x44,0x44,0x55,0x55,0x55,0x55,0x55,0x55,  /* 00000098    "DDUUUUUU" */
+    0x55,0x55,0x66,0x66,0x66,0x66,0x77,0x77,  /* 000000A0    "UUffffww" */
+    0x77,0x77,0x88,0x88,0x02,0x5A,0x01,0x00,  /* 000000A8    "ww...Z.." */
+    0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,  /* 000000B0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000B8    "........" */
+    0x00,0x00,0x00,0x00,0x01,0x32,0x00,0x03,  /* 000000C0    ".....2.." */
+    0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,  /* 000000C8    "DDDDDDDD" */
+    0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,  /* 000000D0    "DDDDDDDD" */
+    0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,  /* 000000D8    "UUUUUUUU" */
+    0x66,0x66,0x66,0x66,0x77,0x77,0x77,0x77,  /* 000000E0    "ffffwwww" */
+    0x88,0x88,0x01,0x32,0x00,0x03,0x33,0x33,  /* 000000E8    "...2..33" */
+    0x33,0x33,0x33,0x33,0x33,0x33,0x44,0x44,  /* 000000F0    "333333DD" */
+    0x44,0x44,0x44,0x44,0x44,0x44,0x55,0x55,  /* 000000F8    "DDDDDDUU" */
+    0x55,0x55,0x55,0x55,0x55,0x55             /* 00000100    "UUUUUU"   */
 };
 
 const unsigned char TemplatePmtt[] =
--- a/sys/external/bsd/acpica/dist/compiler/prscan.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/prscan.c	Wed May 04 18:15:53 2016 +0000
@@ -334,8 +334,7 @@
         Gbl_CurrentLineNumber++;
         Gbl_LogicalLineNumber++;
 
-        if ((Status == ASL_WITHIN_COMMENT) ||
-            (Status == ASL_BLANK_LINE))
+        if (Status == ASL_IGNORE_LINE)
         {
             goto WriteEntireLine;
         }
@@ -870,7 +869,8 @@
  *
  * RETURN:      Status of the GetLine operation:
  *              AE_OK               - Normal line, OK status
- *              ASL_WITHIN_COMMENT  - Line is part of a multi-line comment
+ *              ASL_IGNORE_LINE     - Line is blank or part of a multi-line
+ *                                      comment
  *              ASL_EOF             - End-of-file reached
  *
  * DESCRIPTION: Get the next text line from the input file. Does not strip
@@ -919,6 +919,17 @@
         c = getc (Handle);
         if (c == EOF)
         {
+            /*
+             * On EOF: If there is anything in the line buffer, terminate
+             * it with a newline, and catch the EOF on the next call
+             * to this function.
+             */
+            if (i > 0)
+            {
+                Gbl_CurrentLineBuffer[i] = '\n';
+                return (AE_OK);
+            }
+
             return (ASL_EOF);
         }
 
@@ -986,7 +997,7 @@
 
             if (AcpiGbl_LineScanState == PR_MULTI_LINE_COMMENT)
             {
-                return (ASL_WITHIN_COMMENT);
+                return (ASL_IGNORE_LINE);
             }
 
             /* End of single-line comment */
@@ -1001,7 +1012,7 @@
 
             if (i == 1)
             {
-                return (ASL_BLANK_LINE);
+                return (ASL_IGNORE_LINE);
             }
 
             return (AE_OK);
--- a/sys/external/bsd/acpica/dist/debugger/dbconvert.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbconvert.c	Wed May 04 18:15:53 2016 +0000
@@ -321,7 +321,8 @@
     default:
 
         Object->Type = ACPI_TYPE_INTEGER;
-        Status = AcpiUtStrtoul64 (String, 16, &Object->Integer.Value);
+        Status = AcpiUtStrtoul64 (String, 16, AcpiGbl_IntegerByteWidth,
+            &Object->Integer.Value);
         break;
     }
 
@@ -465,7 +466,7 @@
     NewBuffer = AcpiDbEncodePldBuffer (PldInfo);
     if (!NewBuffer)
     {
-        return;
+        goto Exit;
     }
 
     /* The two bit-packed buffers should match */
@@ -524,6 +525,7 @@
         AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_HorizontalOffset", PldInfo->HorizontalOffset);
     }
 
+    ACPI_FREE (NewBuffer);
+Exit:
     ACPI_FREE (PldInfo);
-    ACPI_FREE (NewBuffer);
 }
--- a/sys/external/bsd/acpica/dist/disassembler/dmopcode.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/disassembler/dmopcode.c	Wed May 04 18:15:53 2016 +0000
@@ -249,11 +249,11 @@
 
     /* Ensure that the comment field is emitted only once */
 
-    if (Op->Common.DisasmFlags & ACPI_PARSEOP_PREDEF_CHECKED)
+    if (Op->Common.DisasmFlags & ACPI_PARSEOP_PREDEFINED_CHECKED)
     {
         return;
     }
-    Op->Common.DisasmFlags |= ACPI_PARSEOP_PREDEF_CHECKED;
+    Op->Common.DisasmFlags |= ACPI_PARSEOP_PREDEFINED_CHECKED;
 
     /* Predefined name must start with an underscore */
 
@@ -385,11 +385,11 @@
 
     /* Ensure that the comment field is emitted only once */
 
-    if (Op->Common.DisasmFlags & ACPI_PARSEOP_PREDEF_CHECKED)
+    if (Op->Common.DisasmFlags & ACPI_PARSEOP_PREDEFINED_CHECKED)
     {
         return;
     }
-    Op->Common.DisasmFlags |= ACPI_PARSEOP_PREDEF_CHECKED;
+    Op->Common.DisasmFlags |= ACPI_PARSEOP_PREDEFINED_CHECKED;
 
     /*
      * Op must be one of the Create* operators: CreateField, CreateBitField,
@@ -646,8 +646,8 @@
     }
     else
     {
-        AcpiOsPrintf ("%s", ACPI_CAST_PTR (char,
-            AcpiGbl_MatchOps[(ACPI_SIZE) Op->Common.Value.Integer]));
+        AcpiOsPrintf ("%s",
+            AcpiGbl_MatchOps[(ACPI_SIZE) Op->Common.Value.Integer]);
     }
 }
 
@@ -969,6 +969,10 @@
         AcpiDmConvertToElseIf (Op);
         break;
 
+    case AML_EXTERNAL_OP:
+
+        break;
+
     default:
 
         /* Just get the opcode name and print it */
@@ -1047,10 +1051,16 @@
     ACPI_PARSE_OBJECT       *ElseOp;
 
 
-    /* Examine the first child of the Else */
-
+    /*
+     * To be able to perform the conversion, two conditions must be satisfied:
+     * 1) The first child of the Else must be an If statement.
+     * 2) The If block can only be followed by an Else block and these must
+     *    be the only blocks under the original Else.
+     */
     IfOp = OriginalElseOp->Common.Value.Arg;
-    if (!IfOp || (IfOp->Common.AmlOpcode != AML_IF_OP))
+    if (!IfOp ||
+        (IfOp->Common.AmlOpcode != AML_IF_OP) ||
+        (IfOp->Asl.Next && (IfOp->Asl.Next->Common.AmlOpcode != AML_ELSE_OP)))
     {
         /* Not an Else..If sequence, cannot convert to ElseIf */
 
--- a/sys/external/bsd/acpica/dist/disassembler/dmutils.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/disassembler/dmutils.c	Wed May 04 18:15:53 2016 +0000
@@ -227,7 +227,7 @@
         return;
     }
 
-    AcpiOsPrintf ("%*.s", ACPI_MUL_4 (Level), " ");
+    AcpiOsPrintf ("%*.s", (Level * 4), " ");
 }
 
 
@@ -279,8 +279,8 @@
             }
         }
 
-        if ((Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST) &&
-            (!(Op->Common.Next->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)))
+        if ((Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) &&
+            (!(Op->Common.Next->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST)))
         {
             return (FALSE);
         }
@@ -295,8 +295,8 @@
         return (TRUE);
     }
 
-    else if ((Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST) &&
-             (Op->Common.Next->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST))
+    else if ((Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) &&
+             (Op->Common.Next->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST))
     {
         AcpiOsPrintf (", ");
         return (TRUE);
--- a/sys/external/bsd/acpica/dist/dispatcher/dsmethod.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/dispatcher/dsmethod.c	Wed May 04 18:15:53 2016 +0000
@@ -460,6 +460,9 @@
             {
                 ObjDesc->Method.Mutex->Mutex.OriginalSyncLevel =
                     ObjDesc->Method.Mutex->Mutex.SyncLevel;
+
+                ObjDesc->Method.Mutex->Mutex.ThreadId =
+                    AcpiOsGetThreadId ();
             }
         }
 
@@ -867,7 +870,7 @@
         {
             if (WalkState)
             {
-                ACPI_INFO ((AE_INFO,
+                ACPI_INFO ((
                     "Marking method %4.4s as Serialized "
                     "because of AE_ALREADY_EXISTS error",
                     WalkState->MethodNode->Name.Ascii));
--- a/sys/external/bsd/acpica/dist/dispatcher/dsobject.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/dispatcher/dsobject.c	Wed May 04 18:15:53 2016 +0000
@@ -538,7 +538,7 @@
             Arg = Arg->Common.Next;
         }
 
-        ACPI_INFO ((AE_INFO,
+        ACPI_INFO ((
             "Actual Package length (%u) is larger than "
             "NumElements field (%u), truncated",
             i, ElementCount));
--- a/sys/external/bsd/acpica/dist/events/evgpeblk.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/events/evgpeblk.c	Wed May 04 18:15:53 2016 +0000
@@ -542,7 +542,7 @@
 
     if (GpeEnabledCount)
     {
-        ACPI_INFO ((AE_INFO,
+        ACPI_INFO ((
             "Enabled %u GPEs in block %02X to %02X", GpeEnabledCount,
             (UINT32) GpeBlock->BlockBaseNumber,
             (UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1))));
--- a/sys/external/bsd/acpica/dist/events/evgpeinit.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/events/evgpeinit.c	Wed May 04 18:15:53 2016 +0000
@@ -292,7 +292,7 @@
 
     if (WalkInfo.Count)
     {
-        ACPI_INFO ((AE_INFO, "Enabled %u new GPEs", WalkInfo.Count));
+        ACPI_INFO (("Enabled %u new GPEs", WalkInfo.Count));
     }
 
     (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exconcat.c	Wed May 04 18:15:53 2016 +0000
@@ -0,0 +1,460 @@
+/******************************************************************************
+ *
+ * Module Name: exconcat - Concatenate-type AML operators
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2016, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ *    of any contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include "acpi.h"
+#include "accommon.h"
+#include "acinterp.h"
+#include "amlresrc.h"
+
+
+#define _COMPONENT          ACPI_EXECUTER
+        ACPI_MODULE_NAME    ("exconcat")
+
+/* Local Prototypes */
+
+static ACPI_STATUS
+AcpiExConvertToObjectTypeString (
+    ACPI_OPERAND_OBJECT     *ObjDesc,
+    ACPI_OPERAND_OBJECT     **ResultDesc);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiExDoConcatenate
+ *
+ * PARAMETERS:  Operand0            - First source object
+ *              Operand1            - Second source object
+ *              ActualReturnDesc    - Where to place the return object
+ *              WalkState           - Current walk state
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Concatenate two objects with the ACPI-defined conversion
+ *              rules as necessary.
+ * NOTE:
+ * Per the ACPI spec (up to 6.1), Concatenate only supports Integer,
+ * String, and Buffer objects. However, we support all objects here
+ * as an extension. This improves the usefulness of both Concatenate
+ * and the Printf/Fprintf macros. The extension returns a string
+ * describing the object type for the other objects.
+ * 02/2016.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiExDoConcatenate (
+    ACPI_OPERAND_OBJECT     *Operand0,
+    ACPI_OPERAND_OBJECT     *Operand1,
+    ACPI_OPERAND_OBJECT     **ActualReturnDesc,
+    ACPI_WALK_STATE         *WalkState)
+{
+    ACPI_OPERAND_OBJECT     *LocalOperand0 = Operand0;
+    ACPI_OPERAND_OBJECT     *LocalOperand1 = Operand1;
+    ACPI_OPERAND_OBJECT     *TempOperand1 = NULL;
+    ACPI_OPERAND_OBJECT     *ReturnDesc;
+    char                    *Buffer;
+    ACPI_OBJECT_TYPE        Operand0Type;
+    ACPI_OBJECT_TYPE        Operand1Type;
+    ACPI_STATUS             Status;
+
+
+    ACPI_FUNCTION_TRACE (ExDoConcatenate);
+
+
+    /* Operand 0 preprocessing */
+
+    switch (Operand0->Common.Type)
+    {
+    case ACPI_TYPE_INTEGER:
+    case ACPI_TYPE_STRING:
+    case ACPI_TYPE_BUFFER:
+
+        Operand0Type = Operand0->Common.Type;
+        break;
+
+    default:
+
+        /* For all other types, get the "object type" string */
+
+        Status = AcpiExConvertToObjectTypeString (
+            Operand0, &LocalOperand0);
+        if (ACPI_FAILURE (Status))
+        {
+            goto Cleanup;
+        }
+
+        Operand0Type = ACPI_TYPE_STRING;
+        break;
+    }
+
+    /* Operand 1 preprocessing */
+
+    switch (Operand1->Common.Type)
+    {
+    case ACPI_TYPE_INTEGER:
+    case ACPI_TYPE_STRING:
+    case ACPI_TYPE_BUFFER:
+
+        Operand1Type = Operand1->Common.Type;
+        break;
+
+    default:
+
+        /* For all other types, get the "object type" string */
+
+        Status = AcpiExConvertToObjectTypeString (
+            Operand1, &LocalOperand1);
+        if (ACPI_FAILURE (Status))
+        {
+            goto Cleanup;
+        }
+
+        Operand1Type = ACPI_TYPE_STRING;
+        break;
+    }
+
+    /*
+     * Convert the second operand if necessary. The first operand (0)
+     * determines the type of the second operand (1) (See the Data Types
+     * section of the ACPI specification). Both object types are
+     * guaranteed to be either Integer/String/Buffer by the operand
+     * resolution mechanism.
+     */
+    switch (Operand0Type)
+    {
+    case ACPI_TYPE_INTEGER:
+
+        Status = AcpiExConvertToInteger (LocalOperand1, &TempOperand1, 16);
+        break;
+
+    case ACPI_TYPE_BUFFER:
+
+        Status = AcpiExConvertToBuffer (LocalOperand1, &TempOperand1);
+        break;
+
+    case ACPI_TYPE_STRING:
+
+        switch (Operand1Type)
+        {
+        case ACPI_TYPE_INTEGER:
+        case ACPI_TYPE_STRING:
+        case ACPI_TYPE_BUFFER:
+
+            /* Other types have already been converted to string */
+
+            Status = AcpiExConvertToString (
+                LocalOperand1, &TempOperand1, ACPI_IMPLICIT_CONVERT_HEX);
+            break;
+
+        default:
+
+            Status = AE_OK;
+            break;
+        }
+        break;
+
+    default:
+
+        ACPI_ERROR ((AE_INFO, "Invalid object type: 0x%X",
+            Operand0->Common.Type));
+        Status = AE_AML_INTERNAL;
+    }
+
+    if (ACPI_FAILURE (Status))
+    {
+        goto Cleanup;
+    }
+
+    /* Take care with any newly created operand objects */
+
+    if ((LocalOperand1 != Operand1) &&
+        (LocalOperand1 != TempOperand1))
+    {
+        AcpiUtRemoveReference (LocalOperand1);
+    }
+
+    LocalOperand1 = TempOperand1;
+
+    /*
+     * Both operands are now known to be the same object type
+     * (Both are Integer, String, or Buffer), and we can now perform
+     * the concatenation.
+     *
+     * There are three cases to handle, as per the ACPI spec:
+     *
+     * 1) Two Integers concatenated to produce a new Buffer
+     * 2) Two Strings concatenated to produce a new String
+     * 3) Two Buffers concatenated to produce a new Buffer
+     */
+    switch (Operand0Type)
+    {
+    case ACPI_TYPE_INTEGER:
+
+        /* Result of two Integers is a Buffer */
+        /* Need enough buffer space for two integers */
+
+        ReturnDesc = AcpiUtCreateBufferObject (
+            (ACPI_SIZE) ACPI_MUL_2 (AcpiGbl_IntegerByteWidth));
+        if (!ReturnDesc)
+        {
+            Status = AE_NO_MEMORY;
+            goto Cleanup;
+        }
+
+        Buffer = (char *) ReturnDesc->Buffer.Pointer;
+
+        /* Copy the first integer, LSB first */
+
+        memcpy (Buffer, &Operand0->Integer.Value,
+            AcpiGbl_IntegerByteWidth);
+
+        /* Copy the second integer (LSB first) after the first */
+
+        memcpy (Buffer + AcpiGbl_IntegerByteWidth,
+            &LocalOperand1->Integer.Value, AcpiGbl_IntegerByteWidth);
+        break;
+
+    case ACPI_TYPE_STRING:
+
+        /* Result of two Strings is a String */
+
+        ReturnDesc = AcpiUtCreateStringObject (
+            ((ACPI_SIZE) LocalOperand0->String.Length +
+            LocalOperand1->String.Length));
+        if (!ReturnDesc)
+        {
+            Status = AE_NO_MEMORY;
+            goto Cleanup;
+        }
+
+        Buffer = ReturnDesc->String.Pointer;
+
+        /* Concatenate the strings */
+
+        strcpy (Buffer, LocalOperand0->String.Pointer);
+        strcat (Buffer, LocalOperand1->String.Pointer);
+        break;
+
+    case ACPI_TYPE_BUFFER:
+
+        /* Result of two Buffers is a Buffer */
+
+        ReturnDesc = AcpiUtCreateBufferObject (
+            ((ACPI_SIZE) Operand0->Buffer.Length +
+            LocalOperand1->Buffer.Length));
+        if (!ReturnDesc)
+        {
+            Status = AE_NO_MEMORY;
+            goto Cleanup;
+        }
+
+        Buffer = (char *) ReturnDesc->Buffer.Pointer;
+
+        /* Concatenate the buffers */
+
+        memcpy (Buffer, Operand0->Buffer.Pointer,
+            Operand0->Buffer.Length);
+        memcpy (Buffer + Operand0->Buffer.Length,
+            LocalOperand1->Buffer.Pointer,
+            LocalOperand1->Buffer.Length);
+        break;
+
+    default:
+
+        /* Invalid object type, should not happen here */
+
+        ACPI_ERROR ((AE_INFO, "Invalid object type: 0x%X",
+            Operand0->Common.Type));
+        Status = AE_AML_INTERNAL;
+        goto Cleanup;
+    }
+
+    *ActualReturnDesc = ReturnDesc;
+
+Cleanup:
+    if (LocalOperand0 != Operand0)
+    {
+        AcpiUtRemoveReference (LocalOperand0);
+    }
+
+    if (LocalOperand1 != Operand1)
+    {
+        AcpiUtRemoveReference (LocalOperand1);
+    }
+
+    return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiExConvertToObjectTypeString
+ *
+ * PARAMETERS:  ObjDesc             - Object to be converted
+ *              ReturnDesc          - Where to place the return object
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Convert an object of arbitrary type to a string object that
+ *              contains the namestring for the object. Used for the
+ *              concatenate operator.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiExConvertToObjectTypeString (
+    ACPI_OPERAND_OBJECT     *ObjDesc,
+    ACPI_OPERAND_OBJECT     **ResultDesc)
+{
+    ACPI_OPERAND_OBJECT     *ReturnDesc;
+    const char              *TypeString;
+
+
+    TypeString = AcpiUtGetTypeName (ObjDesc->Common.Type);
+
+    ReturnDesc = AcpiUtCreateStringObject (
+        ((ACPI_SIZE) strlen (TypeString) + 9)); /* 9 For "[ Object]" */
+    if (!ReturnDesc)
+    {
+        return (AE_NO_MEMORY);
+    }
+
+    strcpy (ReturnDesc->String.Pointer, "[");
+    strcat (ReturnDesc->String.Pointer, TypeString);
+    strcat (ReturnDesc->String.Pointer, " Object]");
+
+    *ResultDesc = ReturnDesc;
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiExConcatTemplate
+ *
+ * PARAMETERS:  Operand0            - First source object
+ *              Operand1            - Second source object
+ *              ActualReturnDesc    - Where to place the return object
+ *              WalkState           - Current walk state
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Concatenate two resource templates
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiExConcatTemplate (
+    ACPI_OPERAND_OBJECT     *Operand0,
+    ACPI_OPERAND_OBJECT     *Operand1,
+    ACPI_OPERAND_OBJECT     **ActualReturnDesc,
+    ACPI_WALK_STATE         *WalkState)
+{
+    ACPI_STATUS             Status;
+    ACPI_OPERAND_OBJECT     *ReturnDesc;
+    UINT8                   *NewBuf;
+    UINT8                   *EndTag;
+    ACPI_SIZE               Length0;
+    ACPI_SIZE               Length1;
+    ACPI_SIZE               NewLength;
+
+
+    ACPI_FUNCTION_TRACE (ExConcatTemplate);
+
+
+    /*
+     * Find the EndTag descriptor in each resource template.
+     * Note1: returned pointers point TO the EndTag, not past it.
+     * Note2: zero-length buffers are allowed; treated like one EndTag
+     */
+
+    /* Get the length of the first resource template */
+
+    Status = AcpiUtGetResourceEndTag (Operand0, &EndTag);
+    if (ACPI_FAILURE (Status))
+    {
+        return_ACPI_STATUS (Status);
+    }
+
+    Length0 = ACPI_PTR_DIFF (EndTag, Operand0->Buffer.Pointer);
+
+    /* Get the length of the second resource template */
+
+    Status = AcpiUtGetResourceEndTag (Operand1, &EndTag);
+    if (ACPI_FAILURE (Status))
+    {
+        return_ACPI_STATUS (Status);
+    }
+
+    Length1 = ACPI_PTR_DIFF (EndTag, Operand1->Buffer.Pointer);
+
+    /* Combine both lengths, minimum size will be 2 for EndTag */
+
+    NewLength = Length0 + Length1 + sizeof (AML_RESOURCE_END_TAG);
+
+    /* Create a new buffer object for the result (with one EndTag) */
+
+    ReturnDesc = AcpiUtCreateBufferObject (NewLength);
+    if (!ReturnDesc)
+    {
+        return_ACPI_STATUS (AE_NO_MEMORY);
+    }
+
+    /*
+     * Copy the templates to the new buffer, 0 first, then 1 follows. One
+     * EndTag descriptor is copied from Operand1.
+     */
+    NewBuf = ReturnDesc->Buffer.Pointer;
+    memcpy (NewBuf, Operand0->Buffer.Pointer, Length0);
+    memcpy (NewBuf + Length0, Operand1->Buffer.Pointer, Length1);
+
+    /* Insert EndTag and set the checksum to zero, means "ignore checksum" */
+
+    NewBuf[NewLength - 1] = 0;
+    NewBuf[NewLength - 2] = ACPI_RESOURCE_NAME_END_TAG | 1;
+
+    /* Return the completed resource template */
+
+    *ActualReturnDesc = ReturnDesc;
+    return_ACPI_STATUS (AE_OK);
+}
--- a/sys/external/bsd/acpica/dist/executer/exconvrt.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exconvrt.c	Wed May 04 18:15:53 2016 +0000
@@ -137,7 +137,8 @@
          * of ACPI 3.0) is that the ToInteger() operator allows both decimal
          * and hexadecimal strings (hex prefixed with "0x").
          */
-        Status = AcpiUtStrtoul64 ((char *) Pointer, Flags, &Result);
+        Status = AcpiUtStrtoul64 ((char *) Pointer, Flags,
+            AcpiGbl_IntegerByteWidth, &Result);
         if (ACPI_FAILURE (Status))
         {
             return_ACPI_STATUS (Status);
--- a/sys/external/bsd/acpica/dist/executer/exfldio.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exfldio.c	Wed May 04 18:15:53 2016 +0000
@@ -946,20 +946,9 @@
 
     AccessBitWidth = ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth);
 
-    /*
-     * Create the bitmasks used for bit insertion.
-     * Note: This if/else is used to bypass compiler differences with the
-     * shift operator
-     */
-    if (AccessBitWidth == ACPI_INTEGER_BIT_SIZE)
-    {
-        WidthMask = ACPI_UINT64_MAX;
-    }
-    else
-    {
-        WidthMask = ACPI_MASK_BITS_ABOVE (AccessBitWidth);
-    }
+    /* Create the bitmasks used for bit insertion */
 
+    WidthMask = ACPI_MASK_BITS_ABOVE_64 (AccessBitWidth);
     Mask = WidthMask &
         ACPI_MASK_BITS_BELOW (ObjDesc->CommonField.StartFieldBitOffset);
 
--- a/sys/external/bsd/acpica/dist/executer/exmisc.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exmisc.c	Wed May 04 18:15:53 2016 +0000
@@ -45,7 +45,6 @@
 #include "accommon.h"
 #include "acinterp.h"
 #include "amlcode.h"
-#include "amlresrc.h"
 
 
 #define _COMPONENT          ACPI_EXECUTER
@@ -150,307 +149,6 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    AcpiExConcatTemplate
- *
- * PARAMETERS:  Operand0            - First source object
- *              Operand1            - Second source object
- *              ActualReturnDesc    - Where to place the return object
- *              WalkState           - Current walk state
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Concatenate two resource templates
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiExConcatTemplate (
-    ACPI_OPERAND_OBJECT     *Operand0,
-    ACPI_OPERAND_OBJECT     *Operand1,
-    ACPI_OPERAND_OBJECT     **ActualReturnDesc,
-    ACPI_WALK_STATE         *WalkState)
-{
-    ACPI_STATUS             Status;
-    ACPI_OPERAND_OBJECT     *ReturnDesc;
-    UINT8                   *NewBuf;
-    UINT8                   *EndTag;
-    ACPI_SIZE               Length0;
-    ACPI_SIZE               Length1;
-    ACPI_SIZE               NewLength;
-
-
-    ACPI_FUNCTION_TRACE (ExConcatTemplate);
-
-
-    /*
-     * Find the EndTag descriptor in each resource template.
-     * Note1: returned pointers point TO the EndTag, not past it.
-     * Note2: zero-length buffers are allowed; treated like one EndTag
-     */
-
-    /* Get the length of the first resource template */
-
-    Status = AcpiUtGetResourceEndTag (Operand0, &EndTag);
-    if (ACPI_FAILURE (Status))
-    {
-        return_ACPI_STATUS (Status);
-    }
-
-    Length0 = ACPI_PTR_DIFF (EndTag, Operand0->Buffer.Pointer);
-
-    /* Get the length of the second resource template */
-
-    Status = AcpiUtGetResourceEndTag (Operand1, &EndTag);
-    if (ACPI_FAILURE (Status))
-    {
-        return_ACPI_STATUS (Status);
-    }
-
-    Length1 = ACPI_PTR_DIFF (EndTag, Operand1->Buffer.Pointer);
-
-    /* Combine both lengths, minimum size will be 2 for EndTag */
-
-    NewLength = Length0 + Length1 + sizeof (AML_RESOURCE_END_TAG);
-
-    /* Create a new buffer object for the result (with one EndTag) */
-
-    ReturnDesc = AcpiUtCreateBufferObject (NewLength);
-    if (!ReturnDesc)
-    {
-        return_ACPI_STATUS (AE_NO_MEMORY);
-    }
-
-    /*
-     * Copy the templates to the new buffer, 0 first, then 1 follows. One
-     * EndTag descriptor is copied from Operand1.
-     */
-    NewBuf = ReturnDesc->Buffer.Pointer;
-    memcpy (NewBuf, Operand0->Buffer.Pointer, Length0);
-    memcpy (NewBuf + Length0, Operand1->Buffer.Pointer, Length1);
-
-    /* Insert EndTag and set the checksum to zero, means "ignore checksum" */
-
-    NewBuf[NewLength - 1] = 0;
-    NewBuf[NewLength - 2] = ACPI_RESOURCE_NAME_END_TAG | 1;
-
-    /* Return the completed resource template */
-
-    *ActualReturnDesc = ReturnDesc;
-    return_ACPI_STATUS (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiExDoConcatenate
- *
- * PARAMETERS:  Operand0            - First source object
- *              Operand1            - Second source object
- *              ActualReturnDesc    - Where to place the return object
- *              WalkState           - Current walk state
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Concatenate two objects OF THE SAME TYPE.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiExDoConcatenate (
-    ACPI_OPERAND_OBJECT     *Operand0,
-    ACPI_OPERAND_OBJECT     *Operand1,
-    ACPI_OPERAND_OBJECT     **ActualReturnDesc,
-    ACPI_WALK_STATE         *WalkState)
-{
-    ACPI_OPERAND_OBJECT     *LocalOperand1 = Operand1;
-    ACPI_OPERAND_OBJECT     *ReturnDesc;
-    char                    *NewBuf;
-    const char              *TypeString;
-    ACPI_STATUS             Status;
-
-
-    ACPI_FUNCTION_TRACE (ExDoConcatenate);
-
-
-    /*
-     * Convert the second operand if necessary. The first operand
-     * determines the type of the second operand, (See the Data Types
-     * section of the ACPI specification.)  Both object types are
-     * guaranteed to be either Integer/String/Buffer by the operand
-     * resolution mechanism.
-     */
-    switch (Operand0->Common.Type)
-    {
-    case ACPI_TYPE_INTEGER:
-
-        Status = AcpiExConvertToInteger (Operand1, &LocalOperand1, 16);
-        break;
-
-    case ACPI_TYPE_STRING:
-        /*
-         * Per the ACPI spec, Concatenate only supports int/str/buf.
-         * However, we support all objects here as an extension.
-         * This improves the usefulness of the Printf() macro.
-         * 12/2015.
-         */
-        switch (Operand1->Common.Type)
-        {
-        case ACPI_TYPE_INTEGER:
-        case ACPI_TYPE_STRING:
-        case ACPI_TYPE_BUFFER:
-
-            Status = AcpiExConvertToString (
-                Operand1, &LocalOperand1, ACPI_IMPLICIT_CONVERT_HEX);
-            break;
-
-        default:
-            /*
-             * Just emit a string containing the object type.
-             */
-            TypeString = AcpiUtGetTypeName (Operand1->Common.Type);
-
-            LocalOperand1 = AcpiUtCreateStringObject (
-                ((ACPI_SIZE) strlen (TypeString) + 9)); /* 9 For "[Object]" */
-            if (!LocalOperand1)
-            {
-                Status = AE_NO_MEMORY;
-                goto Cleanup;
-            }
-
-            strcpy (LocalOperand1->String.Pointer, "[");
-            strcat (LocalOperand1->String.Pointer, TypeString);
-            strcat (LocalOperand1->String.Pointer, " Object]");
-            Status = AE_OK;
-            break;
-        }
-        break;
-
-    case ACPI_TYPE_BUFFER:
-
-        Status = AcpiExConvertToBuffer (Operand1, &LocalOperand1);
-        break;
-
-    default:
-
-        ACPI_ERROR ((AE_INFO, "Invalid object type: 0x%X",
-            Operand0->Common.Type));
-        Status = AE_AML_INTERNAL;
-    }
-
-    if (ACPI_FAILURE (Status))
-    {
-        goto Cleanup;
-    }
-
-    /*
-     * Both operands are now known to be the same object type
-     * (Both are Integer, String, or Buffer), and we can now perform the
-     * concatenation.
-     */
-
-    /*
-     * There are three cases to handle:
-     *
-     * 1) Two Integers concatenated to produce a new Buffer
-     * 2) Two Strings concatenated to produce a new String
-     * 3) Two Buffers concatenated to produce a new Buffer
-     */
-    switch (Operand0->Common.Type)
-    {
-    case ACPI_TYPE_INTEGER:
-
-        /* Result of two Integers is a Buffer */
-        /* Need enough buffer space for two integers */
-
-        ReturnDesc = AcpiUtCreateBufferObject (
-            (ACPI_SIZE) ACPI_MUL_2 (AcpiGbl_IntegerByteWidth));
-        if (!ReturnDesc)
-        {
-            Status = AE_NO_MEMORY;
-            goto Cleanup;
-        }
-
-        NewBuf = (char *) ReturnDesc->Buffer.Pointer;
-
-        /* Copy the first integer, LSB first */
-
-        memcpy (NewBuf, &Operand0->Integer.Value,
-            AcpiGbl_IntegerByteWidth);
-
-        /* Copy the second integer (LSB first) after the first */
-
-        memcpy (NewBuf + AcpiGbl_IntegerByteWidth,
-            &LocalOperand1->Integer.Value, AcpiGbl_IntegerByteWidth);
-        break;
-
-    case ACPI_TYPE_STRING:
-
-        /* Result of two Strings is a String */
-
-        ReturnDesc = AcpiUtCreateStringObject (
-            ((ACPI_SIZE) Operand0->String.Length +
-            LocalOperand1->String.Length));
-        if (!ReturnDesc)
-        {
-            Status = AE_NO_MEMORY;
-            goto Cleanup;
-        }
-
-        NewBuf = ReturnDesc->String.Pointer;
-
-        /* Concatenate the strings */
-
-        strcpy (NewBuf, Operand0->String.Pointer);
-        strcat (NewBuf, LocalOperand1->String.Pointer);
-        break;
-
-    case ACPI_TYPE_BUFFER:
-
-        /* Result of two Buffers is a Buffer */
-
-        ReturnDesc = AcpiUtCreateBufferObject (
-            ((ACPI_SIZE) Operand0->Buffer.Length +
-            LocalOperand1->Buffer.Length));
-        if (!ReturnDesc)
-        {
-            Status = AE_NO_MEMORY;
-            goto Cleanup;
-        }
-
-        NewBuf = (char *) ReturnDesc->Buffer.Pointer;
-
-        /* Concatenate the buffers */
-
-        memcpy (NewBuf, Operand0->Buffer.Pointer,
-            Operand0->Buffer.Length);
-        memcpy (NewBuf + Operand0->Buffer.Length,
-            LocalOperand1->Buffer.Pointer,
-            LocalOperand1->Buffer.Length);
-        break;
-
-    default:
-
-        /* Invalid object type, should not happen here */
-
-        ACPI_ERROR ((AE_INFO, "Invalid object type: 0x%X",
-            Operand0->Common.Type));
-        Status =AE_AML_INTERNAL;
-        goto Cleanup;
-    }
-
-    *ActualReturnDesc = ReturnDesc;
-
-Cleanup:
-    if (LocalOperand1 != Operand1)
-    {
-        AcpiUtRemoveReference (LocalOperand1);
-    }
-    return_ACPI_STATUS (Status);
-}
-
-
-/*******************************************************************************
- *
  * FUNCTION:    AcpiExDoMathOp
  *
  * PARAMETERS:  Opcode              - AML opcode
--- a/sys/external/bsd/acpica/dist/executer/exnames.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exnames.c	Wed May 04 18:15:53 2016 +0000
@@ -204,7 +204,7 @@
     ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Bytes from stream:\n"));
 
     for (Index = 0;
-        (Index < ACPI_NAME_SIZE) && (AcpiUtValidAcpiChar (*AmlAddress, 0));
+        (Index < ACPI_NAME_SIZE) && (AcpiUtValidNameChar (*AmlAddress, 0));
         Index++)
     {
         CharBuf[Index] = *AmlAddress++;
--- a/sys/external/bsd/acpica/dist/executer/exoparg3.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exoparg3.c	Wed May 04 18:15:53 2016 +0000
@@ -134,8 +134,10 @@
          * op is intended for use by disassemblers in order to properly
          * disassemble control method invocations. The opcode or group of
          * opcodes should be surrounded by an "if (0)" clause to ensure that
-         * AML interpreters never see the opcode.
+         * AML interpreters never see the opcode. Thus, something is
+         * wrong if an external opcode ever gets here.
          */
+        ACPI_ERROR ((AE_INFO, "Executed External Op"));
         Status = AE_OK;
         goto Cleanup;
 
--- a/sys/external/bsd/acpica/dist/executer/exsystem.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exsystem.c	Wed May 04 18:15:53 2016 +0000
@@ -94,7 +94,7 @@
 
         /* Reacquire the interpreter */
 
-       AcpiExEnterInterpreter ();
+        AcpiExEnterInterpreter ();
     }
 
     return_ACPI_STATUS (Status);
--- a/sys/external/bsd/acpica/dist/executer/exutils.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exutils.c	Wed May 04 18:15:53 2016 +0000
@@ -341,8 +341,8 @@
  *
  * FUNCTION:    AcpiExEisaIdToString
  *
- * PARAMETERS:  CompressedId    - EISAID to be converted
- *              OutString       - Where to put the converted string (8 bytes)
+ * PARAMETERS:  OutString       - Where to put the converted string (8 bytes)
+ *              CompressedId    - EISAID to be converted
  *
  * RETURN:      None
  *
@@ -400,7 +400,7 @@
  *                                possible 64-bit integer.
  *              Value           - Value to be converted
  *
- * RETURN:      None, string
+ * RETURN:      Converted string in OutString
  *
  * DESCRIPTION: Convert a 64-bit integer to decimal string representation.
  *              Assumes string buffer is large enough to hold the string. The
@@ -437,9 +437,9 @@
  * FUNCTION:    AcpiExPciClsToString
  *
  * PARAMETERS:  OutString       - Where to put the converted string (7 bytes)
- * PARAMETERS:  ClassCode       - PCI class code to be converted (3 bytes)
+ *              ClassCode       - PCI class code to be converted (3 bytes)
  *
- * RETURN:      None
+ * RETURN:      Converted string in OutString
  *
  * DESCRIPTION: Convert 3-bytes PCI class code to string representation.
  *              Return buffer must be large enough to hold the string. The
@@ -475,7 +475,7 @@
  *
  * PARAMETERS:  SpaceId             - ID to be validated
  *
- * RETURN:      TRUE if valid/supported ID.
+ * RETURN:      TRUE if SpaceId is a valid/supported ID.
  *
  * DESCRIPTION: Validate an operation region SpaceID.
  *
--- a/sys/external/bsd/acpica/dist/generate/unix/Makefile.common	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/Makefile.common	Wed May 04 18:15:53 2016 +0000
@@ -9,8 +9,12 @@
 ifeq ($(HOST), _FreeBSD)
 HARDWARE_NAME := $(shell uname -p)
 else
+ifeq ($(HOST), _QNX)
+HARDWARE_NAME := x86pc
+else
 HARDWARE_NAME := $(shell uname -m)
 endif
+endif
 
 #
 # Main rule will only generate versions that are appropriate for the running
--- a/sys/external/bsd/acpica/dist/generate/unix/Makefile.config	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/Makefile.config	Wed May 04 18:15:53 2016 +0000
@@ -67,6 +67,10 @@
 HOST =       _NetBSD
 endif
 
+ifeq ($(UNAME_S), QNX)
+HOST =       _QNX
+endif
+
 ifeq ($(HOST), _APPLE)
 INSTALL  =   cp
 INSTALLFLAGS ?= -f
@@ -163,6 +167,14 @@
     -D$(HOST)\
     -D_GNU_SOURCE\
     -I$(ACPICA_INCLUDE)
+    
+#
+# QNX requires __EXT to enable most functions in its C library, analogous
+# to _GNU_SOURCE.
+#
+ifeq ($(HOST), _QNX)
+    CFLAGS+=-D__EXT
+endif  
 
 #
 # Common compiler warning flags. The warning flags in addition
--- a/sys/external/bsd/acpica/dist/generate/unix/acpibin/Makefile	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/acpibin/Makefile	Wed May 04 18:15:53 2016 +0000
@@ -32,6 +32,7 @@
 	$(OBJDIR)/cmfsize.o\
 	$(OBJDIR)/getopt.o\
 	$(OBJDIR)/utalloc.o\
+	$(OBJDIR)/utascii.o\
 	$(OBJDIR)/utbuffer.o\
 	$(OBJDIR)/utcache.o\
 	$(OBJDIR)/utdebug.o\
--- a/sys/external/bsd/acpica/dist/generate/unix/acpidump/Makefile	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/acpidump/Makefile	Wed May 04 18:15:53 2016 +0000
@@ -39,6 +39,7 @@
 	$(OBJDIR)/osunixxf.o\
 	$(OBJDIR)/tbprint.o\
 	$(OBJDIR)/tbxfroot.o\
+	$(OBJDIR)/utascii.o\
 	$(OBJDIR)/utbuffer.o\
 	$(OBJDIR)/utdebug.o\
 	$(OBJDIR)/utexcep.o\
@@ -64,6 +65,10 @@
 HOST_FAMILY = BSD
 endif
 
+ifeq ($(HOST), _QNX)
+HOST_FAMILY = BSD
+endif
+
 ifeq ($(HOST_FAMILY), BSD)
 OBJECTS += \
 	$(OBJDIR)/osbsdtbl.o
--- a/sys/external/bsd/acpica/dist/generate/unix/acpiexamples/Makefile	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/acpiexamples/Makefile	Wed May 04 18:15:53 2016 +0000
@@ -59,6 +59,7 @@
 	$(OBJDIR)/evrgnini.o\
 	$(OBJDIR)/evxface.o\
 	$(OBJDIR)/evxfregn.o\
+	$(OBJDIR)/exconcat.o\
 	$(OBJDIR)/exconfig.o\
 	$(OBJDIR)/exconvrt.o\
 	$(OBJDIR)/excreate.o\
@@ -130,6 +131,7 @@
 	$(OBJDIR)/tbxfroot.o\
 	$(OBJDIR)/utaddress.o\
 	$(OBJDIR)/utalloc.o\
+	$(OBJDIR)/utascii.o\
 	$(OBJDIR)/utbuffer.o\
 	$(OBJDIR)/utcache.o\
 	$(OBJDIR)/utcopy.o\
--- a/sys/external/bsd/acpica/dist/generate/unix/acpiexec/Makefile	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/acpiexec/Makefile	Wed May 04 18:15:53 2016 +0000
@@ -106,6 +106,7 @@
 	$(OBJDIR)/evxfgpe.o\
 	$(OBJDIR)/evxfregn.o\
 	$(OBJDIR)/exconfig.o\
+	$(OBJDIR)/exconcat.o\
 	$(OBJDIR)/exconvrt.o\
 	$(OBJDIR)/excreate.o\
 	$(OBJDIR)/exdebug.o\
@@ -200,6 +201,7 @@
 	$(OBJDIR)/tbxfroot.o\
 	$(OBJDIR)/utaddress.o\
 	$(OBJDIR)/utalloc.o\
+	$(OBJDIR)/utascii.o\
 	$(OBJDIR)/utbuffer.o\
 	$(OBJDIR)/utcache.o\
 	$(OBJDIR)/utcopy.o\
@@ -245,11 +247,15 @@
     -DACPI_CHECKSUM_ABORT=TRUE
 endif
 
+ifneq ($(HOST),_QNX)
 LDFLAGS += -lpthread
+endif
 
 ifneq ($(HOST),_APPLE)
+ifneq ($(HOST),_QNX)
 LDFLAGS += -lrt
 endif
+endif
 
 #
 # Common Rules
--- a/sys/external/bsd/acpica/dist/generate/unix/acpinames/Makefile	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/acpinames/Makefile	Wed May 04 18:15:53 2016 +0000
@@ -96,6 +96,7 @@
 	$(OBJDIR)/tbxfroot.o\
 	$(OBJDIR)/utaddress.o\
 	$(OBJDIR)/utalloc.o\
+	$(OBJDIR)/utascii.o\
 	$(OBJDIR)/utbuffer.o\
 	$(OBJDIR)/utcache.o\
 	$(OBJDIR)/utdebug.o\
--- a/sys/external/bsd/acpica/dist/generate/unix/acpisrc/Makefile	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/acpisrc/Makefile	Wed May 04 18:15:53 2016 +0000
@@ -39,6 +39,7 @@
     $(OBJDIR)/oslibcfs.o\
     $(OBJDIR)/osunixdir.o\
     $(OBJDIR)/osunixxf.o\
+	$(OBJDIR)/utascii.o\
     $(OBJDIR)/utdebug.o\
     $(OBJDIR)/utexcep.o\
     $(OBJDIR)/utglobal.o\
--- a/sys/external/bsd/acpica/dist/generate/unix/acpixtract/Makefile	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/acpixtract/Makefile	Wed May 04 18:15:53 2016 +0000
@@ -33,6 +33,7 @@
     $(OBJDIR)/getopt.o\
     $(OBJDIR)/oslibcfs.o\
     $(OBJDIR)/osunixxf.o\
+    $(OBJDIR)/utascii.o\
     $(OBJDIR)/utdebug.o\
     $(OBJDIR)/utexcep.o\
     $(OBJDIR)/utglobal.o\
--- a/sys/external/bsd/acpica/dist/generate/unix/iasl/Makefile	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/iasl/Makefile	Wed May 04 18:15:53 2016 +0000
@@ -56,7 +56,9 @@
 	$(OBJDIR)/aslbtypes.o\
 	$(OBJDIR)/aslcodegen.o\
 	$(OBJDIR)/aslcompile.o\
+	$(OBJDIR)/asldebug.o\
 	$(OBJDIR)/aslerror.o\
+	$(OBJDIR)/aslexternal.o\
 	$(OBJDIR)/aslfiles.o\
 	$(OBJDIR)/aslfileio.o\
 	$(OBJDIR)/aslfold.o\
@@ -94,12 +96,14 @@
 	$(OBJDIR)/aslrestype2w.o\
 	$(OBJDIR)/aslstartup.o\
 	$(OBJDIR)/aslstubs.o\
+	$(OBJDIR)/aslpld.o\
 	$(OBJDIR)/asltransform.o\
 	$(OBJDIR)/asltree.o\
 	$(OBJDIR)/aslutils.o\
 	$(OBJDIR)/asluuid.o\
 	$(OBJDIR)/aslwalks.o\
 	$(OBJDIR)/aslxref.o\
+	$(OBJDIR)/aslxrefout.o\
 	$(OBJDIR)/cmfsize.o\
 	$(OBJDIR)/dbfileio.o\
 	$(OBJDIR)/dmbuffer.o\
@@ -140,6 +144,7 @@
 	$(OBJDIR)/dttable2.o\
 	$(OBJDIR)/dttemplate.o\
 	$(OBJDIR)/dtutils.o\
+	$(OBJDIR)/exconcat.o\
 	$(OBJDIR)/exconvrt.o\
 	$(OBJDIR)/excreate.o\
 	$(OBJDIR)/exdump.o\
@@ -196,6 +201,7 @@
 	$(OBJDIR)/tbxfload.o\
 	$(OBJDIR)/utaddress.o\
 	$(OBJDIR)/utalloc.o\
+	$(OBJDIR)/utascii.o\
 	$(OBJDIR)/utbuffer.o\
 	$(OBJDIR)/utcache.o\
 	$(OBJDIR)/utcopy.o\
@@ -269,12 +275,14 @@
 # Function to safely execute yacc
 #
 safe_yacc = \
-	_f=`echo $(1) | tr '[:upper:]' '[:lower:]'` &&\
-	_d=`mktemp -d $(OBJDIR)/$$_f.XXXXXX` &&\
-	_t=`basename $(3)` &&\
-	$(YACC) $(YFLAGS) -p$(1) -o$$_d/$$_f.c -d $(2) &&\
-	mv $$_d/$$_f.$${_t\#\#*.} $(3);\
-	test -d $$_d && rm -fr $$_d
+	_d=`mktemp -d $(OBJDIR)/$(1).XXXXXX` &&\
+	cd $$_d &&\
+	$(YACC) $(YFLAGS) -d -p$(1) $(abspath $(2)) &&\
+	cd - &&\
+	mv $$_d/y.tab$(suffix $(3)) $(3);\
+	_r=$$?;\
+	rm -fr $$_d;\
+	exit $$_r
 
 #
 # Macro processing for iASL .y files
--- a/sys/external/bsd/acpica/dist/hardware/hwregs.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/hardware/hwregs.c	Wed May 04 18:15:53 2016 +0000
@@ -54,6 +54,11 @@
 
 /* Local Prototypes */
 
+static UINT8
+AcpiHwGetAccessBitWidth (
+    ACPI_GENERIC_ADDRESS    *Reg,
+    UINT8                   MaxBitWidth);
+
 static ACPI_STATUS
 AcpiHwReadMultiple (
     UINT32                  *Value,
@@ -71,6 +76,43 @@
 
 /******************************************************************************
  *
+ * FUNCTION:    AcpiHwGetAccessBitWidth
+ *
+ * PARAMETERS:  Reg                 - GAS register structure
+ *              MaxBitWidth         - Max BitWidth supported (32 or 64)
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Obtain optimal access bit width
+ *
+ ******************************************************************************/
+
+static UINT8
+AcpiHwGetAccessBitWidth (
+    ACPI_GENERIC_ADDRESS    *Reg,
+    UINT8                   MaxBitWidth)
+{
+
+    if (!Reg->AccessWidth)
+    {
+        if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_IO)
+        {
+            return (32);
+        }
+        else
+        {
+            return (MaxBitWidth);
+        }
+    }
+    else
+    {
+        return (1 << (Reg->AccessWidth + 2));
+    }
+}
+
+
+/******************************************************************************
+ *
  * FUNCTION:    AcpiHwValidateRegister
  *
  * PARAMETERS:  Reg                 - GAS register structure
@@ -91,6 +133,9 @@
     UINT8                   MaxBitWidth,
     UINT64                  *Address)
 {
+    UINT8                   BitWidth;
+    UINT8                   AccessWidth;
+
 
     /* Must have a valid pointer to a GAS structure */
 
@@ -120,24 +165,25 @@
         return (AE_SUPPORT);
     }
 
-    /* Validate the BitWidth */
+    /* Validate the AccessWidth */
 
-    if ((Reg->BitWidth != 8) &&
-        (Reg->BitWidth != 16) &&
-        (Reg->BitWidth != 32) &&
-        (Reg->BitWidth != MaxBitWidth))
+    if (Reg->AccessWidth > 4)
     {
         ACPI_ERROR ((AE_INFO,
-            "Unsupported register bit width: 0x%X", Reg->BitWidth));
+            "Unsupported register access width: 0x%X", Reg->AccessWidth));
         return (AE_SUPPORT);
     }
 
-    /* Validate the BitOffset. Just a warning for now. */
+    /* Validate the BitWidth, convert AccessWidth into number of bits */
 
-    if (Reg->BitOffset != 0)
+    AccessWidth = AcpiHwGetAccessBitWidth (Reg, MaxBitWidth);
+    BitWidth = ACPI_ROUND_UP (Reg->BitOffset + Reg->BitWidth, AccessWidth);
+    if (MaxBitWidth < BitWidth)
     {
         ACPI_WARNING ((AE_INFO,
-            "Unsupported register bit offset: 0x%X", Reg->BitOffset));
+            "Requested bit width 0x%X is smaller than register bit width 0x%X",
+            MaxBitWidth, BitWidth));
+        return (AE_SUPPORT);
     }
 
     return (AE_OK);
@@ -158,10 +204,7 @@
  *              64-bit values is not needed.
  *
  * LIMITATIONS: <These limitations also apply to AcpiHwWrite>
- *      BitWidth must be exactly 8, 16, or 32.
  *      SpaceID must be SystemMemory or SystemIO.
- *      BitOffset and AccessWidth are currently ignored, as there has
- *          not been a need to implement these.
  *
  ******************************************************************************/
 
@@ -171,7 +214,12 @@
     ACPI_GENERIC_ADDRESS    *Reg)
 {
     UINT64                  Address;
+    UINT8                   AccessWidth;
+    UINT32                  BitWidth;
+    UINT8                   BitOffset;
     UINT64                  Value64;
+    UINT32                  Value32;
+    UINT8                   Index;
     ACPI_STATUS             Status;
 
 
@@ -186,30 +234,64 @@
         return (Status);
     }
 
-    /* Initialize entire 32-bit return value to zero */
-
+    /*
+     * Initialize entire 32-bit return value to zero, convert AccessWidth
+     * into number of bits based
+     */
     *Value = 0;
+    AccessWidth = AcpiHwGetAccessBitWidth (Reg, 32);
+    BitWidth = Reg->BitOffset + Reg->BitWidth;
+    BitOffset = Reg->BitOffset;
 
     /*
      * Two address spaces supported: Memory or IO. PCI_Config is
      * not supported here because the GAS structure is insufficient
      */
-    if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
+    Index = 0;
+    while (BitWidth)
     {
-        Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
-            Address, &Value64, Reg->BitWidth);
+        if (BitOffset > AccessWidth)
+        {
+            Value32 = 0;
+            BitOffset -= AccessWidth;
+        }
+        else
+        {
+            if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
+            {
+                Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
+                    Address + Index * ACPI_DIV_8 (AccessWidth),
+                    &Value64, AccessWidth);
+                Value32 = (UINT32) Value64;
+            }
+            else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
+            {
+                Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
+                    Address + Index * ACPI_DIV_8 (AccessWidth),
+                    &Value32, AccessWidth);
+            }
 
-        *Value = (UINT32) Value64;
-    }
-    else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
-    {
-        Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
-            Address, Value, Reg->BitWidth);
+            if (BitOffset)
+            {
+                Value32 &= ACPI_MASK_BITS_BELOW (BitOffset);
+                BitOffset = 0;
+            }
+            if (BitWidth < AccessWidth)
+            {
+                Value32 &= ACPI_MASK_BITS_ABOVE (BitWidth);
+            }
+        }
+
+        ACPI_SET_BITS (Value, Index * AccessWidth,
+            ACPI_MASK_BITS_ABOVE_32 (AccessWidth), Value32);
+
+        BitWidth -= BitWidth > AccessWidth ? AccessWidth : BitWidth;
+        Index++;
     }
 
     ACPI_DEBUG_PRINT ((ACPI_DB_IO,
         "Read:  %8.8X width %2d from %8.8X%8.8X (%s)\n",
-        *Value, Reg->BitWidth, ACPI_FORMAT_UINT64 (Address),
+        *Value, AccessWidth, ACPI_FORMAT_UINT64 (Address),
         AcpiUtGetRegionName (Reg->SpaceId)));
 
     return (Status);
@@ -237,6 +319,12 @@
     ACPI_GENERIC_ADDRESS    *Reg)
 {
     UINT64                  Address;
+    UINT8                   AccessWidth;
+    UINT32                  BitWidth;
+    UINT8                   BitOffset;
+    UINT64                  Value64;
+    UINT32                  NewValue32, OldValue32;
+    UINT8                   Index;
     ACPI_STATUS             Status;
 
 
@@ -251,24 +339,109 @@
         return (Status);
     }
 
+    /* Convert AccessWidth into number of bits based */
+
+    AccessWidth = AcpiHwGetAccessBitWidth (Reg, 32);
+    BitWidth = Reg->BitOffset + Reg->BitWidth;
+    BitOffset = Reg->BitOffset;
+
     /*
      * Two address spaces supported: Memory or IO. PCI_Config is
      * not supported here because the GAS structure is insufficient
      */
-    if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
+    Index = 0;
+    while (BitWidth)
     {
-        Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
-            Address, (UINT64) Value, Reg->BitWidth);
-    }
-    else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
-    {
-        Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
-            Address, Value, Reg->BitWidth);
+        NewValue32 = ACPI_GET_BITS (&Value, Index * AccessWidth,
+            ACPI_MASK_BITS_ABOVE_32 (AccessWidth));
+
+        if (BitOffset > AccessWidth)
+        {
+            BitOffset -= AccessWidth;
+        }
+        else
+        {
+            if (BitOffset)
+            {
+                NewValue32 &= ACPI_MASK_BITS_BELOW (BitOffset);
+            }
+
+            if (BitWidth < AccessWidth)
+            {
+                NewValue32 &= ACPI_MASK_BITS_ABOVE (BitWidth);
+            }
+
+            if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
+            {
+                if (BitOffset || BitWidth < AccessWidth)
+                {
+                    /*
+                     * Read old values in order not to modify the bits that
+                     * are beyond the register BitWidth/BitOffset setting.
+                     */
+                    Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
+                        Address + Index * ACPI_DIV_8 (AccessWidth),
+                        &Value64, AccessWidth);
+                    OldValue32 = (UINT32) Value64;
+
+                    if (BitOffset)
+                    {
+                        OldValue32 &= ACPI_MASK_BITS_ABOVE (BitOffset + 1);
+                        BitOffset = 0;
+                    }
+
+                    if (BitWidth < AccessWidth)
+                    {
+                        OldValue32 &= ACPI_MASK_BITS_BELOW (BitWidth - 1);
+                    }
+
+                    NewValue32 |= OldValue32;
+                }
+
+                Value64 = (UINT64) NewValue32;
+                Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
+                    Address + Index * ACPI_DIV_8 (AccessWidth),
+                    Value64, AccessWidth);
+            }
+            else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
+            {
+                if (BitOffset || BitWidth < AccessWidth)
+                {
+                    /*
+                     * Read old values in order not to modify the bits that
+                     * are beyond the register BitWidth/BitOffset setting.
+                     */
+                    Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
+                        Address + Index * ACPI_DIV_8 (AccessWidth),
+                        &OldValue32, AccessWidth);
+
+                    if (BitOffset)
+                    {
+                        OldValue32 &= ACPI_MASK_BITS_ABOVE (BitOffset + 1);
+                        BitOffset = 0;
+                    }
+
+                    if (BitWidth < AccessWidth)
+                    {
+                        OldValue32 &= ACPI_MASK_BITS_BELOW (BitWidth - 1);
+                    }
+
+                    NewValue32 |= OldValue32;
+                }
+
+                Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
+                    Address + Index * ACPI_DIV_8 (AccessWidth),
+                    NewValue32, AccessWidth);
+            }
+        }
+
+        BitWidth -= BitWidth > AccessWidth ? AccessWidth : BitWidth;
+        Index++;
     }
 
     ACPI_DEBUG_PRINT ((ACPI_DB_IO,
         "Wrote: %8.8X width %2d   to %8.8X%8.8X (%s)\n",
-        Value, Reg->BitWidth, ACPI_FORMAT_UINT64 (Address),
+        Value, AccessWidth, ACPI_FORMAT_UINT64 (Address),
         AcpiUtGetRegionName (Reg->SpaceId)));
 
     return (Status);
--- a/sys/external/bsd/acpica/dist/hardware/hwxface.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/hardware/hwxface.c	Wed May 04 18:15:53 2016 +0000
@@ -565,8 +565,7 @@
      * Evaluate the \_Sx namespace object containing the register values
      * for this state
      */
-    Info->RelativePathname = ACPI_CAST_PTR (char,
-        AcpiGbl_SleepStateNames[SleepState]);
+    Info->RelativePathname = AcpiGbl_SleepStateNames[SleepState];
 
     Status = AcpiNsEvaluate (Info);
     if (ACPI_FAILURE (Status))
--- a/sys/external/bsd/acpica/dist/include/acevents.h	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/include/acevents.h	Wed May 04 18:15:53 2016 +0000
@@ -273,10 +273,6 @@
     BOOLEAN                 AcpiNsIsLocked);
 
 void
-AcpiEvAssociateRegMethod (
-    ACPI_OPERAND_OBJECT     *RegionObj);
-
-void
 AcpiEvExecuteRegMethods (
     ACPI_NAMESPACE_NODE     *Node,
     ACPI_ADR_SPACE_TYPE     SpaceId,
--- a/sys/external/bsd/acpica/dist/include/acoutput.h	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/include/acoutput.h	Wed May 04 18:15:53 2016 +0000
@@ -267,7 +267,7 @@
 #define ACPI_GET_FUNCTION_NAME          _AcpiFunctionName
 
 /*
- * The Name parameter should be the procedure name as a quoted string.
+ * The Name parameter should be the procedure name as a non-quoted string.
  * The function name is also used by the function exit macros below.
  * Note: (const char) is used to be compatible with the debug interfaces
  * and macros such as __FUNCTION__.
--- a/sys/external/bsd/acpica/dist/include/acparser.h	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/include/acparser.h	Wed May 04 18:15:53 2016 +0000
@@ -171,7 +171,7 @@
 AcpiPsGetOpcodeInfo (
     UINT16                  Opcode);
 
-char *
+const char *
 AcpiPsGetOpcodeName (
     UINT16                  Opcode);
 
--- a/sys/external/bsd/acpica/dist/include/acpredef.h	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/include/acpredef.h	Wed May 04 18:15:53 2016 +0000
@@ -131,7 +131,8 @@
     ACPI_PTYPE2_REV_FIXED   = 9,
     ACPI_PTYPE2_FIX_VAR     = 10,
     ACPI_PTYPE2_VAR_VAR     = 11,
-    ACPI_PTYPE2_UUID_PAIR   = 12
+    ACPI_PTYPE2_UUID_PAIR   = 12,
+    ACPI_PTYPE_CUSTOM       = 13
 };
 
 
@@ -344,7 +345,7 @@
 
     {{"_BIX",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (16 Int),(4 Str) */
-                    PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16, ACPI_RTYPE_STRING, 4,0),
+                    PACKAGE_INFO (ACPI_PTYPE_CUSTOM, ACPI_RTYPE_INTEGER, 16, ACPI_RTYPE_STRING, 4,0),
 
     {{"_BLT",   METHOD_3ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER),
                 METHOD_NO_RETURN_VALUE}},
@@ -516,6 +517,9 @@
                 METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (4 Int) */
                     PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0,0,0),
 
+    {{"_FIT",   METHOD_0ARGS,
+                METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},  /* ACPI 6.0 */
+
     {{"_FIX",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Ints) */
                     PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0,0,0),
@@ -1030,6 +1034,12 @@
     {{"_WED",   METHOD_1ARGS (ACPI_TYPE_INTEGER),
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER)}},
 
+    {{"_WPC",   METHOD_0ARGS,
+                METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},  /* ACPI 6.1 */
+
+    {{"_WPP",   METHOD_0ARGS,
+                METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},  /* ACPI 6.1 */
+
     PACKAGE_INFO (0,0,0,0,0,0) /* Table terminator */
 };
 #else
@@ -1104,7 +1114,7 @@
     PACKAGE_INFO (0,0,0,0,0,0) /* Table terminator */
 };
 
-static const ACPI_PREDEFINED_INFO      AcpiGbl_ScopeNames[] = {
+const ACPI_PREDEFINED_INFO              AcpiGbl_ScopeNames[] = {
     {{"_GPE",     0,      0}},
     {{"_PR_",     0,      0}},
     {{"_SB_",     0,      0}},
@@ -1113,7 +1123,7 @@
     PACKAGE_INFO (0,0,0,0,0,0) /* Table terminator */
 };
 #else
-extern const ACPI_PREDEFINED_INFO      AcpiGbl_ResourceNames[];
+extern const ACPI_PREDEFINED_INFO       AcpiGbl_ResourceNames[];
 #endif
 
 #endif
--- a/sys/external/bsd/acpica/dist/include/acrestyp.h	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/include/acrestyp.h	Wed May 04 18:15:53 2016 +0000
@@ -485,6 +485,7 @@
     UINT8                           Type; \
     UINT8                           ProducerConsumer;    /* For values, see Producer/Consumer above */\
     UINT8                           SlaveMode; \
+    UINT8                           ConnectionSharing; \
     UINT8                           TypeRevisionId; \
     UINT16                          TypeDataLength; \
     UINT16                          VendorLength; \
--- a/sys/external/bsd/acpica/dist/include/acstruct.h	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/include/acstruct.h	Wed May 04 18:15:53 2016 +0000
@@ -202,7 +202,7 @@
     /* The first 3 elements are passed by the caller to AcpiNsEvaluate */
 
     ACPI_NAMESPACE_NODE             *PrefixNode;        /* Input: starting node */
-    char                            *RelativePathname;  /* Input: path relative to PrefixNode */
+    const char                      *RelativePathname;  /* Input: path relative to PrefixNode */
     ACPI_OPERAND_OBJECT             **Parameters;       /* Input: argument list */
 
     ACPI_NAMESPACE_NODE             *Node;              /* Resolved node (PrefixNode:RelativePathname) */
--- a/sys/external/bsd/acpica/dist/include/actbl.h	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/include/actbl.h	Wed May 04 18:15:53 2016 +0000
@@ -248,7 +248,7 @@
 /*******************************************************************************
  *
  * FADT - Fixed ACPI Description Table (Signature "FACP")
- *        Version 4
+ *        Version 6
  *
  ******************************************************************************/
 
@@ -449,4 +449,6 @@
 #define ACPI_FADT_V5_SIZE       (UINT32) (ACPI_FADT_OFFSET (HypervisorId))
 #define ACPI_FADT_V6_SIZE       (UINT32) (sizeof (ACPI_TABLE_FADT))
 
+#define ACPI_FADT_CONFORMANCE   "ACPI 6.1 (FADT version 6)"
+
 #endif /* __ACTBL_H__ */
--- a/sys/external/bsd/acpica/dist/include/actbl2.h	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/include/actbl2.h	Wed May 04 18:15:53 2016 +0000
@@ -364,7 +364,7 @@
  * DBG2 - Debug Port Table 2
  *        Version 0 (Both main table and subtables)
  *
- * Conforms to "Microsoft Debug Port Table 2 (DBG2)", May 22 2012.
+ * Conforms to "Microsoft Debug Port Table 2 (DBG2)", December 10, 2015
  *
  ******************************************************************************/
 
@@ -421,6 +421,11 @@
 
 #define ACPI_DBG2_16550_COMPATIBLE  0x0000
 #define ACPI_DBG2_16550_SUBSET      0x0001
+#define ACPI_DBG2_ARM_PL011         0x0003
+#define ACPI_DBG2_ARM_SBSA_32BIT    0x000D
+#define ACPI_DBG2_ARM_SBSA_GENERIC  0x000E
+#define ACPI_DBG2_ARM_DCC           0x000F
+#define ACPI_DBG2_BCM2835           0x0010
 
 #define ACPI_DBG2_1394_STANDARD     0x0000
 
@@ -453,7 +458,7 @@
  *        Version 1
  *
  * Conforms to "Intel Virtualization Technology for Directed I/O",
- * Version 2.2, Sept. 2013
+ * Version 2.3, October 2014
  *
  ******************************************************************************/
 
@@ -469,6 +474,8 @@
 /* Masks for Flags field above */
 
 #define ACPI_DMAR_INTR_REMAP        (1)
+#define ACPI_DMAR_X2APIC_OPT_OUT    (1<<1)
+#define ACPI_DMAR_X2APIC_MODE       (1<<2)
 
 
 /* DMAR subtable header */
@@ -757,7 +764,7 @@
  * IORT - IO Remapping Table
  *
  * Conforms to "IO Remapping Table System Software on ARM Platforms",
- * Document number: ARM DEN 0049A, 2015
+ * Document number: ARM DEN 0049B, October 2015
  *
  ******************************************************************************/
 
@@ -793,7 +800,8 @@
     ACPI_IORT_NODE_ITS_GROUP            = 0x00,
     ACPI_IORT_NODE_NAMED_COMPONENT      = 0x01,
     ACPI_IORT_NODE_PCI_ROOT_COMPLEX     = 0x02,
-    ACPI_IORT_NODE_SMMU                 = 0x03
+    ACPI_IORT_NODE_SMMU                 = 0x03,
+    ACPI_IORT_NODE_SMMU_V3              = 0x04
 };
 
 
@@ -902,6 +910,26 @@
 #define ACPI_IORT_SMMU_COHERENT_WALK    (1<<1)
 
 
+typedef struct acpi_iort_smmu_v3
+{
+    UINT64                  BaseAddress;            /* SMMUv3 base address */
+    UINT32                  Flags;
+    UINT32                  Reserved;
+    UINT64                  VatosAddress;
+    UINT32                  Model;                 /* O: generic SMMUv3 */
+    UINT32                  EventGsiv;
+    UINT32                  PriGsiv;
+    UINT32                  GerrGsiv;
+    UINT32                  SyncGsiv;
+
+} ACPI_IORT_SMMU_V3;
+
+/* Masks for Flags field above */
+
+#define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE   (1)
+#define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE     (1<<1)
+
+
 /*******************************************************************************
  *
  * IVRS - I/O Virtualization Reporting Structure
@@ -1284,10 +1312,10 @@
 /*******************************************************************************
  *
  * SPCR - Serial Port Console Redirection table
- *        Version 1
+ *        Version 2
  *
  * Conforms to "Serial Port Console Redirection Table",
- * Version 1.00, January 11, 2002
+ * Version 1.03, August 10, 2015
  *
  ******************************************************************************/
 
@@ -1321,6 +1349,8 @@
 
 #define ACPI_SPCR_DO_NOT_DISABLE    (1)
 
+/* Values for Interface Type: See the definition of the DBG2 table */
+
 
 /*******************************************************************************
  *
--- a/sys/external/bsd/acpica/dist/include/actbl3.h	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/include/actbl3.h	Wed May 04 18:15:53 2016 +0000
@@ -205,7 +205,7 @@
 } ACPI_TABLE_FPDT;
 
 
-/* FPDT subtable header */
+/* FPDT subtable header (Performance Record Structure) */
 
 typedef struct acpi_fpdt_header
 {
@@ -230,6 +230,72 @@
 
 /* 0: Firmware Basic Boot Performance Record */
 
+typedef struct acpi_fpdt_boot_pointer
+{
+    ACPI_FPDT_HEADER        Header;
+    UINT8                   Reserved[4];
+    UINT64                  Address;
+
+} ACPI_FPDT_BOOT_POINTER;
+
+
+/* 1: S3 Performance Table Pointer Record */
+
+typedef struct acpi_fpdt_s3pt_pointer
+{
+    ACPI_FPDT_HEADER        Header;
+    UINT8                   Reserved[4];
+    UINT64                  Address;
+
+} ACPI_FPDT_S3PT_POINTER;
+
+
+/*
+ * S3PT - S3 Performance Table. This table is pointed to by the
+ * S3 Pointer Record above.
+ */
+typedef struct acpi_table_s3pt
+{
+    UINT8                   Signature[4]; /* "S3PT" */
+    UINT32                  Length;
+
+} ACPI_TABLE_S3PT;
+
+
+/*
+ * S3PT Subtables (Not part of the actual FPDT)
+ */
+
+/* Values for Type field in S3PT header */
+
+enum AcpiS3ptType
+{
+    ACPI_S3PT_TYPE_RESUME               = 0,
+    ACPI_S3PT_TYPE_SUSPEND              = 1,
+    ACPI_FPDT_BOOT_PERFORMANCE          = 2
+};
+
+typedef struct acpi_s3pt_resume
+{
+    ACPI_FPDT_HEADER        Header;
+    UINT32                  ResumeCount;
+    UINT64                  FullResume;
+    UINT64                  AverageResume;
+
+} ACPI_S3PT_RESUME;
+
+typedef struct acpi_s3pt_suspend
+{
+    ACPI_FPDT_HEADER        Header;
+    UINT64                  SuspendStart;
+    UINT64                  SuspendEnd;
+
+} ACPI_S3PT_SUSPEND;
+
+
+/*
+ * FPDT Boot Performance Record (Not part of the actual FPDT)
+ */
 typedef struct acpi_fpdt_boot
 {
     ACPI_FPDT_HEADER        Header;
@@ -243,66 +309,6 @@
 } ACPI_FPDT_BOOT;
 
 
-/* 1: S3 Performance Table Pointer Record */
-
-typedef struct acpi_fpdt_s3pt_ptr
-{
-    ACPI_FPDT_HEADER        Header;
-    UINT8                   Reserved[4];
-    UINT64                  Address;
-
-} ACPI_FPDT_S3PT_PTR;
-
-
-/*
- * S3PT - S3 Performance Table. This table is pointed to by the
- * FPDT S3 Pointer Record above.
- */
-typedef struct acpi_table_s3pt
-{
-    UINT8                   Signature[4]; /* "S3PT" */
-    UINT32                  Length;
-
-} ACPI_TABLE_S3PT;
-
-
-/*
- * S3PT Subtables
- */
-typedef struct acpi_s3pt_header
-{
-    UINT16                  Type;
-    UINT8                   Length;
-    UINT8                   Revision;
-
-} ACPI_S3PT_HEADER;
-
-/* Values for Type field above */
-
-enum AcpiS3ptType
-{
-    ACPI_S3PT_TYPE_RESUME               = 0,
-    ACPI_S3PT_TYPE_SUSPEND              = 1
-};
-
-typedef struct acpi_s3pt_resume
-{
-    ACPI_S3PT_HEADER        Header;
-    UINT32                  ResumeCount;
-    UINT64                  FullResume;
-    UINT64                  AverageResume;
-
-} ACPI_S3PT_RESUME;
-
-typedef struct acpi_s3pt_suspend
-{
-    ACPI_S3PT_HEADER        Header;
-    UINT64                  SuspendStart;
-    UINT64                  SuspendEnd;
-
-} ACPI_S3PT_SUSPEND;
-
-
 /*******************************************************************************
  *
  * GTDT - Generic Timer Description Table (ACPI 5.1)
@@ -557,9 +563,10 @@
 
 enum AcpiPcctType
 {
-    ACPI_PCCT_TYPE_GENERIC_SUBSPACE     = 0,
-    ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE  = 1,
-    ACPI_PCCT_TYPE_RESERVED             = 2     /* 2 and greater are reserved */
+    ACPI_PCCT_TYPE_GENERIC_SUBSPACE             = 0,
+    ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE          = 1,
+    ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2    = 2,    /* ACPI 6.1 */
+    ACPI_PCCT_TYPE_RESERVED                     = 3     /* 3 and greater are reserved */
 };
 
 /*
@@ -603,6 +610,30 @@
 
 } ACPI_PCCT_HW_REDUCED;
 
+
+/* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */
+
+typedef struct acpi_pcct_hw_reduced_type2
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT32                  DoorbellInterrupt;
+    UINT8                   Flags;
+    UINT8                   Reserved;
+    UINT64                  BaseAddress;
+    UINT64                  Length;
+    ACPI_GENERIC_ADDRESS    DoorbellRegister;
+    UINT64                  PreserveMask;
+    UINT64                  WriteMask;
+    UINT32                  Latency;
+    UINT32                  MaxAccessRate;
+    UINT16                  MinTurnaroundTime;
+    ACPI_GENERIC_ADDRESS    DoorbellAckRegister;
+    UINT64                  AckPreserveMask;
+    UINT64                  AckWriteMask;
+
+} ACPI_PCCT_HW_REDUCED_TYPE2;
+
+
 /* Values for doorbell flags above */
 
 #define ACPI_PCCT_INTERRUPT_POLARITY    (1)
--- a/sys/external/bsd/acpica/dist/include/platform/acenv.h	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/include/platform/acenv.h	Wed May 04 18:15:53 2016 +0000
@@ -67,17 +67,28 @@
  *
  *****************************************************************************/
 
+/* Common application configuration. All single threaded except for AcpiExec. */
+
+#if (defined ACPI_ASL_COMPILER) || \
+    (defined ACPI_BIN_APP)      || \
+    (defined ACPI_DUMP_APP)     || \
+    (defined ACPI_HELP_APP)     || \
+    (defined ACPI_NAMES_APP)    || \
+    (defined ACPI_SRC_APP)      || \
+    (defined ACPI_XTRACT_APP)   || \
+    (defined ACPI_EXAMPLE_APP)
+#define ACPI_APPLICATION
+#define ACPI_SINGLE_THREADED
+#endif
+
 /* iASL configuration */
 
 #ifdef ACPI_ASL_COMPILER
-#define ACPI_APPLICATION
 #define ACPI_DEBUG_OUTPUT
 #define ACPI_CONSTANT_EVAL_ONLY
 #define ACPI_LARGE_NAMESPACE_NODE
 #define ACPI_DATA_TABLE_DISASSEMBLY
-#define ACPI_SINGLE_THREADED
 #define ACPI_32BIT_PHYSICAL_ADDRESS
-
 #define ACPI_DISASSEMBLER 1
 #endif
 
@@ -90,21 +101,6 @@
 #define ACPI_DBG_TRACK_ALLOCATIONS
 #endif
 
-/*
- * AcpiBin/AcpiDump/AcpiHelp/AcpiNames/AcpiSrc/AcpiXtract/Example
- * configuration. All single threaded.
- */
-#if (defined ACPI_BIN_APP)      || \
-    (defined ACPI_DUMP_APP)     || \
-    (defined ACPI_HELP_APP)     || \
-    (defined ACPI_NAMES_APP)    || \
-    (defined ACPI_SRC_APP)      || \
-    (defined ACPI_XTRACT_APP)   || \
-    (defined ACPI_EXAMPLE_APP)
-#define ACPI_APPLICATION
-#define ACPI_SINGLE_THREADED
-#endif
-
 /* AcpiHelp configuration. Error messages disabled. */
 
 #ifdef ACPI_HELP_APP
@@ -139,11 +135,16 @@
 #define ACPI_REDUCED_HARDWARE 1
 #endif
 
-/* Linkable ACPICA library */
+/* Linkable ACPICA library. Two versions, one with full debug. */
 
 #ifdef ACPI_LIBRARY
 #define ACPI_USE_LOCAL_CACHE
-#define ACPI_FULL_DEBUG
+#define ACPI_DEBUGGER 1
+#define ACPI_DISASSEMBLER 1
+
+#ifdef _DEBUG
+#define ACPI_DEBUG_OUTPUT
+#endif
 #endif
 
 /* Common for all ACPICA applications */
@@ -218,6 +219,9 @@
 #elif defined(__HAIKU__)
 #include "achaiku.h"
 
+#elif defined(__QNX__)
+#include "acqnx.h"
+
 #else
 
 /* Unknown environment */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/acpica/dist/include/platform/acqnx.h	Wed May 04 18:15:53 2016 +0000
@@ -0,0 +1,74 @@
+/******************************************************************************
+ *
+ * Name: acqnx.h - OS specific defines, etc.
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2016, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ *    of any contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#ifndef __ACQNX_H__
+#define __ACQNX_H__
+
+/* QNX uses GCC */
+
+#include "acgcc.h"
+
+#define ACPI_UINTPTR_T          uintptr_t
+#define ACPI_USE_LOCAL_CACHE
+#define ACPI_CAST_PTHREAD_T(x)  ((ACPI_THREAD_ID) ACPI_TO_INTEGER (x))
+
+/* At present time (QNX 6.6) all supported architectures are 32 bits. */
+#define ACPI_MACHINE_WIDTH      32
+
+#define COMPILER_DEPENDENT_INT64  int64_t
+#define COMPILER_DEPENDENT_UINT64 uint64_t
+
+#include <ctype.h>
+#include <stdint.h>
+#include <sys/neutrino.h>
+
+#define ACPI_USE_STANDARD_HEADERS
+
+#define __cli() InterruptDisable();
+#define __sti() InterruptEnable();
+#define __cdecl
+
+#define ACPI_USE_SYSTEM_CLIBRARY
+#define ACPI_USE_NATIVE_DIVIDE
+
+#endif /* __ACQNX_H__ */
--- a/sys/external/bsd/acpica/dist/namespace/nsconvert.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/namespace/nsconvert.c	Wed May 04 18:15:53 2016 +0000
@@ -84,7 +84,7 @@
         /* String-to-Integer conversion */
 
         Status = AcpiUtStrtoul64 (OriginalObject->String.Pointer,
-            ACPI_ANY_BASE, &Value);
+            ACPI_ANY_BASE, AcpiGbl_IntegerByteWidth, &Value);
         if (ACPI_FAILURE (Status))
         {
             return (Status);
--- a/sys/external/bsd/acpica/dist/namespace/nsload.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/namespace/nsload.c	Wed May 04 18:15:53 2016 +0000
@@ -140,8 +140,8 @@
         (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
         AcpiNsDeleteNamespaceByOwner (
             AcpiGbl_RootTableList.Tables[TableIndex].OwnerId);
-            AcpiTbReleaseOwnerId (TableIndex);
 
+        AcpiTbReleaseOwnerId (TableIndex);
         return_ACPI_STATUS (Status);
     }
 
--- a/sys/external/bsd/acpica/dist/namespace/nsprepkg.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/namespace/nsprepkg.c	Wed May 04 18:15:53 2016 +0000
@@ -70,6 +70,12 @@
     UINT32                      Count2,
     UINT32                      StartIndex);
 
+static ACPI_STATUS
+AcpiNsCustomPackage (
+    ACPI_EVALUATE_INFO          *Info,
+    ACPI_OPERAND_OBJECT         **Elements,
+    UINT32                      Count);
+
 
 /*******************************************************************************
  *
@@ -148,6 +154,11 @@
      */
     switch (Package->RetInfo.Type)
     {
+    case ACPI_PTYPE_CUSTOM:
+
+        Status = AcpiNsCustomPackage (Info, Elements, Count);
+        break;
+
     case ACPI_PTYPE1_FIXED:
         /*
          * The package count is fixed and there are no subpackages
@@ -188,6 +199,7 @@
             {
                 return (Status);
             }
+
             Elements++;
         }
         break;
@@ -232,6 +244,7 @@
                     return (Status);
                 }
             }
+
             Elements++;
         }
         break;
@@ -342,7 +355,7 @@
         while (Count > 0)
         {
             Status = AcpiNsCheckObjectType(Info, Elements,
-                        Package->RetInfo.ObjectType1, 0);
+                Package->RetInfo.ObjectType1, 0);
             if (ACPI_FAILURE(Status))
             {
                 return (Status);
@@ -358,7 +371,7 @@
             }
 
             Status = AcpiNsCheckObjectType(Info, Elements + 1,
-                        Package->RetInfo.ObjectType2, 0);
+                Package->RetInfo.ObjectType2, 0);
             if (ACPI_FAILURE(Status))
             {
                 return (Status);
@@ -366,8 +379,8 @@
 
             Elements += 2;
             Count -= 2;
-         }
-         break;
+        }
+        break;
 
     default:
 
@@ -442,7 +455,7 @@
         /* Each sub-object must be of type Package */
 
         Status = AcpiNsCheckObjectType (Info, &SubPackage,
-                    ACPI_RTYPE_PACKAGE, i);
+            ACPI_RTYPE_PACKAGE, i);
         if (ACPI_FAILURE (Status))
         {
             return (Status);
@@ -466,10 +479,10 @@
             }
 
             Status = AcpiNsCheckPackageElements (Info, SubElements,
-                        Package->RetInfo.ObjectType1,
-                        Package->RetInfo.Count1,
-                        Package->RetInfo.ObjectType2,
-                        Package->RetInfo.Count2, 0);
+                Package->RetInfo.ObjectType1,
+                Package->RetInfo.Count1,
+                Package->RetInfo.ObjectType2,
+                Package->RetInfo.Count2, 0);
             if (ACPI_FAILURE (Status))
             {
                 return (Status);
@@ -488,10 +501,10 @@
             }
 
             Status = AcpiNsCheckPackageElements (Info, SubElements,
-                        Package->RetInfo.ObjectType1,
-                        Package->RetInfo.Count1,
-                        Package->RetInfo.ObjectType2,
-                        SubPackage->Package.Count - Package->RetInfo.Count1, 0);
+                Package->RetInfo.ObjectType1,
+                Package->RetInfo.Count1,
+                Package->RetInfo.ObjectType2,
+                SubPackage->Package.Count - Package->RetInfo.Count1, 0);
             if (ACPI_FAILURE (Status))
             {
                 return (Status);
@@ -519,7 +532,7 @@
             for (j = 0; j < ExpectedCount; j++)
             {
                 Status = AcpiNsCheckObjectType (Info, &SubElements[j],
-                            Package->RetInfo2.ObjectType[j], j);
+                    Package->RetInfo2.ObjectType[j], j);
                 if (ACPI_FAILURE (Status))
                 {
                     return (Status);
@@ -540,8 +553,8 @@
             /* Check the type of each subpackage element */
 
             Status = AcpiNsCheckPackageElements (Info, SubElements,
-                        Package->RetInfo.ObjectType1,
-                        SubPackage->Package.Count, 0, 0, 0);
+                Package->RetInfo.ObjectType1,
+                SubPackage->Package.Count, 0, 0, 0);
             if (ACPI_FAILURE (Status))
             {
                 return (Status);
@@ -554,7 +567,7 @@
              * the count field (the ACPI name is NumElements)
              */
             Status = AcpiNsCheckObjectType (Info, SubElements,
-                        ACPI_RTYPE_INTEGER, 0);
+                ACPI_RTYPE_INTEGER, 0);
             if (ACPI_FAILURE (Status))
             {
                 return (Status);
@@ -569,11 +582,13 @@
             {
                 goto PackageTooSmall;
             }
+
             if (SubPackage->Package.Count < Package->RetInfo.Count1)
             {
                 ExpectedCount = Package->RetInfo.Count1;
                 goto PackageTooSmall;
             }
+
             if (ExpectedCount == 0)
             {
                 /*
@@ -589,8 +604,8 @@
             /* Check the type of each subpackage element */
 
             Status = AcpiNsCheckPackageElements (Info, (SubElements + 1),
-                        Package->RetInfo.ObjectType1,
-                        (ExpectedCount - 1), 0, 0, 1);
+                Package->RetInfo.ObjectType1,
+                (ExpectedCount - 1), 0, 0, 1);
             if (ACPI_FAILURE (Status))
             {
                 return (Status);
@@ -622,6 +637,92 @@
 
 /*******************************************************************************
  *
+ * FUNCTION:    AcpiNsCustomPackage
+ *
+ * PARAMETERS:  Info                - Method execution information block
+ *              Elements            - Pointer to the package elements array
+ *              Count               - Element count for the package
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Check a returned package object for the correct count and
+ *              correct type of all sub-objects.
+ *
+ * NOTE: Currently used for the _BIX method only. When needed for two or more
+ * methods, probably a detect/dispatch mechanism will be required.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiNsCustomPackage (
+    ACPI_EVALUATE_INFO          *Info,
+    ACPI_OPERAND_OBJECT         **Elements,
+    UINT32                      Count)
+{
+    UINT32                      ExpectedCount;
+    UINT32                      Version;
+    ACPI_STATUS                 Status = AE_OK;
+
+
+    ACPI_FUNCTION_NAME (NsCustomPackage);
+
+
+    /* Get version number, must be Integer */
+
+    if ((*Elements)->Common.Type != ACPI_TYPE_INTEGER)
+    {
+        ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
+            "Return Package has invalid object type for version number"));
+        return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
+    }
+
+    Version = (UINT32) (*Elements)->Integer.Value;
+    ExpectedCount = 21;         /* Version 1 */
+
+    if (Version == 0)
+    {
+        ExpectedCount = 20;     /* Version 0 */
+    }
+
+    if (Count < ExpectedCount)
+    {
+        ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
+            "Return Package is too small - found %u elements, expected %u",
+            Count, ExpectedCount));
+        return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
+    }
+    else if (Count > ExpectedCount)
+    {
+        ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR,
+            "%s: Return Package is larger than needed - "
+            "found %u, expected %u\n",
+            Info->FullPathname, Count, ExpectedCount));
+    }
+
+    /* Validate all elements of the returned package */
+
+    Status = AcpiNsCheckPackageElements (Info, Elements,
+        ACPI_RTYPE_INTEGER, 16,
+        ACPI_RTYPE_STRING, 4, 0);
+    if (ACPI_FAILURE (Status))
+    {
+        return_ACPI_STATUS (Status);
+    }
+
+    /* Version 1 has a single trailing integer */
+
+    if (Version > 0)
+    {
+        Status = AcpiNsCheckPackageElements (Info, Elements + 20,
+            ACPI_RTYPE_INTEGER, 1, 0, 0, 20);
+    }
+
+    return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    AcpiNsCheckPackageElements
  *
  * PARAMETERS:  Info            - Method execution information block
@@ -662,22 +763,24 @@
     for (i = 0; i < Count1; i++)
     {
         Status = AcpiNsCheckObjectType (Info, ThisElement,
-                    Type1, i + StartIndex);
+            Type1, i + StartIndex);
         if (ACPI_FAILURE (Status))
         {
             return (Status);
         }
+
         ThisElement++;
     }
 
     for (i = 0; i < Count2; i++)
     {
         Status = AcpiNsCheckObjectType (Info, ThisElement,
-                    Type2, (i + Count1 + StartIndex));
+            Type2, (i + Count1 + StartIndex));
         if (ACPI_FAILURE (Status))
         {
             return (Status);
         }
+
         ThisElement++;
     }
 
--- a/sys/external/bsd/acpica/dist/os_specific/service_layers/osbsdtbl.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/os_specific/service_layers/osbsdtbl.c	Wed May 04 18:15:53 2016 +0000
@@ -386,7 +386,9 @@
     ACPI_SIZE               RsdpSize;
     ACPI_STATUS             Status;
     u_long                  Address = 0;
+#if defined(SYSTEM_SYSCTL)
     size_t                  Length = sizeof (Address);
+#endif
 
 
     /* Get main ACPI tables from memory on first invocation of this function */
@@ -408,6 +410,7 @@
         Address = strtoul (Buffer, NULL, 0);
     }
 #endif
+#if defined(SYSTEM_SYSCTL)
     if (!Address)
     {
         if (sysctlbyname (SYSTEM_SYSCTL, &Address, &Length, NULL, 0) != 0)
@@ -415,6 +418,7 @@
             Address = 0;
         }
     }
+#endif
     if (Address)
     {
         RsdpBase = Address;
--- a/sys/external/bsd/acpica/dist/os_specific/service_layers/osunixmap.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/os_specific/service_layers/osunixmap.c	Wed May 04 18:15:53 2016 +0000
@@ -56,7 +56,7 @@
 #define O_BINARY 0
 #endif
 
-#if defined(_DragonFly) || defined(_FreeBSD)
+#if defined(_DragonFly) || defined(_FreeBSD) || defined(_QNX)
 #define MMAP_FLAGS          MAP_SHARED
 #else
 #define MMAP_FLAGS          MAP_PRIVATE
--- a/sys/external/bsd/acpica/dist/parser/psargs.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/parser/psargs.c	Wed May 04 18:15:53 2016 +0000
@@ -298,7 +298,7 @@
         PossibleMethodCall &&
         (Node->Type == ACPI_TYPE_METHOD))
     {
-        if (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) == ARGP_SUPERNAME)
+        if (WalkState->Opcode == AML_UNLOAD_OP)
         {
             /*
              * AcpiPsGetNextNamestring has increased the AML pointer,
@@ -744,7 +744,7 @@
  *
  * PARAMETERS:  WalkState           - Current state
  *              ParserState         - Current parser state object
- *              ArgType             - The parser argument type (ARGP_*)
+ *              ArgType             - The argument type (AML_*_ARG)
  *              ReturnArg           - Where the next arg is returned
  *
  * RETURN:      Status, and an op object containing the next argument.
@@ -873,9 +873,9 @@
                 return_ACPI_STATUS (AE_NO_MEMORY);
             }
 
-            /* SuperName allows argument to be a method call */
+            /* To support SuperName arg of Unload */
 
-            if (ArgType == ARGP_SUPERNAME)
+            if (WalkState->Opcode == AML_UNLOAD_OP)
             {
                 Status = AcpiPsGetNextNamepath (WalkState, ParserState,
                     Arg, ACPI_POSSIBLE_METHOD_CALL);
--- a/sys/external/bsd/acpica/dist/parser/psutils.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/parser/psutils.c	Wed May 04 18:15:53 2016 +0000
@@ -148,7 +148,7 @@
     }
     else if (OpInfo->Flags & AML_NAMED)
     {
-        Flags = ACPI_PARSEOP_NAMED;
+        Flags = ACPI_PARSEOP_NAMED_OBJECT;
     }
     else if (Opcode == AML_INT_BYTELIST_OP)
     {
--- a/sys/external/bsd/acpica/dist/resources/rsserial.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/resources/rsserial.c	Wed May 04 18:15:53 2016 +0000
@@ -153,7 +153,7 @@
  *
  ******************************************************************************/
 
-ACPI_RSCONVERT_INFO     AcpiRsConvertI2cSerialBus[16] =
+ACPI_RSCONVERT_INFO     AcpiRsConvertI2cSerialBus[17] =
 {
     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_SERIAL_BUS,
                         ACPI_RS_SIZE (ACPI_RESOURCE_I2C_SERIALBUS),
@@ -179,6 +179,10 @@
                         AML_OFFSET (CommonSerialBus.Flags),
                         1},
 
+    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing),
+                        AML_OFFSET (CommonSerialBus.Flags),
+                        2},
+
     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),
                         AML_OFFSET (CommonSerialBus.TypeRevisionId),
                         1},
@@ -233,7 +237,7 @@
  *
  ******************************************************************************/
 
-ACPI_RSCONVERT_INFO     AcpiRsConvertSpiSerialBus[20] =
+ACPI_RSCONVERT_INFO     AcpiRsConvertSpiSerialBus[21] =
 {
     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_SERIAL_BUS,
                         ACPI_RS_SIZE (ACPI_RESOURCE_SPI_SERIALBUS),
@@ -259,6 +263,10 @@
                         AML_OFFSET (CommonSerialBus.Flags),
                         1},
 
+    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing),
+                        AML_OFFSET (CommonSerialBus.Flags),
+                        2},
+
     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),
                         AML_OFFSET (CommonSerialBus.TypeRevisionId),
                         1},
@@ -329,7 +337,7 @@
  *
  ******************************************************************************/
 
-ACPI_RSCONVERT_INFO     AcpiRsConvertUartSerialBus[22] =
+ACPI_RSCONVERT_INFO     AcpiRsConvertUartSerialBus[23] =
 {
     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_SERIAL_BUS,
                         ACPI_RS_SIZE (ACPI_RESOURCE_UART_SERIALBUS),
@@ -355,6 +363,10 @@
                         AML_OFFSET (CommonSerialBus.Flags),
                         1},
 
+    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing),
+                        AML_OFFSET (CommonSerialBus.Flags),
+                        2},
+
     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),
                         AML_OFFSET (CommonSerialBus.TypeRevisionId),
                         1},
--- a/sys/external/bsd/acpica/dist/tables/tbfind.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/tables/tbfind.c	Wed May 04 18:15:53 2016 +0000
@@ -83,7 +83,7 @@
 
     /* Validate the input table signature */
 
-    if (!AcpiIsValidSignature (Signature))
+    if (!AcpiUtValidNameseg (Signature))
     {
         return_ACPI_STATUS (AE_BAD_SIGNATURE);
     }
--- a/sys/external/bsd/acpica/dist/tables/tbprint.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/tables/tbprint.c	Wed May 04 18:15:53 2016 +0000
@@ -149,7 +149,7 @@
     {
         /* FACS only has signature and length fields */
 
-        ACPI_INFO ((AE_INFO, "%-4.4s 0x%8.8X%8.8X %06X",
+        ACPI_INFO (("%-4.4s 0x%8.8X%8.8X %06X",
             Header->Signature, ACPI_FORMAT_UINT64 (Address),
             Header->Length));
     }
@@ -161,7 +161,7 @@
             Header)->OemId, ACPI_OEM_ID_SIZE);
         AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE);
 
-        ACPI_INFO ((AE_INFO, "RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
+        ACPI_INFO (("RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
             ACPI_FORMAT_UINT64 (Address),
             (ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision > 0) ?
                 ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Length : 20,
@@ -174,7 +174,7 @@
 
         AcpiTbCleanupTableHeader (&LocalHeader, Header);
 
-        ACPI_INFO ((AE_INFO,
+        ACPI_INFO ((
             "%-4.4s 0x%8.8X%8.8X"
             " %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)",
             LocalHeader.Signature, ACPI_FORMAT_UINT64 (Address),
--- a/sys/external/bsd/acpica/dist/tools/acpibin/abcompare.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/tools/acpibin/abcompare.c	Wed May 04 18:15:53 2016 +0000
@@ -91,7 +91,7 @@
     ACPI_TABLE_HEADER       *Header)
 {
 
-    if (!AcpiUtValidAcpiName (Header->Signature))
+    if (!AcpiUtValidNameseg (Header->Signature))
     {
         printf ("Header signature is invalid\n");
         return (FALSE);
--- a/sys/external/bsd/acpica/dist/tools/acpidump/apdump.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/tools/acpidump/apdump.c	Wed May 04 18:15:53 2016 +0000
@@ -74,7 +74,7 @@
     {
         /* Make sure signature is all ASCII and a valid ACPI name */
 
-        if (!AcpiUtValidAcpiName (Table->Signature))
+        if (!AcpiUtValidNameseg (Table->Signature))
         {
             AcpiLogError ("Table signature (0x%8.8X) is invalid\n",
                 *(UINT32 *) Table->Signature);
@@ -326,7 +326,8 @@
 
     /* Convert argument to an integer physical address */
 
-    Status = AcpiUtStrtoul64 (AsciiAddress, 0, &LongAddress);
+    Status = AcpiUtStrtoul64 (AsciiAddress, ACPI_ANY_BASE,
+        ACPI_MAX64_BYTE_WIDTH, &LongAddress);
     if (ACPI_FAILURE (Status))
     {
         AcpiLogError ("%s: Could not convert to a physical address\n",
@@ -464,6 +465,13 @@
         return (-1);
     }
 
+    if (!AcpiUtValidNameseg (Table->Signature))
+    {
+        AcpiLogError (
+            "No valid ACPI signature was found in input file %s\n",
+            Pathname);
+    }
+
     /* File must be at least as long as the table length */
 
     if (Table->Length > FileSize)
--- a/sys/external/bsd/acpica/dist/tools/acpidump/apmain.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/tools/acpidump/apmain.c	Wed May 04 18:15:53 2016 +0000
@@ -237,7 +237,8 @@
 
     case 'r':   /* Dump tables from specified RSDP */
 
-        Status = AcpiUtStrtoul64 (AcpiGbl_Optarg, 0, &Gbl_RsdpBase);
+        Status = AcpiUtStrtoul64 (AcpiGbl_Optarg, ACPI_ANY_BASE,
+            ACPI_MAX64_BYTE_WIDTH, &Gbl_RsdpBase);
         if (ACPI_FAILURE (Status))
         {
             AcpiLogError ("%s: Could not convert to a physical address\n",
--- a/sys/external/bsd/acpica/dist/tools/acpiexec/aeinitfile.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/tools/acpiexec/aeinitfile.c	Wed May 04 18:15:53 2016 +0000
@@ -202,7 +202,8 @@
 
     /* Extract the 64-bit integer */
 
-    Status = AcpiUtStrtoul64 (ValueString, 0, &Value);
+    Status = AcpiUtStrtoul64 (ValueString, ACPI_ANY_BASE,
+        ACPI_MAX64_BYTE_WIDTH, &Value);
     if (ACPI_FAILURE (Status))
     {
         AcpiOsPrintf ("%s %s\n", ValueString,
--- a/sys/external/bsd/acpica/dist/tools/acpiexec/aemain.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/tools/acpiexec/aemain.c	Wed May 04 18:15:53 2016 +0000
@@ -468,7 +468,6 @@
 
     /* Init ACPICA and start debugger thread */
 
-    AcpiGbl_OverrideDefaultRegionHandlers = TRUE;
     Status = AcpiInitializeSubsystem ();
     ACPI_CHECK_OK (AcpiInitializeSubsystem, Status);
     if (ACPI_FAILURE (Status))
--- a/sys/external/bsd/acpica/dist/tools/acpihelp/ahamlops.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/tools/acpihelp/ahamlops.c	Wed May 04 18:15:53 2016 +0000
@@ -147,14 +147,14 @@
                                                                 "DefOpRegion := OpRegionOp NameString RegionSpace RegionOffset RegionLen"},
     {0x5B81, 0x5B81, "0x5B81",          "FieldOp",              "TermObject",   "NameString ByteData",                          "FieldList",
                                                                 "DefField := FieldOp PkgLength NameString FieldFlags FieldList"},
-    {0x5B82, 0x5B82, "0x5B82",          "DeviceOp",             "TermObject",   "NameString",                                   "ObjectList",
-                                                                "DefDevice := DeviceOp PkgLength NameString ObjectList"},
-    {0x5B83, 0x5B83, "0x5B83",          "ProcessorOp",          "TermObject",   "NameString ByteData DWordData ByteData",       "ObjectList",
-                                                                "DefProcessor := ProcessorOp PkgLength NameString ProcId PblkAddr PblkLen ObjectList"},
-    {0x5B84, 0x5B84, "0x5B84",          "PowerResOp",           "TermObject",   "NameString ByteData WordData",                 "ObjectList",
-                                                                "DefPowerRes := PowerResOp PkgLength NameString SystemLevel ResourceOrder ObjectList"},
-    {0x5B85, 0x5B85, "0x5B85",          "ThermalZoneOp",        "TermObject",   "NameString",                                   "ObjectList",
-                                                                "DefThermalZone := ThermalZoneOp PkgLength NameString ObjectList"},
+    {0x5B82, 0x5B82, "0x5B82",          "DeviceOp",             "TermObject",   "NameString",                                   "TermList",
+                                                                "DefDevice := DeviceOp PkgLength NameString TermList"},
+    {0x5B83, 0x5B83, "0x5B83",          "ProcessorOp",          "TermObject",   "NameString ByteData DWordData ByteData",       "TermList",
+                                                                "DefProcessor := ProcessorOp PkgLength NameString ProcId PblkAddr PblkLen TermList"},
+    {0x5B84, 0x5B84, "0x5B84",          "PowerResOp",           "TermObject",   "NameString ByteData WordData",                 "TermList",
+                                                                "DefPowerRes := PowerResOp PkgLength NameString SystemLevel ResourceOrder TermList"},
+    {0x5B85, 0x5B85, "0x5B85",          "ThermalZoneOp",        "TermObject",   "NameString",                                   "TermList",
+                                                                "DefThermalZone := ThermalZoneOp PkgLength NameString TermList"},
     {0x5B86, 0x5B86, "0x5B86",          "IndexFieldOp",         "TermObject",   "NameString NameString ByteData",               "FieldList",
                                                                 "DefIndexField := IndexFieldOp PkgLength NameString NameString FieldFlags FieldList"},
     {0x5B87, 0x5B87, "0x5B87",          "BankFieldOp",          "TermObject",   "NameString NameString TermArg ByteData",       "FieldList",
--- a/sys/external/bsd/acpica/dist/tools/acpihelp/ahaslops.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/tools/acpihelp/ahaslops.c	Wed May 04 18:15:53 2016 +0000
@@ -112,7 +112,7 @@
                                 "Declare a Definition Block"},
     {"DerefOf",                 "(Source) => Object",
                                 "Dereference an object reference"},
-    {"Device",                  "(DeviceName) {ObjectList}",
+    {"Device",                  "(DeviceName) {TermList}",
                                 "Declare a bus/device object"},
     {"Divide",                  "(Dividend, Divisor, Remainder, Result) => Integer",
                                 "Integer Divide"},
@@ -193,9 +193,9 @@
                                 "ResourceSourceIndex, ResourceTypeKeyword, DescriptorName, "
                                 "RawDataBuffer() {VendorData}) {PinList}",
                                 "GPIO I/O Connection Resource Descriptor Macro"},
-    {"I2cSerialBus",            "(SlaveAddress, SlaveModeKeyword, ConnectionSpeed, "
+    {"I2cSerialBusV2",           "(SlaveAddress, SlaveModeKeyword, ConnectionSpeed, "
                                 "AddressingModeKeyword, ResourceSource, "
-                                "ResourceSourceIndex, ResourceTypeKeyword, DescriptorName, "
+                                "ResourceSourceIndex, ResourceTypeKeyword, DescriptorName, Shared, "
                                 "RawDataBuffer() {VendorData})",
                                 "I2C Serial Bus Connection Resource Descriptor Macro"},
     {"If",                      "(Predicate) {TermList}",
@@ -295,9 +295,9 @@
                                 "Integer Bitwise Or"},
     {"Package",                 "(NumElements) {PackageList} => Package",
                                 "Declare a package object"},
-    {"PowerResource",           "(ResourceName, SystemLevel, ResourceOrder) {ObjectList}",
+    {"PowerResource",           "(ResourceName, SystemLevel, ResourceOrder) {TermList}",
                                 "Declare a power resource object"},
-    {"Processor",               "(ProcessorName, ProcessorID, PBlockAddress, PblockLength) {ObjectList}",
+    {"Processor",               "(ProcessorName, ProcessorID, PBlockAddress, PblockLength) {TermList}",
                                 "Declare a processor package"},
     {"QWordIo",                 "(ResourceTypeKeyword, MinKeyword, MaxKeyword, DecodeKeyword, "
                                 "RangeTypeKeyword, AddressGranularity, "
@@ -335,7 +335,7 @@
                                 "Return from method execution"},
     {"Revision",                "=> Integer",
                                 "Constant revision object"},
-    {"Scope",                   "(Location) {ObjectList}",
+    {"Scope",                   "(Location) {TermList}",
                                 "Open named scope "},
     {"ShiftLeft",               "(Source, ShiftCount, Result) => Integer",
                                 "Integer shift value left"},
@@ -347,11 +347,11 @@
                                 "Get the size of a buffer}, string}, or package"},
     {"Sleep",                   "(Milliseconds)",
                                 "Sleep n milliseconds (yields the processor)"},
-    {"SpiSerialBus",            "(DeviceSelection, PolarityKeyword, WireModeKeyword, "
+    {"SpiSerialBusV2",          "(DeviceSelection, PolarityKeyword, WireModeKeyword, "
                                 "DataBitLength, SlaveModeKeyword, "
                                 "ConnectionSpeed, ClockPolarityKeyword, ClockPhaseKeyword, "
                                 "ResourceSource, ResourceSourceIndex, "
-                                "ResourceTypeKeyword, DescriptorName, RawDataBuffer() {VendorData})",
+                                "ResourceTypeKeyword, DescriptorName, Shared, RawDataBuffer() {VendorData})",
                                 "SPI Serial Bus Connection Resource Descriptor Macro"},
     {"Stall",                   "(Microseconds)",
                                 "Delay n microseconds (does not yield the processor)"},
@@ -365,7 +365,7 @@
                                 "Integer Subtract"},
     {"Switch",                  "(Expression) {CaseTermList}",
                                 "Select code to execute based on expression value"},
-    {"ThermalZone",             "(ThermalZoneName) {ObjectList}",
+    {"ThermalZone",             "(ThermalZoneName) {TermList}",
                                 "Declare a thermal zone package"},
     {"Timer",                   "=> Integer",
                                 "Get 64-bit timer value"},
@@ -383,10 +383,10 @@
                                 "Copy ASCII string from buffer"},
     {"ToUuid",                  "(AsciiString) => Buffer",
                                 "Convert Ascii string to UUID"},
-    {"UartSerialBus",           "(ConnectionSpeed, ByteLengthKeyword, StopBitsKeyword, "
+    {"UartSerialBusV2",         "(ConnectionSpeed, ByteLengthKeyword, StopBitsKeyword, "
                                 "LinesInUse, EndianKeyword, ParityKeyword, "
                                 "FlowControlKeyword, ReceiveBufferSize, TransmitBufferSize, ResourceSource, "
-                                "ResourceSourceIndex, ResourceTypeKeyword, DescriptorName, "
+                                "ResourceSourceIndex, ResourceTypeKeyword, DescriptorName, Shared, "
                                 "RawDataBuffer() {VendorData})",
                                 "UART Serial Bus Connection Resource Descriptor Macro"},
     {"Unicode",                 "(String) => Buffer",
--- a/sys/external/bsd/acpica/dist/tools/acpisrc/asfile.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/tools/acpisrc/asfile.c	Wed May 04 18:15:53 2016 +0000
@@ -575,6 +575,7 @@
 
     if (AsGetFile (Pathname, &Gbl_FileBuffer, &Gbl_FileSize))
     {
+        free (Pathname);
         return (-1);
     }
 
@@ -758,7 +759,7 @@
     {
         printf ("Could not read the input file %s (%u bytes)\n",
             Filename, Size);
-        goto ErrorExit;
+        goto ErrorFree;
     }
 
     Buffer [Size] = 0;         /* Null terminate the buffer */
@@ -778,6 +779,8 @@
     *FileSize = Size;
     return (0);
 
+ErrorFree:
+    free (Buffer);
 
 ErrorExit:
 
--- a/sys/external/bsd/acpica/dist/tools/acpisrc/astable.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/tools/acpisrc/astable.c	Wed May 04 18:15:53 2016 +0000
@@ -501,6 +501,7 @@
     {"ASL_RESOURCE_INFO",                   SRC_TYPE_STRUCT},
     {"ASL_RESOURCE_NODE",                   SRC_TYPE_STRUCT},
     {"ASL_WALK_CALLBACK",                   SRC_TYPE_SIMPLE},
+    {"ASL_XREF_INFO",                       SRC_TYPE_STRUCT},
     {"UINT64_OVERLAY",                      SRC_TYPE_UNION},
     {"UINT64_STRUCT",                       SRC_TYPE_STRUCT},
 
@@ -590,7 +591,8 @@
     {"ACPI_ERST_INFO",                      SRC_TYPE_STRUCT},
     {"ACPI_FPDT_HEADER",                    SRC_TYPE_STRUCT},
     {"ACPI_FPDT_BOOT",                      SRC_TYPE_STRUCT},
-    {"ACPI_FPDT_S3PT_PTR",                  SRC_TYPE_STRUCT},
+    {"ACPI_FPDT_BOOT_POINTER",              SRC_TYPE_STRUCT},
+    {"ACPI_FPDT_S3PT_POINTER",              SRC_TYPE_STRUCT},
     {"ACPI_GTDT_HEADER",                    SRC_TYPE_STRUCT},
     {"ACPI_GTDT_TIMER_BLOCK",               SRC_TYPE_STRUCT},
     {"ACPI_GTDT_TIMER_ENTRY",               SRC_TYPE_STRUCT},
@@ -606,8 +608,10 @@
     {"ACPI_HEST_AER",                       SRC_TYPE_STRUCT},
     {"ACPI_HEST_AER_BRIDGE",                SRC_TYPE_STRUCT},
     {"ACPI_HEST_GENERIC",                   SRC_TYPE_STRUCT},
+    {"ACPI_HEST_GENERIC_V2",                SRC_TYPE_STRUCT},
     {"ACPI_HEST_GENERIC_STATUS",            SRC_TYPE_STRUCT},
     {"ACPI_HEST_GENERIC_DATA",              SRC_TYPE_STRUCT},
+    {"ACPI_HEST_GENERIC_DATA_V300",         SRC_TYPE_STRUCT},
     {"ACPI_IBFT_HEADER",                    SRC_TYPE_STRUCT},
     {"ACPI_IBFT_CONTROL",                   SRC_TYPE_STRUCT},
     {"ACPI_IBFT_INITIATOR",                 SRC_TYPE_STRUCT},
@@ -620,6 +624,7 @@
     {"ACPI_IORT_NODE",                      SRC_TYPE_STRUCT},
     {"ACPI_IORT_ROOT_COMPLEX",              SRC_TYPE_STRUCT},
     {"ACPI_IORT_SMMU",                      SRC_TYPE_STRUCT},
+    {"ACPI_IORT_SMMU_V3",                   SRC_TYPE_STRUCT},
     {"ACPI_IVRS_HEADER",                    SRC_TYPE_STRUCT},
     {"ACPI_IVRS_HARDWARE",                  SRC_TYPE_STRUCT},
     {"ACPI_IVRS_DE_HEADER",                 SRC_TYPE_STRUCT},
@@ -662,6 +667,7 @@
     {"ACPI_NFIT_DATA_REGION",               SRC_TYPE_STRUCT},
     {"ACPI_NFIT_FLUSH_ADDRESS",             SRC_TYPE_STRUCT},
     {"ACPI_PCCT_HW_REDUCED",                SRC_TYPE_STRUCT},
+    {"ACPI_PCCT_HW_REDUCED_TYPE2",          SRC_TYPE_STRUCT},
     {"ACPI_PCCT_SHARED_MEMORY",             SRC_TYPE_STRUCT},
     {"ACPI_PCCT_SUBSPACE",                  SRC_TYPE_STRUCT},
     {"ACPI_RSDP_COMMON",                    SRC_TYPE_STRUCT},
--- a/sys/external/bsd/acpica/dist/tools/examples/examples.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/tools/examples/examples.c	Wed May 04 18:15:53 2016 +0000
@@ -149,7 +149,7 @@
 
     /* Example warning and error output */
 
-    ACPI_INFO        ((AE_INFO, "Example ACPICA info message"));
+    ACPI_INFO        (("Example ACPICA info message"));
     ACPI_WARNING     ((AE_INFO, "Example ACPICA warning message"));
     ACPI_ERROR       ((AE_INFO, "Example ACPICA error message"));
     ACPI_EXCEPTION   ((AE_INFO, AE_AML_OPERAND_TYPE,
@@ -176,7 +176,6 @@
 
     /* Initialize the ACPICA subsystem */
 
-    AcpiGbl_OverrideDefaultRegionHandlers = TRUE;
     Status = AcpiInitializeSubsystem ();
     if (ACPI_FAILURE (Status))
     {
@@ -186,7 +185,7 @@
 
     /* Initialize the ACPICA Table Manager and get all ACPI tables */
 
-    ACPI_INFO ((AE_INFO, "Loading ACPI tables"));
+    ACPI_INFO (("Loading ACPI tables"));
 
     Status = AcpiInitializeTables (NULL, 16, FALSE);
     if (ACPI_FAILURE (Status))
@@ -284,7 +283,6 @@
 
     /* Initialize the ACPICA subsystem */
 
-    AcpiGbl_OverrideDefaultRegionHandlers = TRUE;
     Status = AcpiInitializeSubsystem ();
     if (ACPI_FAILURE (Status))
     {
@@ -349,7 +347,7 @@
     void                        *Context)
 {
 
-    ACPI_INFO ((AE_INFO, "Received a notify 0x%X", Value));
+    ACPI_INFO (("Received a notify 0x%X", Value));
 }
 
 
@@ -384,7 +382,7 @@
     void                        *RegionContext)
 {
 
-    ACPI_INFO ((AE_INFO, "Received a region access"));
+    ACPI_INFO (("Received a region access"));
 
     return (AE_OK);
 }
@@ -444,7 +442,7 @@
     ACPI_OBJECT             *Object;
 
 
-    ACPI_INFO ((AE_INFO, "Executing _OSI reserved method"));
+    ACPI_INFO (("Executing _OSI reserved method"));
 
     /* Setup input argument */
 
@@ -483,7 +481,7 @@
         AcpiOsPrintf ("Invalid return type from _OSI, %.2X\n", Object->Type);
     }
 
-    ACPI_INFO ((AE_INFO, "_OSI returned 0x%8.8X",
+    ACPI_INFO (("_OSI returned 0x%8.8X",
         (UINT32) Object->Integer.Value));
 
 
@@ -511,7 +509,7 @@
     ACPI_OBJECT             *Object;
 
 
-    ACPI_INFO ((AE_INFO, "Executing MAIN method"));
+    ACPI_INFO (("Executing MAIN method"));
 
     /* Setup input argument */
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/acpica/dist/utilities/utascii.c	Wed May 04 18:15:53 2016 +0000
@@ -0,0 +1,161 @@
+/******************************************************************************
+ *
+ * Module Name: utascii - Utility ascii functions
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2016, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ *    of any contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include "acpi.h"
+#include "accommon.h"
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtValidNameseg
+ *
+ * PARAMETERS:  Name            - The name or table signature to be examined.
+ *                                Four characters, does not have to be a
+ *                                NULL terminated string.
+ *
+ * RETURN:      TRUE if signature is has 4 valid ACPI characters
+ *
+ * DESCRIPTION: Validate an ACPI table signature.
+ *
+ ******************************************************************************/
+
+BOOLEAN
+AcpiUtValidNameseg (
+    char                    *Name)
+{
+    UINT32                  i;
+
+
+    /* Validate each character in the signature */
+
+    for (i = 0; i < ACPI_NAME_SIZE; i++)
+    {
+        if (!AcpiUtValidNameChar (Name[i], i))
+        {
+            return (FALSE);
+        }
+    }
+
+    return (TRUE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtValidNameChar
+ *
+ * PARAMETERS:  Char            - The character to be examined
+ *              Position        - Byte position (0-3)
+ *
+ * RETURN:      TRUE if the character is valid, FALSE otherwise
+ *
+ * DESCRIPTION: Check for a valid ACPI character. Must be one of:
+ *              1) Upper case alpha
+ *              2) numeric
+ *              3) underscore
+ *
+ *              We allow a '!' as the last character because of the ASF! table
+ *
+ ******************************************************************************/
+
+BOOLEAN
+AcpiUtValidNameChar (
+    char                    Character,
+    UINT32                  Position)
+{
+
+    if (!((Character >= 'A' && Character <= 'Z') ||
+          (Character >= '0' && Character <= '9') ||
+          (Character == '_')))
+    {
+        /* Allow a '!' in the last position */
+
+        if (Character == '!' && Position == 3)
+        {
+            return (TRUE);
+        }
+
+        return (FALSE);
+    }
+
+    return (TRUE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtCheckAndRepairAscii
+ *
+ * PARAMETERS:  Name                - Ascii string
+ *              Count               - Number of characters to check
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Ensure that the requested number of characters are printable
+ *              Ascii characters. Sets non-printable and null chars to <space>.
+ *
+ ******************************************************************************/
+
+void
+AcpiUtCheckAndRepairAscii (
+    UINT8                   *Name,
+    char                    *RepairedName,
+    UINT32                  Count)
+{
+    UINT32                  i;
+
+
+    for (i = 0; i < Count; i++)
+    {
+        RepairedName[i] = (char) Name[i];
+
+        if (!Name[i])
+        {
+            return;
+        }
+        if (!isprint (Name[i]))
+        {
+            RepairedName[i] = ' ';
+        }
+    }
+}
--- a/sys/external/bsd/acpica/dist/utilities/utnonansi.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/utilities/utnonansi.c	Wed May 04 18:15:53 2016 +0000
@@ -164,219 +164,6 @@
 }
 
 
-/*******************************************************************************
- *
- * FUNCTION:    AcpiUtStrtoul64
- *
- * PARAMETERS:  String          - Null terminated string
- *              Base            - Radix of the string: 16 or ACPI_ANY_BASE;
- *                                ACPI_ANY_BASE means 'in behalf of ToInteger'
- *              RetInteger      - Where the converted integer is returned
- *
- * RETURN:      Status and Converted value
- *
- * DESCRIPTION: Convert a string into an unsigned value. Performs either a
- *              32-bit or 64-bit conversion, depending on the current mode
- *              of the interpreter.
- *
- * NOTE:        Does not support Octal strings, not needed.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiUtStrtoul64 (
-    char                    *String,
-    UINT32                  Base,
-    UINT64                  *RetInteger)
-{
-    UINT32                  ThisDigit = 0;
-    UINT64                  ReturnValue = 0;
-    UINT64                  Quotient;
-    UINT64                  Dividend;
-    UINT32                  ToIntegerOp = (Base == ACPI_ANY_BASE);
-    UINT32                  Mode32 = (AcpiGbl_IntegerByteWidth == 4);
-    UINT8                   ValidDigits = 0;
-    UINT8                   SignOf0x = 0;
-    UINT8                   Term = 0;
-
-
-    ACPI_FUNCTION_TRACE_STR (UtStroul64, String);
-
-
-    switch (Base)
-    {
-    case ACPI_ANY_BASE:
-    case 16:
-
-        break;
-
-    default:
-
-        /* Invalid Base */
-
-        return_ACPI_STATUS (AE_BAD_PARAMETER);
-    }
-
-    if (!String)
-    {
-        goto ErrorExit;
-    }
-
-    /* Skip over any white space in the buffer */
-
-    while ((*String) && (isspace ((int) *String) || *String == '\t'))
-    {
-        String++;
-    }
-
-    if (ToIntegerOp)
-    {
-        /*
-         * Base equal to ACPI_ANY_BASE means 'ToInteger operation case'.
-         * We need to determine if it is decimal or hexadecimal.
-         */
-        if ((*String == '0') && (tolower ((int) *(String + 1)) == 'x'))
-        {
-            SignOf0x = 1;
-            Base = 16;
-
-            /* Skip over the leading '0x' */
-            String += 2;
-        }
-        else
-        {
-            Base = 10;
-        }
-    }
-
-    /* Any string left? Check that '0x' is not followed by white space. */
-
-    if (!(*String) || isspace ((int) *String) || *String == '\t')
-    {
-        if (ToIntegerOp)
-        {
-            goto ErrorExit;
-        }
-        else
-        {
-            goto AllDone;
-        }
-    }
-
-    /*
-     * Perform a 32-bit or 64-bit conversion, depending upon the current
-     * execution mode of the interpreter
-     */
-    Dividend = (Mode32) ? ACPI_UINT32_MAX : ACPI_UINT64_MAX;
-
-    /* Main loop: convert the string to a 32- or 64-bit integer */
-
-    while (*String)
-    {
-        if (isdigit ((int) *String))
-        {
-            /* Convert ASCII 0-9 to Decimal value */
-
-            ThisDigit = ((UINT8) *String) - '0';
-        }
-        else if (Base == 10)
-        {
-            /* Digit is out of range; possible in ToInteger case only */
-
-            Term = 1;
-        }
-        else
-        {
-            ThisDigit = (UINT8) toupper ((int) *String);
-            if (isxdigit ((int) ThisDigit))
-            {
-                /* Convert ASCII Hex char to value */
-
-                ThisDigit = ThisDigit - 'A' + 10;
-            }
-            else
-            {
-                Term = 1;
-            }
-        }
-
-        if (Term)
-        {
-            if (ToIntegerOp)
-            {
-                goto ErrorExit;
-            }
-            else
-            {
-                break;
-            }
-        }
-        else if ((ValidDigits == 0) && (ThisDigit == 0) && !SignOf0x)
-        {
-            /* Skip zeros */
-            String++;
-            continue;
-        }
-
-        ValidDigits++;
-
-        if (SignOf0x && ((ValidDigits > 16) || ((ValidDigits > 8) && Mode32)))
-        {
-            /*
-             * This is ToInteger operation case.
-             * No any restrictions for string-to-integer conversion,
-             * see ACPI spec.
-             */
-            goto ErrorExit;
-        }
-
-        /* Divide the digit into the correct position */
-
-        (void) AcpiUtShortDivide (
-            (Dividend - (UINT64) ThisDigit), Base, &Quotient, NULL);
-
-        if (ReturnValue > Quotient)
-        {
-            if (ToIntegerOp)
-            {
-                goto ErrorExit;
-            }
-            else
-            {
-                break;
-            }
-        }
-
-        ReturnValue *= Base;
-        ReturnValue += ThisDigit;
-        String++;
-    }
-
-    /* All done, normal exit */
-
-AllDone:
-
-    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Converted value: %8.8X%8.8X\n",
-        ACPI_FORMAT_UINT64 (ReturnValue)));
-
-    *RetInteger = ReturnValue;
-    return_ACPI_STATUS (AE_OK);
-
-
-ErrorExit:
-    /* Base was set/validated above */
-
-    if (Base == 10)
-    {
-        return_ACPI_STATUS (AE_BAD_DECIMAL_CONSTANT);
-    }
-    else
-    {
-        return_ACPI_STATUS (AE_BAD_HEX_CONSTANT);
-    }
-}
-
-
 #if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
 /*******************************************************************************
  *
@@ -451,3 +238,430 @@
     return (FALSE);
 }
 #endif
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtStrtoul64
+ *
+ * PARAMETERS:  String                  - Null terminated string
+ *              Base                    - Radix of the string: 16 or 10 or
+ *                                        ACPI_ANY_BASE
+ *              MaxIntegerByteWidth     - Maximum allowable integer,in bytes:
+ *                                        4 or 8 (32 or 64 bits)
+ *              RetInteger              - Where the converted integer is
+ *                                        returned
+ *
+ * RETURN:      Status and Converted value
+ *
+ * DESCRIPTION: Convert a string into an unsigned value. Performs either a
+ *              32-bit or 64-bit conversion, depending on the input integer
+ *              size (often the current mode of the interpreter).
+ *
+ * NOTES:       Negative numbers are not supported, as they are not supported
+ *              by ACPI.
+ *
+ *              AcpiGbl_IntegerByteWidth should be set to the proper width.
+ *              For the core ACPICA code, this width depends on the DSDT
+ *              version. For iASL, the default byte width is always 8 for the
+ *              parser, but error checking is performed later to flag cases
+ *              where a 64-bit constant is defined in a 32-bit DSDT/SSDT.
+ *
+ *              Does not support Octal strings, not needed at this time.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtStrtoul64 (
+    char                    *String,
+    UINT32                  Base,
+    UINT32                  MaxIntegerByteWidth,
+    UINT64                  *RetInteger)
+{
+    UINT32                  ThisDigit = 0;
+    UINT64                  ReturnValue = 0;
+    UINT64                  Quotient;
+    UINT64                  Dividend;
+    UINT8                   ValidDigits = 0;
+    UINT8                   SignOf0x = 0;
+    UINT8                   Term = 0;
+
+
+    ACPI_FUNCTION_TRACE_STR (UtStrtoul64, String);
+
+
+    switch (Base)
+    {
+    case ACPI_ANY_BASE:
+    case 10:
+    case 16:
+
+        break;
+
+    default:
+
+        /* Invalid Base */
+
+        return_ACPI_STATUS (AE_BAD_PARAMETER);
+    }
+
+    if (!String)
+    {
+        goto ErrorExit;
+    }
+
+    /* Skip over any white space in the buffer */
+
+    while ((*String) && (isspace ((int) *String) || *String == '\t'))
+    {
+        String++;
+    }
+
+    if (Base == ACPI_ANY_BASE)
+    {
+        /*
+         * Base equal to ACPI_ANY_BASE means 'Either decimal or hex'.
+         * We need to determine if it is decimal or hexadecimal.
+         */
+        if ((*String == '0') && (tolower ((int) *(String + 1)) == 'x'))
+        {
+            SignOf0x = 1;
+            Base = 16;
+
+            /* Skip over the leading '0x' */
+            String += 2;
+        }
+        else
+        {
+            Base = 10;
+        }
+    }
+
+    /* Any string left? Check that '0x' is not followed by white space. */
+
+    if (!(*String) || isspace ((int) *String) || *String == '\t')
+    {
+        if (Base == ACPI_ANY_BASE)
+        {
+            goto ErrorExit;
+        }
+        else
+        {
+            goto AllDone;
+        }
+    }
+
+    /*
+     * Perform a 32-bit or 64-bit conversion, depending upon the input
+     * byte width
+     */
+    Dividend = (MaxIntegerByteWidth <= ACPI_MAX32_BYTE_WIDTH) ?
+        ACPI_UINT32_MAX : ACPI_UINT64_MAX;
+
+    /* Main loop: convert the string to a 32- or 64-bit integer */
+
+    while (*String)
+    {
+        if (isdigit ((int) *String))
+        {
+            /* Convert ASCII 0-9 to Decimal value */
+
+            ThisDigit = ((UINT8) *String) - '0';
+        }
+        else if (Base == 10)
+        {
+            /* Digit is out of range; possible in ToInteger case only */
+
+            Term = 1;
+        }
+        else
+        {
+            ThisDigit = (UINT8) toupper ((int) *String);
+            if (isxdigit ((int) ThisDigit))
+            {
+                /* Convert ASCII Hex char to value */
+
+                ThisDigit = ThisDigit - 'A' + 10;
+            }
+            else
+            {
+                Term = 1;
+            }
+        }
+
+        if (Term)
+        {
+            if (Base == ACPI_ANY_BASE)
+            {
+                goto ErrorExit;
+            }
+            else
+            {
+                break;
+            }
+        }
+        else if ((ValidDigits == 0) && (ThisDigit == 0) && !SignOf0x)
+        {
+            /* Skip zeros */
+            String++;
+            continue;
+        }
+
+        ValidDigits++;
+
+        if (SignOf0x && ((ValidDigits > 16) ||
+            ((ValidDigits > 8) && (MaxIntegerByteWidth <= ACPI_MAX32_BYTE_WIDTH))))
+        {
+            /*
+             * This is ToInteger operation case.
+             * No restrictions for string-to-integer conversion,
+             * see ACPI spec.
+             */
+            goto ErrorExit;
+        }
+
+        /* Divide the digit into the correct position */
+
+        (void) AcpiUtShortDivide (
+            (Dividend - (UINT64) ThisDigit), Base, &Quotient, NULL);
+
+        if (ReturnValue > Quotient)
+        {
+            if (Base == ACPI_ANY_BASE)
+            {
+                goto ErrorExit;
+            }
+            else
+            {
+                break;
+            }
+        }
+
+        ReturnValue *= Base;
+        ReturnValue += ThisDigit;
+        String++;
+    }
+
+    /* All done, normal exit */
+
+AllDone:
+
+    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Converted value: %8.8X%8.8X\n",
+        ACPI_FORMAT_UINT64 (ReturnValue)));
+
+    *RetInteger = ReturnValue;
+    return_ACPI_STATUS (AE_OK);
+
+
+ErrorExit:
+
+    /* Base was set/validated above (10 or 16) */
+
+    if (Base == 10)
+    {
+        return_ACPI_STATUS (AE_BAD_DECIMAL_CONSTANT);
+    }
+    else
+    {
+        return_ACPI_STATUS (AE_BAD_HEX_CONSTANT);
+    }
+}
+
+
+#ifdef _OBSOLETE_FUNCTIONS
+/* Removed: 01/2016 */
+
+/*******************************************************************************
+ *
+ * FUNCTION:    strtoul64
+ *
+ * PARAMETERS:  String              - Null terminated string
+ *              Terminater          - Where a pointer to the terminating byte
+ *                                    is returned
+ *              Base                - Radix of the string
+ *
+ * RETURN:      Converted value
+ *
+ * DESCRIPTION: Convert a string into an unsigned value.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+strtoul64 (
+    char                    *String,
+    UINT32                  Base,
+    UINT64                  *RetInteger)
+{
+    UINT32                  Index;
+    UINT32                  Sign;
+    UINT64                  ReturnValue = 0;
+    ACPI_STATUS             Status = AE_OK;
+
+
+    *RetInteger = 0;
+
+    switch (Base)
+    {
+    case 0:
+    case 8:
+    case 10:
+    case 16:
+
+        break;
+
+    default:
+        /*
+         * The specified Base parameter is not in the domain of
+         * this function:
+         */
+        return (AE_BAD_PARAMETER);
+    }
+
+    /* Skip over any white space in the buffer: */
+
+    while (isspace ((int) *String) || *String == '\t')
+    {
+        ++String;
+    }
+
+    /*
+     * The buffer may contain an optional plus or minus sign.
+     * If it does, then skip over it but remember what is was:
+     */
+    if (*String == '-')
+    {
+        Sign = ACPI_SIGN_NEGATIVE;
+        ++String;
+    }
+    else if (*String == '+')
+    {
+        ++String;
+        Sign = ACPI_SIGN_POSITIVE;
+    }
+    else
+    {
+        Sign = ACPI_SIGN_POSITIVE;
+    }
+
+    /*
+     * If the input parameter Base is zero, then we need to
+     * determine if it is octal, decimal, or hexadecimal:
+     */
+    if (Base == 0)
+    {
+        if (*String == '0')
+        {
+            if (tolower ((int) *(++String)) == 'x')
+            {
+                Base = 16;
+                ++String;
+            }
+            else
+            {
+                Base = 8;
+            }
+        }
+        else
+        {
+            Base = 10;
+        }
+    }
+
+    /*
+     * For octal and hexadecimal bases, skip over the leading
+     * 0 or 0x, if they are present.
+     */
+    if (Base == 8 && *String == '0')
+    {
+        String++;
+    }
+
+    if (Base == 16 &&
+        *String == '0' &&
+        tolower ((int) *(++String)) == 'x')
+    {
+        String++;
+    }
+
+    /* Main loop: convert the string to an unsigned long */
+
+    while (*String)
+    {
+        if (isdigit ((int) *String))
+        {
+            Index = ((UINT8) *String) - '0';
+        }
+        else
+        {
+            Index = (UINT8) toupper ((int) *String);
+            if (isupper ((int) Index))
+            {
+                Index = Index - 'A' + 10;
+            }
+            else
+            {
+                goto ErrorExit;
+            }
+        }
+
+        if (Index >= Base)
+        {
+            goto ErrorExit;
+        }
+
+        /* Check to see if value is out of range: */
+
+        if (ReturnValue > ((ACPI_UINT64_MAX - (UINT64) Index) /
+            (UINT64) Base))
+        {
+            goto ErrorExit;
+        }
+        else
+        {
+            ReturnValue *= Base;
+            ReturnValue += Index;
+        }
+
+        ++String;
+    }
+
+
+    /* If a minus sign was present, then "the conversion is negated": */
+
+    if (Sign == ACPI_SIGN_NEGATIVE)
+    {
+        ReturnValue = (ACPI_UINT32_MAX - ReturnValue) + 1;
+    }
+
+    *RetInteger = ReturnValue;
+    return (Status);
+
+
+ErrorExit:
+    switch (Base)
+    {
+    case 8:
+
+        Status = AE_BAD_OCTAL_CONSTANT;
+        break;
+
+    case 10:
+
+        Status = AE_BAD_DECIMAL_CONSTANT;
+        break;
+
+    case 16:
+
+        Status = AE_BAD_HEX_CONSTANT;
+        break;
+
+    default:
+
+        /* Base validated above */
+
+        break;
+    }
+
+    return (Status);
+}
+#endif
--- a/sys/external/bsd/acpica/dist/utilities/utprint.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/utilities/utprint.c	Wed May 04 18:15:53 2016 +0000
@@ -88,12 +88,6 @@
     BOOLEAN                 Upper);
 
 
-/* Module globals */
-
-static const char           AcpiGbl_LowerHexDigits[] = "0123456789abcdef";
-static const char           AcpiGbl_UpperHexDigits[] = "0123456789ABCDEF";
-
-
 /*******************************************************************************
  *
  * FUNCTION:    AcpiUtBoundStringLength
--- a/sys/external/bsd/acpica/dist/utilities/utstring.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/utilities/utstring.c	Wed May 04 18:15:53 2016 +0000
@@ -159,86 +159,6 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    AcpiUtValidAcpiChar
- *
- * PARAMETERS:  Char            - The character to be examined
- *              Position        - Byte position (0-3)
- *
- * RETURN:      TRUE if the character is valid, FALSE otherwise
- *
- * DESCRIPTION: Check for a valid ACPI character. Must be one of:
- *              1) Upper case alpha
- *              2) numeric
- *              3) underscore
- *
- *              We allow a '!' as the last character because of the ASF! table
- *
- ******************************************************************************/
-
-BOOLEAN
-AcpiUtValidAcpiChar (
-    char                    Character,
-    UINT32                  Position)
-{
-
-    if (!((Character >= 'A' && Character <= 'Z') ||
-          (Character >= '0' && Character <= '9') ||
-          (Character == '_')))
-    {
-        /* Allow a '!' in the last position */
-
-        if (Character == '!' && Position == 3)
-        {
-            return (TRUE);
-        }
-
-        return (FALSE);
-    }
-
-    return (TRUE);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiUtValidAcpiName
- *
- * PARAMETERS:  Name            - The name to be examined. Does not have to
- *                                be NULL terminated string.
- *
- * RETURN:      TRUE if the name is valid, FALSE otherwise
- *
- * DESCRIPTION: Check for a valid ACPI name. Each character must be one of:
- *              1) Upper case alpha
- *              2) numeric
- *              3) underscore
- *
- ******************************************************************************/
-
-BOOLEAN
-AcpiUtValidAcpiName (
-    char                    *Name)
-{
-    UINT32                  i;
-
-
-    ACPI_FUNCTION_ENTRY ();
-
-
-    for (i = 0; i < ACPI_NAME_SIZE; i++)
-    {
-        if (!AcpiUtValidAcpiChar (Name[i], i))
-        {
-            return (FALSE);
-        }
-    }
-
-    return (TRUE);
-}
-
-
-/*******************************************************************************
- *
  * FUNCTION:    AcpiUtRepairName
  *
  * PARAMETERS:  Name            - The ACPI name to be repaired
@@ -286,7 +206,7 @@
 
     for (i = 0; i < ACPI_NAME_SIZE; i++)
     {
-        if (AcpiUtValidAcpiChar (Name[i], i))
+        if (AcpiUtValidNameChar (Name[i], i))
         {
             continue;
         }
--- a/sys/external/bsd/acpica/dist/utilities/utxferror.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/utilities/utxferror.c	Wed May 04 18:15:53 2016 +0000
@@ -205,8 +205,6 @@
 
 void ACPI_INTERNAL_VAR_XFACE
 AcpiInfo (
-    const char              *ModuleName,
-    UINT32                  LineNumber,
     const char              *Format,
     ...)
 {
--- a/sys/external/bsd/acpica/dist/utilities/utxfinit.c	Wed May 04 17:17:00 2016 +0000
+++ b/sys/external/bsd/acpica/dist/utilities/utxfinit.c	Wed May 04 18:15:53 2016 +0000
@@ -132,25 +132,6 @@
         return_ACPI_STATUS (Status);
     }
 
-    if (!AcpiGbl_OverrideDefaultRegionHandlers)
-    {
-        /*
-         * Install the default operation region handlers. These are the
-         * handlers that are defined by the ACPI specification to be
-         * "always accessible" -- namely, SystemMemory, SystemIO, and
-         * PCI_Config. This also means that no _REG methods need to be
-         * run for these address spaces. We need to have these handlers
-         * installed before any AML code can be executed, especially any
-         * module-level code (11/2015).
-         */
-        Status = AcpiEvInstallRegionHandlers ();
-        if (ACPI_FAILURE (Status))
-        {
-            ACPI_EXCEPTION ((AE_INFO, Status, "During Region initialization"));
-            return_ACPI_STATUS (Status);
-        }
-    }
-
     return_ACPI_STATUS (AE_OK);
 }
 
@@ -187,26 +168,6 @@
      */
     AcpiGbl_EarlyInitialization = FALSE;
 
-    if (AcpiGbl_OverrideDefaultRegionHandlers)
-    {
-        /*
-         * Install the default operation region handlers. These are the
-         * handlers that are defined by the ACPI specification to be
-         * "always accessible" -- namely, SystemMemory, SystemIO, and
-         * PCI_Config. This also means that no _REG methods need to be
-         * run for these address spaces. We need to have these handlers
-         * installed before any AML code can be executed, especially any
-         * module-level code (11/2015).
-         */
-        Status = AcpiEvInstallRegionHandlers ();
-        if (ACPI_FAILURE (Status))
-        {
-            ACPI_EXCEPTION ((AE_INFO, Status, "During Region initialization"));
-            return_ACPI_STATUS (Status);
-        }
-    }
-
-
 #if (!ACPI_REDUCED_HARDWARE)
 
     /* Enable ACPI mode */
@@ -312,25 +273,6 @@
     ACPI_FUNCTION_TRACE (AcpiInitializeObjects);
 
 
-    /*
-     * Run all _REG methods
-     *
-     * Note: Any objects accessed by the _REG methods will be automatically
-     * initialized, even if they contain executable AML (see the call to
-     * AcpiNsInitializeObjects below).
-     */
-    if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT))
-    {
-        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
-            "[Init] Executing _REG OpRegion methods\n"));
-
-        Status = AcpiEvInitializeOpRegions ();
-        if (ACPI_FAILURE (Status))
-        {
-            return_ACPI_STATUS (Status);
-        }
-    }
-
 #ifdef ACPI_EXEC_APP
     /*
      * This call implements the "initialization file" option for AcpiExec.
@@ -354,35 +296,30 @@
     if (AcpiGbl_GroupModuleLevelCode)
     {
         AcpiNsExecModuleCodeList ();
-    }
 
-    /*
-     * Initialize the objects that remain uninitialized. This runs the
-     * executable AML that may be part of the declaration of these objects:
-     * OperationRegions, BufferFields, Buffers, and Packages.
-     */
-    if (!(Flags & ACPI_NO_OBJECT_INIT))
-    {
-        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
-            "[Init] Completing Initialization of ACPI Objects\n"));
-
-        Status = AcpiNsInitializeObjects ();
-        if (ACPI_FAILURE (Status))
+        /*
+         * Initialize the objects that remain uninitialized. This
+         * runs the executable AML that may be part of the
+         * declaration of these objects:
+         * OperationRegions, BufferFields, Buffers, and Packages.
+         */
+        if (!(Flags & ACPI_NO_OBJECT_INIT))
         {
-            return_ACPI_STATUS (Status);
+            Status = AcpiNsInitializeObjects ();
+            if (ACPI_FAILURE (Status))
+            {
+                return_ACPI_STATUS (Status);
+            }
         }
     }
 
     /*
-     * Initialize all device objects in the namespace. This runs the device
-     * _STA and _INI methods.
+     * Initialize all device/region objects in the namespace. This runs
+     * the device _STA and _INI methods and region _REG methods.
      */
-    if (!(Flags & ACPI_NO_DEVICE_INIT))
+    if (!(Flags & (ACPI_NO_DEVICE_INIT | ACPI_NO_ADDRESS_SPACE_INIT)))
     {
-        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
-            "[Init] Initializing ACPI Devices\n"));
-
-        Status = AcpiNsInitializeDevices ();
+        Status = AcpiNsInitializeDevices (Flags);
         if (ACPI_FAILURE (Status))
         {
             return_ACPI_STATUS (Status);