---------------------------------------- trunk
authorchristos <christos@NetBSD.org>
Tue, 18 Aug 2015 09:53:33 +0000
branchtrunk
changeset 237198 b816d1d365c1
parent 237197 890fb68edb45
child 237199 d0c07bc9fff6
---------------------------------------- 17 July 2015. Summary of changes for version 20150717: 1) ACPICA kernel-resident subsystem: Improved the partitioning between the Debugger and Disassembler components. This allows the Debugger to be used standalone within kernel code without the Disassembler (which is used for single stepping also). This renames and moves one file, dmobject.c to dbobject.c. Lv Zheng. Debugger: Implemented a new command to trace the execution of control methods (Trace). This is especially useful for the in-kernel version of the debugger when file I/O may not be available for method trace output. See the ACPICA reference for more information. Lv Zheng. Moved all C library prototypes (used for the local versions of these functions when requested) to a new header, acclib.h Cleaned up the use of non-ANSI C library functions. These functions are implemented locally in ACPICA. Moved all such functions to a common source file, utnonansi.c Debugger: Fixed a problem with the "!!" command (get last command executed) where the debugger could enter an infinite loop and eventually crash. Removed the use of local macros that were used for some of the standard C library functions to automatically cast input parameters. This mostly affected the is* functions where the input parameter is defined to be an int. This required a few modifications to the main ACPICA source code to provide casting for these functions and eliminate possible compiler warnings for these parameters. Across the source code, added additional status/error checking to resolve issues discovered by static source code analysis tools such as Coverity. 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: 100.9K Code, 24.5K Data, 125.4K Total Debug Version: 197.8K Code, 81.5K Data, 279.3K Total Previous Release: Non-Debug Version: 100.6K Code, 27.6K Data, 128.2K Total Debug Version: 196.2K Code, 81.0K Data, 277.2K Total 2) iASL Compiler/Disassembler and Tools: iASL: Fixed a regression where the device map file feature no longer worked properly when used in conjunction with the disassembler. It only worked properly with the compiler itself. iASL: Implemented a new warning for method LocalX variables that are set but never used (similar to a C compiler such as gcc). This also applies to ArgX variables that are not defined by the parent method, and are instead (legally) used as local variables. iASL/Preprocessor: Finished the pass-through of line numbers from the preprocessor to the compiler. This ensures that compiler errors/warnings have the correct original line numbers and filenames, regardless of any #include files. iASL/Preprocessor: Fixed a couple of issues with comment handling and the pass-through of comments to the preprocessor output file (which becomes the compiler input file). Also fixed a problem with // comments that appear after a math expression. iASL: Added support for the TCPA server table to the table compiler and template generator. (The client table was already previously supported) iASL/Preprocessor: Added a permanent #define of the symbol "__IASL__" to identify the iASL compiler. Cleaned up the use of the macros NEGATIVE and POSITIVE which were defined multiple times. The new names are ACPI_SIGN_NEGATIVE and ACPI_SIGN_POSITIVE. AcpiHelp: Update to expand help messages for the iASL preprocessor directives. ---------------------------------------- 19 June 2015. Summary of changes for version 20150619: Two regressions in version 20150616 have been addressed: Fixes some problems/issues with the C library macro removal (ACPI_STRLEN, etc.) This update changes ACPICA to only use the standard headers for functions, or the prototypes for the local versions of the C library functions. Across the source code, this required some additional casts for some Clib invocations for portability. Moved all local prototypes to a new file, acclib.h Fixes several problems with recent changes to the handling of the FACS table that could cause some systems not to boot. ---------------------------------------- 16 June 2015. Summary of changes for version 20150616: 1) ACPICA kernel-resident subsystem: Across the entire ACPICA source code base, the various macros for the C library functions (such as ACPI_STRLEN, etc.) have been removed and replaced by the standard C library names (strlen, etc.) The original purpose for these macros is no longer applicable. This simplification reduces the number of macros used in the ACPICA source code significantly, improving readability and maintainability. Implemented support for a new ACPI table, the OSDT. This table, the "override" SDT, can be loaded directly by the host OS at boot time. It enables the replacement of existing namespace objects that were installed via the DSDT and/or SSDTs. The primary purpose for this is to replace buggy or incorrect ASL/AML code obtained via the BIOS. The OSDT is slated for inclusion in a future version of the ACPI Specification. Lv Zheng/Bob Moore. Added support for systems with (improperly) two FACS tables -- a "32-bit" table (via FADT 32-bit legacy field) and a "64-bit" table (via the 64-bit X field). This change will support both automatically. There continues to be systems found with this issue. This support requires a change to the AcpiSetFirmwareWakingVector interface. Also, a public global variable has been added to allow the host to select which FACS is desired (AcpiGbl_Use32BitFacsAddresses). See the ACPICA reference for more details Lv Zheng. Added a new feature to allow for systems that do not contain an FACS. Although this is already supported on hardware-reduced platforms, the feature has been extended for all platforms. The reasoning is that we do not want to abort the entire ACPICA initialization just because the system is seriously buggy and has no FACS. Fixed a problem where the GUID strings for NFIT tables (in acuuid.h) were not correctly transcribed from the ACPI specification in ACPICA version 20150515. Implemented support for the _CLS object in the AcpiGetObjectInfo external interface. Updated the definitions of the TCPA and TPM2 ACPI tables to the more recent TCG ACPI Specification, December 14, 2014. Table disassembler and compiler also updated. Note: The TCPA "server" table is not supported by the disassembler/table-compiler at this time. ACPI 6.0: Added definitions for the new GIC version field in the MADT. 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: 100.6K Code, 27.6K Data, 128.2K Total Debug Version: 196.2K Code, 81.0K Data, 277.2K Total Previous Release: Non-Debug Version: 99.9K Code, 27.5K Data, 127.4K Total Debug Version: 195.2K Code, 80.8K Data, 276.0K Total 2) iASL Compiler/Disassembler and Tools: Disassembler: Fixed a problem with the new symbolic operator disassembler where incorrect ASL code could be emitted in some cases for the "non- commutative" operators -- Subtract, Divide, Modulo, ShiftLeft, and ShiftRight. The actual problem cases seem to be rather unusual in common ASL code, however. David Box. Modified the linux version of acpidump to obtain ACPI tables from not just /dev/mem (which may not exist) and /sys/firmware/acpi/tables. Lv Zheng. iASL: Fixed a problem where the user preprocessor output file (.i) contained extra data that was not expected. The compiler was using this file as a temporary file and passed through #line directives in order to keep compiler error messages in sync with the input file and line number across multiple include files. The (.i) is no longer a temporary file as the compiler uses a new, different file for the original purpose. iASL: Fixed a problem where comments within the original ASL source code file were not passed through to the preprocessor output file, nor any listing files. iASL: Fixed some issues for the handling of the "#include" preprocessor directive and the similar (but not the same) "Include" ASL operator. iASL: Add support for the new OSDT in both the disassembler and compiler. iASL: Fixed a problem with the constant folding support where a Buffer object could be incorrectly generated (incorrectly formed) during a conversion to a Store() operator. AcpiHelp: Updated for new NFIT GUIDs, "External" AML opcode, and new description text for the _REV predefined name. _REV now permanently returns 2, as per the ACPI 6.0 specification. Debugger: Enhanced the output of the Debug ASL object for references produced by the Index operator. For Buffers and strings, only output the actual byte pointed to by the index. For packages, only print the single package element decoded by the index. Previously, the entire buffer/string/package was emitted. iASL/Table-compiler: Fixed a regression where the "generic" data types were no longer recognized, causing errors. ---------------------------------------- 15 May 2015. Summary of changes for version 20150515: This release implements most of ACPI 6.0 as described below. 1) ACPICA kernel-resident subsystem: Implemented runtime argument checking and return value checking for all new ACPI 6.0 predefined names. This includes: _BTH, _CR3, _DSD, _LPI, _MTL, _PRR, _RDI, _RST, _TFP, _TSN. 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: 99.9K Code, 27.5K Data, 127.4K Total Debug Version: 195.2K Code, 80.8K Data, 276.0K Total Previous Release: Non-Debug Version: 99.1K Code, 27.3K Data, 126.4K Total Debug Version: 192.8K Code, 79.9K Data, 272.7K Total 2) iASL Compiler/Disassembler and Tools: iASL compiler: Added compile-time support for all new ACPI 6.0 predefined names (argument count validation and return value typechecking.) iASL disassembler and table compiler: implemented support for all new ACPI 6.0 tables. This includes: DRTM, IORT, LPIT, NFIT, STAO, WPBT, XENV. iASL disassembler and table compiler: Added ACPI 6.0 changes to existing tables: FADT, MADT. iASL preprocessor: Added a new directive to enable inclusion of binary blobs into ASL code. The new directive is #includebuffer. It takes a binary file as input and emits a named ascii buffer object into the ASL code. AcpiHelp: Added support for all new ACPI 6.0 predefined names. AcpiHelp: Added a new option, -d, to display all iASL preprocessor directives. AcpiHelp: Added a new option, -t, to display all known/supported ACPI tables.
sys/external/bsd/acpica/dist/changes.txt
sys/external/bsd/acpica/dist/common/adisasm.c
sys/external/bsd/acpica/dist/common/ahids.c
sys/external/bsd/acpica/dist/common/ahpredef.c
sys/external/bsd/acpica/dist/common/ahtable.c
sys/external/bsd/acpica/dist/common/ahuuids.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/getopt.c
sys/external/bsd/acpica/dist/compiler/aslascii.c
sys/external/bsd/acpica/dist/compiler/aslcodegen.c
sys/external/bsd/acpica/dist/compiler/asldefine.h
sys/external/bsd/acpica/dist/compiler/aslfold.c
sys/external/bsd/acpica/dist/compiler/aslglobal.h
sys/external/bsd/acpica/dist/compiler/aslmain.c
sys/external/bsd/acpica/dist/compiler/aslmapenter.c
sys/external/bsd/acpica/dist/compiler/aslmapoutput.c
sys/external/bsd/acpica/dist/compiler/aslmessages.c
sys/external/bsd/acpica/dist/compiler/aslmessages.h
sys/external/bsd/acpica/dist/compiler/aslmethod.c
sys/external/bsd/acpica/dist/compiler/aslnamesp.c
sys/external/bsd/acpica/dist/compiler/asloffset.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/aslprintf.c
sys/external/bsd/acpica/dist/compiler/aslstartup.c
sys/external/bsd/acpica/dist/compiler/aslstubs.c
sys/external/bsd/acpica/dist/compiler/asltypes.h
sys/external/bsd/acpica/dist/compiler/asluuid.c
sys/external/bsd/acpica/dist/compiler/dtcompiler.h
sys/external/bsd/acpica/dist/compiler/dtexpress.c
sys/external/bsd/acpica/dist/compiler/dtio.c
sys/external/bsd/acpica/dist/compiler/dttemplate.c
sys/external/bsd/acpica/dist/compiler/dttemplate.h
sys/external/bsd/acpica/dist/compiler/preprocess.h
sys/external/bsd/acpica/dist/compiler/prparser.l
sys/external/bsd/acpica/dist/compiler/prscan.c
sys/external/bsd/acpica/dist/debugger/dbconvert.c
sys/external/bsd/acpica/dist/debugger/dbfileio.c
sys/external/bsd/acpica/dist/debugger/dbhistry.c
sys/external/bsd/acpica/dist/debugger/dbobject.c
sys/external/bsd/acpica/dist/debugger/dbxface.c
sys/external/bsd/acpica/dist/disassembler/dmdeferred.c
sys/external/bsd/acpica/dist/disassembler/dmnames.c
sys/external/bsd/acpica/dist/disassembler/dmopcode.c
sys/external/bsd/acpica/dist/dispatcher/dsargs.c
sys/external/bsd/acpica/dist/dispatcher/dsdebug.c
sys/external/bsd/acpica/dist/dispatcher/dsfield.c
sys/external/bsd/acpica/dist/dispatcher/dsinit.c
sys/external/bsd/acpica/dist/dispatcher/dsmethod.c
sys/external/bsd/acpica/dist/dispatcher/dsobject.c
sys/external/bsd/acpica/dist/dispatcher/dswload.c
sys/external/bsd/acpica/dist/dispatcher/dswload2.c
sys/external/bsd/acpica/dist/events/evgpe.c
sys/external/bsd/acpica/dist/events/evgpeinit.c
sys/external/bsd/acpica/dist/executer/exconvrt.c
sys/external/bsd/acpica/dist/executer/excreate.c
sys/external/bsd/acpica/dist/executer/exfield.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/exoparg2.c
sys/external/bsd/acpica/dist/executer/exoparg3.c
sys/external/bsd/acpica/dist/executer/exregion.c
sys/external/bsd/acpica/dist/executer/exstorob.c
sys/external/bsd/acpica/dist/executer/exutils.c
sys/external/bsd/acpica/dist/generate/unix/Makefile.config
sys/external/bsd/acpica/dist/generate/unix/Makefile.rules
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/acpihelp/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/hwgpe.c
sys/external/bsd/acpica/dist/hardware/hwpci.c
sys/external/bsd/acpica/dist/include/acclib.h
sys/external/bsd/acpica/dist/include/accommon.h
sys/external/bsd/acpica/dist/include/acdispat.h
sys/external/bsd/acpica/dist/include/acnames.h
sys/external/bsd/acpica/dist/include/acobject.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/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/acuuid.h
sys/external/bsd/acpica/dist/include/platform/acefi.h
sys/external/bsd/acpica/dist/include/platform/acefiex.h
sys/external/bsd/acpica/dist/include/platform/acenv.h
sys/external/bsd/acpica/dist/include/platform/acenvex.h
sys/external/bsd/acpica/dist/include/platform/acgcc.h
sys/external/bsd/acpica/dist/include/platform/acmsvc.h
sys/external/bsd/acpica/dist/include/platform/acmsvcex.h
sys/external/bsd/acpica/dist/include/platform/acwinex.h
sys/external/bsd/acpica/dist/namespace/nsconvert.c
sys/external/bsd/acpica/dist/namespace/nsnames.c
sys/external/bsd/acpica/dist/namespace/nsparse.c
sys/external/bsd/acpica/dist/namespace/nsprepkg.c
sys/external/bsd/acpica/dist/namespace/nsrepair.c
sys/external/bsd/acpica/dist/namespace/nssearch.c
sys/external/bsd/acpica/dist/namespace/nsutils.c
sys/external/bsd/acpica/dist/os_specific/service_layers/osbsdtbl.c
sys/external/bsd/acpica/dist/os_specific/service_layers/osefitbl.c
sys/external/bsd/acpica/dist/os_specific/service_layers/osefixf.c
sys/external/bsd/acpica/dist/os_specific/service_layers/osunixmap.c
sys/external/bsd/acpica/dist/os_specific/service_layers/oswintbl.c
sys/external/bsd/acpica/dist/parser/psargs.c
sys/external/bsd/acpica/dist/parser/psloop.c
sys/external/bsd/acpica/dist/parser/psobject.c
sys/external/bsd/acpica/dist/parser/psparse.c
sys/external/bsd/acpica/dist/parser/psutils.c
sys/external/bsd/acpica/dist/parser/psxface.c
sys/external/bsd/acpica/dist/resources/rscreate.c
sys/external/bsd/acpica/dist/resources/rsmisc.c
sys/external/bsd/acpica/dist/tables/tbfind.c
sys/external/bsd/acpica/dist/tables/tbprint.c
sys/external/bsd/acpica/dist/tables/tbxfload.c
sys/external/bsd/acpica/dist/tests/misc/badcode.asl
sys/external/bsd/acpica/dist/tools/acpidump/acpidump.h
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/aeexec.c
sys/external/bsd/acpica/dist/tools/acpiexec/aehandlers.c
sys/external/bsd/acpica/dist/tools/acpiexec/aeinitfile.c
sys/external/bsd/acpica/dist/tools/acpiexec/aeregion.c
sys/external/bsd/acpica/dist/tools/acpiexec/aetables.c
sys/external/bsd/acpica/dist/tools/acpihelp/acpihelp.h
sys/external/bsd/acpica/dist/tools/acpihelp/ahamlops.c
sys/external/bsd/acpica/dist/tools/acpihelp/ahaslkey.c
sys/external/bsd/acpica/dist/tools/acpihelp/ahdecode.c
sys/external/bsd/acpica/dist/tools/acpihelp/ahmain.c
sys/external/bsd/acpica/dist/tools/acpinames/anstubs.c
sys/external/bsd/acpica/dist/tools/acpinames/antables.c
sys/external/bsd/acpica/dist/tools/acpisrc/acpisrc.h
sys/external/bsd/acpica/dist/tools/acpisrc/asconvrt.c
sys/external/bsd/acpica/dist/tools/acpisrc/asfile.c
sys/external/bsd/acpica/dist/tools/acpisrc/asmain.c
sys/external/bsd/acpica/dist/tools/acpisrc/asremove.c
sys/external/bsd/acpica/dist/tools/acpisrc/astable.c
sys/external/bsd/acpica/dist/tools/acpisrc/asutils.c
sys/external/bsd/acpica/dist/utilities/utalloc.c
sys/external/bsd/acpica/dist/utilities/utbuffer.c
sys/external/bsd/acpica/dist/utilities/utclib.c
sys/external/bsd/acpica/dist/utilities/utcopy.c
sys/external/bsd/acpica/dist/utilities/utdelete.c
sys/external/bsd/acpica/dist/utilities/utfileio.c
sys/external/bsd/acpica/dist/utilities/uthex.c
sys/external/bsd/acpica/dist/utilities/utids.c
sys/external/bsd/acpica/dist/utilities/utinit.c
sys/external/bsd/acpica/dist/utilities/utnonansi.c
sys/external/bsd/acpica/dist/utilities/utpredef.c
sys/external/bsd/acpica/dist/utilities/utprint.c
sys/external/bsd/acpica/dist/utilities/utstring.c
sys/external/bsd/acpica/dist/utilities/utxface.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	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/changes.txt	Tue Aug 18 09:53:33 2015 +0000
@@ -1,4 +1,260 @@
 ----------------------------------------
+17 July 2015. Summary of changes for version 20150717:
+
+1) ACPICA kernel-resident subsystem:
+
+Improved the partitioning between the Debugger and Disassembler 
+components. This allows the Debugger to be used standalone within kernel 
+code without the Disassembler (which is used for single stepping also). 
+This renames and moves one file, dmobject.c to dbobject.c. Lv Zheng.
+
+Debugger: Implemented a new command to trace the execution of control 
+methods (Trace). This is especially useful for the in-kernel version of 
+the debugger when file I/O may not be available for method trace output. 
+See the ACPICA reference for more information. Lv Zheng.
+
+Moved all C library prototypes (used for the local versions of these 
+functions when requested) to a new header, acclib.h
+Cleaned up the use of non-ANSI C library functions. These functions are 
+implemented locally in ACPICA. Moved all such functions to a common 
+source file, utnonansi.c
+
+Debugger: Fixed a problem with the "!!" command (get last command 
+executed) where the debugger could enter an infinite loop and eventually 
+crash.
+
+Removed the use of local macros that were used for some of the standard C 
+library functions to automatically cast input parameters. This mostly 
+affected the is* functions where the input parameter is defined to be an 
+int. This required a few modifications to the main ACPICA source code to 
+provide casting for these functions and eliminate possible compiler 
+warnings for these parameters.
+
+Across the source code, added additional status/error checking to resolve 
+issues discovered by static source code analysis tools such as Coverity.
+
+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: 100.9K Code, 24.5K Data, 125.4K Total
+    Debug Version:     197.8K Code, 81.5K Data, 279.3K Total
+  Previous Release:
+    Non-Debug Version: 100.6K Code, 27.6K Data, 128.2K Total
+    Debug Version:     196.2K Code, 81.0K Data, 277.2K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Fixed a regression where the device map file feature no longer 
+worked properly when used in conjunction with the disassembler. It only 
+worked properly with the compiler itself.
+
+iASL: Implemented a new warning for method LocalX variables that are set 
+but never used (similar to a C compiler such as gcc). This also applies 
+to ArgX variables that are not defined by the parent method, and are 
+instead (legally) used as local variables.
+
+iASL/Preprocessor: Finished the pass-through of line numbers from the 
+preprocessor to the compiler. This ensures that compiler errors/warnings 
+have the correct original line numbers and filenames, regardless of any 
+#include files.
+
+iASL/Preprocessor: Fixed a couple of issues with comment handling and the 
+pass-through of comments to the preprocessor output file (which becomes 
+the compiler input file). Also fixed a problem with // comments that 
+appear after a math expression.
+
+iASL: Added support for the TCPA server table to the table compiler and 
+template generator. (The client table was already previously supported)
+
+iASL/Preprocessor: Added a permanent #define of the symbol "__IASL__" to 
+identify the iASL compiler.
+
+Cleaned up the use of the macros NEGATIVE and POSITIVE which were defined 
+multiple times. The new names are ACPI_SIGN_NEGATIVE and 
+ACPI_SIGN_POSITIVE.
+
+AcpiHelp: Update to expand help messages for the iASL preprocessor 
+directives.
+
+
+----------------------------------------
+19 June 2015. Summary of changes for version 20150619:
+
+Two regressions in version 20150616 have been addressed:
+
+Fixes some problems/issues with the C library macro removal (ACPI_STRLEN, 
+etc.) This update changes ACPICA to only use the standard headers for 
+functions, or the prototypes for the local versions of the C library 
+functions. Across the source code, this required some additional casts 
+for some Clib invocations for portability. Moved all local prototypes to 
+a new file, acclib.h
+
+Fixes several problems with recent changes to the handling of the FACS 
+table that could cause some systems not to boot.
+
+
+----------------------------------------
+16 June 2015. Summary of changes for version 20150616:
+
+
+1) ACPICA kernel-resident subsystem:
+
+Across the entire ACPICA source code base, the various macros for the C 
+library functions (such as ACPI_STRLEN, etc.) have been removed and 
+replaced by the standard C library names (strlen, etc.) The original 
+purpose for these macros is no longer applicable. This simplification 
+reduces the number of macros used in the ACPICA source code 
+significantly, improving readability and maintainability.
+
+Implemented support for a new ACPI table, the OSDT. This table, the 
+"override" SDT, can be loaded directly by the host OS at boot time. It 
+enables the replacement of existing namespace objects that were installed 
+via the DSDT and/or SSDTs. The primary purpose for this is to replace 
+buggy or incorrect ASL/AML code obtained via the BIOS. The OSDT is slated 
+for inclusion in a future version of the ACPI Specification. Lv Zheng/Bob 
+Moore.
+
+Added support for systems with (improperly) two FACS tables -- a "32-bit" 
+table (via FADT 32-bit legacy field) and a "64-bit" table (via the 64-bit 
+X field). This change will support both automatically. There continues to 
+be systems found with this issue. This support requires a change to the 
+AcpiSetFirmwareWakingVector interface. Also, a public global variable has 
+been added to allow the host to select which FACS is desired 
+(AcpiGbl_Use32BitFacsAddresses). See the ACPICA reference for more 
+details Lv Zheng.
+
+Added a new feature to allow for systems that do not contain an FACS. 
+Although this is already supported on hardware-reduced platforms, the 
+feature has been extended for all platforms. The reasoning is that we do 
+not want to abort the entire ACPICA initialization just because the 
+system is seriously buggy and has no FACS.
+
+Fixed a problem where the GUID strings for NFIT tables (in acuuid.h) were 
+not correctly transcribed from the ACPI specification in ACPICA version 
+20150515.
+
+Implemented support for the _CLS object in the AcpiGetObjectInfo external 
+interface.
+
+Updated the definitions of the TCPA and TPM2 ACPI tables to the more 
+recent TCG ACPI Specification, December 14, 2014. Table disassembler and 
+compiler also updated. Note: The TCPA "server" table is not supported by 
+the disassembler/table-compiler at this time.
+
+ACPI 6.0: Added definitions for the new GIC version field in the MADT.
+
+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: 100.6K Code, 27.6K Data, 128.2K Total
+    Debug Version:     196.2K Code, 81.0K Data, 277.2K Total
+  Previous Release:
+    Non-Debug Version:  99.9K Code, 27.5K Data, 127.4K Total
+    Debug Version:     195.2K Code, 80.8K Data, 276.0K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+Disassembler: Fixed a problem with the new symbolic operator disassembler 
+where incorrect ASL code could be emitted in some cases for the "non-
+commutative" operators -- Subtract, Divide, Modulo, ShiftLeft, and 
+ShiftRight. The actual problem cases seem to be rather unusual in common 
+ASL code, however. David Box.
+
+Modified the linux version of acpidump to obtain ACPI tables from not 
+just /dev/mem (which may not exist) and /sys/firmware/acpi/tables. Lv 
+Zheng.
+
+iASL: Fixed a problem where the user preprocessor output file (.i) 
+contained extra data that was not expected. The compiler was using this 
+file as a temporary file and passed through #line directives in order to 
+keep compiler error messages in sync with the input file and line number 
+across multiple include files. The (.i) is no longer a temporary file as 
+the compiler uses a new, different file for the original purpose.
+
+iASL: Fixed a problem where comments within the original ASL source code 
+file were not passed through to the preprocessor output file, nor any 
+listing files.
+
+iASL: Fixed some issues for the handling of the "#include" preprocessor 
+directive and the similar (but not the same) "Include" ASL operator.
+
+iASL: Add support for the new OSDT in both the disassembler and compiler.
+
+iASL: Fixed a problem with the constant folding support where a Buffer 
+object could be incorrectly generated (incorrectly formed) during a 
+conversion to a Store() operator.
+
+AcpiHelp: Updated for new NFIT GUIDs, "External" AML opcode, and new 
+description text for the _REV predefined name. _REV now permanently 
+returns 2, as per the ACPI 6.0 specification.
+
+Debugger: Enhanced the output of the Debug ASL object for references 
+produced by the Index operator. For Buffers and strings, only output the 
+actual byte pointed to by the index. For packages, only print the single 
+package element decoded by the index. Previously, the entire 
+buffer/string/package was emitted.
+
+iASL/Table-compiler: Fixed a regression where the "generic" data types 
+were no longer recognized, causing errors.
+
+
+----------------------------------------
+15 May 2015. Summary of changes for version 20150515:
+
+This release implements most of ACPI 6.0 as described below.
+
+1) ACPICA kernel-resident subsystem:
+
+Implemented runtime argument checking and return value checking for all 
+new ACPI 6.0 predefined names. This includes: _BTH, _CR3, _DSD, _LPI, 
+_MTL, _PRR, _RDI, _RST, _TFP, _TSN.
+
+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:  99.9K Code, 27.5K Data, 127.4K Total
+    Debug Version:     195.2K Code, 80.8K Data, 276.0K Total
+  Previous Release:
+    Non-Debug Version:  99.1K Code, 27.3K Data, 126.4K Total
+    Debug Version:     192.8K Code, 79.9K Data, 272.7K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL compiler: Added compile-time support for all new ACPI 6.0 predefined 
+names (argument count validation and return value typechecking.)
+
+iASL disassembler and table compiler: implemented support for all new 
+ACPI 6.0 tables. This includes: DRTM, IORT, LPIT, NFIT, STAO, WPBT, XENV. 
+
+iASL disassembler and table compiler: Added ACPI 6.0 changes to existing 
+tables: FADT, MADT.
+
+iASL preprocessor: Added a new directive to enable inclusion of binary 
+blobs into ASL code. The new directive is #includebuffer. It takes a 
+binary file as input and emits a named ascii buffer object into the ASL 
+code.
+
+AcpiHelp: Added support for all new ACPI 6.0 predefined names.
+
+AcpiHelp: Added a new option, -d, to display all iASL preprocessor 
+directives.
+
+AcpiHelp: Added a new option, -t, to display all known/supported ACPI 
+tables.
+
+----------------------------------------
 10 April 2015. Summary of changes for version 20150410:
 
 Reverted a change introduced in version 20150408 that caused
--- a/sys/external/bsd/acpica/dist/common/adisasm.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/common/adisasm.c	Tue Aug 18 09:53:33 2015 +0000
@@ -187,6 +187,7 @@
     AcpiGbl_RootTableList.CurrentTableCount = 0;
     AcpiGbl_RootTableList.Tables = LocalTables;
 
+    AcpiGbl_PreviousOp = NULL;
     return (Status);
 }
 
@@ -214,6 +215,7 @@
     char                    **OutFilename)
 {
     ACPI_STATUS             Status;
+    ACPI_STATUS             GlobalStatus = AE_OK;
     char                    *DisasmFilename = NULL;
     char                    *ExternalFilename;
     ACPI_EXTERNAL_FILE      *ExternalFileList = AcpiGbl_ExternalFileList;
@@ -229,7 +231,7 @@
      */
     if (Filename)
     {
-        Status = AcpiDbGetTableFromFile (Filename, &Table);
+        Status = AcpiDbGetTableFromFile (Filename, &Table, FALSE);
         if (ACPI_FAILURE (Status))
         {
             return (Status);
@@ -242,7 +244,7 @@
         while (ExternalFileList)
         {
             ExternalFilename = ExternalFileList->Path;
-            if (!ACPI_STRCMP (ExternalFilename, Filename))
+            if (!strcmp (ExternalFilename, Filename))
             {
                 /* Next external file */
 
@@ -250,9 +252,16 @@
                 continue;
             }
 
-            Status = AcpiDbGetTableFromFile (ExternalFilename, &ExternalTable);
+            Status = AcpiDbGetTableFromFile (ExternalFilename, &ExternalTable, TRUE);
             if (ACPI_FAILURE (Status))
             {
+                if (Status == AE_TYPE)
+                {
+                    ExternalFileList = ExternalFileList->Next;
+                    GlobalStatus = AE_TYPE;
+                    Status = AE_OK;
+                    continue;
+                }
                 return (Status);
             }
 
@@ -282,6 +291,11 @@
             ExternalFileList = ExternalFileList->Next;
         }
 
+        if (ACPI_FAILURE (GlobalStatus))
+        {
+            return (GlobalStatus);
+        }
+
         /* Clear external list generated by Scope in external tables */
 
         if (AcpiGbl_ExternalFileList)
@@ -783,8 +797,8 @@
 
     AcpiTbInitTableDescriptor (TableDesc, ACPI_PTR_TO_PHYSADDR (Table),
         ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, Table);
-    AcpiTbValidateTable (TableDesc);
-    return (AE_OK);
+    Status = AcpiTbValidateTable (TableDesc);
+    return (Status);
 }
 
 
@@ -879,7 +893,7 @@
 
     /* Create the root object */
 
-    AcpiGbl_ParseOpRoot = AcpiPsCreateScopeOp ();
+    AcpiGbl_ParseOpRoot = AcpiPsCreateScopeOp (AmlStart);
     if (!AcpiGbl_ParseOpRoot)
     {
         return (AE_NO_MEMORY);
--- a/sys/external/bsd/acpica/dist/common/ahids.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/common/ahids.c	Tue Aug 18 09:53:33 2015 +0000
@@ -230,7 +230,7 @@
 
     for (Info = AslDeviceIds; Info->Name; Info++)
     {
-        if (!ACPI_STRCMP (HardwareId, Info->Name))
+        if (!strcmp (HardwareId, Info->Name))
         {
             return (Info);
         }
--- a/sys/external/bsd/acpica/dist/common/ahpredef.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/common/ahpredef.c	Tue Aug 18 09:53:33 2015 +0000
@@ -94,6 +94,7 @@
     AH_PREDEF ("_BMS",    "Battery Measurement Sampling Time", "Sets the battery measurement sampling time"),
     AH_PREDEF ("_BQC",    "Brightness Query Current", "Returns the current display brightness level"),
     AH_PREDEF ("_BST",    "Battery Status", "Returns a Control Method Battery status block"),
+    AH_PREDEF ("_BTH",    "Battery Throttle Limit", "Thermal limit for charging and discharging"),
     AH_PREDEF ("_BTM",    "Battery Time", "Returns the battery runtime"),
     AH_PREDEF ("_BTP",    "Battery Trip Point", "Sets a Control Method Battery trip point"),
     AH_PREDEF ("_CBA",    "Configuration Base Address", "Sets the base address for a PCI Express host bridge"),
@@ -102,6 +103,7 @@
     AH_PREDEF ("_CID",    "Compatible ID", "Returns a device's Plug and Play Compatible ID list"),
     AH_PREDEF ("_CLS",    "Class Code", "Returns PCI class code and subclass"),
     AH_PREDEF ("_CPC",    "Continuous Performance Control", "Returns a list of performance control interfaces"),
+    AH_PREDEF ("_CR3",    "Warm/Standby Temperature", "Temperature for a fast low power state"),
     AH_PREDEF ("_CRS",    "Current Resource Settings", "Returns the current resource settings for a device"),
     AH_PREDEF ("_CRT",    "Critical Temperature", "Returns the shutdown critical temperature"),
     AH_PREDEF ("_CSD",    "C-State Dependencies", "Returns a list of C-state dependencies"),
@@ -175,6 +177,7 @@
     AH_PREDEF ("_LIN",    "Lines In Use", "Handshake lines, Resource Descriptor field"),
     AH_PREDEF ("_LL_",    "Low Level", "Interrupt polarity, Resource Descriptor field"),
     AH_PREDEF ("_LPD",    "Low Power Dependencies", "Returns a list of dependencies for low power idle entry"),
+    AH_PREDEF ("_LPI",    "Low Power Idle States", "Returns a list of supported low power idle states"),
     AH_PREDEF ("_MAF",    "Maximum Address Fixed", "Resource Descriptor field"),
     AH_PREDEF ("_MAT",    "Multiple APIC Table Entry", "Returns a list of MADT APIC structure entries"),
     AH_PREDEF ("_MAX",    "Maximum Base Address", "Resource Descriptor field"),
@@ -186,6 +189,7 @@
     AH_PREDEF ("_MOD",    "Mode", "Interrupt mode, Resource Descriptor field"),
     AH_PREDEF ("_MSG",    "Message", "Sets the system message waiting status indicator"),
     AH_PREDEF ("_MSM",    "Memory Set Monitoring", "Sets bandwidth monitoring parameters for a memory device"),
+    AH_PREDEF ("_MTL",    "Minimum Throttle Limit", "Returns the minimum throttle limit for a thermal zone"),
     AH_PREDEF ("_MTP",    "Memory Type", "Resource Descriptor field"),
     AH_PREDEF ("_NTT",    "Notification Temperature Threshold", "Returns a threshold for device temperature change that requires platform notification"),
     AH_PREDEF ("_OFF",    "Power Off", "Sets a power resource to the off state"),
@@ -209,7 +213,7 @@
     AH_PREDEF ("_PMD",    "Power Metered Devices", "Returns a list of devices that are measured by the power meter device"),
     AH_PREDEF ("_PMM",    "Power Meter Measurement", "Returns the current value of the Power Meter"),
     AH_PREDEF ("_POL",    "Polarity", "Interrupt polarity, Resource Descriptor field"),
-    AH_PREDEF ("_PPC",    "Performance Present Capabilites", "Returns a list of the performance states currently supported by the platform"),
+    AH_PREDEF ("_PPC",    "Performance Present Capabilities", "Returns a list of the performance states currently supported by the platform"),
     AH_PREDEF ("_PPE",    "Polling for Platform Error", "Returns the polling interval to retrieve Corrected Platform Error information"),
     AH_PREDEF ("_PPI",    "Pin Configuration", "Resource Descriptor field"),
     AH_PREDEF ("_PR",     "Processor", "Predefined scope for processor objects"),
@@ -219,6 +223,7 @@
     AH_PREDEF ("_PR3",    "Power Resources for D3hot", "Returns a list of dependent power resources to enter state D3hot"),
     AH_PREDEF ("_PRE",    "Power Resources for Enumeration", "Returns a list of dependent power resources to enumerate devices on a bus"),
     AH_PREDEF ("_PRL",    "Power Source Redundancy List", "Returns a list of power source devices in the same redundancy grouping"),
+    AH_PREDEF ("_PRR",    "Power Resource for Reset", "Execute a reset on a device"),
     AH_PREDEF ("_PRS",    "Possible Resource Settings", "Returns a list of a device's possible resource settings"),
     AH_PREDEF ("_PRT",    "PCI Routing Table", "Returns a list of PCI interrupt mappings"),
     AH_PREDEF ("_PRW",    "Power Resources for Wake", "Returns a list of dependent power resources for waking"),
@@ -242,10 +247,12 @@
     AH_PREDEF ("_Qxx",    "EC Query", "Embedded Controller query and SMBus Alarm control method"),
     AH_PREDEF ("_RBO",    "Register Bit Offset", "Resource Descriptor field"),
     AH_PREDEF ("_RBW",    "Register Bit Width", "Resource Descriptor field"),
+    AH_PREDEF ("_RDI",    "Resource Dependencies for Idle", "Returns a list of dependencies for idle states"),
     AH_PREDEF ("_REG",    "Region Availability", "Inform AML code of an operation region availability change"),
-    AH_PREDEF ("_REV",    "Supported ACPI Revision", "Returns the revision of the ACPI specification that is implemented"),
+    AH_PREDEF ("_REV",    "Supported Integer Width", "Returns the supported integer width (<= 1: 32 bits only, >=2: both 32 and 64 bits"),
     AH_PREDEF ("_RMV",    "Removal Status", "Returns a device's removal ability status (docking)"),
     AH_PREDEF ("_RNG",    "Range", "Memory range type, Resource Descriptor field"),
+    AH_PREDEF ("_RST",    "Device Reset", "Executes a reset on a device"),
     AH_PREDEF ("_ROM",    "Read-Only Memory", "Returns a copy of the ROM data for a display device"),
     AH_PREDEF ("_RT_",    "Resource Type", "Resource Descriptor field"),
     AH_PREDEF ("_RTV",    "Relative Temperature Values", "Returns temperature value information"),
@@ -296,6 +303,7 @@
     AH_PREDEF ("_TC1",    "Thermal Constant 1", "Returns TC1 for the passive cooling formula"),
     AH_PREDEF ("_TC2",    "Thermal Constant 2", "Returns TC2 for the passive cooling formula"),
     AH_PREDEF ("_TDL",    "T-State Depth Limit", "Returns the _TSS entry number of the lowest power throttling state"),
+    AH_PREDEF ("_TFP",    "Thermal Fast Sampling Period", "Returns the sampling period for passive cooling"),
     AH_PREDEF ("_TIP",    "Expired Timer Wake Policy", "Returns timer policies of the wake alarm device"),
     AH_PREDEF ("_TIV",    "Timer Values", "Returns remaining time of the wake alarm device"),
     AH_PREDEF ("_TMP",    "Temperature", "Returns a thermal zone's current temperature"),
@@ -306,6 +314,7 @@
     AH_PREDEF ("_TRT",    "Thermal Relationship Table", "Returns thermal relationships between platform devices"),
     AH_PREDEF ("_TSD",    "Throttling State Dependencies", "Returns a list of T-state dependencies"),
     AH_PREDEF ("_TSF",    "Type-Specific Flags", "Resource Descriptor field"),
+    AH_PREDEF ("_TSN",    "Thermal Sensor Device", "Returns a reference to a thermal sensor"),
     AH_PREDEF ("_TSP",    "Thermal Sampling Period", "Returns the thermal sampling period for passive cooling"),
     AH_PREDEF ("_TSS",    "Throttling Supported States", "Returns supported throttling state information"),
     AH_PREDEF ("_TST",    "Temperature Sensor Threshold", "Returns the minimum separation for a device's temperature trip points"),
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/acpica/dist/common/ahtable.c	Tue Aug 18 09:53:33 2015 +0000
@@ -0,0 +1,150 @@
+/******************************************************************************
+ *
+ * Module Name: ahtable - Table of known ACPI tables with descriptions
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, 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"
+
+
+/* Local prototypes */
+
+const AH_TABLE *
+AcpiAhGetTableInfo (
+    char                    *Signature);
+
+extern const AH_TABLE      AcpiSupportedTables[];
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiAhGetTableInfo
+ *
+ * PARAMETERS:  Signature           - ACPI signature (4 chars) to match
+ *
+ * RETURN:      Pointer to a valid AH_TABLE. Null if no match found.
+ *
+ * DESCRIPTION: Find a match in the "help" table of supported ACPI tables
+ *
+ ******************************************************************************/
+
+const AH_TABLE *
+AcpiAhGetTableInfo (
+    char                    *Signature)
+{
+    const AH_TABLE      *Info;
+
+
+    for (Info = AcpiSupportedTables; Info->Signature; Info++)
+    {
+        if (ACPI_COMPARE_NAME (Signature, Info->Signature))
+        {
+            return (Info);
+        }
+    }
+
+    return (NULL);
+}
+
+
+/*
+ * Note: Any tables added here should be duplicated within AcpiDmTableData
+ * in the file common/dmtable.c
+ */
+const AH_TABLE      AcpiSupportedTables[] =
+{
+    {ACPI_SIG_ASF,  "Alert Standard Format table"},
+    {ACPI_SIG_BERT, "Boot Error Record Table"},
+    {ACPI_SIG_BGRT, "Boot Graphics Resource Table"},
+    {ACPI_SIG_BOOT, "Simple Boot Flag Table"},
+    {ACPI_SIG_CPEP, "Corrected Platform Error Polling table"},
+    {ACPI_SIG_CSRT, "Core System Resource Table"},
+    {ACPI_SIG_DBG2, "Debug Port table type 2"},
+    {ACPI_SIG_DBGP, "Debug Port table"},
+    {ACPI_SIG_DMAR, "DMA Remapping table"},
+    {ACPI_SIG_DRTM, "Dynamic Root of Trust for Measurement table"},
+    {ACPI_SIG_DSDT, "Differentiated System Description Table (AML table)"},
+    {ACPI_SIG_ECDT, "Embedded Controller Boot Resources Table"},
+    {ACPI_SIG_EINJ, "Error Injection table"},
+    {ACPI_SIG_ERST, "Error Record Serialization Table"},
+    {ACPI_SIG_FACS, "Firmware ACPI Control Structure"},
+    {ACPI_SIG_FADT, "Fixed ACPI Description Table (FADT)"},
+    {ACPI_SIG_FPDT, "Firmware Performance Data Table"},
+    {ACPI_SIG_GTDT, "Generic Timer Description Table"},
+    {ACPI_SIG_HEST, "Hardware Error Source Table"},
+    {ACPI_SIG_HPET, "High Precision Event Timer table"},
+    {ACPI_SIG_IORT, "IO Remapping Table"},
+    {ACPI_SIG_IVRS, "I/O Virtualization Reporting Structure"},
+    {ACPI_SIG_LPIT, "Low Power Idle Table"},
+    {ACPI_SIG_MADT, "Multiple APIC Description Table (MADT)"},
+    {ACPI_SIG_MCFG, "Memory Mapped Configuration table"},
+    {ACPI_SIG_MCHI, "Management Controller Host Interface table"},
+    {ACPI_SIG_MPST, "Memory Power State Table"},
+    {ACPI_SIG_MSCT, "Maximum System Characteristics Table"},
+    {ACPI_SIG_MSDM, "Microsoft Data Management table"},
+    {ACPI_SIG_MTMR, "MID Timer Table"},
+    {ACPI_SIG_NFIT, "NVDIMM Firmware Interface Table"},
+    {ACPI_SIG_PCCT, "Platform Communications Channel Table"},
+    {ACPI_SIG_PMTT, "Platform Memory Topology Table"},
+    {ACPI_RSDP_NAME,"Root System Description Pointer"},
+    {ACPI_SIG_RSDT, "Root System Description Table"},
+    {ACPI_SIG_S3PT, "S3 Performance Table"},
+    {ACPI_SIG_SBST, "Smart Battery Specification Table"},
+    {ACPI_SIG_SLIC, "Software Licensing Description Table"},
+    {ACPI_SIG_SLIT, "System Locality Information Table"},
+    {ACPI_SIG_SPCR, "Serial Port Console Redirection table"},
+    {ACPI_SIG_SPMI, "Server Platform Management Interface table"},
+    {ACPI_SIG_SRAT, "System Resource Affinity Table"},
+    {ACPI_SIG_SSDT, "Secondary System Description Table (AML table)"},
+    {ACPI_SIG_STAO, "Status Override table"},
+    {ACPI_SIG_TCPA, "Trusted Computing Platform Alliance table"},
+    {ACPI_SIG_TPM2, "Trusted Platform Module hardware interface table"},
+    {ACPI_SIG_UEFI, "UEFI Boot Optimization Table"},
+    {ACPI_SIG_VRTC, "Virtual Real-Time Clock Table"},
+    {ACPI_SIG_WAET, "Windows ACPI Emulated Devices Table"},
+    {ACPI_SIG_WDAT, "Watchdog Action Table"},
+    {ACPI_SIG_WDDT, "Watchdog Description Table"},
+    {ACPI_SIG_WDRT, "Watchdog Resource Table"},
+    {ACPI_SIG_WPBT, "Windows Platform Binary Table"},
+    {ACPI_SIG_XENV, "Xen Environment table"},
+    {ACPI_SIG_XSDT, "Extended System Description Table"},
+    {NULL,          NULL}
+};
--- a/sys/external/bsd/acpica/dist/common/ahuuids.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/common/ahuuids.c	Tue Aug 18 09:53:33 2015 +0000
@@ -43,6 +43,7 @@
 
 #include "acpi.h"
 #include "accommon.h"
+#include "acuuid.h"
 
 #define _COMPONENT          ACPI_UTILITIES
         ACPI_MODULE_NAME    ("ahuuids")
@@ -52,44 +53,36 @@
  */
 const AH_UUID  AcpiUuids[] =
 {
-    {"PCI Host Bridge Device",
-        "33db4d5b-1ff7-401c-9657-7441c03dd766"},
-
-    {"Platform-wide Capabilities",
-        "0811b06e-4a27-44f9-8d60-3cbbc22e7b48"},
-
-    {"Dynamic Enumeration",
-        "d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf"},
+    {"[Controllers]",               NULL},
+    {"GPIO Controller",             UUID_GPIO_CONTROLLER},
+    {"USB Controller",              UUID_USB_CONTROLLER},
+    {"SATA Controller",             UUID_SATA_CONTROLLER},
 
-    {"GPIO Controller",
-        "4f248f40-d5e2-499f-834c-27758ea1cd3f"},
+    {"[Devices]",                   NULL},
+    {"PCI Host Bridge Device",      UUID_PCI_HOST_BRIDGE},
+    {"HID I2C Device",              UUID_I2C_DEVICE},
+    {"Power Button Device",         UUID_POWER_BUTTON},
 
-    {"Battery Thermal Limit",
-        "4c2067e3-887d-475c-9720-4af1d3ed602e"},
-
-    {"Thermal Extensions",
-        "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500"},
+    {"[Interfaces]",                NULL},
+    {"Device Labeling Interface",   UUID_DEVICE_LABELING},
+    {"Physical Presence Interface", UUID_PHYSICAL_PRESENCE},
 
-    {"USB Controller",
-        "ce2ee385-00e6-48cb-9f05-2edb927c4899"},
-
-    {"HID I2C Device",
-        "3cdff6f7-4267-4555-ad05-b30a3d8938de"},
-
-    {"Power Button Device",
-        "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c"},
+    {"[Non-volatile DIMM and NFIT table]",       NULL},
+    {"Volatile Memory Region",      UUID_VOLATILE_MEMORY},
+    {"Persistent Memory Region",    UUID_PERSISTENT_MEMORY},
+    {"NVDIMM Control Region",       UUID_CONTROL_REGION},
+    {"NVDIMM Data Region",          UUID_DATA_REGION},
+    {"Volatile Virtual Disk",       UUID_VOLATILE_VIRTUAL_DISK},
+    {"Volatile Virtual CD",         UUID_VOLATILE_VIRTUAL_CD},
+    {"Persistent Virtual Disk",     UUID_PERSISTENT_VIRTUAL_DISK},
+    {"Persistent Virtual CD",       UUID_PERSISTENT_VIRTUAL_CD},
 
-    {"Device Labeling Interface",
-        "e5c937d0-3553-4d7a-9117-ea4d19c3434d"},
-
-    {"SATA Controller",
-        "e4db149b-fcfe-425b-a6d8-92357d78fc7f"},
-
-    {"Physical Presence Interface",
-        "3dddfaa6-361b-4eb4-a424-8d10089d1653"},
-
-    {"Device Properties for _DSD",
-        "daffd814-6eba-4d8c-8a91-bc9bbf4aa301"},
+    {"[Miscellaneous]",             NULL},
+    {"Platform-wide Capabilities",  UUID_PLATFORM_CAPABILITIES},
+    {"Dynamic Enumeration",         UUID_DYNAMIC_ENUMERATION},
+    {"Battery Thermal Limit",       UUID_BATTERY_THERMAL_LIMIT},
+    {"Thermal Extensions",          UUID_THERMAL_EXTENSIONS},
+    {"Device Properties for _DSD",  UUID_DEVICE_PROPERTIES},
 
     {NULL, NULL}
 };
@@ -120,9 +113,16 @@
 
     for (Info = AcpiUuids; Info->Description; Info++)
     {
+        /* Null string means desciption is a UUID class */
+
+        if (!Info->String)
+        {
+            continue;
+        }
+
         AcpiUtConvertStringToUuid (Info->String, UuidBuffer);
 
-        if (!ACPI_MEMCMP (Data, UuidBuffer, UUID_BUFFER_LENGTH))
+        if (!memcmp (Data, UuidBuffer, UUID_BUFFER_LENGTH))
         {
             return (Info->Description);
         }
--- a/sys/external/bsd/acpica/dist/common/dmextern.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/common/dmextern.c	Tue Aug 18 09:53:33 2015 +0000
@@ -224,7 +224,7 @@
         return (NULL);
     }
 
-    Length = (ACPI_STRLEN (ParentPath) + ACPI_STRLEN (Path) + 1);
+    Length = (strlen (ParentPath) + strlen (Path) + 1);
     if (ParentPath[1])
     {
         /*
@@ -253,7 +253,7 @@
      *
      * Copy the parent path
      */
-    ACPI_STRCPY (Fullpath, &ParentPath[Index]);
+    strcpy (Fullpath, &ParentPath[Index]);
 
     /*
      * Add dot separator
@@ -261,12 +261,12 @@
      */
     if (ParentPath[1])
     {
-        ACPI_STRCAT (Fullpath, ".");
+        strcat (Fullpath, ".");
     }
 
     /* Copy child path (carat parent prefix(es) were skipped above) */
 
-    ACPI_STRCAT (Fullpath, Path);
+    strcat (Fullpath, Path);
 
 Cleanup:
     ACPI_FREE (ParentPath);
@@ -648,13 +648,13 @@
 
     if ((*ExternalPath == AML_ROOT_PREFIX) && (ExternalPath[1]))
     {
-        Temp = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (ExternalPath) + 1);
+        Temp = ACPI_ALLOCATE_ZEROED (strlen (ExternalPath) + 1);
         if (!Temp)
         {
             return_VOID;
         }
 
-        ACPI_STRCPY (Temp, &ExternalPath[1]);
+        strcpy (Temp, &ExternalPath[1]);
         ACPI_FREE (ExternalPath);
         ExternalPath = Temp;
     }
@@ -806,7 +806,7 @@
     NextExternal = AcpiGbl_ExternalList;
     while (NextExternal)
     {
-        if (!ACPI_STRCMP (ExternalPath, NextExternal->Path))
+        if (!strcmp (ExternalPath, NextExternal->Path))
         {
             /* Duplicate method, check that the Value (ArgCount) is the same */
 
@@ -849,7 +849,7 @@
     NewExternal->Value = Value;
     NewExternal->Path = ExternalPath;
     NewExternal->Type = Type;
-    NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath);
+    NewExternal->Length = (UINT16) strlen (ExternalPath);
     NewExternal->InternalPath = InternalPath;
 
     /* Link the new descriptor into the global list, alphabetically ordered */
@@ -1286,7 +1286,9 @@
                 "     * 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. Example iASL invocations:\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"
@@ -1314,7 +1316,8 @@
                 "     * 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.\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"
@@ -1345,7 +1348,9 @@
                 "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. Example iASL invocations:\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"
@@ -1368,7 +1373,8 @@
                 "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.\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"
--- a/sys/external/bsd/acpica/dist/common/dmrestag.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/common/dmrestag.c	Tue Aug 18 09:53:33 2015 +0000
@@ -650,7 +650,7 @@
 
     /* Get the full pathname to the parent buffer */
 
-    RequiredSize = AcpiNsGetPathnameLength (BufferNode);
+    RequiredSize = AcpiNsBuildNormalizedPath (BufferNode, NULL, 0, FALSE);
     if (!RequiredSize)
     {
         return (NULL);
@@ -662,12 +662,8 @@
         return (NULL);
     }
 
-    Status = AcpiNsBuildExternalPath (BufferNode, RequiredSize, Pathname);
-    if (ACPI_FAILURE (Status))
-    {
-        ACPI_FREE (Pathname);
-        return (NULL);
-    }
+    (void) AcpiNsBuildNormalizedPath (BufferNode, Pathname,
+            RequiredSize, FALSE);
 
     /*
      * Create the full path to the resource and tag by: remove the buffer name,
@@ -679,10 +675,10 @@
      * end up in the final compiled AML, it's just an appearance issue for the
      * disassembled code.
      */
-    Pathname[ACPI_STRLEN (Pathname) - ACPI_NAME_SIZE] = 0;
-    ACPI_STRNCAT (Pathname, ResourceNode->Name.Ascii, ACPI_NAME_SIZE);
-    ACPI_STRCAT (Pathname, ".");
-    ACPI_STRNCAT (Pathname, Tag, ACPI_NAME_SIZE);
+    Pathname[strlen (Pathname) - ACPI_NAME_SIZE] = 0;
+    strncat (Pathname, ResourceNode->Name.Ascii, ACPI_NAME_SIZE);
+    strcat (Pathname, ".");
+    strncat (Pathname, Tag, ACPI_NAME_SIZE);
 
     /* Internalize the namepath to AML format */
 
--- a/sys/external/bsd/acpica/dist/common/dmtable.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/common/dmtable.c	Tue Aug 18 09:53:33 2015 +0000
@@ -53,6 +53,11 @@
 #define _COMPONENT          ACPI_CA_DISASSEMBLER
         ACPI_MODULE_NAME    ("dmtable")
 
+const AH_TABLE *
+AcpiAhGetTableInfo (
+    char                    *Signature);
+
+
 /* Local Prototypes */
 
 static void
@@ -78,7 +83,7 @@
     "ASF Remote Control",
     "ASF RMCP Boot Options",
     "ASF Address",
-    "Unknown SubTable Type"         /* Reserved */
+    "Unknown Subtable Type"         /* Reserved */
 };
 
 static const char           *AcpiDmDmarSubnames[] =
@@ -88,7 +93,7 @@
     "Root Port ATS Capability",
     "Remapping Hardware Static Affinity",
     "ACPI Namespace Device Declaration",
-    "Unknown SubTable Type"         /* Reserved */
+    "Unknown Subtable Type"         /* Reserved */
 };
 
 static const char           *AcpiDmDmarScope[] =
@@ -176,7 +181,7 @@
 {
     "Generic Timer Block",
     "Generic Watchdog Timer",
-    "Unknown SubTable Type"         /* Reserved */
+    "Unknown Subtable Type"         /* Reserved */
 };
 
 static const char           *AcpiDmHestSubnames[] =
@@ -191,7 +196,7 @@
     "PCI Express AER (AER Endpoint)",
     "PCI Express/PCI-X Bridge AER",
     "Generic Hardware Error Source",
-    "Unknown SubTable Type"         /* Reserved */
+    "Unknown Subtable Type"         /* Reserved */
 };
 
 static const char           *AcpiDmHestNotifySubnames[] =
@@ -223,14 +228,27 @@
     "Generic Interrupt Distributor",    /* ACPI_MADT_GENERIC_DISTRIBUTOR */
     "Generic MSI Frame",                /* ACPI_MADT_GENERIC_MSI_FRAME */
     "Generic Interrupt Redistributor",  /* ACPI_MADT_GENERIC_REDISTRIBUTOR */
-    "Unknown SubTable Type"             /* Reserved */
+    "Generic Interrupt Translator",     /* ACPI_MADT_GENERIC_TRANSLATOR */
+    "Unknown Subtable Type"             /* Reserved */
+};
+
+static const char           *AcpiDmNfitSubnames[] =
+{
+    "System Physical Address Range",    /* ACPI_NFIT_TYPE_SYSTEM_ADDRESS */
+    "Memory Range Map",                 /* ACPI_NFIT_TYPE_MEMORY_MAP */
+    "Interleave Info",                  /* ACPI_NFIT_TYPE_INTERLEAVE */
+    "SMBIOS Information",               /* ACPI_NFIT_TYPE_SMBIOS */
+    "NVDIMM Control Region",            /* ACPI_NFIT_TYPE_CONTROL_REGION */
+    "NVDIMM Block Data Window Region",  /* ACPI_NFIT_TYPE_DATA_REGION */
+    "Flush Hint Address",               /* ACPI_NFIT_TYPE_FLUSH_ADDRESS */
+    "Unknown Subtable Type"             /* Reserved */
 };
 
 static const char           *AcpiDmPcctSubnames[] =
 {
     "Generic Communications Subspace",  /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */
-    "HW-Reduced Communications Subspace",
-    "Unknown SubTable Type"             /* Reserved */
+    "HW-Reduced Comm Subspace",         /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE */
+    "Unknown Subtable Type"             /* Reserved */
 };
 
 static const char           *AcpiDmPmttSubnames[] =
@@ -238,7 +256,7 @@
     "Socket",                       /* ACPI_PMTT_TYPE_SOCKET */
     "Memory Controller",            /* ACPI_PMTT_TYPE_CONTROLLER */
     "Physical Component (DIMM)",    /* ACPI_PMTT_TYPE_DIMM  */
-    "Unknown SubTable Type"         /* Reserved */
+    "Unknown Subtable Type"         /* Reserved */
 };
 
 static const char           *AcpiDmSratSubnames[] =
@@ -247,21 +265,20 @@
     "Memory Affinity",
     "Processor Local x2APIC Affinity",
     "GICC Affinity",
-    "Unknown SubTable Type"         /* Reserved */
+    "Unknown Subtable Type"         /* Reserved */
 };
 
 static const char           *AcpiDmIvrsSubnames[] =
 {
     "Hardware Definition Block",
     "Memory Definition Block",
-    "Unknown SubTable Type"         /* Reserved */
+    "Unknown Subtable Type"         /* Reserved */
 };
 
 static const char           *AcpiDmLpitSubnames[] =
 {
     "Native C-state Idle Structure",
-    "Simple I/O Idle Structure",
-    "Unknown SubTable Type"         /* Reserved */
+    "Unknown Subtable Type"         /* Reserved */
 };
 
 #define ACPI_FADT_PM_RESERVED       9
@@ -304,56 +321,65 @@
  * handler. This table must be NULL terminated. RSDP and FACS are
  * special-cased elsewhere.
  *
+ * Note: Any tables added here should be duplicated within AcpiSupportedTables
+ * in the file common/ahtable.c
+ *
  ******************************************************************************/
 
-ACPI_DMTABLE_DATA    AcpiDmTableData[] =
+const ACPI_DMTABLE_DATA     AcpiDmTableData[] =
 {
-    {ACPI_SIG_ASF,  NULL,                   AcpiDmDumpAsf,  DtCompileAsf,   TemplateAsf,    "Alert Standard Format table"},
-    {ACPI_SIG_BERT, AcpiDmTableInfoBert,    NULL,           NULL,           TemplateBert,   "Boot Error Record Table"},
-    {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt,    NULL,           NULL,           TemplateBgrt,   "Boot Graphics Resource Table"},
-    {ACPI_SIG_BOOT, AcpiDmTableInfoBoot,    NULL,           NULL,           TemplateBoot,   "Simple Boot Flag Table"},
-    {ACPI_SIG_CPEP, NULL,                   AcpiDmDumpCpep, DtCompileCpep,  TemplateCpep,   "Corrected Platform Error Polling table"},
-    {ACPI_SIG_CSRT, NULL,                   AcpiDmDumpCsrt, DtCompileCsrt,  TemplateCsrt,   "Core System Resource Table"},
-    {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2,    AcpiDmDumpDbg2, DtCompileDbg2,  TemplateDbg2,   "Debug Port table type 2"},
-    {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp,    NULL,           NULL,           TemplateDbgp,   "Debug Port table"},
-    {ACPI_SIG_DMAR, NULL,                   AcpiDmDumpDmar, DtCompileDmar,  TemplateDmar,   "DMA Remapping table"},
-    {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt,    NULL,           NULL,           TemplateEcdt,   "Embedded Controller Boot Resources Table"},
-    {ACPI_SIG_EINJ, NULL,                   AcpiDmDumpEinj, DtCompileEinj,  TemplateEinj,   "Error Injection table"},
-    {ACPI_SIG_ERST, NULL,                   AcpiDmDumpErst, DtCompileErst,  TemplateErst,   "Error Record Serialization Table"},
-    {ACPI_SIG_FADT, NULL,                   AcpiDmDumpFadt, DtCompileFadt,  TemplateFadt,   "Fixed ACPI Description Table (FADT)"},
-    {ACPI_SIG_FPDT, NULL,                   AcpiDmDumpFpdt, DtCompileFpdt,  TemplateFpdt,   "Firmware Performance Data Table"},
-    {ACPI_SIG_GTDT, NULL,                   AcpiDmDumpGtdt, DtCompileGtdt,  TemplateGtdt,   "Generic Timer Description Table"},
-    {ACPI_SIG_HEST, NULL,                   AcpiDmDumpHest, DtCompileHest,  TemplateHest,   "Hardware Error Source Table"},
-    {ACPI_SIG_HPET, AcpiDmTableInfoHpet,    NULL,           NULL,           TemplateHpet,   "High Precision Event Timer table"},
-    {ACPI_SIG_IVRS, NULL,                   AcpiDmDumpIvrs, DtCompileIvrs,  TemplateIvrs,   "I/O Virtualization Reporting Structure"},
-    {ACPI_SIG_LPIT, NULL,                   AcpiDmDumpLpit, DtCompileLpit,  TemplateLpit,   "Low Power Idle Table"},
-    {ACPI_SIG_MADT, NULL,                   AcpiDmDumpMadt, DtCompileMadt,  TemplateMadt,   "Multiple APIC Description Table (MADT)"},
-    {ACPI_SIG_MCFG, NULL,                   AcpiDmDumpMcfg, DtCompileMcfg,  TemplateMcfg,   "Memory Mapped Configuration table"},
-    {ACPI_SIG_MCHI, AcpiDmTableInfoMchi,    NULL,           NULL,           TemplateMchi,   "Management Controller Host Interface table"},
-    {ACPI_SIG_MPST, AcpiDmTableInfoMpst,    AcpiDmDumpMpst, DtCompileMpst,  TemplateMpst,   "Memory Power State Table"},
-    {ACPI_SIG_MSCT, NULL,                   AcpiDmDumpMsct, DtCompileMsct,  TemplateMsct,   "Maximum System Characteristics Table"},
-    {ACPI_SIG_MSDM, NULL,                   AcpiDmDumpSlic, DtCompileSlic,  TemplateMsdm,   "Microsoft Data Management table"},
-    {ACPI_SIG_MTMR, NULL,                   AcpiDmDumpMtmr, DtCompileMtmr,  TemplateMtmr,   "MID Timer Table"},
-    {ACPI_SIG_PCCT, AcpiDmTableInfoPcct,    AcpiDmDumpPcct, DtCompilePcct,  TemplatePcct,   "Platform Communications Channel Table"},
-    {ACPI_SIG_PMTT, NULL,                   AcpiDmDumpPmtt, DtCompilePmtt,  TemplatePmtt,   "Platform Memory Topology Table"},
-    {ACPI_SIG_RSDT, NULL,                   AcpiDmDumpRsdt, DtCompileRsdt,  TemplateRsdt,   "Root System Description Table"},
-    {ACPI_SIG_S3PT, NULL,                   NULL,           NULL,           TemplateS3pt,   "S3 Performance Table"},
-    {ACPI_SIG_SBST, AcpiDmTableInfoSbst,    NULL,           NULL,           TemplateSbst,   "Smart Battery Specification Table"},
-    {ACPI_SIG_SLIC, NULL,                   AcpiDmDumpSlic, DtCompileSlic,  TemplateSlic,   "Software Licensing Description Table"},
-    {ACPI_SIG_SLIT, NULL,                   AcpiDmDumpSlit, DtCompileSlit,  TemplateSlit,   "System Locality Information Table"},
-    {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr,    NULL,           NULL,           TemplateSpcr,   "Serial Port Console Redirection table"},
-    {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi,    NULL,           NULL,           TemplateSpmi,   "Server Platform Management Interface table"},
-    {ACPI_SIG_SRAT, NULL,                   AcpiDmDumpSrat, DtCompileSrat,  TemplateSrat,   "System Resource Affinity Table"},
-    {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa,    NULL,           NULL,           TemplateTcpa,   "Trusted Computing Platform Alliance table"},
-    {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2,    NULL,           NULL,           TemplateTpm2,   "Trusted Platform Module hardware interface table"},
-    {ACPI_SIG_UEFI, AcpiDmTableInfoUefi,    NULL,           DtCompileUefi,  TemplateUefi,   "UEFI Boot Optimization Table"},
-    {ACPI_SIG_VRTC, AcpiDmTableInfoVrtc,    AcpiDmDumpVrtc, DtCompileVrtc,  TemplateVrtc,   "Virtual Real-Time Clock Table"},
-    {ACPI_SIG_WAET, AcpiDmTableInfoWaet,    NULL,           NULL,           TemplateWaet,   "Windows ACPI Emulated Devices Table"},
-    {ACPI_SIG_WDAT, NULL,                   AcpiDmDumpWdat, DtCompileWdat,  TemplateWdat,   "Watchdog Action Table"},
-    {ACPI_SIG_WDDT, AcpiDmTableInfoWddt,    NULL,           NULL,           TemplateWddt,   "Watchdog Description Table"},
-    {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt,    NULL,           NULL,           TemplateWdrt,   "Watchdog Resource Table"},
-    {ACPI_SIG_XSDT, NULL,                   AcpiDmDumpXsdt, DtCompileXsdt,  TemplateXsdt,   "Extended System Description Table"},
-    {NULL,          NULL,                   NULL,           NULL,           NULL,           NULL}
+    {ACPI_SIG_ASF,  NULL,                   AcpiDmDumpAsf,  DtCompileAsf,   TemplateAsf},
+    {ACPI_SIG_BERT, AcpiDmTableInfoBert,    NULL,           NULL,           TemplateBert},
+    {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt,    NULL,           NULL,           TemplateBgrt},
+    {ACPI_SIG_BOOT, AcpiDmTableInfoBoot,    NULL,           NULL,           TemplateBoot},
+    {ACPI_SIG_CPEP, NULL,                   AcpiDmDumpCpep, DtCompileCpep,  TemplateCpep},
+    {ACPI_SIG_CSRT, NULL,                   AcpiDmDumpCsrt, DtCompileCsrt,  TemplateCsrt},
+    {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2,    AcpiDmDumpDbg2, DtCompileDbg2,  TemplateDbg2},
+    {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp,    NULL,           NULL,           TemplateDbgp},
+    {ACPI_SIG_DMAR, NULL,                   AcpiDmDumpDmar, DtCompileDmar,  TemplateDmar},
+    {ACPI_SIG_DRTM, NULL,                   AcpiDmDumpDrtm, DtCompileDrtm,  TemplateDrtm},
+    {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt,    NULL,           NULL,           TemplateEcdt},
+    {ACPI_SIG_EINJ, NULL,                   AcpiDmDumpEinj, DtCompileEinj,  TemplateEinj},
+    {ACPI_SIG_ERST, NULL,                   AcpiDmDumpErst, DtCompileErst,  TemplateErst},
+    {ACPI_SIG_FADT, NULL,                   AcpiDmDumpFadt, DtCompileFadt,  TemplateFadt},
+    {ACPI_SIG_FPDT, NULL,                   AcpiDmDumpFpdt, DtCompileFpdt,  TemplateFpdt},
+    {ACPI_SIG_GTDT, NULL,                   AcpiDmDumpGtdt, DtCompileGtdt,  TemplateGtdt},
+    {ACPI_SIG_HEST, NULL,                   AcpiDmDumpHest, DtCompileHest,  TemplateHest},
+    {ACPI_SIG_HPET, AcpiDmTableInfoHpet,    NULL,           NULL,           TemplateHpet},
+    {ACPI_SIG_IORT, NULL,                   AcpiDmDumpIort, DtCompileIort,  TemplateIort},
+    {ACPI_SIG_IVRS, NULL,                   AcpiDmDumpIvrs, DtCompileIvrs,  TemplateIvrs},
+    {ACPI_SIG_LPIT, NULL,                   AcpiDmDumpLpit, DtCompileLpit,  TemplateLpit},
+    {ACPI_SIG_MADT, NULL,                   AcpiDmDumpMadt, DtCompileMadt,  TemplateMadt},
+    {ACPI_SIG_MCFG, NULL,                   AcpiDmDumpMcfg, DtCompileMcfg,  TemplateMcfg},
+    {ACPI_SIG_MCHI, AcpiDmTableInfoMchi,    NULL,           NULL,           TemplateMchi},
+    {ACPI_SIG_MPST, AcpiDmTableInfoMpst,    AcpiDmDumpMpst, DtCompileMpst,  TemplateMpst},
+    {ACPI_SIG_MSCT, NULL,                   AcpiDmDumpMsct, DtCompileMsct,  TemplateMsct},
+    {ACPI_SIG_MSDM, NULL,                   AcpiDmDumpSlic, DtCompileSlic,  TemplateMsdm},
+    {ACPI_SIG_MTMR, NULL,                   AcpiDmDumpMtmr, DtCompileMtmr,  TemplateMtmr},
+    {ACPI_SIG_NFIT, AcpiDmTableInfoNfit,    AcpiDmDumpNfit, DtCompileNfit,  TemplateNfit},
+    {ACPI_SIG_PCCT, AcpiDmTableInfoPcct,    AcpiDmDumpPcct, DtCompilePcct,  TemplatePcct},
+    {ACPI_SIG_PMTT, NULL,                   AcpiDmDumpPmtt, DtCompilePmtt,  TemplatePmtt},
+    {ACPI_SIG_RSDT, NULL,                   AcpiDmDumpRsdt, DtCompileRsdt,  TemplateRsdt},
+    {ACPI_SIG_S3PT, NULL,                   NULL,           NULL,           TemplateS3pt},
+    {ACPI_SIG_SBST, AcpiDmTableInfoSbst,    NULL,           NULL,           TemplateSbst},
+    {ACPI_SIG_SLIC, NULL,                   AcpiDmDumpSlic, DtCompileSlic,  TemplateSlic},
+    {ACPI_SIG_SLIT, NULL,                   AcpiDmDumpSlit, DtCompileSlit,  TemplateSlit},
+    {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr,    NULL,           NULL,           TemplateSpcr},
+    {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi,    NULL,           NULL,           TemplateSpmi},
+    {ACPI_SIG_SRAT, NULL,                   AcpiDmDumpSrat, DtCompileSrat,  TemplateSrat},
+    {ACPI_SIG_STAO, NULL,                   AcpiDmDumpStao, DtCompileStao,  TemplateStao},
+    {ACPI_SIG_TCPA, NULL,                   AcpiDmDumpTcpa, DtCompileTcpa,  TemplateTcpa},
+    {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2,    NULL,           NULL,           TemplateTpm2},
+    {ACPI_SIG_UEFI, AcpiDmTableInfoUefi,    NULL,           DtCompileUefi,  TemplateUefi},
+    {ACPI_SIG_VRTC, AcpiDmTableInfoVrtc,    AcpiDmDumpVrtc, DtCompileVrtc,  TemplateVrtc},
+    {ACPI_SIG_WAET, AcpiDmTableInfoWaet,    NULL,           NULL,           TemplateWaet},
+    {ACPI_SIG_WDAT, NULL,                   AcpiDmDumpWdat, DtCompileWdat,  TemplateWdat},
+    {ACPI_SIG_WDDT, AcpiDmTableInfoWddt,    NULL,           NULL,           TemplateWddt},
+    {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt,    NULL,           NULL,           TemplateWdrt},
+    {ACPI_SIG_WPBT, NULL,                   AcpiDmDumpWpbt, DtCompileWpbt,  TemplateWpbt},
+    {ACPI_SIG_XENV, AcpiDmTableInfoXenv,    NULL,           NULL,           TemplateXenv},
+    {ACPI_SIG_XSDT, NULL,                   AcpiDmDumpXsdt, DtCompileXsdt,  TemplateXsdt},
+    {NULL,          NULL,                   NULL,           NULL,           NULL}
 };
 
 
@@ -407,18 +433,18 @@
  *
  ******************************************************************************/
 
-ACPI_DMTABLE_DATA *
+const ACPI_DMTABLE_DATA *
 AcpiDmGetTableData (
     char                    *Signature)
 {
-    ACPI_DMTABLE_DATA       *TableData;
+    const ACPI_DMTABLE_DATA *Info;
 
 
-    for (TableData = AcpiDmTableData; TableData->Signature; TableData++)
+    for (Info = AcpiDmTableData; Info->Signature; Info++)
     {
-        if (ACPI_COMPARE_NAME (Signature, TableData->Signature))
+        if (ACPI_COMPARE_NAME (Signature, Info->Signature))
         {
-            return (TableData);
+            return (Info);
         }
     }
 
@@ -444,7 +470,7 @@
     ACPI_TABLE_HEADER       *Table)
 {
     ACPI_STATUS             Status;
-    ACPI_DMTABLE_DATA       *TableData;
+    const ACPI_DMTABLE_DATA *TableData;
     UINT32                  Length;
 
 
@@ -474,7 +500,11 @@
     if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS))
     {
         Length = Table->Length;
-        AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);
+        Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
     }
     else if (ACPI_VALIDATE_RSDP_SIG (Table->Signature))
     {
@@ -502,7 +532,7 @@
         TableData = AcpiDmGetTableData (Table->Signature);
         if (!TableData)
         {
-            if (!ACPI_STRNCMP (Table->Signature, "OEM", 3))
+            if (!strncmp (Table->Signature, "OEM", 3))
             {
                 AcpiOsPrintf ("\n**** OEM-defined ACPI table [%4.4s], unknown contents\n\n",
                     Table->Signature);
@@ -535,7 +565,11 @@
         {
             /* Simple table, just walk the info table */
 
-            AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo);
+            Status = AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo);
+            if (ACPI_FAILURE (Status))
+            {
+                return;
+            }
         }
     }
 
@@ -558,7 +592,6 @@
  * PARAMETERS:  Offset              - Current byte offset, from table start
  *              ByteLength          - Length of the field in bytes, 0 for flags
  *              Name                - Name of this field
- *              Value               - Optional value, displayed on left of ':'
  *
  * RETURN:      None
  *
@@ -692,9 +725,10 @@
     UINT16                  Temp16;
     UINT32                  Temp32;
     UINT64                  Value;
-    ACPI_DMTABLE_DATA       *TableData;
+    const AH_TABLE          *TableData;
     const char              *Name;
     BOOLEAN                 LastOutputBlankLine = FALSE;
+    ACPI_STATUS             Status;
     char                    RepairedName[8];
 
 
@@ -715,13 +749,24 @@
         Target = ACPI_ADD_PTR (UINT8, Table, Info->Offset);
         CurrentOffset = TableOffset + Info->Offset;
 
-        /* Check for beyond EOT or beyond subtable end */
+        /* Check for beyond subtable end or (worse) beyond EOT */
 
-        if ((CurrentOffset >= TableLength) ||
-            (SubtableLength && (Info->Offset >= SubtableLength)))
+        if (SubtableLength && (Info->Offset >= SubtableLength))
         {
             AcpiOsPrintf (
-                "**** ACPI table terminates in the middle of a data structure! (dump table)\n");
+                "/**** ACPI subtable terminates early - "
+                "may be older version (dump table) */\n");
+
+            /* Move on to next subtable */
+
+            return (AE_OK);
+        }
+
+        if (CurrentOffset >= TableLength)
+        {
+            AcpiOsPrintf (
+                "/**** ACPI table terminates "
+                "in the middle of a data structure! (dump table) */\n");
             return (AE_BAD_DATA);
         }
 
@@ -754,6 +799,7 @@
         case ACPI_DMT_UINT16:
         case ACPI_DMT_DMAR:
         case ACPI_DMT_HEST:
+        case ACPI_DMT_NFIT:
 
             ByteLength = 2;
             break;
@@ -810,6 +856,7 @@
             ByteLength = 128;
             break;
 
+        case ACPI_DMT_UNICODE:
         case ACPI_DMT_BUFFER:
         case ACPI_DMT_RAW_BUFFER:
 
@@ -818,7 +865,7 @@
 
         case ACPI_DMT_STRING:
 
-            ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1;
+            ByteLength = strlen (ACPI_CAST_PTR (char, Target)) + 1;
             break;
 
         case ACPI_DMT_GAS:
@@ -841,16 +888,39 @@
             ByteLength = sizeof (ACPI_HEST_NOTIFY);
             break;
 
+        case ACPI_DMT_IORTMEM:
+
+            if (!LastOutputBlankLine)
+            {
+                LastOutputBlankLine = FALSE;
+            }
+            ByteLength = sizeof (ACPI_IORT_MEMORY_ACCESS);
+            break;
+
         default:
 
             ByteLength = 0;
             break;
         }
 
+        /* Check if we are beyond a subtable, or (worse) beyond EOT */
+
         if (CurrentOffset + ByteLength > TableLength)
         {
+            if (SubtableLength)
+            {
+                AcpiOsPrintf (
+                    "/**** ACPI subtable terminates early - "
+                    "may be older version (dump table) */\n");
+
+                /* Move on to next subtable */
+
+                return (AE_OK);
+            }
+
             AcpiOsPrintf (
-                "**** ACPI table terminates in the middle of a data structure!\n");
+                "/**** ACPI table terminates "
+                "in the middle of a data structure! */\n");
             return (AE_BAD_DATA);
         }
 
@@ -980,10 +1050,10 @@
 
             AcpiDmCheckAscii (Target, RepairedName, 4);
             AcpiOsPrintf ("\"%.4s\"    ", RepairedName);
-            TableData = AcpiDmGetTableData (ACPI_CAST_PTR (char, Target));
+            TableData = AcpiAhGetTableInfo (ACPI_CAST_PTR (char, Target));
             if (TableData)
             {
-                AcpiOsPrintf (STRING_FORMAT, TableData->Name);
+                AcpiOsPrintf (STRING_FORMAT, TableData->Description);
             }
             else
             {
@@ -1053,8 +1123,13 @@
             /* Generic Address Structure */
 
             AcpiOsPrintf (STRING_FORMAT, "Generic Address Structure");
-            AcpiDmDumpTable (TableLength, CurrentOffset, Target,
+            Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
                 sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas);
+            if (ACPI_FAILURE (Status))
+            {
+                return (Status);
+            }
+
             AcpiOsPrintf ("\n");
             LastOutputBlankLine = TRUE;
             break;
@@ -1189,8 +1264,13 @@
             AcpiOsPrintf (STRING_FORMAT,
                 "Hardware Error Notification Structure");
 
-            AcpiDmDumpTable (TableLength, CurrentOffset, Target,
+            Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
                 sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify);
+            if (ACPI_FAILURE (Status))
+            {
+                return (Status);
+            }
+
             AcpiOsPrintf ("\n");
             LastOutputBlankLine = TRUE;
             break;
@@ -1209,6 +1289,21 @@
                 AcpiDmHestNotifySubnames[Temp8]);
             break;
 
+        case ACPI_DMT_IORTMEM:
+
+            AcpiOsPrintf (STRING_FORMAT,
+                "IORT Memory Access Properties");
+
+            Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
+                sizeof (ACPI_IORT_MEMORY_ACCESS), AcpiDmTableInfoIortAcc);
+            if (ACPI_FAILURE (Status))
+            {
+                return (Status);
+            }
+
+            LastOutputBlankLine = TRUE;
+            break;
+
         case ACPI_DMT_MADT:
 
             /* MADT subtable types */
@@ -1223,6 +1318,20 @@
                 AcpiDmMadtSubnames[Temp8]);
             break;
 
+        case ACPI_DMT_NFIT:
+
+            /* NFIT subtable types */
+
+            Temp16 = ACPI_GET16 (Target);
+            if (Temp16 > ACPI_NFIT_TYPE_RESERVED)
+            {
+                Temp16 = ACPI_NFIT_TYPE_RESERVED;
+            }
+
+            AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
+                AcpiDmNfitSubnames[Temp16]);
+            break;
+
         case ACPI_DMT_PCCT:
 
             /* PCCT subtable types */
@@ -1251,16 +1360,27 @@
                 AcpiDmPmttSubnames[Temp8]);
             break;
 
+        case ACPI_DMT_UNICODE:
+
+            if (ByteLength == 0)
+            {
+                AcpiOsPrintf ("/* Zero-length Data */\n");
+                break;
+            }
+
+            AcpiDmDumpUnicode (Table, CurrentOffset, ByteLength);
+            break;
+
         case ACPI_DMT_RAW_BUFFER:
-            /*
-             * Currently only used for SLIC table
-             */
-            AcpiOsPrintf ("/* Proprietary data structure */ ");
 
-            AcpiDmDumpBuffer (Table, sizeof (ACPI_TABLE_HEADER),
-                ByteLength, sizeof (ACPI_TABLE_HEADER),
-                "Licensing Data", TRUE);
-            AcpiOsPrintf ("\n");
+            if (ByteLength == 0)
+            {
+                AcpiOsPrintf ("/* Zero-length Data */\n");
+                break;
+            }
+
+            AcpiDmDumpBuffer (Table, CurrentOffset, ByteLength,
+                CurrentOffset, NULL);
             break;
 
         case ACPI_DMT_SRAT:
--- a/sys/external/bsd/acpica/dist/common/getopt.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/common/getopt.c	Tue Aug 18 09:53:33 2015 +0000
@@ -145,7 +145,7 @@
         {
             return (ACPI_OPT_END);
         }
-        else if (ACPI_STRCMP (argv[AcpiGbl_Optind], "--") == 0)
+        else if (strcmp (argv[AcpiGbl_Optind], "--") == 0)
         {
             AcpiGbl_Optind++;
             return (ACPI_OPT_END);
@@ -159,7 +159,7 @@
     /* Make sure that the option is legal */
 
     if (CurrentChar == ':' ||
-       (OptsPtr = ACPI_STRCHR (opts, CurrentChar)) == NULL)
+       (OptsPtr = strchr (opts, CurrentChar)) == NULL)
     {
         ACPI_OPTION_ERROR ("Illegal option: -", CurrentChar);
 
--- a/sys/external/bsd/acpica/dist/compiler/aslascii.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslascii.c	Tue Aug 18 09:53:33 2015 +0000
@@ -148,8 +148,7 @@
  *
  * FUNCTION:    FlCheckForAscii
  *
- * PARAMETERS:  Handle              - Open input file
- *              Filename            - Input filename
+ * PARAMETERS:  Filename            - Full input filename
  *              DisplayErrors       - TRUE if error messages desired
  *
  * RETURN:      Status
@@ -165,7 +164,6 @@
 
 ACPI_STATUS
 FlCheckForAscii (
-    FILE                    *Handle,
     char                    *Filename,
     BOOLEAN                 DisplayErrors)
 {
@@ -173,8 +171,18 @@
     ACPI_SIZE               BadBytes = 0;
     BOOLEAN                 OpeningComment = FALSE;
     ASL_FILE_STATUS         Status;
+    FILE                    *Handle;
 
 
+    /* Open file in text mode so file offset is always accurate */
+
+    Handle = fopen (Filename, "rb");
+    if (!Handle)
+    {
+        perror ("Could not open input file");
+        return (AE_ERROR);
+    }
+
     Status.Line = 1;
     Status.Offset = 0;
 
@@ -214,16 +222,30 @@
             if ((BadBytes < 10) && (DisplayErrors))
             {
                 AcpiOsPrintf (
-                    "Non-ASCII character [0x%2.2X] found in line %u, file offset 0x%.2X\n",
+                    "Found non-ASCII character in source text: "
+                    "0x%2.2X in line %u, file offset 0x%2.2X\n",
                     Byte, Status.Line, Status.Offset);
             }
-
             BadBytes++;
         }
 
-        /* Update line counter */
+        /* Ensure character is either printable or a "space" char */
 
-        else if (Byte == 0x0A)
+        else if (!isprint (Byte) && !isspace (Byte))
+        {
+            if ((BadBytes < 10) && (DisplayErrors))
+            {
+                AcpiOsPrintf (
+                    "Found invalid character in source text: "
+                    "0x%2.2X in line %u, file offset 0x%2.2X\n",
+                    Byte, Status.Line, Status.Offset);
+            }
+            BadBytes++;
+        }
+
+        /* Update line counter as necessary */
+
+        if (Byte == 0x0A)
         {
             Status.Line++;
         }
@@ -231,9 +253,7 @@
         Status.Offset++;
     }
 
-    /* Seek back to the beginning of the source file */
-
-    fseek (Handle, 0, SEEK_SET);
+    fclose (Handle);
 
     /* Were there any non-ASCII characters in the file? */
 
@@ -242,8 +262,8 @@
         if (DisplayErrors)
         {
             AcpiOsPrintf (
-                "%u non-ASCII characters found in input source text, could be a binary file\n",
-                BadBytes);
+                "Total %u invalid characters found in input source text, "
+                "could be a binary file\n", BadBytes);
             AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, Filename);
         }
 
@@ -286,6 +306,7 @@
         {
             if (Byte == '/')
             {
+                Status->Offset++;
                 return;
             }
 
--- a/sys/external/bsd/acpica/dist/compiler/aslcodegen.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslcodegen.c	Tue Aug 18 09:53:33 2015 +0000
@@ -110,7 +110,7 @@
 
     DbgPrint (ASL_TREE_OUTPUT,
         "%*s Value    P_Op A_Op OpLen PByts Len  SubLen PSubLen OpPtr"
-        "    Parent   Child    Next     Flags    AcTyp    Final Col L\n",
+        "    Parent   Child    Next     Flags    AcTyp    Final Col L#  EL#  LL#  ELL#\n",
         76, " ");
 
     CgCloseTable ();
@@ -145,7 +145,7 @@
             "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\n",
+            "    Parent   Child    Next     Flags    AcTyp    Final Col L#  EL#  LL#  ELL#\n",
             76, " ");
     }
 
@@ -169,7 +169,7 @@
 
     DbgPrint (ASL_TREE_OUTPUT,
     "%08X %04X %04X %01X     %04X  %04X %04X   %04X    "
-    "%08X %08X %08X %08X %08X %08X %04X  %02d  %02d\n",
+    "%08X %08X %08X %08X %08X %08X %04X  %02d  %02d   %02d   %02d   %02d\n",
             /* 1  */ (UINT32) Op->Asl.Value.Integer,
             /* 2  */ Op->Asl.ParseOpcode,
             /* 3  */ Op->Asl.AmlOpcode,
@@ -186,7 +186,10 @@
             /* 14 */ Op->Asl.AcpiBtype,
             /* 15 */ Op->Asl.FinalAmlLength,
             /* 16 */ Op->Asl.Column,
-            /* 17 */ Op->Asl.LineNumber);
+            /* 17 */ Op->Asl.LineNumber,
+            /* 18 */ Op->Asl.EndLine,
+            /* 19 */ Op->Asl.LogicalLineNumber,
+            /* 20 */ Op->Asl.EndLogicalLine);
 
     /* Generate the AML for this node */
 
--- a/sys/external/bsd/acpica/dist/compiler/asldefine.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asldefine.h	Tue Aug 18 09:53:33 2015 +0000
@@ -52,8 +52,9 @@
 #define AML_DISASSEMBLER_NAME       "AML/ASL+ Disassembler"
 #define ASL_INVOCATION_NAME         "iasl"
 #define ASL_CREATOR_ID              "INTL"
+#define ASL_DEFINE                  "__IASL__"
 
-#define ASL_COMPLIANCE              "Supports ACPI Specification Revision 5.1"
+#define ASL_COMPLIANCE              "Supports ACPI Specification Revision 6.0"
 
 
 /* Configuration constants */
@@ -105,7 +106,8 @@
 
 /* filename suffixes for output files */
 
-#define FILE_SUFFIX_PREPROCESSOR    "i"
+#define FILE_SUFFIX_PREPROC_USER    "i  "
+#define FILE_SUFFIX_PREPROCESSOR    "pre"
 #define FILE_SUFFIX_AML_CODE        "aml"
 #define FILE_SUFFIX_MAP             "map"
 #define FILE_SUFFIX_LISTING         "lst"
@@ -136,6 +138,8 @@
 #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)
 
 
 /* Listings */
@@ -152,12 +156,6 @@
 #define ACPI_COMPILER_RESERVED_NAME     (ACPI_UINT32_MAX - 3)
 
 
-/* String to Integer conversion */
-
-#define NEGATIVE                    1
-#define POSITIVE                    0
-
-
 /* Helper macros for resource tag creation */
 
 #define RsCreateMultiBitField \
--- a/sys/external/bsd/acpica/dist/compiler/aslfold.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslfold.c	Tue Aug 18 09:53:33 2015 +0000
@@ -236,6 +236,8 @@
      */
     if (WalkState->Opcode == AML_BUFFER_OP)
     {
+        DbgPrint (ASL_PARSE_OUTPUT,
+            "\nBuffer+Buffer->Buffer constant reduction is not supported yet");
         Status = AE_TYPE;
         goto CleanupAndExit;
     }
@@ -380,10 +382,12 @@
         return (Status);
     }
 
+    /* Disconnect any existing children, install new constant */
+
+    Op->Asl.Child = NULL;
     TrInstallReducedConstant (Op, ObjDesc);
 
     UtSetParseOpName (Op);
-    Op->Asl.Child = NULL;
     return (AE_OK);
 }
 
@@ -494,6 +498,10 @@
         goto EvalError;
     }
 
+    /* Truncate any subtree expressions, they have been evaluated */
+
+    Child1->Asl.Child = NULL;
+
     /* Folded constant is in ObjDesc, store into Child1 */
 
     TrInstallReducedConstant (Child1, ObjDesc);
@@ -505,11 +513,6 @@
     UtSetParseOpName (Op);
     Op->Common.Parent = OriginalParent;
 
-    /* Truncate any subtree expressions, they have been evaluated */
-
-    Child1->Asl.Child = NULL;
-    Child2->Asl.Child = NULL;
-
     /* First child is the folded constant */
 
     /* Second child will be the target */
@@ -547,7 +550,8 @@
     ACPI_PARSE_OBJECT       *Op,
     ACPI_OPERAND_OBJECT     *ObjDesc)
 {
-    ACPI_PARSE_OBJECT       *RootOp;
+    ACPI_PARSE_OBJECT       *LengthOp;
+    ACPI_PARSE_OBJECT       *DataOp;
 
 
     TotalFolds++;
@@ -574,17 +578,22 @@
 
         Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL;
         Op->Common.AmlOpcode = AML_STRING_OP;
-        Op->Asl.AmlLength = ACPI_STRLEN (ObjDesc->String.Pointer) + 1;
+        Op->Asl.AmlLength = strlen (ObjDesc->String.Pointer) + 1;
         Op->Common.Value.String = ObjDesc->String.Pointer;
 
         DbgPrint (ASL_PARSE_OUTPUT,
             "Constant expression reduced to (STRING) %s\n\n",
             Op->Common.Value.String);
-
         break;
 
     case ACPI_TYPE_BUFFER:
-
+        /*
+         * Create a new parse subtree of the form:
+         *
+         * BUFFER (Buffer AML opcode)
+         *    INTEGER (Buffer length in bytes)
+         *    RAW_DATA (Buffer byte data)
+         */
         Op->Asl.ParseOpcode = PARSEOP_BUFFER;
         Op->Common.AmlOpcode = AML_BUFFER_OP;
         Op->Asl.CompileFlags = NODE_AML_PACKAGE;
@@ -592,28 +601,24 @@
 
         /* Child node is the buffer length */
 
-        RootOp = TrAllocateNode (PARSEOP_INTEGER);
+        LengthOp = TrAllocateNode (PARSEOP_INTEGER);
 
-        RootOp->Asl.AmlOpcode = AML_DWORD_OP;
-        RootOp->Asl.Value.Integer = ObjDesc->Buffer.Length;
-        RootOp->Asl.Parent = Op;
+        LengthOp->Asl.AmlOpcode = AML_DWORD_OP;
+        LengthOp->Asl.Value.Integer = ObjDesc->Buffer.Length;
+        LengthOp->Asl.Parent = Op;
+        (void) OpcSetOptimalIntegerSize (LengthOp);
 
-        (void) OpcSetOptimalIntegerSize (RootOp);
+        Op->Asl.Child = LengthOp;
 
-        Op->Asl.Child = RootOp;
-        Op = RootOp;
-        UtSetParseOpName (Op);
-
-        /* Peer to the child is the raw buffer data */
+        /* Next child is the raw buffer data */
 
-        RootOp = TrAllocateNode (PARSEOP_RAW_DATA);
-        RootOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
-        RootOp->Asl.AmlLength = ObjDesc->Buffer.Length;
-        RootOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer;
-        RootOp->Asl.Parent = Op->Asl.Parent;
+        DataOp = TrAllocateNode (PARSEOP_RAW_DATA);
+        DataOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
+        DataOp->Asl.AmlLength = ObjDesc->Buffer.Length;
+        DataOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer;
+        DataOp->Asl.Parent = Op;
 
-        Op->Asl.Next = RootOp;
-        Op = RootOp;
+        LengthOp->Asl.Next = DataOp;
 
         DbgPrint (ASL_PARSE_OUTPUT,
             "Constant expression reduced to (BUFFER) length %X\n\n",
--- a/sys/external/bsd/acpica/dist/compiler/aslglobal.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslglobal.h	Tue Aug 18 09:53:33 2015 +0000
@@ -73,6 +73,7 @@
     {NULL, NULL, "Binary Output:", "AML Output"},
     {NULL, NULL, "Source Output:", "Source Output"},
     {NULL, NULL, "Preprocessor: ", "Preprocessor Output"},
+    {NULL, NULL, "Preprocessor: ", "Preprocessor Temp File"},
     {NULL, NULL, "Listing File: ", "Listing Output"},
     {NULL, NULL, "Hex Dump:     ", "Hex Table Output"},
     {NULL, NULL, "Namespace:    ", "Namespace Output"},
@@ -123,10 +124,10 @@
 ASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_LineBufPtr, NULL);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_LineBufferSize, ASL_DEFAULT_LINE_BUFFER_SIZE);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_CurrentColumn, 0);
-ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_PreviousLineNumber, 0);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_CurrentLineNumber, 1);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_LogicalLineNumber, 1);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_CurrentLineOffset, 0);
+ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_OriginalInputFileSize, 0);
 ASL_EXTERN UINT8                    ASL_INIT_GLOBAL (Gbl_SyntaxError, 0);
 
 /* Exception reporting */
@@ -146,6 +147,7 @@
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_MapfileFlag, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_NsOutputFlag, FALSE);
 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_AsmOutputFlag, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_C_OutputFlag, FALSE);
--- a/sys/external/bsd/acpica/dist/compiler/aslmain.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslmain.c	Tue Aug 18 09:53:33 2015 +0000
@@ -261,7 +261,7 @@
 
     /* Close all open files */
 
-    Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */
+    Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .pre file is same as source file */
 
     for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++)
     {
--- a/sys/external/bsd/acpica/dist/compiler/aslmapenter.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslmapenter.c	Tue Aug 18 09:53:33 2015 +0000
@@ -239,7 +239,7 @@
     /* Sort on source DeviceName first */
 
     while (NextGpio &&
-            (ACPI_STRCMP (DeviceName, NextGpio->DeviceName) > 0))
+            (strcmp (DeviceName, NextGpio->DeviceName) > 0))
     {
         PrevGpio = NextGpio;
         NextGpio = NextGpio->Next;
@@ -249,7 +249,7 @@
 
     while (NextGpio &&
             (NextGpio->PinNumber < PinNumber) &&
-            !ACPI_STRCMP (DeviceName, NextGpio->DeviceName))
+            !strcmp (DeviceName, NextGpio->DeviceName))
     {
         PrevGpio = NextGpio;
         NextGpio = NextGpio->Next;
@@ -316,7 +316,7 @@
     /* Sort on source DeviceName */
 
     while (NextSerial &&
-        (ACPI_STRCMP (DeviceName, NextSerial->DeviceName) > 0))
+        (strcmp (DeviceName, NextSerial->DeviceName) > 0))
     {
         PrevSerial = NextSerial;
         NextSerial = NextSerial->Next;
@@ -326,7 +326,7 @@
 
     while (NextSerial &&
         (NextSerial->Address < Address) &&
-        !ACPI_STRCMP (DeviceName, NextSerial->DeviceName))
+        !strcmp (DeviceName, NextSerial->DeviceName))
     {
         PrevSerial = NextSerial;
         NextSerial = NextSerial->Next;
--- a/sys/external/bsd/acpica/dist/compiler/aslmapoutput.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslmapoutput.c	Tue Aug 18 09:53:33 2015 +0000
@@ -207,7 +207,7 @@
         /* Print header info for the controller itself */
 
         if (!PrevDeviceName ||
-            ACPI_STRCMP (PrevDeviceName, Info->DeviceName))
+            strcmp (PrevDeviceName, Info->DeviceName))
         {
             FlPrintFile (ASL_FILE_MAP_OUTPUT,
                 "\n\nGPIO Controller:  %-8s  %-28s",
@@ -360,7 +360,7 @@
         /* Print header info for the controller itself */
 
         if (!PrevDeviceName ||
-            ACPI_STRCMP (PrevDeviceName, Info->DeviceName))
+            strcmp (PrevDeviceName, Info->DeviceName))
         {
             FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\n%s Controller:  ",
                 Type);
--- a/sys/external/bsd/acpica/dist/compiler/aslmessages.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslmessages.c	Tue Aug 18 09:53:33 2015 +0000
@@ -235,7 +235,11 @@
 /*    ASL_MSG_BUFFER_ALLOCATION */          "Could not allocate line buffer",
 /*    ASL_MSG_MISSING_DEPENDENCY */         "Missing dependency",
 /*    ASL_MSG_ILLEGAL_FORWARD_REF */        "Illegal forward reference within a method",
-/*    ASL_MSG_ILLEGAL_METHOD_REF */         "Illegal reference across two methods"
+/*    ASL_MSG_ILLEGAL_METHOD_REF */         "Illegal reference across two methods",
+/*    ASL_MSG_LOCAL_NOT_USED */             "Method Local is set but never used",
+/*    ASL_MSG_ARG_AS_LOCAL_NOT_USED */      "Method Argument (as a local) is set but never used",
+/*    ASL_MSG_ARG_NOT_USED */               "Method Argument is never used"
+
 };
 
 /* Table compiler */
@@ -270,7 +274,8 @@
 /*    ASL_MSG_TOO_MANY_ARGUMENTS */         "Too many macro arguments",
 /*    ASL_MSG_UNKNOWN_DIRECTIVE */          "Unknown directive",
 /*    ASL_MSG_UNKNOWN_PRAGMA */             "Unknown pragma",
-/*    ASL_MSG_WARNING_DIRECTIVE */          "#warning"
+/*    ASL_MSG_WARNING_DIRECTIVE */          "#warning",
+/*    ASL_MSG_INCLUDE_FILE */               "Found a # preprocessor directive in ASL Include() file"
 };
 
 
@@ -331,7 +336,7 @@
 
         if (Index >= ACPI_ARRAY_LENGTH (AslPreprocessorMsgs))
         {
-            return ("[Unknown Preprocesor exception ID]");
+            return ("[Unknown Preprocessor exception ID]");
         }
     }
 
--- a/sys/external/bsd/acpica/dist/compiler/aslmessages.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslmessages.h	Tue Aug 18 09:53:33 2015 +0000
@@ -238,6 +238,9 @@
     ASL_MSG_MISSING_DEPENDENCY,
     ASL_MSG_ILLEGAL_FORWARD_REF,
     ASL_MSG_ILLEGAL_METHOD_REF,
+    ASL_MSG_LOCAL_NOT_USED,
+    ASL_MSG_ARG_AS_LOCAL_NOT_USED,
+    ASL_MSG_ARG_NOT_USED,
 
     /* These messages are used by the Data Table compiler only */
 
@@ -267,6 +270,7 @@
     ASL_MSG_UNKNOWN_DIRECTIVE,
     ASL_MSG_UNKNOWN_PRAGMA,
     ASL_MSG_WARNING_DIRECTIVE,
+    ASL_MSG_INCLUDE_FILE
 
 } ASL_MESSAGE_IDS;
 
--- a/sys/external/bsd/acpica/dist/compiler/aslmethod.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslmethod.c	Tue Aug 18 09:53:33 2015 +0000
@@ -255,7 +255,7 @@
             return (AE_ERROR);
         }
 
-        RegisterNumber = (Op->Asl.AmlOpcode & 0x000F);
+        RegisterNumber = (Op->Asl.AmlOpcode & 0x0007);
 
         /*
          * If the local is being used as a target, mark the local
@@ -430,7 +430,7 @@
 
         /* Special typechecking for _HID */
 
-        if (!ACPI_STRCMP (METHOD_NAME__HID, Op->Asl.NameSeg))
+        if (!strcmp (METHOD_NAME__HID, Op->Asl.NameSeg))
         {
             Next = Op->Asl.Child->Asl.Next;
             AnCheckId (Next, ASL_TYPE_HID);
@@ -438,7 +438,7 @@
 
         /* Special typechecking for _CID */
 
-        else if (!ACPI_STRCMP (METHOD_NAME__CID, Op->Asl.NameSeg))
+        else if (!strcmp (METHOD_NAME__CID, Op->Asl.NameSeg))
         {
             Next = Op->Asl.Child->Asl.Next;
 
--- a/sys/external/bsd/acpica/dist/compiler/aslnamesp.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslnamesp.c	Tue Aug 18 09:53:33 2015 +0000
@@ -409,7 +409,7 @@
 
 
     TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
-    Status = AcpiNsHandleToPathname (Node, &TargetPath);
+    Status = AcpiNsHandleToPathname (Node, &TargetPath, FALSE);
     if (ACPI_FAILURE (Status))
     {
         return (Status);
--- a/sys/external/bsd/acpica/dist/compiler/asloffset.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asloffset.c	Tue Aug 18 09:53:33 2015 +0000
@@ -363,7 +363,7 @@
     /* Get the full pathname to the namespace node */
 
     TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
-    Status = AcpiNsHandleToPathname (Node, &TargetPath);
+    Status = AcpiNsHandleToPathname (Node, &TargetPath, FALSE);
     if (ACPI_FAILURE (Status))
     {
         return;
--- a/sys/external/bsd/acpica/dist/compiler/asloperands.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asloperands.c	Tue Aug 18 09:53:33 2015 +0000
@@ -932,7 +932,7 @@
     if (Child->Asl.Value.String)
     {
         Gbl_TableSignature = Child->Asl.Value.String;
-        if (ACPI_STRLEN (Gbl_TableSignature) != 4)
+        if (strlen (Gbl_TableSignature) != 4)
         {
             AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child,
                 "Length not exactly 4");
@@ -967,9 +967,9 @@
     Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
     if (Child->Asl.Value.String)
     {
-        Length = ACPI_STRLEN (Child->Asl.Value.String);
+        Length = strlen (Child->Asl.Value.String);
         Gbl_TableId = UtStringCacheCalloc (Length + 1);
-        ACPI_STRCPY (Gbl_TableId, Child->Asl.Value.String);
+        strcpy (Gbl_TableId, Child->Asl.Value.String);
 
         /*
          * Convert anything non-alphanumeric to an underscore. This
--- a/sys/external/bsd/acpica/dist/compiler/aslopt.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslopt.c	Tue Aug 18 09:53:33 2015 +0000
@@ -168,9 +168,9 @@
     /* We must allocate a new string for the name (TargetPath gets deleted) */
 
     *NewPath = UtStringCacheCalloc (ACPI_NAME_SIZE + 1);
-    ACPI_STRCPY (*NewPath, Path);
+    strcpy (*NewPath, Path);
 
-    if (ACPI_STRNCMP (*NewPath, "_T_", 3))
+    if (strncmp (*NewPath, "_T_", 3))
     {
         AslError (ASL_OPTIMIZATION, ASL_MSG_SINGLE_NAME_OPTIMIZATION, Op,
                 *NewPath);
@@ -341,7 +341,7 @@
         Index = TargetPath->Length;
     }
 
-    ACPI_STRCPY (&NewPathExternal[i], &((char *) TargetPath->Pointer)[Index]);
+    strcpy (&NewPathExternal[i], &((char *) TargetPath->Pointer)[Index]);
     ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, " %-24s", NewPathExternal));
 
     /*
@@ -358,11 +358,11 @@
         return (Status);
     }
 
-    if (ACPI_STRLEN (NewPath) >= AmlNameStringLength)
+    if (strlen (NewPath) >= AmlNameStringLength)
     {
         ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
             " NOT SHORTER (New %u old %u)",
-            (UINT32) ACPI_STRLEN (NewPath), (UINT32) AmlNameStringLength));
+            (UINT32) strlen (NewPath), (UINT32) AmlNameStringLength));
         ACPI_FREE (NewPathExternal);
         return (AE_NOT_FOUND);
     }
@@ -597,7 +597,7 @@
      * The original path must be longer than one NameSeg (4 chars) for there
      * to be any possibility that it can be optimized to a shorter string
      */
-    AmlNameStringLength = ACPI_STRLEN (AmlNameString);
+    AmlNameStringLength = strlen (AmlNameString);
     if (AmlNameStringLength <= ACPI_NAME_SIZE)
     {
         ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
@@ -655,7 +655,7 @@
      * format -- something we can easily manipulate
      */
     TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
-    Status = AcpiNsHandleToPathname (TargetNode, &TargetPath);
+    Status = AcpiNsHandleToPathname (TargetNode, &TargetPath, FALSE);
     if (ACPI_FAILURE (Status))
     {
         AslCoreSubsystemError (Op, Status, "Getting Target NamePath",
@@ -667,7 +667,7 @@
     /* CurrentPath is the path to this scope (where we are in the namespace) */
 
     CurrentPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
-    Status = AcpiNsHandleToPathname (CurrentNode, &CurrentPath);
+    Status = AcpiNsHandleToPathname (CurrentNode, &CurrentPath, FALSE);
     if (ACPI_FAILURE (Status))
     {
         AslCoreSubsystemError (Op, Status, "Getting Current NamePath",
@@ -745,7 +745,7 @@
      */
     if (ACPI_SUCCESS (Status))
     {
-        HowMuchShorter = (AmlNameStringLength - ACPI_STRLEN (NewPath));
+        HowMuchShorter = (AmlNameStringLength - strlen (NewPath));
         OptTotal += HowMuchShorter;
 
         ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
@@ -761,12 +761,12 @@
                  * (alias name) is the second operand
                  */
                 Op->Asl.Child->Asl.Next->Asl.Value.String = NewPath;
-                Op->Asl.Child->Asl.Next->Asl.AmlLength = ACPI_STRLEN (NewPath);
+                Op->Asl.Child->Asl.Next->Asl.AmlLength = strlen (NewPath);
             }
             else
             {
                 Op->Asl.Child->Asl.Value.String = NewPath;
-                Op->Asl.Child->Asl.AmlLength = ACPI_STRLEN (NewPath);
+                Op->Asl.Child->Asl.AmlLength = strlen (NewPath);
             }
         }
         else if (Flags & AML_CREATE)
@@ -781,14 +781,14 @@
             /* Update the parse node with the new NamePath */
 
             NextOp->Asl.Value.String = NewPath;
-            NextOp->Asl.AmlLength = ACPI_STRLEN (NewPath);
+            NextOp->Asl.AmlLength = strlen (NewPath);
         }
         else
         {
             /* Update the parse node with the new NamePath */
 
             Op->Asl.Value.String = NewPath;
-            Op->Asl.AmlLength = ACPI_STRLEN (NewPath);
+            Op->Asl.AmlLength = strlen (NewPath);
         }
     }
     else
--- a/sys/external/bsd/acpica/dist/compiler/asloptions.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asloptions.c	Tue Aug 18 09:53:33 2015 +0000
@@ -194,6 +194,7 @@
             DtParserdebug = 1;
             PrParserdebug = 1;
             Gbl_DebugFlag = TRUE;
+            Gbl_KeepPreprocessorTempFile = TRUE;
             break;
 
         case 'p':   /* Prune ASL parse tree */
@@ -285,6 +286,11 @@
             AcpiGbl_CstyleDisassembly = FALSE;
             break;
 
+        case 'v':
+
+            AcpiGbl_DbOpt_Verbose = TRUE;
+            break;
+
         default:
 
             printf ("Unknown option: -d%s\n", AcpiGbl_Optarg);
--- a/sys/external/bsd/acpica/dist/compiler/aslprintf.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslprintf.c	Tue Aug 18 09:53:33 2015 +0000
@@ -186,7 +186,7 @@
         if (StringToProcess)
         {
             NewString = UtStringCacheCalloc (StringLength + 1);
-            ACPI_STRNCPY (NewString, StartPosition, StringLength);
+            strncpy (NewString, StartPosition, StringLength);
 
             NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
             NewOp->Asl.Value.String = NewString;
@@ -275,7 +275,7 @@
     if (StringToProcess)
     {
         NewString = UtStringCacheCalloc (StringLength + 1);
-        ACPI_STRNCPY (NewString, StartPosition, StringLength);
+        strncpy (NewString, StartPosition, StringLength);
 
         NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
         NewOp->Asl.Value.String = NewString;
--- a/sys/external/bsd/acpica/dist/compiler/aslstartup.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslstartup.c	Tue Aug 18 09:53:33 2015 +0000
@@ -159,10 +159,10 @@
 
     /* Check for 100% ASCII source file (comments are ignored) */
 
-    Status = FlCheckForAscii (Info->Handle, Info->Filename, TRUE);
+    Status = FlCheckForAscii (Info->Filename, TRUE);
     if (ACPI_FAILURE (Status))
     {
-        printf ("Non-ascii input file - %s\n", Info->Filename);
+        printf ("Invalid characters in input file - %s\n", Info->Filename);
 
         if (!Gbl_IgnoreErrors)
         {
@@ -246,6 +246,11 @@
         return (Status);
     }
 
+    /* Handle additional output files for disassembler */
+
+    Gbl_FileType = ASL_INPUT_TYPE_ACPI_TABLE;
+    Status = FlOpenMiscOutputFiles (Gbl_OutputFilenamePrefix);
+
     /* This is where the disassembly happens */
 
     AcpiGbl_DbOpt_Disasm = TRUE;
@@ -261,13 +266,6 @@
 
     AcpiDmUnresolvedWarning (0);
 
-#if 0
-    /* TBD: Handle additional output files for disassembler */
-
-    Status = FlOpenMiscOutputFiles (Gbl_OutputFilenamePrefix);
-    NsDisplayNamespace ();
-#endif
-
     /* Shutdown compiler and ACPICA subsystem */
 
     AeClearErrorLog ();
@@ -359,6 +357,8 @@
         return (AE_ERROR);
     }
 
+    Gbl_OriginalInputFileSize = FlGetFileSize (ASL_FILE_INPUT);
+
     /* Determine input file type */
 
     Gbl_FileType = AslDetectSourceFileType (&Gbl_Files[ASL_FILE_INPUT]);
--- a/sys/external/bsd/acpica/dist/compiler/aslstubs.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslstubs.c	Tue Aug 18 09:53:33 2015 +0000
@@ -165,15 +165,6 @@
     return (AE_OK);
 }
 
-void
-AcpiExDoDebugObject (
-    ACPI_OPERAND_OBJECT     *SourceDesc,
-    UINT32                  Level,
-    UINT32                  Index)
-{
-    return;
-}
-
 ACPI_STATUS
 AcpiExReadDataFromField (
     ACPI_WALK_STATE         *WalkState,
@@ -216,6 +207,60 @@
     return (AE_SUPPORT);
 }
 
+void
+AcpiExDoDebugObject (
+    ACPI_OPERAND_OBJECT     *SourceDesc,
+    UINT32                  Level,
+    UINT32                  Index)
+{
+    return;
+}
+
+void
+AcpiExStartTraceMethod (
+    ACPI_NAMESPACE_NODE     *MethodNode,
+    ACPI_OPERAND_OBJECT     *ObjDesc,
+    ACPI_WALK_STATE         *WalkState)
+{
+    return;
+}
+
+void
+AcpiExStopTraceMethod (
+    ACPI_NAMESPACE_NODE     *MethodNode,
+    ACPI_OPERAND_OBJECT     *ObjDesc,
+    ACPI_WALK_STATE         *WalkState)
+{
+    return;
+}
+
+void
+AcpiExStartTraceOpcode (
+    ACPI_PARSE_OBJECT       *Op,
+    ACPI_WALK_STATE         *WalkState)
+{
+    return;
+}
+
+void
+AcpiExStopTraceOpcode (
+    ACPI_PARSE_OBJECT       *Op,
+    ACPI_WALK_STATE         *WalkState)
+
+{
+    return;
+}
+
+void
+AcpiExTracePoint (
+    ACPI_TRACE_EVENT_TYPE   Type,
+    BOOLEAN                 Begin,
+    UINT8                   *Aml,
+    char                    *Pathname)
+{
+    return;
+}
+
 ACPI_STATUS
 AcpiTbFindTable (
     char                    *Signature,
--- a/sys/external/bsd/acpica/dist/compiler/asltypes.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asltypes.h	Tue Aug 18 09:53:33 2015 +0000
@@ -148,32 +148,56 @@
 /*
  * File types. Note: Any changes to this table must also be reflected
  * in the Gbl_Files array.
+ *
+ * Corresponding filename suffixes are in comments
+ *
+ * NOTE: Don't move the first 4 file types
  */
 typedef enum
 {
     ASL_FILE_STDOUT             = 0,
     ASL_FILE_STDERR,
-    ASL_FILE_INPUT,
-    ASL_FILE_AML_OUTPUT,        /* Don't move these first 4 file types */
-    ASL_FILE_SOURCE_OUTPUT,
-    ASL_FILE_PREPROCESSOR,
-    ASL_FILE_LISTING_OUTPUT,
-    ASL_FILE_HEX_OUTPUT,
-    ASL_FILE_NAMESPACE_OUTPUT,
-    ASL_FILE_DEBUG_OUTPUT,
-    ASL_FILE_ASM_SOURCE_OUTPUT,
-    ASL_FILE_C_SOURCE_OUTPUT,
-    ASL_FILE_ASM_INCLUDE_OUTPUT,
-    ASL_FILE_C_INCLUDE_OUTPUT,
-    ASL_FILE_C_OFFSET_OUTPUT,
-    ASL_FILE_MAP_OUTPUT
+    ASL_FILE_INPUT,             /* .asl */
+    ASL_FILE_AML_OUTPUT,        /* .aml */
+    ASL_FILE_SOURCE_OUTPUT,     /* .src */
+    ASL_FILE_PREPROCESSOR,      /* .pre */
+    ASL_FILE_PREPROCESSOR_USER, /* .i   */
+    ASL_FILE_LISTING_OUTPUT,    /* .lst */
+    ASL_FILE_HEX_OUTPUT,        /* .hex */
+    ASL_FILE_NAMESPACE_OUTPUT,  /* .nsp */
+    ASL_FILE_DEBUG_OUTPUT,      /* .txt */
+    ASL_FILE_ASM_SOURCE_OUTPUT, /* .asm */
+    ASL_FILE_C_SOURCE_OUTPUT,   /* .c   */
+    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_TYPES;
 
 
-#define ASL_MAX_FILE_TYPE       15
+#define ASL_MAX_FILE_TYPE       16
 #define ASL_NUM_FILES           (ASL_MAX_FILE_TYPE + 1)
 
+/* filename suffixes for output files */
+
+#define FILE_SUFFIX_PREPROC_USER    "i  "
+#define FILE_SUFFIX_PREPROCESSOR    "pre"
+#define FILE_SUFFIX_AML_CODE        "aml"
+#define FILE_SUFFIX_MAP             "map"
+#define FILE_SUFFIX_LISTING         "lst"
+#define FILE_SUFFIX_HEX_DUMP        "hex"
+#define FILE_SUFFIX_DEBUG           "txt"
+#define FILE_SUFFIX_SOURCE          "src"
+#define FILE_SUFFIX_NAMESPACE       "nsp"
+#define FILE_SUFFIX_ASM_SOURCE      "asm"
+#define FILE_SUFFIX_C_SOURCE        "c"
+#define FILE_SUFFIX_DISASSEMBLY     "dsl"
+#define FILE_SUFFIX_ASM_INCLUDE     "inc"
+#define FILE_SUFFIX_C_INCLUDE       "h"
+#define FILE_SUFFIX_ASL_CODE        "asl"
+#define FILE_SUFFIX_C_OFFSET        "offset.h"
+
 
 /* Cache block structure for ParseOps and Strings */
 
@@ -278,5 +302,19 @@
 
 } ACPI_SERIAL_INFO;
 
+typedef struct asl_method_local
+{
+    ACPI_PARSE_OBJECT       *Op;
+    UINT8                   Flags;
+
+} ASL_METHOD_LOCAL;
+
+/* Values for Flags field above */
+
+#define ASL_LOCAL_INITIALIZED   (1)
+#define ASL_LOCAL_REFERENCED    (1<<1)
+#define ASL_ARG_IS_LOCAL        (1<<2)
+#define ASL_ARG_INITIALIZED     (1<<3)
+#define ASL_ARG_REFERENCED      (1<<4)
 
 #endif  /* __ASLTYPES_H */
--- a/sys/external/bsd/acpica/dist/compiler/asluuid.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asluuid.c	Tue Aug 18 09:53:33 2015 +0000
@@ -69,7 +69,7 @@
     UINT32                  i;
 
 
-    if (!InString || (ACPI_STRLEN (InString) != UUID_STRING_LENGTH))
+    if (!InString || (strlen (InString) != UUID_STRING_LENGTH))
     {
         return (AE_BAD_PARAMETER);
     }
--- a/sys/external/bsd/acpica/dist/compiler/dtcompiler.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/dtcompiler.h	Tue Aug 18 09:53:33 2015 +0000
@@ -115,6 +115,7 @@
     struct dt_subtable      *StackTop;
     UINT8                   *Buffer;
     UINT8                   *LengthField;
+    char                    *Name;
     UINT32                  Length;
     UINT32                  TotalLength;
     UINT32                  SizeOfLengthField;
@@ -170,12 +171,23 @@
     DT_SUBTABLE             **RetSubtable,
     BOOLEAN                 Required);
 
+ACPI_STATUS
+DtCompilePadding (
+    UINT32                  Length,
+    DT_SUBTABLE             **RetSubtable);
+
 
 /* dtio - binary and text input/output */
 
 UINT32
 DtGetNextLine (
-    FILE                    *Handle);
+    FILE                    *Handle,
+    UINT32                  Flags);
+
+/* Flags for DtGetNextLine */
+
+#define DT_ALLOW_MULTILINE_QUOTES   0x01
+
 
 DT_FIELD *
 DtScanFile (
@@ -429,6 +441,10 @@
     void                    **PFieldList);
 
 ACPI_STATUS
+DtCompileDrtm (
+    void                    **PFieldList);
+
+ACPI_STATUS
 DtCompileEinj (
     void                    **PFieldList);
 
@@ -453,6 +469,10 @@
     void                    **PFieldList);
 
 ACPI_STATUS
+DtCompileIort (
+    void                    **PFieldList);
+
+ACPI_STATUS
 DtCompileIvrs (
     void                    **PFieldList);
 
@@ -481,6 +501,10 @@
     void                    **PFieldList);
 
 ACPI_STATUS
+DtCompileNfit (
+    void                    **PFieldList);
+
+ACPI_STATUS
 DtCompilePmtt (
     void                    **PFieldList);
 
@@ -509,6 +533,14 @@
     void                    **PFieldList);
 
 ACPI_STATUS
+DtCompileStao (
+    void                    **PFieldList);
+
+ACPI_STATUS
+DtCompileTcpa (
+    void                    **PFieldList);
+
+ACPI_STATUS
 DtCompileUefi (
     void                    **PFieldList);
 
@@ -521,12 +553,18 @@
     void                    **PFieldList);
 
 ACPI_STATUS
+DtCompileWpbt (
+    void                    **PFieldList);
+
+ACPI_STATUS
 DtCompileXsdt (
     void                    **PFieldList);
 
 ACPI_STATUS
 DtCompileGeneric (
-    void                    **PFieldList);
+    void                    **PFieldList,
+    char                    *TermFieldName,
+    UINT32                  *PFieldLength);
 
 ACPI_DMTABLE_INFO *
 DtGetGenericTableInfo (
@@ -543,6 +581,7 @@
 extern const unsigned char  TemplateDbg2[];
 extern const unsigned char  TemplateDbgp[];
 extern const unsigned char  TemplateDmar[];
+extern const unsigned char  TemplateDrtm[];
 extern const unsigned char  TemplateEcdt[];
 extern const unsigned char  TemplateEinj[];
 extern const unsigned char  TemplateErst[];
@@ -551,6 +590,7 @@
 extern const unsigned char  TemplateGtdt[];
 extern const unsigned char  TemplateHest[];
 extern const unsigned char  TemplateHpet[];
+extern const unsigned char  TemplateIort[];
 extern const unsigned char  TemplateIvrs[];
 extern const unsigned char  TemplateLpit[];
 extern const unsigned char  TemplateMadt[];
@@ -560,6 +600,7 @@
 extern const unsigned char  TemplateMsct[];
 extern const unsigned char  TemplateMsdm[];
 extern const unsigned char  TemplateMtmr[];
+extern const unsigned char  TemplateNfit[];
 extern const unsigned char  TemplatePcct[];
 extern const unsigned char  TemplatePmtt[];
 extern const unsigned char  TemplateRsdt[];
@@ -570,6 +611,7 @@
 extern const unsigned char  TemplateSpcr[];
 extern const unsigned char  TemplateSpmi[];
 extern const unsigned char  TemplateSrat[];
+extern const unsigned char  TemplateStao[];
 extern const unsigned char  TemplateTcpa[];
 extern const unsigned char  TemplateTpm2[];
 extern const unsigned char  TemplateUefi[];
@@ -578,6 +620,8 @@
 extern const unsigned char  TemplateWdat[];
 extern const unsigned char  TemplateWddt[];
 extern const unsigned char  TemplateWdrt[];
+extern const unsigned char  TemplateWpbt[];
+extern const unsigned char  TemplateXenv[];
 extern const unsigned char  TemplateXsdt[];
 
 #endif
--- a/sys/external/bsd/acpica/dist/compiler/dtexpress.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/dtexpress.c	Tue Aug 18 09:53:33 2015 +0000
@@ -413,7 +413,7 @@
     LabelField = Gbl_LabelList;
     while (LabelField)
     {
-        if (!ACPI_STRCMP (Name, LabelField->Value))
+        if (!strcmp (Name, LabelField->Value))
         {
             return (LabelField);
         }
--- a/sys/external/bsd/acpica/dist/compiler/dtio.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/dtio.c	Tue Aug 18 09:53:33 2015 +0000
@@ -129,7 +129,7 @@
 
     /* Skip lines that start with a space */
 
-    if (!ACPI_STRCMP (String, " "))
+    if (!strcmp (String, " "))
     {
         ReturnString = UtStringCacheCalloc (1);
         return (ReturnString);
@@ -138,7 +138,7 @@
     /* Setup pointers to start and end of input string */
 
     Start = String;
-    End = String + ACPI_STRLEN (String) - 1;
+    End = String + strlen (String) - 1;
 
     /* Find first non-whitespace character */
 
@@ -180,9 +180,9 @@
 
     Length = ACPI_PTR_DIFF (End, Start) + 1;
     ReturnString = UtStringCacheCalloc (Length + 1);
-    if (ACPI_STRLEN (Start))
+    if (strlen (Start))
     {
-        ACPI_STRNCPY (ReturnString, Start, Length);
+        strncpy (ReturnString, Start, Length);
     }
 
     ReturnString[Length] = 0;
@@ -313,7 +313,7 @@
     Length = ACPI_PTR_DIFF (End, Start);
 
     TmpName = UtLocalCalloc (Length + 1);
-    ACPI_STRNCPY (TmpName, Start, Length);
+    strncpy (TmpName, Start, Length);
     Name = DtTrim (TmpName);
     ACPI_FREE (TmpName);
 
@@ -360,7 +360,7 @@
     Length = ACPI_PTR_DIFF (End, Start);
     TmpValue = UtLocalCalloc (Length + 1);
 
-    ACPI_STRNCPY (TmpValue, Start, Length);
+    strncpy (TmpValue, Start, Length);
     Value = DtTrim (TmpValue);
     ACPI_FREE (TmpValue);
 
@@ -406,7 +406,8 @@
 
 UINT32
 DtGetNextLine (
-    FILE                    *Handle)
+    FILE                    *Handle,
+    UINT32                  Flags)
 {
     BOOLEAN                 LineNotAllBlanks = FALSE;
     UINT32                  State = DT_NORMAL_TEXT;
@@ -415,7 +416,7 @@
     int                     c;
 
 
-    ACPI_MEMSET (Gbl_CurrentLineBuffer, 0, Gbl_LineBufferSize);
+    memset (Gbl_CurrentLineBuffer, 0, Gbl_LineBufferSize);
     for (i = 0; ;)
     {
         /*
@@ -550,9 +551,12 @@
 
             case '\n':
 
-                AcpiOsPrintf ("ERROR at line %u: Unterminated quoted string\n",
-                    Gbl_CurrentLineNumber++);
-                State = DT_NORMAL_TEXT;
+                if (!(Flags & DT_ALLOW_MULTILINE_QUOTES))
+                {
+                    AcpiOsPrintf ("ERROR at line %u: Unterminated quoted string\n",
+                        Gbl_CurrentLineNumber++);
+                    State = DT_NORMAL_TEXT;
+                }
                 break;
 
             default:    /* Get next character */
@@ -746,7 +750,7 @@
 
     /* Scan line-by-line */
 
-    while ((Offset = DtGetNextLine (Handle)) != ASL_EOF)
+    while ((Offset = DtGetNextLine (Handle, 0)) != ASL_EOF)
     {
         ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Line %2.2u/%4.4X - %s",
             Gbl_CurrentLineNumber, Offset, Gbl_CurrentLineBuffer));
@@ -897,7 +901,7 @@
             }
 
             BufChar = Buffer[(ACPI_SIZE) i + j];
-            if (ACPI_IS_PRINT (BufChar))
+            if (isprint (BufChar))
             {
                 FlPrintFile (FileId, "%c", BufChar);
             }
@@ -978,8 +982,8 @@
 {
 
     DbgPrint (ASL_DEBUG_OUTPUT,
-        "[%.04X] %.08X %.08X %.08X %.08X %.08X %p %p %p\n",
-        Subtable->Depth, Subtable->Length, Subtable->TotalLength,
+        "[%.04X] %24s %.08X %.08X %.08X %.08X %.08X %p %p %p\n",
+        Subtable->Depth, Subtable->Name, Subtable->Length, Subtable->TotalLength,
         Subtable->SizeOfLengthField, Subtable->Flags, Subtable,
         Subtable->Parent, Subtable->Child, Subtable->Peer);
 }
@@ -992,8 +996,8 @@
 {
 
     DbgPrint (ASL_DEBUG_OUTPUT,
-        "[%.04X] %*s%08X (%.02X) - (%.02X)\n",
-        Subtable->Depth, (4 * Subtable->Depth), " ",
+        "[%.04X] %24s %*s%08X (%.02X) - (%.02X)\n",
+        Subtable->Depth, Subtable->Name, (4 * Subtable->Depth), " ",
         Subtable, Subtable->Length, Subtable->TotalLength);
 }
 
@@ -1024,12 +1028,12 @@
 
     DbgPrint (ASL_DEBUG_OUTPUT,
         "Subtable Info:\n"
-        "Depth  Length   TotalLen LenSize  Flags    "
+        "Depth                      Name Length   TotalLen LenSize  Flags    "
         "This     Parent   Child    Peer\n\n");
     DtWalkTableTree (Gbl_RootTable, DtDumpSubtableInfo, NULL, NULL);
 
     DbgPrint (ASL_DEBUG_OUTPUT,
-        "\nSubtable Tree: (Depth, Subtable, Length, TotalLength)\n\n");
+        "\nSubtable Tree: (Depth, Name, Subtable, Length, TotalLength)\n\n");
     DtWalkTableTree (Gbl_RootTable, DtDumpSubtableTree, NULL, NULL);
 
     DbgPrint (ASL_DEBUG_OUTPUT, "\n");
--- a/sys/external/bsd/acpica/dist/compiler/dttemplate.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/dttemplate.c	Tue Aug 18 09:53:33 2015 +0000
@@ -59,7 +59,7 @@
 static ACPI_STATUS
 DtCreateOneTemplate (
     char                    *Signature,
-    ACPI_DMTABLE_DATA       *TableData);
+    const ACPI_DMTABLE_DATA *TableData);
 
 static ACPI_STATUS
 DtCreateAllTemplates (
@@ -85,6 +85,7 @@
 {
 
     if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_DSDT) ||
+        ACPI_COMPARE_NAME (Signature, ACPI_SIG_OSDT) ||
         ACPI_COMPARE_NAME (Signature, ACPI_SIG_SSDT) ||
         ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS) ||
         ACPI_COMPARE_NAME (Signature, ACPI_RSDP_NAME))
@@ -112,7 +113,7 @@
 DtCreateTemplates (
     char                    *Signature)
 {
-    ACPI_DMTABLE_DATA       *TableData;
+    const ACPI_DMTABLE_DATA *TableData;
     ACPI_STATUS             Status;
 
 
@@ -127,8 +128,8 @@
     }
 
     AcpiUtStrupr (Signature);
-    if (!ACPI_STRCMP (Signature, "ALL") ||
-        !ACPI_STRCMP (Signature, "*"))
+    if (!strcmp (Signature, "ALL") ||
+        !strcmp (Signature, "*"))
     {
         /* Create all available/known templates */
 
@@ -213,7 +214,7 @@
 DtCreateAllTemplates (
     void)
 {
-    ACPI_DMTABLE_DATA       *TableData;
+    const ACPI_DMTABLE_DATA *TableData;
     ACPI_STATUS             Status;
 
 
@@ -292,7 +293,7 @@
 static ACPI_STATUS
 DtCreateOneTemplate (
     char                    *Signature,
-    ACPI_DMTABLE_DATA       *TableData)
+    const ACPI_DMTABLE_DATA  *TableData)
 {
     char                    *DisasmFilename;
     FILE                    *File;
@@ -327,7 +328,7 @@
     AcpiOsPrintf ("/*\n");
     AcpiOsPrintf (ACPI_COMMON_HEADER ("iASL Compiler/Disassembler", " * "));
 
-    AcpiOsPrintf (" * Template for [%4.4s] ACPI Table\n",
+    AcpiOsPrintf (" * Template for [%4.4s] ACPI Table",
         Signature);
 
     /* Dump the actual ACPI table */
@@ -336,6 +337,8 @@
     {
         /* Normal case, tables that appear in AcpiDmTableData */
 
+        AcpiOsPrintf (" (static data table)\n");
+
         if (Gbl_VerboseTemplates)
         {
             AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength]"
@@ -344,7 +347,7 @@
         else
         {
             AcpiOsPrintf (" * Format: [ByteLength]"
-                "  FieldName : HexFieldValue\n */\n\n");
+                "  FieldName : HexFieldValue\n */\n");
         }
 
         AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER,
@@ -352,9 +355,11 @@
     }
     else
     {
-        /* Special ACPI tables - DSDT, SSDT, FADT, RSDP */
+        /* Special ACPI tables - DSDT, SSDT, OSDT, FADT, RSDP */
 
-        AcpiOsPrintf (" */\n\n");
+        AcpiOsPrintf (" (AML byte code table)\n");
+
+        AcpiOsPrintf (" */\n");
         if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_DSDT))
         {
             Actual = fwrite (TemplateDsdt, 1, sizeof (TemplateDsdt) -1, File);
@@ -377,6 +382,17 @@
                 goto Cleanup;
             }
         }
+        else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_OSDT))
+        {
+            Actual = fwrite (TemplateOsdt, 1, sizeof (TemplateOsdt) -1, File);
+            if (Actual != sizeof (TemplateOsdt) -1)
+            {
+                fprintf (stderr,
+                    "Could not write to output file %s\n", DisasmFilename);
+                Status = AE_ERROR;
+                goto Cleanup;
+            }
+        }
         else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS)) /* FADT */
         {
             AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER,
--- a/sys/external/bsd/acpica/dist/compiler/dttemplate.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/dttemplate.h	Tue Aug 18 09:53:33 2015 +0000
@@ -45,7 +45,7 @@
 #define __DTTEMPLATE_H
 
 
-/* Special templates for DSDT and SSDT (AML byte-code tables) */
+/* Special templates for the ASL/AML tables: DSDT, SSDT, and OSDT */
 
 const char TemplateDsdt[] =
     "DefinitionBlock (\"dsdt.aml\", \"DSDT\", 2, \"Intel\", \"Template\", 0x00000001)\n"
@@ -65,6 +65,15 @@
     "    }\n"
     "}\n\n";
 
+const char TemplateOsdt[] =
+    "DefinitionBlock (\"osdt.aml\", \"OSDT\", 2, \"Intel\", \"Template\", 0x00000001)\n"
+    "{\n"
+    "    Method (MAIN, 0, NotSerialized)\n"
+    "    {\n"
+    "        Return (Zero)\n"
+    "    }\n"
+    "}\n\n";
+
 
 /* Templates for ACPI data tables */
 
@@ -234,6 +243,29 @@
     0x00,0x00,0x00,0x00                       /* 00000088    "...."     */
 };
 
+const unsigned char TemplateDrtm[] =
+{
+    0x44,0x52,0x54,0x4D,0x94,0x00,0x00,0x00,  /* 00000000    "DRTM...." */
+    0x01,0xB9,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" */
+    0x10,0x04,0x15,0x20,0x00,0x00,0x00,0x00,  /* 00000020    "... ...." */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000028    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000030    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000038    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000040    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000048    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000050    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000058    "........" */
+    0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000060    "........" */
+    0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000068    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000070    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000078    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000080    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000088    "........" */
+    0x00,0x00,0x00,0x00                       /* 00000090    "...."     */
+};
+
 const unsigned char TemplateEcdt[] =
 {
     0x45,0x43,0x44,0x54,0x42,0x00,0x00,0x00,  /* 00000000    "ECDTB..." */
@@ -379,11 +411,11 @@
 
 const unsigned char TemplateFadt[] =
 {
-    0x46,0x41,0x43,0x50,0x0C,0x01,0x00,0x00,  /* 00000000    "FACP...." */
-    0x05,0x64,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    ".dINTEL " */
-    0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45,  /* 00000010    "TEMPLATE" */
+    0x46,0x41,0x43,0x50,0x14,0x01,0x00,0x00,  /* 00000000    "FACP...." */
+    0x06,0x8A,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
+    0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65,  /* 00000010    "Template" */
     0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
-    0x15,0x11,0x13,0x20,0x01,0x00,0x00,0x00,  /* 00000020    "... ...." */
+    0x10,0x04,0x15,0x20,0x01,0x00,0x00,0x00,  /* 00000020    "... ...." */
     0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000028    "........" */
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000030    "........" */
     0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000038    "........" */
@@ -412,7 +444,8 @@
     0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01,  /* 000000F0    "........" */
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000F8    "........" */
     0x01,0x08,0x00,0x01,0x00,0x00,0x00,0x00,  /* 00000100    "........" */
-    0x00,0x00,0x00,0x00                       /* 00000108    "...."     */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000108    "........" */
+    0x00,0x00,0x00,0x00                       /* 00000110    "...."     */
 };
 
 const unsigned char TemplateFpdt[] =
@@ -538,6 +571,44 @@
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00   /* 00000030    "........" */
 };
 
+const unsigned char TemplateIort[] =
+{
+    0x49,0x4F,0x52,0x54,0x0C,0x01,0x00,0x00,  /* 00000000    "IORT...." */
+    0x00,0xBC,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    "... ...." */
+    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    "........" */
+    0x18,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000040    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000048    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000050    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000058    "........" */
+    0x01,0x30,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000060    ".0......" */
+    0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,  /* 00000068    "....0..." */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000070    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x5C,0x5F,0x53,  /* 00000078    ".....\_S" */
+    0x42,0x2E,0x50,0x43,0x49,0x30,0x2E,0x44,  /* 00000080    "B.PCI0.D" */
+    0x45,0x56,0x30,0x00,0x00,0x00,0x00,0x00,  /* 00000088    "EV0....." */
+    0x02,0x20,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000090    ". ......" */
+    0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,  /* 00000098    ".... ..." */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000A0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000A8    "........" */
+    0x03,0x5C,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000B0    ".\......" */
+    0x00,0x00,0x00,0x00,0x5C,0x00,0x00,0x00,  /* 000000B8    "....\..." */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000C0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000C8    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000D0    "........" */
+    0x3C,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 000000D8    "<......." */
+    0x4C,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 000000E0    "L......." */
+    0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000E8    "T......." */
+    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    "...."     */
+};
+
 const unsigned char TemplateIvrs[] =
 {
     0x49,0x56,0x52,0x53,0xBC,0x00,0x00,0x00,  /* 00000000    "IVRS...." */
@@ -568,73 +639,75 @@
 
 const unsigned char TemplateLpit[] =
 {
-    0x4C,0x50,0x49,0x54,0xB4,0x00,0x00,0x00,  /* 00000000    "LPIT...." */
-    0x01,0x20,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    ". INTEL " */
-    0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45,  /* 00000010    "TEMPLATE" */
+    0x4C,0x50,0x49,0x54,0x94,0x00,0x00,0x00,  /* 00000000    "LPIT...." */
+    0x00,0xD8,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
+    0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65,  /* 00000010    "Template" */
     0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
-    0x25,0x03,0x14,0x20,0x00,0x00,0x00,0x00,  /* 00000020    "%.. ...." */
+    0x10,0x04,0x15,0x20,0x00,0x00,0x00,0x00,  /* 00000020    "... ...." */
     0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000028    "8......." */
-    0x00,0x00,0x00,0x00,0x7F,0x01,0x02,0x00,  /* 00000030    "........" */
+    0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01,  /* 00000030    "........" */
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000038    "........" */
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000040    "........" */
-    0x00,0x20,0x00,0x03,0x00,0x00,0x00,0x00,  /* 00000048    ". ......" */
+    0x7F,0x40,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000048    ".@......" */
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000050    "........" */
-    0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000058    "........" */
-    0x58,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000060    "X......." */
-    0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x02,  /* 00000068    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000058    "........" */
+    0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000060    "8......." */
+    0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01,  /* 00000068    "........" */
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000070    "........" */
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000078    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000080    "........" */
-    0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x02,  /* 00000088    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000090    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000098    "........" */
-    0x00,0x08,0x00,0x01,0x00,0x00,0x00,0x00,  /* 000000A0    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000A8    "........" */
-    0x00,0x00,0x00,0x00                       /* 000000B0    "...."     */
+    0x7F,0x40,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000080    ".@......" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000088    "........" */
+    0x00,0x00,0x00,0x00                       /* 00000090    "...."     */
 };
 
-/* MADT with ACPI 5.1 subtables */
+/* MADT with ACPI 6.0 subtables */
 
 const unsigned char TemplateMadt[] =
 {
-    0x41,0x50,0x49,0x43,0x2a,0x01,0x00,0x00,  /* 00000000    "APIC*..." */
-    0x04,0x34,0x49,0x4e,0x54,0x45,0x4c,0x20,  /* 00000008    ".4INTEL " */
-    0x54,0x45,0x4d,0x50,0x4c,0x41,0x54,0x45,  /* 00000010    "TEMPLATE" */
-    0x01,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c,  /* 00000018    "....INTL" */
-    0x24,0x04,0x14,0x20,0x00,0x00,0x00,0x00,  /* 00000020    "$.. ...." */
+    0x41,0x50,0x49,0x43,0x5A,0x01,0x00,0x00,  /* 00000000    "APICZ..." */
+    0x03,0xEA,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
+    0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65,  /* 00000010    "Template" */
+    0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
+    0x10,0x04,0x15,0x20,0x00,0x00,0x00,0x00,  /* 00000020    "... ...." */
     0x01,0x00,0x00,0x00,0x00,0x08,0x00,0x00,  /* 00000028    "........" */
-    0x01,0x00,0x00,0x00,0x01,0x0c,0x01,0x00,  /* 00000030    "........" */
+    0x01,0x00,0x00,0x00,0x01,0x0C,0x01,0x00,  /* 00000030    "........" */
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000038    "........" */
-    0x02,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000040    "........" */
-    0x00,0x00,0x03,0x08,0x0d,0x00,0x01,0x00,  /* 00000048    "........" */
+    0x02,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000040    "........" */
+    0x00,0x00,0x03,0x08,0x0D,0x00,0x01,0x00,  /* 00000048    "........" */
     0x00,0x00,0x04,0x06,0x00,0x05,0x00,0x01,  /* 00000050    "........" */
-    0x05,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000058    "........" */
+    0x05,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000058    "........" */
     0x00,0x00,0x00,0x00,0x06,0x10,0x00,0x00,  /* 00000060    "........" */
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000068    "........" */
     0x00,0x00,0x00,0x00,0x07,0x16,0x00,0x00,  /* 00000070    "........" */
     0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000078    "........" */
-    0x00,0x00,0x00,0x00,0x5c,0x43,0x50,0x55,  /* 00000080    "....\CPU" */
+    0x00,0x00,0x00,0x00,0x5C,0x43,0x50,0x55,  /* 00000080    "....\CPU" */
     0x30,0x00,0x08,0x10,0x05,0x00,0x00,0x00,  /* 00000088    "0......." */
     0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,  /* 00000090    "........" */
     0x00,0x00,0x09,0x10,0x00,0x00,0x00,0x00,  /* 00000098    "........" */
-    0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,  /* 000000a0    "........" */
-    0x00,0x00,0x0a,0x0c,0x05,0x00,0x00,0x00,  /* 000000a8    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x4c,  /* 000000b0    ".......L" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000b8    "........" */
-    0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,  /* 000000c0    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000c8    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000d0    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000d8    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000e0    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000e8    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000f0    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000f8    "........" */
-    0x00,0x00,0x0e,0x10,0x00,0x00,0x00,0x00,  /* 00000100    "........" */
+    0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,  /* 000000A0    "........" */
+    0x00,0x00,0x0A,0x0C,0x05,0x00,0x00,0x00,  /* 000000A8    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0x50,  /* 000000B0    ".......P" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000B8    "........" */
+    0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,  /* 000000C0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000C8    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000D0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000D8    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000E0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000E8    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000F0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000F8    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x18,  /* 00000100    "........" */
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000108    "........" */
-    0x00,0x00,0x0c,0x18,0x00,0x00,0x00,0x00,  /* 00000110    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000118    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000110    "........" */
+    0x00,0x00,0x01,0x00,0x00,0x00,0x0D,0x18,  /* 00000118    "........" */
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000120    "........" */
-    0x00,0x00                                 /* 00000128    "..      " */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,  /* 00000128    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x10,  /* 00000130    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000138    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x14,  /* 00000140    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000148    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000150    "........" */
+    0x00,0x00                                 /* 00000158    ".."       */
 };
 
 const unsigned char TemplateMcfg[] =
@@ -728,6 +801,56 @@
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00   /* 00000088    "........" */
 };
 
+const unsigned char TemplateNfit[] =
+{
+    0x4E,0x46,0x49,0x54,0x70,0x01,0x00,0x00,  /* 00000000    "NFITp..." */
+    0x01,0x53,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    ".SINTEL " */
+    0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65,  /* 00000010    "Template" */
+    0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
+    0x10,0x04,0x15,0x20,0x00,0x00,0x00,0x00,  /* 00000020    "... ...." */
+    0x00,0x00,0x38,0x00,0x01,0x00,0x00,0x00,  /* 00000028    "..8....." */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000030    "........" */
+    0x30,0x05,0xAF,0x91,0x86,0x5D,0x0E,0x47,  /* 00000038    "0....].G" */
+    0xA6,0xB0,0x0A,0x2D,0xB9,0x40,0x82,0x49,  /* 00000040    "...-.@.I" */
+    0x00,0x00,0x00,0x7C,0x03,0x00,0x00,0x00,  /* 00000048    "...|...." */
+    0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,  /* 00000050    "........" */
+    0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000058    "........" */
+    0x01,0x00,0x30,0x00,0x01,0x00,0x00,0x00,  /* 00000060    "..0....." */
+    0x04,0x00,0x00,0x00,0x01,0x00,0x01,0x00,  /* 00000068    "........" */
+    0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,  /* 00000070    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000078    "........" */
+    0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,  /* 00000080    "........" */
+    0x01,0x00,0x03,0x00,0x2A,0x00,0x00,0x00,  /* 00000088    "....*..." */
+    0x02,0x00,0x20,0x00,0x01,0x00,0x00,0x00,  /* 00000090    ".. ....." */
+    0x04,0x00,0x00,0x00,0x00,0x01,0x00,0x00,  /* 00000098    "........" */
+    0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,  /* 000000A0    "........" */
+    0x06,0x00,0x00,0x00,0x09,0x00,0x00,0x00,  /* 000000A8    "........" */
+    0x03,0x00,0x28,0x00,0x00,0x00,0x00,0x00,  /* 000000B0    "..(....." */
+    0xB4,0x13,0x5D,0x40,0x91,0x0B,0x29,0x93,  /* 000000B8    "..]@..)." */
+    0x67,0xE8,0x23,0x4C,0x00,0x00,0x00,0x88,  /* 000000C0    "g.#L...." */
+    0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77,  /* 000000C8    ".."3DUfw" */
+    0x88,0x99,0xAA,0xBB,0xCC,0xDD,0xEE,0xFF,  /* 000000D0    "........" */
+    0x04,0x00,0x50,0x00,0x01,0x00,0x86,0x80,  /* 000000D8    "..P....." */
+    0x17,0x20,0x01,0x00,0x86,0x80,0x17,0x20,  /* 000000E0    ". ..... " */
+    0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000E8    "........" */
+    0x89,0x00,0x54,0x76,0x01,0x03,0x00,0x01,  /* 000000F0    "..Tv...." */
+    0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000F8    ". ......" */
+    0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,  /* 00000100    "........" */
+    0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000108    "........" */
+    0x00,0x10,0x80,0x00,0x00,0x00,0x00,0x00,  /* 00000110    "........" */
+    0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000118    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000120    "........" */
+    0x05,0x00,0x28,0x00,0x01,0x00,0x00,0x01,  /* 00000128    "..(....." */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000130    "........" */
+    0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000138    ". ......" */
+    0x00,0x00,0x00,0xE0,0x0F,0x00,0x00,0x00,  /* 00000140    "........" */
+    0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,  /* 00000148    "........" */
+    0x06,0x00,0x20,0x00,0x01,0x00,0x00,0x00,  /* 00000150    ".. ....." */
+    0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000158    "........" */
+    0x00,0x00,0x00,0x18,0x04,0x00,0x00,0x00,  /* 00000160    "........" */
+    0x00,0x00,0x00,0x18,0x06,0x00,0x00,0x00   /* 00000168    "........" */
+};
+
 const unsigned char TemplateMtmr[] =
 {
     0x4D,0x54,0x4D,0x52,0x4C,0x00,0x00,0x00,  /* 00000000    "MTMRL..." */
@@ -999,15 +1122,41 @@
     0x00,0x00                                 /* 00000090    ".."       */
 };
 
+const unsigned char TemplateStao[] =
+{
+    0x53,0x54,0x41,0x4F,0x7E,0x00,0x00,0x00,  /* 00000000    "STAO~..." */
+    0x01,0x7F,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,0x01,0x5C,0x5F,0x53,  /* 00000020    "... .\_S" */
+    0x42,0x30,0x2E,0x42,0x55,0x53,0x30,0x2E,  /* 00000028    "B0.BUS0." */
+    0x44,0x45,0x56,0x31,0x00,0x5C,0x5F,0x53,  /* 00000030    "DEV1.\_S" */
+    0x42,0x30,0x2E,0x42,0x55,0x53,0x30,0x2E,  /* 00000038    "B0.BUS0." */
+    0x44,0x45,0x56,0x32,0x00,0x5C,0x5F,0x53,  /* 00000040    "DEV2.\_S" */
+    0x42,0x30,0x2E,0x42,0x55,0x53,0x31,0x2E,  /* 00000048    "B0.BUS1." */
+    0x44,0x45,0x56,0x31,0x2E,0x44,0x45,0x56,  /* 00000050    "DEV1.DEV" */
+    0x32,0x00,0x5C,0x5F,0x53,0x42,0x30,0x2E,  /* 00000058    "2.\_SB0." */
+    0x42,0x55,0x53,0x31,0x2E,0x44,0x45,0x56,  /* 00000060    "BUS1.DEV" */
+    0x32,0x2E,0x44,0x45,0x56,0x32,0x00,0x5C,  /* 00000068    "2.DEV2.\" */
+    0x55,0x53,0x42,0x31,0x2E,0x48,0x55,0x42,  /* 00000070    "USB1.HUB" */
+    0x31,0x2E,0x50,0x54,0x31,0x00             /* 00000078    "1.PT1."   */
+};
+
 const unsigned char TemplateTcpa[] =
 {
-    0x54,0x43,0x50,0x41,0x32,0x00,0x00,0x00,  /* 00000000    "TCPA2..." */
-    0x01,0x67,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    ".gINTEL " */
-    0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45,  /* 00000010    "TEMPLATE" */
+    0x54,0x43,0x50,0x41,0x64,0x00,0x00,0x00,  /* 00000000    "TCPAd..." */
+    0x02,0xFF,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
+    0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65,  /* 00000010    "Template" */
     0x80,0x31,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    ".1..INTL" */
-    0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00,  /* 00000020    "(.. ...." */
-    0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,  /* 00000028    "........" */
-    0x00,0x00                                 /* 00000030    ".."       */
+    0x19,0x06,0x15,0x20,0x01,0x00,0x00,0x00,  /* 00000020    "... ...." */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000028    "........" */
+    0x11,0x00,0xFF,0xEE,0xDD,0xCC,0xBB,0xAA,  /* 00000030    "........" */
+    0x02,0x01,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000038    "........" */
+    0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x03,  /* 00000040    "..... .." */
+    0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000048    "........" */
+    0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x03,  /* 00000050    "..... .." */
+    0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000058    "........" */
+    0x01,0x01,0x01,0x01                       /* 00000060    "...."     */
 };
 
 const unsigned char TemplateTpm2[] =
@@ -1095,6 +1244,41 @@
     0x00,0x00,0x00,0x00,0xFF,0xFF,0x00        /* 00000040    "......."  */
 };
 
+const unsigned char TemplateWpbt[] =
+{
+    0x57,0x50,0x42,0x54,0x98,0x00,0x00,0x00,  /* 00000000    "WPBT...." */
+    0x01,0x83,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" */
+    0x10,0x04,0x15,0x20,0x78,0x56,0x34,0x12,  /* 00000020    "... xV4." */
+    0x00,0x00,0x00,0xBB,0x00,0x00,0x00,0xAA,  /* 00000028    "........" */
+    0x33,0x88,0x64,0x00,0x34,0x00,0x20,0x00,  /* 00000030    "3.d.4. ." */
+    0x73,0x00,0x63,0x00,0x6F,0x00,0x72,0x00,  /* 00000038    "s.c.o.r." */
+    0x65,0x00,0x20,0x00,0x61,0x00,0x6E,0x00,  /* 00000040    "e. .a.n." */
+    0x64,0x00,0x20,0x00,0x37,0x00,0x20,0x00,  /* 00000048    "d. .7. ." */
+    0x79,0x00,0x65,0x00,0x61,0x00,0x72,0x00,  /* 00000050    "y.e.a.r." */
+    0x73,0x00,0x20,0x00,0x61,0x00,0x67,0x00,  /* 00000058    "s. .a.g." */
+    0x6F,0x00,0x20,0x00,0x6F,0x00,0x75,0x00,  /* 00000060    "o. .o.u." */
+    0x72,0x00,0x20,0x00,0x66,0x00,0x61,0x00,  /* 00000068    "r. .f.a." */
+    0x74,0x00,0x68,0x00,0x65,0x00,0x72,0x00,  /* 00000070    "t.h.e.r." */
+    0x73,0x00,0x20,0x00,0x62,0x00,0x72,0x00,  /* 00000078    "s. .b.r." */
+    0x6F,0x00,0x75,0x00,0x67,0x00,0x68,0x00,  /* 00000080    "o.u.g.h." */
+    0x74,0x00,0x20,0x00,0x66,0x00,0x6F,0x00,  /* 00000088    "t. .f.o." */
+    0x72,0x00,0x74,0x00,0x68,0x00,0x00,0x00   /* 00000090    "r.t.h..." */
+};
+
+const unsigned char TemplateXenv[] =
+{
+    0x58,0x45,0x4E,0x56,0x39,0x00,0x00,0x00,  /* 00000000    "XENV9..." */
+    0x01,0x3A,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" */
+    0x10,0x04,0x15,0x20,0x00,0x00,0x00,0x10,  /* 00000020    "... ...." */
+    0x00,0x00,0x00,0x0A,0x00,0x20,0x00,0x00,  /* 00000028    "..... .." */
+    0x00,0x00,0x00,0x0B,0x25,0x00,0xBB,0xAA,  /* 00000030    "....%..." */
+    0x03                                      /* 00000038    "."        */
+};
+
 const unsigned char TemplateXsdt[] =
 {
     0x58,0x53,0x44,0x54,0x64,0x00,0x00,0x00,  /* 00000000    "XSDTd..." */
--- a/sys/external/bsd/acpica/dist/compiler/preprocess.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/preprocess.h	Tue Aug 18 09:53:33 2015 +0000
@@ -267,14 +267,18 @@
     char                    *BufferToAdd,
     UINT32                  LengthToAdd);
 
-void
+FILE *
 PrOpenIncludeFile (
-    char                    *Filename);
+    char                    *Filename,
+    char                    *OpenMode,
+    char                    **FullPathname);
 
 FILE *
 PrOpenIncludeWithPrefix (
     char                    *PrefixDir,
-    char                    *Filename);
+    char                    *Filename,
+    char                    *OpenMode,
+    char                    **FullPathname);
 
 void
 PrPushInputFileStack (
--- a/sys/external/bsd/acpica/dist/compiler/prparser.l	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/prparser.l	Tue Aug 18 09:53:33 2015 +0000
@@ -50,14 +50,22 @@
 #define STRING_SETUP    strcpy (StringBuffer, PrParsertext);\
     PrParserlval.str = StringBuffer
 
-#define YY_NO_INPUT     /* No file input, we use strings only */
-
 #define _COMPONENT          ACPI_COMPILER
         ACPI_MODULE_NAME    ("prscanner")
+
+
+/* Local prototypes */
+
+static char
+PrDoCommentType1 (
+    void);
+
+static char
+PrDoCommentType2 (
+    void);
 %}
 
 %option noyywrap
-%option nounput
 
 Number          [0-9a-fA-F]+
 HexNumber       0[xX][0-9a-fA-F]+
@@ -66,6 +74,8 @@
 Identifier      [a-zA-Z][0-9a-zA-Z]*
 
 %%
+"/*"            { if (!PrDoCommentType1 ()) {yyterminate ();} }
+"//"            { if (!PrDoCommentType2 ()) {yyterminate ();} }
 
 \(              return (EXPOP_PAREN_OPEN);
 \)              return (EXPOP_PAREN_CLOSE);
@@ -151,3 +161,76 @@
 
     yy_delete_buffer (LexBuffer);
 }
+
+
+/********************************************************************************
+ *
+ * FUNCTION:    PrDoCommentType1
+ *
+ * PARAMETERS:  none
+ *
+ * RETURN:      none
+ *
+ * DESCRIPTION: Process a new legacy comment. Just toss it.
+ *
+ ******************************************************************************/
+
+static char
+PrDoCommentType1 (
+    void)
+{
+    int                 c;
+
+
+Loop:
+    while (((c = input ()) != '*') && (c != EOF))
+    {
+    }
+    if (c == EOF)
+    {
+        return (FALSE);
+    }
+
+    if (((c = input ()) != '/') && (c != EOF))
+    {
+        unput (c);
+        goto Loop;
+    }
+    if (c == EOF)
+    {
+        return (FALSE);
+    }
+
+    return (TRUE);
+}
+
+
+/********************************************************************************
+ *
+ * FUNCTION:    PrDoCommentType2
+ *
+ * PARAMETERS:  none
+ *
+ * RETURN:      none
+ *
+ * DESCRIPTION: Process a new "//" comment. Just toss it.
+ *
+ ******************************************************************************/
+
+static char
+PrDoCommentType2 (
+    void)
+{
+    int                 c;
+
+
+    while (((c = input ()) != '\n') && (c != EOF))
+    {
+    }
+    if (c == EOF)
+    {
+        return (FALSE);
+    }
+
+    return (TRUE);
+}
--- a/sys/external/bsd/acpica/dist/compiler/prscan.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/prscan.c	Tue Aug 18 09:53:33 2015 +0000
@@ -67,6 +67,14 @@
     char                    *DirectiveToken,
     char                    **Next);
 
+static void
+PrGetNextLineInit (
+    void);
+
+static UINT32
+PrGetNextLine (
+    FILE                    *Handle);
+
 static int
 PrMatchDirective (
     char                    *Directive);
@@ -85,28 +93,41 @@
     char                    *Action,
     char                    *DirectiveName);
 
+static void
+PrDoIncludeBuffer (
+    char                    *Pathname,
+    char                    *BufferName);
+
+static void
+PrDoIncludeFile (
+    char                    *Pathname);
+
 
 /*
  * Supported preprocessor directives
+ * Each entry is of the form "Name, ArgumentCount"
  */
 static const PR_DIRECTIVE_INFO      Gbl_DirectiveInfo[] =
 {
-    {"define",  1},
-    {"elif",    0}, /* Converted to #else..#if internally */
-    {"else",    0},
-    {"endif",   0},
-    {"error",   1},
-    {"if",      1},
-    {"ifdef",   1},
-    {"ifndef",  1},
-    {"include", 0}, /* Argument is not standard format, so 0 */
-    {"line",    1},
-    {"pragma",  1},
-    {"undef",   1},
-    {"warning", 1},
-    {NULL,      0}
+    {"define",          1},
+    {"elif",            0}, /* Converted to #else..#if internally */
+    {"else",            0},
+    {"endif",           0},
+    {"error",           1},
+    {"if",              1},
+    {"ifdef",           1},
+    {"ifndef",          1},
+    {"include",         0}, /* Argument is not standard format, so just use 0 here */
+    {"includebuffer",   0}, /* Argument is not standard format, so just use 0 here */
+    {"line",            1},
+    {"pragma",          1},
+    {"undef",           1},
+    {"warning",         1},
+    {NULL,              0}
 };
 
+/* This table must match ordering of above table exactly */
+
 enum Gbl_DirectiveIndexes
 {
     PR_DIRECTIVE_DEFINE = 0,
@@ -118,10 +139,11 @@
     PR_DIRECTIVE_IFDEF,
     PR_DIRECTIVE_IFNDEF,
     PR_DIRECTIVE_INCLUDE,
+    PR_DIRECTIVE_INCLUDEBUFFER,
     PR_DIRECTIVE_LINE,
     PR_DIRECTIVE_PRAGMA,
     PR_DIRECTIVE_UNDEF,
-    PR_DIRECTIVE_WARNING,
+    PR_DIRECTIVE_WARNING
 };
 
 #define ASL_DIRECTIVE_NOT_FOUND     -1
@@ -171,7 +193,7 @@
     /* Init globals */
 
     Gbl_InputFileList = NULL;
-    Gbl_CurrentLineNumber = 0;
+    Gbl_CurrentLineNumber = 1;
     Gbl_PreprocessorLineNumber = 1;
     Gbl_PreprocessorError = FALSE;
 
@@ -256,7 +278,7 @@
 
     } while (MoreInputFiles);
 
-    /* Point compiler input to the new preprocessor output file (.i) */
+    /* Point compiler input to the new preprocessor output file (.pre) */
 
     FlCloseFile (ASL_FILE_INPUT);
     Gbl_Files[ASL_FILE_INPUT].Handle = Gbl_Files[ASL_FILE_PREPROCESSOR].Handle;
@@ -265,7 +287,10 @@
     /* Reset globals to allow compiler to run */
 
     FlSeekFile (ASL_FILE_INPUT, 0);
-    Gbl_CurrentLineNumber = 1;
+    if (!Gbl_PreprocessOnly)
+    {
+        Gbl_CurrentLineNumber = 0;
+    }
 
     DbgPrint (ASL_DEBUG_OUTPUT, "Preprocessing phase complete \n\n");
 }
@@ -282,7 +307,8 @@
  * DESCRIPTION: Preprocess one entire file, line-by-line.
  *
  * Input:  Raw user ASL from ASL_FILE_INPUT
- * Output: Preprocessed file written to ASL_FILE_PREPROCESSOR
+ * Output: Preprocessed file written to ASL_FILE_PREPROCESSOR and
+ *         (optionally) ASL_FILE_PREPROCESSOR_USER
  *
  ******************************************************************************/
 
@@ -290,7 +316,7 @@
 PrPreprocessInputFile (
     void)
 {
-    UINT32                  Offset;
+    UINT32                  Status;
     char                    *Token;
     char                    *ReplaceString;
     PR_DEFINE_INFO          *DefineInfo;
@@ -299,10 +325,21 @@
     int                     OffsetAdjust;
 
 
-    /* Scan line-by-line. Comments and blank lines are skipped by this function */
+    PrGetNextLineInit ();
+
+    /* Scan source line-by-line and process directives. Then write the .i file */
 
-    while ((Offset = DtGetNextLine (Gbl_Files[ASL_FILE_INPUT].Handle)) != ASL_EOF)
+    while ((Status = PrGetNextLine (Gbl_Files[ASL_FILE_INPUT].Handle)) != ASL_EOF)
     {
+        Gbl_CurrentLineNumber++;
+        Gbl_LogicalLineNumber++;
+
+        if ((Status == ASL_WITHIN_COMMENT) ||
+            (Status == ASL_BLANK_LINE))
+        {
+            goto WriteEntireLine;
+        }
+
         /* Need a copy of the input line for strok() */
 
         strcpy (Gbl_MainTokenBuffer, Gbl_CurrentLineBuffer);
@@ -382,31 +419,13 @@
             Token = PrGetNextToken (NULL, PR_TOKEN_SEPARATORS, &Next);
         }
 
-#if 0
-/* Line prefix */
-        FlPrintFile (ASL_FILE_PREPROCESSOR, "/* %14s  %.5u  i:%.5u */ ",
-            Gbl_Files[ASL_FILE_INPUT].Filename,
-            Gbl_CurrentLineNumber, Gbl_PreprocessorLineNumber);
-#endif
-
-        /*
-         * Emit a #line directive if necessary, to keep the line numbers in
-         * the (.i) file synchronized with the original source code file, so
-         * that the correct line number appears in any error messages
-         * generated by the actual compiler.
-         */
-        if (Gbl_CurrentLineNumber > (Gbl_PreviousLineNumber + 1))
-        {
-            FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u\n",
-                Gbl_CurrentLineNumber);
-        }
-
-        Gbl_PreviousLineNumber = Gbl_CurrentLineNumber;
         Gbl_PreprocessorLineNumber++;
 
+
+WriteEntireLine:
         /*
          * Now we can write the possibly modified source line to the
-         * preprocessor (.i) file
+         * preprocessor file(s).
          */
         FlWriteFile (ASL_FILE_PREPROCESSOR, Gbl_CurrentLineBuffer,
             strlen (Gbl_CurrentLineBuffer));
@@ -433,7 +452,7 @@
     char                    **Next)
 {
     char                    *Token = Gbl_MainTokenBuffer;
-    char                    *Token2;
+    char                    *Token2 = NULL;
     char                    *End;
     UINT64                  Value;
     ACPI_SIZE               TokenOffset;
@@ -452,13 +471,23 @@
         PrError (ASL_ERROR, ASL_MSG_UNKNOWN_DIRECTIVE,
             THIS_TOKEN_OFFSET (DirectiveToken));
 
-        DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID
+        DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID
             "#%s: Unknown directive\n",
             Gbl_CurrentLineNumber, DirectiveToken);
         return;
     }
 
     /*
+     * Emit a line directive into the preprocessor file (.pre) after
+     * every matched directive. This is passed through to the compiler
+     * so that error/warning messages are kept in sync with the
+     * original source file.
+     */
+    FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\" // #%s\n",
+        Gbl_CurrentLineNumber, Gbl_Files[ASL_FILE_INPUT].Filename,
+        Gbl_DirectiveInfo[Directive].Name);
+
+    /*
      * If we are currently ignoring this block and we encounter a #else or
      * #elif, we must ignore their blocks also if the parent block is also
      * being ignored.
@@ -539,7 +568,7 @@
 
     /* Most directives have at least one argument */
 
-    if (Gbl_DirectiveInfo[Directive].ArgCount == 1)
+    if (Gbl_DirectiveInfo[Directive].ArgCount >= 1)
     {
         Token = PrGetNextToken (NULL, PR_TOKEN_SEPARATORS, Next);
         if (!Token)
@@ -548,6 +577,15 @@
         }
     }
 
+    if (Gbl_DirectiveInfo[Directive].ArgCount >= 2)
+    {
+        Token2 = PrGetNextToken (NULL, PR_TOKEN_SEPARATORS, Next);
+        if (!Token2)
+        {
+            goto SyntaxError;
+        }
+    }
+
     /*
      * At this point, if we are ignoring the current code block,
      * do not process any more directives (i.e., ignore them also.)
@@ -599,7 +637,7 @@
             Gbl_IgnoringThisCodeBlock = TRUE;
         }
 
-        DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID
+        DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID
             "Resolved #if: %8.8X%8.8X %s\n",
             Gbl_CurrentLineNumber, ACPI_FORMAT_UINT64 (Value),
             Gbl_IgnoringThisCodeBlock ? "<Skipping Block>" : "<Executing Block>");
@@ -637,7 +675,7 @@
         {
 #ifndef MACROS_SUPPORTED
             AcpiOsPrintf ("%s ERROR - line %u: #define macros are not supported yet\n",
-                Gbl_CurrentLineBuffer, Gbl_CurrentLineNumber);
+                Gbl_CurrentLineBuffer, Gbl_LogicalLineNumber);
             exit(1);
 #else
             PrAddMacro (Token, Next);
@@ -672,9 +710,9 @@
                 Token2 = "";
             }
 #endif
-            DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID
+            DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID
                 "New #define: %s->%s\n",
-                Gbl_CurrentLineNumber, Token, Token2);
+                Gbl_LogicalLineNumber, Token, Token2);
 
             PrAddDefine (Token, Token2, FALSE);
         }
@@ -700,11 +738,32 @@
             goto SyntaxError;
         }
 
-        DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID
+        DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID
             "Start #include file \"%s\"\n", Gbl_CurrentLineNumber,
             Token, Gbl_CurrentLineNumber);
 
-        PrOpenIncludeFile (Token);
+        PrDoIncludeFile (Token);
+        break;
+
+    case PR_DIRECTIVE_INCLUDEBUFFER:
+
+        Token = PrGetNextToken (NULL, " \"<>", Next);
+        if (!Token)
+        {
+            goto SyntaxError;
+        }
+
+        Token2 = PrGetNextToken (NULL, PR_TOKEN_SEPARATORS, Next);
+        if (!Token2)
+        {
+            goto SyntaxError;
+        }
+
+        DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID
+            "Start #includebuffer input from file \"%s\", buffer name %s\n",
+            Gbl_CurrentLineNumber, Token, Token2);
+
+        PrDoIncludeBuffer (Token, Token2);
         break;
 
     case PR_DIRECTIVE_LINE:
@@ -718,14 +777,11 @@
             return;
         }
 
-        DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID
+        DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID
             "User #line invocation %s\n", Gbl_CurrentLineNumber,
             Token);
 
-        /* Update local line numbers */
-
         Gbl_CurrentLineNumber = (UINT32) Value;
-        Gbl_PreviousLineNumber = 0;
 
         /* Emit #line into the preprocessor file */
 
@@ -768,7 +824,7 @@
 
     case PR_DIRECTIVE_UNDEF:
 
-        DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID
+        DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID
             "#undef: %s\n", Gbl_CurrentLineNumber, Token);
 
         PrRemoveDefine (Token);
@@ -778,12 +834,15 @@
 
         PrError (ASL_WARNING, ASL_MSG_WARNING_DIRECTIVE,
             THIS_TOKEN_OFFSET (Token));
+
+        Gbl_SourceLine = 0;
+        Gbl_NextError = Gbl_ErrorLog;
         break;
 
     default:
 
         /* Should never get here */
-        DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID
+        DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID
             "Unrecognized directive: %u\n",
             Gbl_CurrentLineNumber, Directive);
         break;
@@ -801,6 +860,153 @@
 
 /*******************************************************************************
  *
+ * FUNCTION:    PrGetNextLine, PrGetNextLineInit
+ *
+ * PARAMETERS:  Handle              - Open file handle for the source file
+ *
+ * RETURN:      Status of the GetLine operation:
+ *              AE_OK               - Normal line, OK status
+ *              ASL_WITHIN_COMMENT  - Line is 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
+ *              comments.
+ *
+ ******************************************************************************/
+
+#define PR_NORMAL_TEXT          0
+#define PR_MULTI_LINE_COMMENT   1
+#define PR_SINGLE_LINE_COMMENT  2
+#define PR_QUOTED_STRING        3
+
+static UINT8                    AcpiGbl_LineScanState = PR_NORMAL_TEXT;
+
+static void
+PrGetNextLineInit (
+    void)
+{
+    AcpiGbl_LineScanState = 0;
+}
+
+static UINT32
+PrGetNextLine (
+    FILE                    *Handle)
+{
+    UINT32                  i;
+    int                     c = 0;
+    int                     PreviousChar;
+
+
+    /* Always clear the global line buffer */
+
+    memset (Gbl_CurrentLineBuffer, 0, Gbl_LineBufferSize);
+    for (i = 0; ;)
+    {
+        /*
+         * If line is too long, expand the line buffers. Also increases
+         * Gbl_LineBufferSize.
+         */
+        if (i >= Gbl_LineBufferSize)
+        {
+            UtExpandLineBuffers ();
+        }
+
+        PreviousChar = c;
+        c = getc (Handle);
+        if (c == EOF)
+        {
+            return (ASL_EOF);
+        }
+
+        /* Update state machine as necessary */
+
+        switch (AcpiGbl_LineScanState)
+        {
+        case PR_NORMAL_TEXT:
+
+            /* Check for multi-line comment start */
+
+            if ((PreviousChar == '/') && (c == '*'))
+            {
+                AcpiGbl_LineScanState = PR_MULTI_LINE_COMMENT;
+            }
+
+            /* Check for single-line comment start */
+
+            else if ((PreviousChar == '/') && (c == '/'))
+            {
+                AcpiGbl_LineScanState = PR_SINGLE_LINE_COMMENT;
+            }
+
+            /* Check for quoted string start */
+
+            else if (PreviousChar == '"')
+            {
+                AcpiGbl_LineScanState = PR_QUOTED_STRING;
+            }
+            break;
+
+        case PR_QUOTED_STRING:
+
+            if (PreviousChar == '"')
+            {
+                AcpiGbl_LineScanState = PR_NORMAL_TEXT;
+            }
+            break;
+
+        case PR_MULTI_LINE_COMMENT:
+
+            /* Check for multi-line comment end */
+
+            if ((PreviousChar == '*') && (c == '/'))
+            {
+                AcpiGbl_LineScanState = PR_NORMAL_TEXT;
+            }
+            break;
+
+        case PR_SINGLE_LINE_COMMENT: /* Just ignore text until EOL */
+        default:
+            break;
+        }
+
+        /* Always copy the character into line buffer */
+
+        Gbl_CurrentLineBuffer[i] = (char) c;
+        i++;
+
+        /* Always exit on end-of-line */
+
+        if (c == '\n')
+        {
+            /* Handle multi-line comments */
+
+            if (AcpiGbl_LineScanState == PR_MULTI_LINE_COMMENT)
+            {
+                return (ASL_WITHIN_COMMENT);
+            }
+
+            /* End of single-line comment */
+
+            if (AcpiGbl_LineScanState == PR_SINGLE_LINE_COMMENT)
+            {
+                AcpiGbl_LineScanState = PR_NORMAL_TEXT;
+                return (AE_OK);
+            }
+
+            /* Blank line */
+
+            if (i == 1)
+            {
+                return (ASL_BLANK_LINE);
+            }
+            return (AE_OK);
+        }
+    }
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    PrMatchDirective
  *
  * PARAMETERS:  Directive           - Pointer to directive name token
@@ -954,9 +1160,92 @@
 {
 
     DbgPrint (ASL_DEBUG_OUTPUT, "Pr(%.4u) - [%u %s] "
-        "%*s %s #%s, Depth %u\n",
+        "%*s %s #%s, IfDepth %u\n",
         Gbl_CurrentLineNumber, Gbl_IfDepth,
         Gbl_IgnoringThisCodeBlock ? "I" : "E",
         Gbl_IfDepth * 4, " ",
         Action, DirectiveName, Gbl_IfDepth);
 }
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    PrDoIncludeFile
+ *
+ * PARAMETERS:  Pathname                - Name of the input file
+ *
+ * RETURN:      None.
+ *
+ * DESCRIPTION: Open an include file, from #include.
+ *
+ ******************************************************************************/
+
+static void
+PrDoIncludeFile (
+    char                    *Pathname)
+{
+    char                    *FullPathname;
+
+
+    (void) PrOpenIncludeFile (Pathname, "r", &FullPathname);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    PrDoIncludeBuffer
+ *
+ * PARAMETERS:  Pathname                - Name of the input binary file
+ *              BufferName              - ACPI namepath of the buffer
+ *
+ * RETURN:      None.
+ *
+ * DESCRIPTION: Create an ACPI buffer object from a binary file. The contents
+ *              of the file are emitted into the buffer object as ascii
+ *              hex data. From #includebuffer.
+ *
+ ******************************************************************************/
+
+static void
+PrDoIncludeBuffer (
+    char                    *Pathname,
+    char                    *BufferName)
+{
+    char                    *FullPathname;
+    FILE                    *BinaryBufferFile;
+    UINT32                  i = 0;
+    UINT8                   c;
+
+
+    BinaryBufferFile = PrOpenIncludeFile (Pathname, "rb", &FullPathname);
+    if (!BinaryBufferFile)
+    {
+        return;
+    }
+
+    /* Emit "Name (XXXX, Buffer() {" header */
+
+    FlPrintFile (ASL_FILE_PREPROCESSOR, "Name (%s, Buffer()\n{", BufferName);
+
+    /* Dump the entire file in ascii hex format */
+
+    while (fread (&c, 1, 1, BinaryBufferFile))
+    {
+        if (!(i % 8))
+        {
+            FlPrintFile (ASL_FILE_PREPROCESSOR, "\n   ", c);
+        }
+
+        FlPrintFile (ASL_FILE_PREPROCESSOR, " 0x%2.2X,", c);
+        i++;
+    }
+
+    DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID
+        "#includebuffer: read %u bytes from %s\n",
+        Gbl_CurrentLineNumber, i, FullPathname);
+
+    /* Close the Name() operator */
+
+    FlPrintFile (ASL_FILE_PREPROCESSOR, "\n})\n", BufferName);
+    fclose (BinaryBufferFile);
+}
--- a/sys/external/bsd/acpica/dist/debugger/dbconvert.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbconvert.c	Tue Aug 18 09:53:33 2015 +0000
@@ -77,7 +77,7 @@
 
     /* Digit must be ascii [0-9a-fA-F] */
 
-    if (!ACPI_IS_XDIGIT (HexChar))
+    if (!isxdigit (HexChar))
     {
         return (AE_BAD_HEX_CONSTANT);
     }
@@ -88,7 +88,7 @@
     }
     else
     {
-        Value = (UINT8) (ACPI_TOUPPER (HexChar) - 0x37);
+        Value = (UINT8) (toupper (HexChar) - 0x37);
     }
 
     *ReturnValue = Value;
@@ -306,7 +306,7 @@
 
         Object->Type = ACPI_TYPE_STRING;
         Object->String.Pointer = String;
-        Object->String.Length = (UINT32) ACPI_STRLEN (String);
+        Object->String.Length = (UINT32) strlen (String);
         break;
 
     case ACPI_TYPE_BUFFER:
@@ -471,7 +471,7 @@
 
     /* The two bit-packed buffers should match */
 
-    if (ACPI_MEMCMP (NewBuffer, BufferDesc->Buffer.Pointer,
+    if (memcmp (NewBuffer, BufferDesc->Buffer.Pointer,
         BufferDesc->Buffer.Length))
     {
         AcpiOsPrintf ("Converted _PLD buffer does not compare. New:\n");
--- a/sys/external/bsd/acpica/dist/debugger/dbfileio.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbfileio.c	Tue Aug 18 09:53:33 2015 +0000
@@ -112,7 +112,7 @@
     }
 
     AcpiOsPrintf ("Debug output file %s opened\n", Name);
-    ACPI_STRNCPY (AcpiGbl_DbDebugFilename, Name,
+    strncpy (AcpiGbl_DbDebugFilename, Name,
         sizeof (AcpiGbl_DbDebugFilename));
     AcpiGbl_DbOutputToFile = TRUE;
 
@@ -216,7 +216,8 @@
 ACPI_STATUS
 AcpiDbGetTableFromFile (
     char                    *Filename,
-    ACPI_TABLE_HEADER       **ReturnTable)
+    ACPI_TABLE_HEADER       **ReturnTable,
+    BOOLEAN                 MustBeAmlFile)
 {
 #ifdef ACPI_APPLICATION
     ACPI_STATUS             Status;
@@ -230,9 +231,18 @@
         return (Status);
     }
 
-#ifdef ACPI_DATA_TABLE_DISASSEMBLY
-    IsAmlTable = AcpiUtIsAmlTable (Table);
-#endif
+    if (MustBeAmlFile)
+    {
+        IsAmlTable = AcpiUtIsAmlTable (Table);
+        if (!IsAmlTable)
+        {
+            ACPI_EXCEPTION ((AE_INFO, AE_OK,
+                "Input for -e is not an AML table: "
+                "\"%4.4s\" (must be DSDT/SSDT)",
+                Table->Signature));
+            return (AE_TYPE);
+        }
+    }
 
     if (IsAmlTable)
     {
--- a/sys/external/bsd/acpica/dist/debugger/dbhistry.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbhistry.c	Tue Aug 18 09:53:33 2015 +0000
@@ -92,7 +92,7 @@
 
     /* Put command into the next available slot */
 
-    CmdLen = (UINT16) ACPI_STRLEN (CommandLine);
+    CmdLen = (UINT16) strlen (CommandLine);
     if (!CmdLen)
     {
         return;
@@ -100,7 +100,7 @@
 
     if (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command != NULL)
     {
-        BufferLen = (UINT16) ACPI_STRLEN (
+        BufferLen = (UINT16) strlen (
             AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command);
         if (CmdLen > BufferLen)
         {
@@ -116,7 +116,7 @@
             AcpiOsAllocate (CmdLen + 1);
     }
 
-    ACPI_STRCPY (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command,
+    strcpy (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command,
         CommandLine);
 
     AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].CmdNum =
@@ -217,7 +217,7 @@
 
     else
     {
-        CmdNum = ACPI_STRTOUL (CommandNumArg, NULL, 0);
+        CmdNum = strtoul (CommandNumArg, NULL, 0);
     }
 
     return (AcpiDbGetHistoryByIndex (CmdNum));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbobject.c	Tue Aug 18 09:53:33 2015 +0000
@@ -0,0 +1,525 @@
+/*******************************************************************************
+ *
+ * Module Name: dbobject - ACPI object decode and display
+ *
+ ******************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, 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 "acnamesp.h"
+#include "acdebug.h"
+#ifdef ACPI_DISASSEMBLER
+#include "acdisasm.h"
+#endif
+
+
+#ifdef ACPI_DEBUGGER
+
+#define _COMPONENT          ACPI_CA_DEBUGGER
+        ACPI_MODULE_NAME    ("dbobject")
+
+/* Local prototypes */
+
+static void
+AcpiDbDecodeNode (
+    ACPI_NAMESPACE_NODE     *Node);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbDumpMethodInfo
+ *
+ * PARAMETERS:  Status          - Method execution status
+ *              WalkState       - Current state of the parse tree walk
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Called when a method has been aborted because of an error.
+ *              Dumps the method execution stack, and the method locals/args,
+ *              and disassembles the AML opcode that failed.
+ *
+ ******************************************************************************/
+
+void
+AcpiDbDumpMethodInfo (
+    ACPI_STATUS             Status,
+    ACPI_WALK_STATE         *WalkState)
+{
+    ACPI_THREAD_STATE       *Thread;
+
+
+    /* Ignore control codes, they are not errors */
+
+    if ((Status & AE_CODE_MASK) == AE_CODE_CONTROL)
+    {
+        return;
+    }
+
+    /* We may be executing a deferred opcode */
+
+    if (WalkState->DeferredNode)
+    {
+        AcpiOsPrintf ("Executing subtree for Buffer/Package/Region\n");
+        return;
+    }
+
+    /*
+     * If there is no Thread, we are not actually executing a method.
+     * This can happen when the iASL compiler calls the interpreter
+     * to perform constant folding.
+     */
+    Thread = WalkState->Thread;
+    if (!Thread)
+    {
+        return;
+    }
+
+    /* Display the method locals and arguments */
+
+    AcpiOsPrintf ("\n");
+    AcpiDbDecodeLocals (WalkState);
+    AcpiOsPrintf ("\n");
+    AcpiDbDecodeArguments (WalkState);
+    AcpiOsPrintf ("\n");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbDecodeInternalObject
+ *
+ * PARAMETERS:  ObjDesc         - Object to be displayed
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Short display of an internal object. Numbers/Strings/Buffers.
+ *
+ ******************************************************************************/
+
+void
+AcpiDbDecodeInternalObject (
+    ACPI_OPERAND_OBJECT     *ObjDesc)
+{
+    UINT32                  i;
+
+
+    if (!ObjDesc)
+    {
+        AcpiOsPrintf (" Uninitialized");
+        return;
+    }
+
+    if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
+    {
+        AcpiOsPrintf (" %p [%s]", ObjDesc, AcpiUtGetDescriptorName (ObjDesc));
+        return;
+    }
+
+    AcpiOsPrintf (" %s", AcpiUtGetObjectTypeName (ObjDesc));
+
+    switch (ObjDesc->Common.Type)
+    {
+    case ACPI_TYPE_INTEGER:
+
+        AcpiOsPrintf (" %8.8X%8.8X",
+                ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
+        break;
+
+    case ACPI_TYPE_STRING:
+
+        AcpiOsPrintf ("(%u) \"%.24s",
+                ObjDesc->String.Length, ObjDesc->String.Pointer);
+
+        if (ObjDesc->String.Length > 24)
+        {
+            AcpiOsPrintf ("...");
+        }
+        else
+        {
+            AcpiOsPrintf ("\"");
+        }
+        break;
+
+    case ACPI_TYPE_BUFFER:
+
+        AcpiOsPrintf ("(%u)", ObjDesc->Buffer.Length);
+        for (i = 0; (i < 8) && (i < ObjDesc->Buffer.Length); i++)
+        {
+            AcpiOsPrintf (" %2.2X", ObjDesc->Buffer.Pointer[i]);
+        }
+        break;
+
+    default:
+
+        AcpiOsPrintf (" %p", ObjDesc);
+        break;
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbDecodeNode
+ *
+ * PARAMETERS:  Node        - Object to be displayed
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Short display of a namespace node
+ *
+ ******************************************************************************/
+
+static void
+AcpiDbDecodeNode (
+    ACPI_NAMESPACE_NODE     *Node)
+{
+
+    AcpiOsPrintf ("<Node>            Name %4.4s",
+            AcpiUtGetNodeName (Node));
+
+    if (Node->Flags & ANOBJ_METHOD_ARG)
+    {
+        AcpiOsPrintf (" [Method Arg]");
+    }
+    if (Node->Flags & ANOBJ_METHOD_LOCAL)
+    {
+        AcpiOsPrintf (" [Method Local]");
+    }
+
+    switch (Node->Type)
+    {
+    /* These types have no attached object */
+
+    case ACPI_TYPE_DEVICE:
+
+        AcpiOsPrintf (" Device");
+        break;
+
+    case ACPI_TYPE_THERMAL:
+
+        AcpiOsPrintf (" Thermal Zone");
+        break;
+
+    default:
+
+        AcpiDbDecodeInternalObject (AcpiNsGetAttachedObject (Node));
+        break;
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbDisplayInternalObject
+ *
+ * PARAMETERS:  ObjDesc         - Object to be displayed
+ *              WalkState       - Current walk state
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Short display of an internal object
+ *
+ ******************************************************************************/
+
+void
+AcpiDbDisplayInternalObject (
+    ACPI_OPERAND_OBJECT     *ObjDesc,
+    ACPI_WALK_STATE         *WalkState)
+{
+    UINT8                   Type;
+
+
+    AcpiOsPrintf ("%p ", ObjDesc);
+
+    if (!ObjDesc)
+    {
+        AcpiOsPrintf ("<Null Object>\n");
+        return;
+    }
+
+    /* Decode the object type */
+
+    switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))
+    {
+    case ACPI_DESC_TYPE_PARSER:
+
+        AcpiOsPrintf ("<Parser>  ");
+        break;
+
+    case ACPI_DESC_TYPE_NAMED:
+
+        AcpiDbDecodeNode ((ACPI_NAMESPACE_NODE *) ObjDesc);
+        break;
+
+    case ACPI_DESC_TYPE_OPERAND:
+
+        Type = ObjDesc->Common.Type;
+        if (Type > ACPI_TYPE_LOCAL_MAX)
+        {
+            AcpiOsPrintf (" Type %X [Invalid Type]", (UINT32) Type);
+            return;
+        }
+
+        /* Decode the ACPI object type */
+
+        switch (ObjDesc->Common.Type)
+        {
+        case ACPI_TYPE_LOCAL_REFERENCE:
+
+            AcpiOsPrintf ("[%s] ", AcpiUtGetReferenceName (ObjDesc));
+
+            /* Decode the refererence */
+
+            switch (ObjDesc->Reference.Class)
+            {
+            case ACPI_REFCLASS_LOCAL:
+
+                AcpiOsPrintf ("%X ", ObjDesc->Reference.Value);
+                if (WalkState)
+                {
+                    ObjDesc = WalkState->LocalVariables
+                                [ObjDesc->Reference.Value].Object;
+                    AcpiOsPrintf ("%p", ObjDesc);
+                    AcpiDbDecodeInternalObject (ObjDesc);
+                }
+                break;
+
+            case ACPI_REFCLASS_ARG:
+
+                AcpiOsPrintf ("%X ", ObjDesc->Reference.Value);
+                if (WalkState)
+                {
+                    ObjDesc = WalkState->Arguments
+                                [ObjDesc->Reference.Value].Object;
+                    AcpiOsPrintf ("%p", ObjDesc);
+                    AcpiDbDecodeInternalObject (ObjDesc);
+                }
+                break;
+
+            case ACPI_REFCLASS_INDEX:
+
+                switch (ObjDesc->Reference.TargetType)
+                {
+                case ACPI_TYPE_BUFFER_FIELD:
+
+                    AcpiOsPrintf ("%p", ObjDesc->Reference.Object);
+                    AcpiDbDecodeInternalObject (ObjDesc->Reference.Object);
+                    break;
+
+                case ACPI_TYPE_PACKAGE:
+
+                    AcpiOsPrintf ("%p", ObjDesc->Reference.Where);
+                    if (!ObjDesc->Reference.Where)
+                    {
+                        AcpiOsPrintf (" Uninitialized WHERE pointer");
+                    }
+                    else
+                    {
+                        AcpiDbDecodeInternalObject (
+                            *(ObjDesc->Reference.Where));
+                    }
+                    break;
+
+                default:
+
+                    AcpiOsPrintf ("Unknown index target type");
+                    break;
+                }
+                break;
+
+            case ACPI_REFCLASS_REFOF:
+
+                if (!ObjDesc->Reference.Object)
+                {
+                    AcpiOsPrintf ("Uninitialized reference subobject pointer");
+                    break;
+                }
+
+                /* Reference can be to a Node or an Operand object */
+
+                switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc->Reference.Object))
+                {
+                case ACPI_DESC_TYPE_NAMED:
+                    AcpiDbDecodeNode (ObjDesc->Reference.Object);
+                    break;
+
+                case ACPI_DESC_TYPE_OPERAND:
+                    AcpiDbDecodeInternalObject (ObjDesc->Reference.Object);
+                    break;
+
+                default:
+                    break;
+                }
+                break;
+
+            case ACPI_REFCLASS_NAME:
+
+                AcpiDbDecodeNode (ObjDesc->Reference.Node);
+                break;
+
+            case ACPI_REFCLASS_DEBUG:
+            case ACPI_REFCLASS_TABLE:
+
+                AcpiOsPrintf ("\n");
+                break;
+
+            default:    /* Unknown reference class */
+
+                AcpiOsPrintf ("%2.2X\n", ObjDesc->Reference.Class);
+                break;
+            }
+            break;
+
+        default:
+
+            AcpiOsPrintf ("<Obj>            ");
+            AcpiDbDecodeInternalObject (ObjDesc);
+            break;
+        }
+        break;
+
+    default:
+
+        AcpiOsPrintf ("<Not a valid ACPI Object Descriptor> [%s]",
+            AcpiUtGetDescriptorName (ObjDesc));
+        break;
+    }
+
+    AcpiOsPrintf ("\n");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbDecodeLocals
+ *
+ * PARAMETERS:  WalkState       - State for current method
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Display all locals for the currently running control method
+ *
+ ******************************************************************************/
+
+void
+AcpiDbDecodeLocals (
+    ACPI_WALK_STATE         *WalkState)
+{
+    UINT32                  i;
+    ACPI_OPERAND_OBJECT     *ObjDesc;
+    ACPI_NAMESPACE_NODE     *Node;
+
+
+    ObjDesc = WalkState->MethodDesc;
+    Node    = WalkState->MethodNode;
+    if (!Node)
+    {
+        AcpiOsPrintf (
+            "No method node (Executing subtree for buffer or opregion)\n");
+        return;
+    }
+
+    if (Node->Type != ACPI_TYPE_METHOD)
+    {
+        AcpiOsPrintf ("Executing subtree for Buffer/Package/Region\n");
+        return;
+    }
+
+    AcpiOsPrintf ("Local Variables for method [%4.4s]:\n",
+            AcpiUtGetNodeName (Node));
+
+    for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++)
+    {
+        ObjDesc = WalkState->LocalVariables[i].Object;
+        AcpiOsPrintf ("    Local%X: ", i);
+        AcpiDbDisplayInternalObject (ObjDesc, WalkState);
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbDecodeArguments
+ *
+ * PARAMETERS:  WalkState       - State for current method
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Display all arguments for the currently running control method
+ *
+ ******************************************************************************/
+
+void
+AcpiDbDecodeArguments (
+    ACPI_WALK_STATE         *WalkState)
+{
+    UINT32                  i;
+    ACPI_OPERAND_OBJECT     *ObjDesc;
+    ACPI_NAMESPACE_NODE     *Node;
+
+
+    ObjDesc = WalkState->MethodDesc;
+    Node    = WalkState->MethodNode;
+    if (!Node)
+    {
+        AcpiOsPrintf (
+            "No method node (Executing subtree for buffer or opregion)\n");
+        return;
+    }
+
+    if (Node->Type != ACPI_TYPE_METHOD)
+    {
+        AcpiOsPrintf ("Executing subtree for Buffer/Package/Region\n");
+        return;
+    }
+
+    AcpiOsPrintf (
+        "Arguments for Method [%4.4s]:  (%X arguments defined, max concurrency = %X)\n",
+        AcpiUtGetNodeName (Node), ObjDesc->Method.ParamCount, ObjDesc->Method.SyncLevel);
+
+    for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++)
+    {
+        ObjDesc = WalkState->Arguments[i].Object;
+        AcpiOsPrintf ("    Arg%u:   ", i);
+        AcpiDbDisplayInternalObject (ObjDesc, WalkState);
+    }
+}
+
+#endif
--- a/sys/external/bsd/acpica/dist/debugger/dbxface.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbxface.c	Tue Aug 18 09:53:33 2015 +0000
@@ -45,7 +45,9 @@
 #include "accommon.h"
 #include "amlcode.h"
 #include "acdebug.h"
+#ifdef ACPI_DISASSEMBLER
 #include "acdisasm.h"
+#endif
 
 
 #ifdef ACPI_DEBUGGER
@@ -179,6 +181,7 @@
     UINT32                  OriginalDebugLevel;
     ACPI_PARSE_OBJECT       *DisplayOp;
     ACPI_PARSE_OBJECT       *ParentOp;
+    UINT32                  AmlOffset;
 
 
     ACPI_FUNCTION_ENTRY ();
@@ -192,15 +195,18 @@
         return (AE_ABORT_METHOD);
     }
 
+    AmlOffset = (UINT32) ACPI_PTR_DIFF (Op->Common.Aml,
+                    WalkState->ParserState.AmlStart);
+
     /* Check for single-step breakpoint */
 
     if (WalkState->MethodBreakpoint &&
-       (WalkState->MethodBreakpoint <= Op->Common.AmlOffset))
+       (WalkState->MethodBreakpoint <= AmlOffset))
     {
         /* Check if the breakpoint has been reached or passed */
         /* Hit the breakpoint, resume single step, reset breakpoint */
 
-        AcpiOsPrintf ("***Break*** at AML offset %X\n", Op->Common.AmlOffset);
+        AcpiOsPrintf ("***Break*** at AML offset %X\n", AmlOffset);
         AcpiGbl_CmSingleStep = TRUE;
         AcpiGbl_StepToNextCall = FALSE;
         WalkState->MethodBreakpoint = 0;
@@ -209,10 +215,10 @@
     /* Check for user breakpoint (Must be on exact Aml offset) */
 
     else if (WalkState->UserBreakpoint &&
-            (WalkState->UserBreakpoint == Op->Common.AmlOffset))
+            (WalkState->UserBreakpoint == AmlOffset))
     {
         AcpiOsPrintf ("***UserBreakpoint*** at AML offset %X\n",
-            Op->Common.AmlOffset);
+            AmlOffset);
         AcpiGbl_CmSingleStep = TRUE;
         AcpiGbl_StepToNextCall = FALSE;
         WalkState->MethodBreakpoint = 0;
@@ -308,7 +314,9 @@
 
         /* Now we can display it */
 
+#ifdef ACPI_DISASSEMBLER
         AcpiDmDisassemble (WalkState, DisplayOp, ACPI_UINT32_MAX);
+#endif
 
         if ((Op->Common.AmlOpcode == AML_IF_OP) ||
             (Op->Common.AmlOpcode == AML_WHILE_OP))
@@ -431,7 +439,7 @@
     {
         return_ACPI_STATUS (AE_NO_MEMORY);
     }
-    ACPI_MEMSET (AcpiGbl_DbBuffer, 0, ACPI_DEBUG_BUFFER_SIZE);
+    memset (AcpiGbl_DbBuffer, 0, ACPI_DEBUG_BUFFER_SIZE);
 
     /* Initial scope is the root */
 
--- a/sys/external/bsd/acpica/dist/disassembler/dmdeferred.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/disassembler/dmdeferred.c	Tue Aug 18 09:53:33 2015 +0000
@@ -165,7 +165,6 @@
     ACPI_STATUS             Status;
     ACPI_PARSE_OBJECT       *SearchOp;
     ACPI_PARSE_OBJECT       *StartOp;
-    UINT32                  BaseAmlOffset;
     ACPI_PARSE_OBJECT       *NewRootOp;
     ACPI_PARSE_OBJECT       *ExtraOp;
 
@@ -202,19 +201,10 @@
     WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE;
     Status = AcpiPsParseAml (WalkState);
 
-    /*
-     * We need to update all of the AML offsets, since the parser thought
-     * that the method began at offset zero. In reality, it began somewhere
-     * within the ACPI table, at the BaseAmlOffset. Walk the entire tree that
-     * was just created and update the AmlOffset in each Op.
-     */
-    BaseAmlOffset = (Op->Common.Value.Arg)->Common.AmlOffset + 1;
     StartOp = (Op->Common.Value.Arg)->Common.Next;
     SearchOp = StartOp;
-
     while (SearchOp)
     {
-        SearchOp->Common.AmlOffset += BaseAmlOffset;
         SearchOp = AcpiPsGetDepthNext (StartOp, SearchOp);
     }
 
--- a/sys/external/bsd/acpica/dist/disassembler/dmnames.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/disassembler/dmnames.c	Tue Aug 18 09:53:33 2015 +0000
@@ -179,7 +179,7 @@
     /* Convert NamedDesc/handle to a full pathname */
 
     Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
-    Status = AcpiNsHandleToPathname (Node, &Buffer);
+    Status = AcpiNsHandleToPathname (Node, &Buffer, FALSE);
     if (ACPI_FAILURE (Status))
     {
         AcpiOsPrintf ("****Could not get pathname****)");
--- a/sys/external/bsd/acpica/dist/disassembler/dmopcode.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/disassembler/dmopcode.c	Tue Aug 18 09:53:33 2015 +0000
@@ -48,6 +48,7 @@
 #include "acdisasm.h"
 #include "acinterp.h"
 #include "acnamesp.h"
+#include "acdebug.h"
 
 #ifdef ACPI_DISASSEMBLER
 
@@ -269,10 +270,10 @@
      * Note: NameString is guaranteed to be upper case here.
      */
     LastCharIsDigit =
-        (ACPI_IS_DIGIT (NameString[3]));    /* d */
+        (isdigit ((int) NameString[3]));    /* d */
     LastCharsAreHex =
-        (ACPI_IS_XDIGIT (NameString[2]) &&  /* xx */
-         ACPI_IS_XDIGIT (NameString[3]));
+        (isxdigit ((int) NameString[2]) &&  /* xx */
+         isxdigit ((int) NameString[3]));
 
     switch (NameString[1])
     {
@@ -967,7 +968,7 @@
             (WalkState->Results) &&
             (WalkState->ResultCount))
         {
-            AcpiDmDecodeInternalObject (
+            AcpiDbDecodeInternalObject (
                 WalkState->Results->Results.ObjDesc [
                     (WalkState->ResultCount - 1) %
                         ACPI_RESULTS_FRAME_OBJ_NUM]);
--- a/sys/external/bsd/acpica/dist/dispatcher/dsargs.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/dispatcher/dsargs.c	Tue Aug 18 09:53:33 2015 +0000
@@ -94,7 +94,7 @@
 
     /* Allocate a new parser op to be the root of the parsed tree */
 
-    Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP);
+    Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP, AmlStart);
     if (!Op)
     {
         return_ACPI_STATUS (AE_NO_MEMORY);
@@ -141,7 +141,7 @@
 
     /* Evaluate the deferred arguments */
 
-    Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP);
+    Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP, AmlStart);
     if (!Op)
     {
         return_ACPI_STATUS (AE_NO_MEMORY);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/acpica/dist/dispatcher/dsdebug.c	Tue Aug 18 09:53:33 2015 +0000
@@ -0,0 +1,249 @@
+/******************************************************************************
+ *
+ * Module Name: dsdebug - Parser/Interpreter interface - debugging
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, 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 "acdispat.h"
+#include "acnamesp.h"
+#include "acdisasm.h"
+#include "acinterp.h"
+
+
+#define _COMPONENT          ACPI_DISPATCHER
+        ACPI_MODULE_NAME    ("dsdebug")
+
+
+#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
+
+/* Local prototypes */
+
+static void
+AcpiDsPrintNodePathname (
+    ACPI_NAMESPACE_NODE     *Node,
+    const char              *Message);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDsPrintNodePathname
+ *
+ * PARAMETERS:  Node            - Object
+ *              Message         - Prefix message
+ *
+ * DESCRIPTION: Print an object's full namespace pathname
+ *              Manages allocation/freeing of a pathname buffer
+ *
+ ******************************************************************************/
+
+static void
+AcpiDsPrintNodePathname (
+    ACPI_NAMESPACE_NODE     *Node,
+    const char              *Message)
+{
+    ACPI_BUFFER             Buffer;
+    ACPI_STATUS             Status;
+
+
+    ACPI_FUNCTION_TRACE (DsPrintNodePathname);
+
+    if (!Node)
+    {
+        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "[NULL NAME]"));
+        return_VOID;
+    }
+
+    /* Convert handle to full pathname and print it (with supplied message) */
+
+    Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
+
+    Status = AcpiNsHandleToPathname (Node, &Buffer, FALSE);
+    if (ACPI_SUCCESS (Status))
+    {
+        if (Message)
+        {
+            ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "%s ", Message));
+        }
+
+        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "[%s] (Node %p)",
+            (char *) Buffer.Pointer, Node));
+        ACPI_FREE (Buffer.Pointer);
+    }
+
+    return_VOID;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDsDumpMethodStack
+ *
+ * PARAMETERS:  Status          - Method execution status
+ *              WalkState       - Current state of the parse tree walk
+ *              Op              - Executing parse op
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Called when a method has been aborted because of an error.
+ *              Dumps the method execution stack.
+ *
+ ******************************************************************************/
+
+void
+AcpiDsDumpMethodStack (
+    ACPI_STATUS             Status,
+    ACPI_WALK_STATE         *WalkState,
+    ACPI_PARSE_OBJECT       *Op)
+{
+    ACPI_PARSE_OBJECT       *Next;
+    ACPI_THREAD_STATE       *Thread;
+    ACPI_WALK_STATE         *NextWalkState;
+    ACPI_NAMESPACE_NODE     *PreviousMethod = NULL;
+    ACPI_OPERAND_OBJECT     *MethodDesc;
+
+
+    ACPI_FUNCTION_TRACE (DsDumpMethodStack);
+
+    /* Ignore control codes, they are not errors */
+
+    if ((Status & AE_CODE_MASK) == AE_CODE_CONTROL)
+    {
+        return_VOID;
+    }
+
+    /* We may be executing a deferred opcode */
+
+    if (WalkState->DeferredNode)
+    {
+        ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+            "Executing subtree for Buffer/Package/Region\n"));
+        return_VOID;
+    }
+
+    /*
+     * If there is no Thread, we are not actually executing a method.
+     * This can happen when the iASL compiler calls the interpreter
+     * to perform constant folding.
+     */
+    Thread = WalkState->Thread;
+    if (!Thread)
+    {
+        return_VOID;
+    }
+
+    /* Display exception and method name */
+
+    ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+        "\n**** Exception %s during execution of method ",
+        AcpiFormatException (Status)));
+    AcpiDsPrintNodePathname (WalkState->MethodNode, NULL);
+
+    /* Display stack of executing methods */
+
+    ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH,
+        "\n\nMethod Execution Stack:\n"));
+    NextWalkState = Thread->WalkStateList;
+
+    /* Walk list of linked walk states */
+
+    while (NextWalkState)
+    {
+        MethodDesc = NextWalkState->MethodDesc;
+        if (MethodDesc)
+        {
+            AcpiExStopTraceMethod (
+                    (ACPI_NAMESPACE_NODE *) MethodDesc->Method.Node,
+                    MethodDesc, WalkState);
+        }
+
+        ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+            "    Method [%4.4s] executing: ",
+            AcpiUtGetNodeName (NextWalkState->MethodNode)));
+
+        /* First method is the currently executing method */
+
+        if (NextWalkState == WalkState)
+        {
+            if (Op)
+            {
+                /* Display currently executing ASL statement */
+
+                Next = Op->Common.Next;
+                Op->Common.Next = NULL;
+
+#ifdef ACPI_DISASSEMBLER
+                AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX);
+#endif
+                Op->Common.Next = Next;
+            }
+        }
+        else
+        {
+            /*
+             * This method has called another method
+             * NOTE: the method call parse subtree is already deleted at this
+             * point, so we cannot disassemble the method invocation.
+             */
+            ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Call to method "));
+            AcpiDsPrintNodePathname (PreviousMethod, NULL);
+        }
+
+        PreviousMethod = NextWalkState->MethodNode;
+        NextWalkState = NextWalkState->Next;
+        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "\n"));
+    }
+
+    return_VOID;
+}
+
+#else
+
+void
+AcpiDsDumpMethodStack (
+    ACPI_STATUS             Status,
+    ACPI_WALK_STATE         *WalkState,
+    ACPI_PARSE_OBJECT       *Op)
+{
+    return;
+}
+
+#endif
--- a/sys/external/bsd/acpica/dist/dispatcher/dsfield.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/dispatcher/dsfield.c	Tue Aug 18 09:53:33 2015 +0000
@@ -530,7 +530,7 @@
         }
     }
 
-    ACPI_MEMSET (&Info, 0, sizeof (ACPI_CREATE_FIELD_INFO));
+    memset (&Info, 0, sizeof (ACPI_CREATE_FIELD_INFO));
 
     /* Second arg is the field flags */
 
--- a/sys/external/bsd/acpica/dist/dispatcher/dsinit.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/dispatcher/dsinit.c	Tue Aug 18 09:53:33 2015 +0000
@@ -224,7 +224,7 @@
 
     /* Set all init info to zero */
 
-    ACPI_MEMSET (&Info, 0, sizeof (ACPI_INIT_WALK_INFO));
+    memset (&Info, 0, sizeof (ACPI_INIT_WALK_INFO));
 
     Info.OwnerId = OwnerId;
     Info.TableIndex = TableIndex;
--- a/sys/external/bsd/acpica/dist/dispatcher/dsmethod.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/dispatcher/dsmethod.c	Tue Aug 18 09:53:33 2015 +0000
@@ -46,9 +46,9 @@
 #include "acdispat.h"
 #include "acinterp.h"
 #include "acnamesp.h"
-#include "acdisasm.h"
 #include "acparser.h"
 #include "amlcode.h"
+#include "acdebug.h"
 
 
 #define _COMPONENT          ACPI_DISPATCHER
@@ -109,7 +109,7 @@
 
     /* Create/Init a root op for the method parse tree */
 
-    Op = AcpiPsAllocOp (AML_METHOD_OP);
+    Op = AcpiPsAllocOp (AML_METHOD_OP, ObjDesc->Method.AmlStart);
     if (!Op)
     {
         return_ACPI_STATUS (AE_NO_MEMORY);
@@ -123,6 +123,7 @@
     WalkState = AcpiDsCreateWalkState (Node->OwnerId, NULL, NULL, NULL);
     if (!WalkState)
     {
+        AcpiPsFreeOp (Op);
         return_ACPI_STATUS (AE_NO_MEMORY);
     }
 
@@ -131,6 +132,7 @@
     if (ACPI_FAILURE (Status))
     {
         AcpiDsDeleteWalkState (WalkState);
+        AcpiPsFreeOp (Op);
         return_ACPI_STATUS (Status);
     }
 
@@ -139,10 +141,6 @@
     /* Parse the method, scan for creation of named objects */
 
     Status = AcpiPsParseAml (WalkState);
-    if (ACPI_FAILURE (Status))
-    {
-        return_ACPI_STATUS (Status);
-    }
 
     AcpiPsDeleteParseTree (Op);
     return_ACPI_STATUS (Status);
@@ -215,7 +213,7 @@
  * RETURN:      Status
  *
  * DESCRIPTION: Called on method error. Invoke the global exception handler if
- *              present, dump the method data if the disassembler is configured
+ *              present, dump the method data if the debugger is configured
  *
  *              Note: Allows the exception handler to change the status code
  *
@@ -226,6 +224,9 @@
     ACPI_STATUS             Status,
     ACPI_WALK_STATE         *WalkState)
 {
+    UINT32                  AmlOffset;
+
+
     ACPI_FUNCTION_ENTRY ();
 
 
@@ -249,23 +250,28 @@
          * Handler can map the exception code to anything it wants, including
          * AE_OK, in which case the executing method will not be aborted.
          */
+        AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml,
+                        WalkState->ParserState.AmlStart);
+
         Status = AcpiGbl_ExceptionHandler (Status,
                     WalkState->MethodNode ?
                         WalkState->MethodNode->Name.Integer : 0,
-                    WalkState->Opcode, WalkState->AmlOffset, NULL);
+                    WalkState->Opcode, AmlOffset, NULL);
         AcpiExEnterInterpreter ();
     }
 
     AcpiDsClearImplicitReturn (WalkState);
 
-#ifdef ACPI_DISASSEMBLER
     if (ACPI_FAILURE (Status))
     {
-        /* Display method locals/args if disassembler is present */
+        AcpiDsDumpMethodStack (Status, WalkState, WalkState->Op);
+
+        /* Display method locals/args if debugger is present */
 
-        AcpiDmDumpMethodInfo (Status, WalkState, WalkState->Op);
+#ifdef ACPI_DEBUGGER
+        AcpiDbDumpMethodInfo (Status, WalkState);
+#endif
     }
-#endif
 
     return (Status);
 }
@@ -351,6 +357,8 @@
         return_ACPI_STATUS (AE_NULL_ENTRY);
     }
 
+    AcpiExStartTraceMethod (MethodNode, ObjDesc, WalkState);
+
     /* Prevent wraparound of thread count */
 
     if (ObjDesc->Method.ThreadCount == ACPI_UINT8_MAX)
@@ -612,10 +620,7 @@
     /* On error, we must terminate the method properly */
 
     AcpiDsTerminateControlMethod (ObjDesc, NextWalkState);
-    if (NextWalkState)
-    {
-        AcpiDsDeleteWalkState (NextWalkState);
-    }
+    AcpiDsDeleteWalkState (NextWalkState);
 
     return_ACPI_STATUS (Status);
 }
@@ -872,5 +877,8 @@
         }
     }
 
+    AcpiExStopTraceMethod ((ACPI_NAMESPACE_NODE *) MethodDesc->Method.Node,
+            MethodDesc, WalkState);
+
     return_VOID;
 }
--- a/sys/external/bsd/acpica/dist/dispatcher/dsobject.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/dispatcher/dsobject.c	Tue Aug 18 09:53:33 2015 +0000
@@ -348,7 +348,7 @@
 
         if (ByteList)
         {
-            ACPI_MEMCPY (ObjDesc->Buffer.Pointer, ByteList->Named.Data,
+            memcpy (ObjDesc->Buffer.Pointer, ByteList->Named.Data,
                          ByteListLength);
         }
     }
@@ -775,7 +775,7 @@
     case ACPI_TYPE_STRING:
 
         ObjDesc->String.Pointer = Op->Common.Value.String;
-        ObjDesc->String.Length = (UINT32) ACPI_STRLEN (Op->Common.Value.String);
+        ObjDesc->String.Length = (UINT32) strlen (Op->Common.Value.String);
 
         /*
          * The string is contained in the ACPI table, don't ever try
--- a/sys/external/bsd/acpica/dist/dispatcher/dswload.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/dispatcher/dswload.c	Tue Aug 18 09:53:33 2015 +0000
@@ -325,9 +325,18 @@
         if ((WalkState->Opcode != AML_SCOPE_OP) &&
             (!(WalkState->ParseFlags & ACPI_PARSE_DEFERRED_OP)))
         {
-            Flags |= ACPI_NS_ERROR_IF_FOUND;
-            ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Cannot already exist\n",
-                    AcpiUtGetTypeName (ObjectType)));
+            if (WalkState->NamespaceOverride)
+            {
+                Flags |= ACPI_NS_OVERRIDE_IF_FOUND;
+                ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Override allowed\n",
+                        AcpiUtGetTypeName (ObjectType)));
+            }
+            else
+            {
+                Flags |= ACPI_NS_ERROR_IF_FOUND;
+                ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Cannot already exist\n",
+                        AcpiUtGetTypeName (ObjectType)));
+            }
         }
         else
         {
@@ -389,7 +398,7 @@
     {
         /* Create a new op */
 
-        Op = AcpiPsAllocOp (WalkState->Opcode);
+        Op = AcpiPsAllocOp (WalkState->Opcode, WalkState->Aml);
         if (!Op)
         {
             return_ACPI_STATUS (AE_NO_MEMORY);
--- a/sys/external/bsd/acpica/dist/dispatcher/dswload2.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/dispatcher/dswload2.c	Tue Aug 18 09:53:33 2015 +0000
@@ -344,7 +344,7 @@
     {
         /* Create a new op */
 
-        Op = AcpiPsAllocOp (WalkState->Opcode);
+        Op = AcpiPsAllocOp (WalkState->Opcode, WalkState->Aml);
         if (!Op)
         {
             return_ACPI_STATUS (AE_NO_MEMORY);
--- a/sys/external/bsd/acpica/dist/events/evgpe.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/events/evgpe.c	Tue Aug 18 09:53:33 2015 +0000
@@ -104,6 +104,7 @@
     {
         ACPI_SET_BIT (GpeRegisterInfo->EnableForRun, (UINT8) RegisterBit);
     }
+    GpeRegisterInfo->EnableMask = GpeRegisterInfo->EnableForRun;
 
     return_ACPI_STATUS (AE_OK);
 }
@@ -141,7 +142,7 @@
 
     /* Enable the requested GPE */
 
-    Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE_SAVE);
+    Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE);
     return_ACPI_STATUS (Status);
 }
 
@@ -231,7 +232,7 @@
         Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo);
         if (ACPI_SUCCESS (Status))
         {
-            Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE_SAVE);
+            Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
         }
 
         if (ACPI_FAILURE (Status))
--- a/sys/external/bsd/acpica/dist/events/evgpeinit.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/events/evgpeinit.c	Tue Aug 18 09:53:33 2015 +0000
@@ -395,7 +395,7 @@
 
     /* 4) The last two characters of the name are the hex GPE Number */
 
-    GpeNumber = ACPI_STRTOUL (&Name[2], NULL, 16);
+    GpeNumber = strtoul (&Name[2], NULL, 16);
     if (GpeNumber == ACPI_UINT32_MAX)
     {
         /* Conversion failed; invalid method, just ignore it */
--- a/sys/external/bsd/acpica/dist/executer/exconvrt.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exconvrt.c	Tue Aug 18 09:53:33 2015 +0000
@@ -251,7 +251,7 @@
         /* Copy the integer to the buffer, LSB first */
 
         NewBuf = ReturnDesc->Buffer.Pointer;
-        ACPI_MEMCPY (NewBuf,
+        memcpy (NewBuf,
                         &ObjDesc->Integer.Value,
                         AcpiGbl_IntegerByteWidth);
         break;
@@ -276,7 +276,7 @@
         /* Copy the string to the buffer */
 
         NewBuf = ReturnDesc->Buffer.Pointer;
-        ACPI_STRNCPY ((char *) NewBuf, (char *) ObjDesc->String.Pointer,
+        strncpy ((char *) NewBuf, (char *) ObjDesc->String.Pointer,
             ObjDesc->String.Length);
         break;
 
--- a/sys/external/bsd/acpica/dist/executer/excreate.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/executer/excreate.c	Tue Aug 18 09:53:33 2015 +0000
@@ -526,6 +526,7 @@
 
     ObjDesc->Method.AmlStart = AmlStart;
     ObjDesc->Method.AmlLength = AmlLength;
+    ObjDesc->Method.Node = Operand[0];
 
     /*
      * Disassemble the method flags. Split off the ArgCount, Serialized
--- a/sys/external/bsd/acpica/dist/executer/exfield.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exfield.c	Tue Aug 18 09:53:33 2015 +0000
@@ -460,7 +460,7 @@
         }
 
         Buffer = BufferDesc->Buffer.Pointer;
-        ACPI_MEMCPY (Buffer, SourceDesc->Buffer.Pointer, Length);
+        memcpy (Buffer, SourceDesc->Buffer.Pointer, Length);
 
         /* Lock entire transaction if requested */
 
--- a/sys/external/bsd/acpica/dist/executer/exfldio.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exfldio.c	Tue Aug 18 09:53:33 2015 +0000
@@ -456,7 +456,7 @@
              * Copy the data from the source buffer.
              * Length is the field width in bytes.
              */
-            ACPI_MEMCPY (Value,
+            memcpy (Value,
                 (ObjDesc->BufferField.BufferObj)->Buffer.Pointer +
                     ObjDesc->BufferField.BaseByteOffset +
                     FieldDatumByteOffset,
@@ -468,7 +468,7 @@
              * Copy the data to the target buffer.
              * Length is the field width in bytes.
              */
-            ACPI_MEMCPY ((ObjDesc->BufferField.BufferObj)->Buffer.Pointer +
+            memcpy ((ObjDesc->BufferField.BufferObj)->Buffer.Pointer +
                 ObjDesc->BufferField.BaseByteOffset +
                 FieldDatumByteOffset,
                 Value, ObjDesc->CommonField.AccessByteWidth);
@@ -748,7 +748,7 @@
         return_ACPI_STATUS (AE_BUFFER_OVERFLOW);
     }
 
-    ACPI_MEMSET (Buffer, 0, BufferLength);
+    memset (Buffer, 0, BufferLength);
     AccessBitWidth = ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth);
 
     /* Handle the simple case here */
@@ -765,7 +765,7 @@
             /* Use RawDatum (UINT64) to handle buffers < 64 bits */
 
             Status = AcpiExFieldDatumIo (ObjDesc, 0, &RawDatum, ACPI_READ);
-            ACPI_MEMCPY (Buffer, &RawDatum, BufferLength);
+            memcpy (Buffer, &RawDatum, BufferLength);
         }
 
         return_ACPI_STATUS (Status);
@@ -835,7 +835,7 @@
 
         /* Write merged datum to target buffer */
 
-        ACPI_MEMCPY (((char *) Buffer) + BufferOffset, &MergedDatum,
+        memcpy (((char *) Buffer) + BufferOffset, &MergedDatum,
             ACPI_MIN(ObjDesc->CommonField.AccessByteWidth,
                 BufferLength - BufferOffset));
 
@@ -853,7 +853,7 @@
 
     /* Write the last datum to the buffer */
 
-    ACPI_MEMCPY (((char *) Buffer) + BufferOffset, &MergedDatum,
+    memcpy (((char *) Buffer) + BufferOffset, &MergedDatum,
         ACPI_MIN(ObjDesc->CommonField.AccessByteWidth,
             BufferLength - BufferOffset));
 
@@ -926,7 +926,7 @@
          * at Byte zero. All unused (upper) bytes of the
          * buffer will be 0.
          */
-        ACPI_MEMCPY ((char *) NewBuffer, (char *) Buffer, BufferLength);
+        memcpy ((char *) NewBuffer, (char *) Buffer, BufferLength);
         Buffer = NewBuffer;
         BufferLength = RequiredLength;
     }
@@ -969,7 +969,7 @@
 
     /* Get initial Datum from the input buffer */
 
-    ACPI_MEMCPY (&RawDatum, Buffer,
+    memcpy (&RawDatum, Buffer,
         ACPI_MIN(ObjDesc->CommonField.AccessByteWidth,
             BufferLength - BufferOffset));
 
@@ -1021,7 +1021,7 @@
         /* Get the next input datum from the buffer */
 
         BufferOffset += ObjDesc->CommonField.AccessByteWidth;
-        ACPI_MEMCPY (&RawDatum, ((char *) Buffer) + BufferOffset,
+        memcpy (&RawDatum, ((char *) Buffer) + BufferOffset,
             ACPI_MIN(ObjDesc->CommonField.AccessByteWidth,
                  BufferLength - BufferOffset));
 
--- a/sys/external/bsd/acpica/dist/executer/exmisc.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exmisc.c	Tue Aug 18 09:53:33 2015 +0000
@@ -225,8 +225,8 @@
      * EndTag descriptor is copied from Operand1.
      */
     NewBuf = ReturnDesc->Buffer.Pointer;
-    ACPI_MEMCPY (NewBuf, Operand0->Buffer.Pointer, Length0);
-    ACPI_MEMCPY (NewBuf + Length0, Operand1->Buffer.Pointer, Length1);
+    memcpy (NewBuf, Operand0->Buffer.Pointer, Length0);
+    memcpy (NewBuf + Length0, Operand1->Buffer.Pointer, Length1);
 
     /* Insert EndTag and set the checksum to zero, means "ignore checksum" */
 
@@ -340,12 +340,12 @@
 
         /* Copy the first integer, LSB first */
 
-        ACPI_MEMCPY (NewBuf, &Operand0->Integer.Value,
+        memcpy (NewBuf, &Operand0->Integer.Value,
                         AcpiGbl_IntegerByteWidth);
 
         /* Copy the second integer (LSB first) after the first */
 
-        ACPI_MEMCPY (NewBuf + AcpiGbl_IntegerByteWidth,
+        memcpy (NewBuf + AcpiGbl_IntegerByteWidth,
                         &LocalOperand1->Integer.Value,
                         AcpiGbl_IntegerByteWidth);
         break;
@@ -367,8 +367,8 @@
 
         /* Concatenate the strings */
 
-        ACPI_STRCPY (NewBuf, Operand0->String.Pointer);
-        ACPI_STRCPY (NewBuf + Operand0->String.Length,
+        strcpy (NewBuf, Operand0->String.Pointer);
+        strcpy (NewBuf + Operand0->String.Length,
                         LocalOperand1->String.Pointer);
         break;
 
@@ -389,9 +389,9 @@
 
         /* Concatenate the buffers */
 
-        ACPI_MEMCPY (NewBuf, Operand0->Buffer.Pointer,
+        memcpy (NewBuf, Operand0->Buffer.Pointer,
                         Operand0->Buffer.Length);
-        ACPI_MEMCPY (NewBuf + Operand0->Buffer.Length,
+        memcpy (NewBuf + Operand0->Buffer.Length,
                         LocalOperand1->Buffer.Pointer,
                         LocalOperand1->Buffer.Length);
         break;
@@ -712,7 +712,7 @@
 
         /* Lexicographic compare: compare the data bytes */
 
-        Compare = ACPI_MEMCMP (Operand0->Buffer.Pointer,
+        Compare = memcmp (Operand0->Buffer.Pointer,
                     LocalOperand1->Buffer.Pointer,
                     (Length0 > Length1) ? Length1 : Length0);
 
--- a/sys/external/bsd/acpica/dist/executer/exnames.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exnames.c	Tue Aug 18 09:53:33 2015 +0000
@@ -221,7 +221,7 @@
 
         if (NameString)
         {
-            ACPI_STRCAT (NameString, CharBuf);
+            strcat (NameString, CharBuf);
             ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
                 "Appended to - %s\n", NameString));
         }
--- a/sys/external/bsd/acpica/dist/executer/exoparg2.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exoparg2.c	Tue Aug 18 09:53:33 2015 +0000
@@ -368,7 +368,7 @@
          * Copy the raw buffer data with no transform.
          * (NULL terminated already)
          */
-        ACPI_MEMCPY (ReturnDesc->String.Pointer,
+        memcpy (ReturnDesc->String.Pointer,
             Operand[0]->Buffer.Pointer, Length);
         break;
 
@@ -412,6 +412,8 @@
             }
 
             ReturnDesc->Reference.TargetType = ACPI_TYPE_BUFFER_FIELD;
+            ReturnDesc->Reference.IndexPointer =
+                &(Operand[0]->Buffer.Pointer [Index]);
             break;
 
         case ACPI_TYPE_BUFFER:
@@ -423,6 +425,8 @@
             }
 
             ReturnDesc->Reference.TargetType = ACPI_TYPE_BUFFER_FIELD;
+            ReturnDesc->Reference.IndexPointer =
+                &(Operand[0]->Buffer.Pointer [Index]);
             break;
 
         case ACPI_TYPE_PACKAGE:
@@ -434,7 +438,8 @@
             }
 
             ReturnDesc->Reference.TargetType = ACPI_TYPE_PACKAGE;
-            ReturnDesc->Reference.Where = &Operand[0]->Package.Elements [Index];
+            ReturnDesc->Reference.Where =
+                &Operand[0]->Package.Elements [Index];
             break;
 
         default:
--- a/sys/external/bsd/acpica/dist/executer/exoparg3.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exoparg3.c	Tue Aug 18 09:53:33 2015 +0000
@@ -261,7 +261,7 @@
         {
             /* We have a buffer, copy the portion requested */
 
-            ACPI_MEMCPY (Buffer, Operand[0]->String.Pointer + Index,
+            memcpy (Buffer, Operand[0]->String.Pointer + Index,
                          Length);
         }
 
--- a/sys/external/bsd/acpica/dist/executer/exregion.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exregion.c	Tue Aug 18 09:53:33 2015 +0000
@@ -558,13 +558,13 @@
     {
     case ACPI_READ:
 
-        ACPI_MEMCPY (ACPI_CAST_PTR (char, Value), ACPI_PHYSADDR_TO_PTR (Address),
+        memcpy (ACPI_CAST_PTR (char, Value), ACPI_PHYSADDR_TO_PTR (Address),
             ACPI_DIV_8 (BitWidth));
         break;
 
     case ACPI_WRITE:
 
-        ACPI_MEMCPY (ACPI_PHYSADDR_TO_PTR (Address), ACPI_CAST_PTR (char, Value),
+        memcpy (ACPI_PHYSADDR_TO_PTR (Address), ACPI_CAST_PTR (char, Value),
             ACPI_DIV_8 (BitWidth));
         break;
 
--- a/sys/external/bsd/acpica/dist/executer/exstorob.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exstorob.c	Tue Aug 18 09:53:33 2015 +0000
@@ -109,8 +109,8 @@
     {
         /* Clear existing buffer and copy in the new one */
 
-        ACPI_MEMSET (TargetDesc->Buffer.Pointer, 0, TargetDesc->Buffer.Length);
-        ACPI_MEMCPY (TargetDesc->Buffer.Pointer, Buffer, Length);
+        memset (TargetDesc->Buffer.Pointer, 0, TargetDesc->Buffer.Length);
+        memcpy (TargetDesc->Buffer.Pointer, Buffer, Length);
 
 #ifdef ACPI_OBSOLETE_BEHAVIOR
         /*
@@ -139,7 +139,7 @@
     {
         /* Truncate the source, copy only what will fit */
 
-        ACPI_MEMCPY (TargetDesc->Buffer.Pointer, Buffer,
+        memcpy (TargetDesc->Buffer.Pointer, Buffer,
             TargetDesc->Buffer.Length);
 
         ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
@@ -203,9 +203,9 @@
          * String will fit in existing non-static buffer.
          * Clear old string and copy in the new one
          */
-        ACPI_MEMSET (TargetDesc->String.Pointer, 0,
+        memset (TargetDesc->String.Pointer, 0,
             (ACPI_SIZE) TargetDesc->String.Length + 1);
-        ACPI_MEMCPY (TargetDesc->String.Pointer, Buffer, Length);
+        memcpy (TargetDesc->String.Pointer, Buffer, Length);
     }
     else
     {
@@ -229,7 +229,7 @@
         }
 
         TargetDesc->Common.Flags &= ~AOPOBJ_STATIC_POINTER;
-        ACPI_MEMCPY (TargetDesc->String.Pointer, Buffer, Length);
+        memcpy (TargetDesc->String.Pointer, Buffer, Length);
     }
 
     /* Set the new target length */
--- a/sys/external/bsd/acpica/dist/executer/exutils.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/executer/exutils.c	Tue Aug 18 09:53:33 2015 +0000
@@ -433,6 +433,43 @@
 
 /*******************************************************************************
  *
+ * FUNCTION:    AcpiExPciClsToString
+ *
+ * PARAMETERS:  OutString       - Where to put the converted string (7 bytes)
+ * PARAMETERS:  ClassCode       - PCI class code to be converted (3 bytes)
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Convert 3-bytes PCI class code to string representation.
+ *              Return buffer must be large enough to hold the string. The
+ *              string returned is always exactly of length
+ *              ACPI_PCICLS_STRING_SIZE (includes null terminator).
+ *
+ ******************************************************************************/
+
+void
+AcpiExPciClsToString (
+    char                    *OutString,
+    UINT8                   ClassCode[3])
+{
+
+    ACPI_FUNCTION_ENTRY ();
+
+
+    /* All 3 bytes are hexadecimal */
+
+    OutString[0] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[0], 4);
+    OutString[1] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[0], 0);
+    OutString[2] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[1], 4);
+    OutString[3] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[1], 0);
+    OutString[4] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[2], 4);
+    OutString[5] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[2], 0);
+    OutString[6] = 0;
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    AcpiIsValidSpaceId
  *
  * PARAMETERS:  SpaceId             - ID to be validated
--- a/sys/external/bsd/acpica/dist/generate/unix/Makefile.config	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/Makefile.config	Tue Aug 18 09:53:33 2015 +0000
@@ -55,6 +55,10 @@
 HOST =       _APPLE
 endif
 
+ifeq ($(UNAME_S), DragonFly)
+HOST =       _DragonFly
+endif
+
 ifeq ($(UNAME_S), FreeBSD)
 HOST =       _FreeBSD
 endif
--- a/sys/external/bsd/acpica/dist/generate/unix/Makefile.rules	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/Makefile.rules	Tue Aug 18 09:53:33 2015 +0000
@@ -18,7 +18,7 @@
 	$(COMPILEOBJ)
 
 clean :
-	rm -f $(PROG) $(PROG).exe $(OBJECTS) $(INTERMEDIATES) $(MISC)
+	rm -f $(PROG) $(PROG).exe $(OBJECTS) $(OBJDIR)/*.o $(INTERMEDIATES) $(MISC)
 
 install :
 	$(INSTALLPROG)
--- a/sys/external/bsd/acpica/dist/generate/unix/acpidump/Makefile	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/acpidump/Makefile	Tue Aug 18 09:53:33 2015 +0000
@@ -44,6 +44,7 @@
 	$(OBJDIR)/utexcep.o\
 	$(OBJDIR)/utglobal.o\
 	$(OBJDIR)/utmath.o\
+	$(OBJDIR)/utnonansi.o\
 	$(OBJDIR)/utprint.o\
 	$(OBJDIR)/utstring.o\
 	$(OBJDIR)/utxferror.o
@@ -51,6 +52,10 @@
 #
 # Per-host interfaces
 #
+ifeq ($(HOST), _DragonFly)
+HOST_FAMILY = BSD
+endif
+
 ifeq ($(HOST), _FreeBSD)
 HOST_FAMILY = BSD
 endif
--- a/sys/external/bsd/acpica/dist/generate/unix/acpiexamples/Makefile	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/acpiexamples/Makefile	Tue Aug 18 09:53:33 2015 +0000
@@ -40,6 +40,7 @@
 	$(OBJDIR)/extables.o\
 	$(OBJDIR)/dsargs.o\
 	$(OBJDIR)/dscontrol.o\
+	$(OBJDIR)/dsdebug.o\
 	$(OBJDIR)/dsfield.o\
 	$(OBJDIR)/dsinit.o\
 	$(OBJDIR)/dsmethod.o\
@@ -148,6 +149,7 @@
 	$(OBJDIR)/utobject.o\
 	$(OBJDIR)/utosi.o\
 	$(OBJDIR)/utownerid.o\
+	$(OBJDIR)/utnonansi.o\
 	$(OBJDIR)/utpredef.o\
 	$(OBJDIR)/utprint.o\
 	$(OBJDIR)/utresrc.o\
--- a/sys/external/bsd/acpica/dist/generate/unix/acpiexec/Makefile	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/acpiexec/Makefile	Tue Aug 18 09:53:33 2015 +0000
@@ -58,6 +58,7 @@
 	$(OBJDIR)/dbinput.o\
 	$(OBJDIR)/dbmethod.o\
 	$(OBJDIR)/dbnames.o\
+	$(OBJDIR)/dbobject.o\
 	$(OBJDIR)/dbstats.o\
 	$(OBJDIR)/dbtest.o\
 	$(OBJDIR)/dbutils.o\
@@ -66,7 +67,6 @@
 	$(OBJDIR)/dmcstyle.o\
 	$(OBJDIR)/dmdeferred.o\
 	$(OBJDIR)/dmnames.o\
-	$(OBJDIR)/dmobject.o\
 	$(OBJDIR)/dmopcode.o\
 	$(OBJDIR)/dmresrc.o\
 	$(OBJDIR)/dmresrcl.o\
@@ -76,6 +76,7 @@
 	$(OBJDIR)/dmwalk.o\
 	$(OBJDIR)/dsargs.o\
 	$(OBJDIR)/dscontrol.o\
+	$(OBJDIR)/dsdebug.o\
 	$(OBJDIR)/dsfield.o\
 	$(OBJDIR)/dsinit.o\
 	$(OBJDIR)/dsmethod.o\
@@ -218,6 +219,7 @@
 	$(OBJDIR)/utobject.o\
 	$(OBJDIR)/utosi.o\
 	$(OBJDIR)/utownerid.o\
+	$(OBJDIR)/utnonansi.o\
 	$(OBJDIR)/utpredef.o\
 	$(OBJDIR)/utprint.o\
 	$(OBJDIR)/utresrc.o\
--- a/sys/external/bsd/acpica/dist/generate/unix/acpihelp/Makefile	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/acpihelp/Makefile	Tue Aug 18 09:53:33 2015 +0000
@@ -35,6 +35,7 @@
 	$(OBJDIR)/ahids.o\
 	$(OBJDIR)/ahpredef.o\
 	$(OBJDIR)/ahmain.o\
+	$(OBJDIR)/ahtable.o\
 	$(OBJDIR)/ahuuids.o\
 	$(OBJDIR)/getopt.o\
 	$(OBJDIR)/oslibcfs.o\
@@ -44,6 +45,7 @@
 	$(OBJDIR)/utglobal.o\
 	$(OBJDIR)/uthex.o\
 	$(OBJDIR)/utmath.o\
+	$(OBJDIR)/utnonansi.o\
 	$(OBJDIR)/utpredef.o\
 	$(OBJDIR)/utprint.o\
 	$(OBJDIR)/utuuid.o
--- a/sys/external/bsd/acpica/dist/generate/unix/acpisrc/Makefile	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/acpisrc/Makefile	Tue Aug 18 09:53:33 2015 +0000
@@ -43,7 +43,9 @@
     $(OBJDIR)/utexcep.o\
     $(OBJDIR)/utglobal.o\
     $(OBJDIR)/utmath.o\
+	$(OBJDIR)/utnonansi.o\
     $(OBJDIR)/utprint.o\
+    $(OBJDIR)/utstring.o\
     $(OBJDIR)/utxferror.o
 
 #
--- a/sys/external/bsd/acpica/dist/generate/unix/acpixtract/Makefile	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/acpixtract/Makefile	Tue Aug 18 09:53:33 2015 +0000
@@ -36,6 +36,7 @@
     $(OBJDIR)/utexcep.o\
     $(OBJDIR)/utglobal.o\
     $(OBJDIR)/utmath.o\
+    $(OBJDIR)/utnonansi.o\
     $(OBJDIR)/utprint.o\
     $(OBJDIR)/utxferror.o
 
--- a/sys/external/bsd/acpica/dist/generate/unix/iasl/Makefile	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/generate/unix/iasl/Makefile	Tue Aug 18 09:53:33 2015 +0000
@@ -48,6 +48,7 @@
 	$(OBJDIR)/adwalk.o\
 	$(OBJDIR)/ahids.o\
 	$(OBJDIR)/ahpredef.o\
+	$(OBJDIR)/ahtable.o\
 	$(OBJDIR)/ahuuids.o\
 	$(OBJDIR)/aslanalyze.o\
 	$(OBJDIR)/aslascii.o\
@@ -105,7 +106,6 @@
 	$(OBJDIR)/dmdeferred.o\
 	$(OBJDIR)/dmextern.o\
 	$(OBJDIR)/dmnames.o\
-	$(OBJDIR)/dmobject.o\
 	$(OBJDIR)/dmopcode.o\
 	$(OBJDIR)/dmresrc.o\
 	$(OBJDIR)/dmresrcl.o\
@@ -207,6 +207,7 @@
 	$(OBJDIR)/utmath.o\
 	$(OBJDIR)/utmisc.o\
 	$(OBJDIR)/utmutex.o\
+	$(OBJDIR)/utnonansi.o\
 	$(OBJDIR)/utobject.o\
 	$(OBJDIR)/utownerid.o\
 	$(OBJDIR)/utpredef.o\
--- a/sys/external/bsd/acpica/dist/hardware/hwgpe.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/hardware/hwgpe.c	Tue Aug 18 09:53:33 2015 +0000
@@ -97,6 +97,8 @@
  * RETURN:      Status
  *
  * DESCRIPTION: Enable or disable a single GPE in the parent enable register.
+ *              The EnableMask field of the involved GPE register must be
+ *              updated by the caller if necessary.
  *
  ******************************************************************************/
 
@@ -133,7 +135,7 @@
     /* Set or clear just the bit that corresponds to this GPE */
 
     RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
-    switch (Action & ~ACPI_GPE_SAVE_MASK)
+    switch (Action)
     {
     case ACPI_GPE_CONDITIONAL_ENABLE:
 
@@ -165,10 +167,6 @@
     /* Write the updated enable mask */
 
     Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
-    if (ACPI_SUCCESS (Status) && (Action & ACPI_GPE_SAVE_MASK))
-    {
-        GpeRegisterInfo->EnableMask = (UINT8) EnableMask;
-    }
     return (Status);
 }
 
@@ -334,11 +332,8 @@
     ACPI_STATUS             Status;
 
 
+    GpeRegisterInfo->EnableMask = EnableMask;
     Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
-    if (ACPI_SUCCESS (Status))
-    {
-        GpeRegisterInfo->EnableMask = EnableMask;
-    }
 
     return (Status);
 }
--- a/sys/external/bsd/acpica/dist/hardware/hwpci.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/hardware/hwpci.c	Tue Aug 18 09:53:33 2015 +0000
@@ -140,7 +140,7 @@
     ACPI_HANDLE             PciRegion)
 {
     ACPI_STATUS             Status;
-    ACPI_PCI_DEVICE         *ListHead = NULL;
+    ACPI_PCI_DEVICE         *ListHead;
 
 
     ACPI_FUNCTION_TRACE (HwDerivePciId);
@@ -198,7 +198,6 @@
     ACPI_HANDLE             ParentDevice;
     ACPI_STATUS             Status;
     ACPI_PCI_DEVICE         *ListElement;
-    ACPI_PCI_DEVICE         *ListHead = NULL;
 
 
     /*
@@ -206,6 +205,7 @@
      * a list of device nodes. Loop will exit when either the PCI device is
      * found, or the root of the namespace is reached.
      */
+    *ReturnListHead = NULL;
     CurrentDevice = PciRegion;
     while (1)
     {
@@ -222,7 +222,6 @@
 
         if (ParentDevice == RootPciDevice)
         {
-            *ReturnListHead = ListHead;
             return (AE_OK);
         }
 
@@ -237,9 +236,9 @@
 
         /* Put new element at the head of the list */
 
-        ListElement->Next = ListHead;
+        ListElement->Next = *ReturnListHead;
         ListElement->Device = ParentDevice;
-        ListHead = ListElement;
+        *ReturnListHead = ListElement;
 
         CurrentDevice = ParentDevice;
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/acpica/dist/include/acclib.h	Tue Aug 18 09:53:33 2015 +0000
@@ -0,0 +1,167 @@
+/******************************************************************************
+ *
+ * Name: acclib.h -- C library support. Prototypes for the (optional) local
+ *                   implementations of required C library functions.
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, 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 _ACCLIB_H
+#define _ACCLIB_H
+
+
+/*
+ * Prototypes and macros for local implementations of C library functions
+ */
+
+/* is* functions. The AcpiGbl_Ctypes array is defined in utclib.c */
+
+extern const UINT8 AcpiGbl_Ctypes[];
+
+#define _ACPI_XA     0x00    /* extra alphabetic - not supported */
+#define _ACPI_XS     0x40    /* extra space */
+#define _ACPI_BB     0x00    /* BEL, BS, etc. - not supported */
+#define _ACPI_CN     0x20    /* CR, FF, HT, NL, VT */
+#define _ACPI_DI     0x04    /* '0'-'9' */
+#define _ACPI_LO     0x02    /* 'a'-'z' */
+#define _ACPI_PU     0x10    /* punctuation */
+#define _ACPI_SP     0x08    /* space, tab, CR, LF, VT, FF */
+#define _ACPI_UP     0x01    /* 'A'-'Z' */
+#define _ACPI_XD     0x80    /* '0'-'9', 'A'-'F', 'a'-'f' */
+
+#define isdigit(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_DI))
+#define isspace(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_SP))
+#define isxdigit(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_XD))
+#define isupper(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_UP))
+#define islower(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO))
+#define isprint(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU))
+#define isalpha(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
+
+
+/* Strings */
+
+char *
+strcat (
+    char                    *DstString,
+    const char              *SrcString);
+
+char *
+strchr (
+    const char              *String,
+    int                     ch);
+
+char *
+strcpy (
+    char                    *DstString,
+    const char              *SrcString);
+
+int
+strcmp (
+    const char              *String1,
+    const char              *String2);
+
+ACPI_SIZE
+strlen (
+    const char              *String);
+
+char *
+strncat (
+    char                    *DstString,
+    const char              *SrcString,
+    ACPI_SIZE               Count);
+
+int
+strncmp (
+    const char              *String1,
+    const char              *String2,
+    ACPI_SIZE               Count);
+
+char *
+strncpy (
+    char                    *DstString,
+    const char              *SrcString,
+    ACPI_SIZE               Count);
+
+char *
+strstr (
+    char                    *String1,
+    char                    *String2);
+
+
+/* Conversion */
+
+UINT32
+strtoul (
+    const char              *String,
+    char                    **Terminator,
+    UINT32                  Base);
+
+
+/* Memory */
+
+int
+memcmp (
+    void                    *Buffer1,
+    void                    *Buffer2,
+    ACPI_SIZE               Count);
+
+void *
+memcpy (
+    void                    *Dest,
+    const void              *Src,
+    ACPI_SIZE               Count);
+
+void *
+memset (
+    void                    *Dest,
+    int                     Value,
+    ACPI_SIZE               Count);
+
+
+/* upper/lower case */
+
+int
+tolower (
+    int                     c);
+
+int
+toupper (
+    int                     c);
+
+#endif /* _ACCLIB_H */
--- a/sys/external/bsd/acpica/dist/include/accommon.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/include/accommon.h	Tue Aug 18 09:53:33 2015 +0000
@@ -59,6 +59,9 @@
 #include "acglobal.h"           /* All global variables */
 #include "achware.h"            /* Hardware defines and interfaces */
 #include "acutils.h"            /* Utility interfaces */
+#ifndef ACPI_USE_SYSTEM_CLIBRARY
+#include "acclib.h"             /* C library interfaces */
+#endif /* !ACPI_USE_SYSTEM_CLIBRARY */
 
 
 #endif /* __ACCOMMON_H__ */
--- a/sys/external/bsd/acpica/dist/include/acdispat.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/include/acdispat.h	Tue Aug 18 09:53:33 2015 +0000
@@ -461,4 +461,14 @@
     ACPI_OPERAND_OBJECT     *Object,
     ACPI_WALK_STATE         *WalkState);
 
+
+/*
+ * dsdebug - parser debugging routines
+ */
+void
+AcpiDsDumpMethodStack (
+    ACPI_STATUS             Status,
+    ACPI_WALK_STATE         *WalkState,
+    ACPI_PARSE_OBJECT       *Op);
+
 #endif /* _ACDISPAT_H_ */
--- a/sys/external/bsd/acpica/dist/include/acnames.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/include/acnames.h	Tue Aug 18 09:53:33 2015 +0000
@@ -51,6 +51,7 @@
 #define METHOD_NAME__BBN        "_BBN"
 #define METHOD_NAME__CBA        "_CBA"
 #define METHOD_NAME__CID        "_CID"
+#define METHOD_NAME__CLS        "_CLS"
 #define METHOD_NAME__CRS        "_CRS"
 #define METHOD_NAME__DDN        "_DDN"
 #define METHOD_NAME__HID        "_HID"
--- a/sys/external/bsd/acpica/dist/include/acobject.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/include/acobject.h	Tue Aug 18 09:53:33 2015 +0000
@@ -213,6 +213,7 @@
     UINT8                           ParamCount;
     UINT8                           SyncLevel;
     union acpi_operand_object       *Mutex;
+    union acpi_operand_object       *Node;
     UINT8                           *AmlStart;
     union
     {
@@ -430,13 +431,14 @@
 typedef struct acpi_object_reference
 {
     ACPI_OBJECT_COMMON_HEADER
-     UINT8                           Class;              /* Reference Class */
-     UINT8                           TargetType;         /* Used for Index Op */
-     UINT8                           Reserved;
-     void                            *Object;            /* NameOp=>HANDLE to obj, IndexOp=>ACPI_OPERAND_OBJECT */
-     ACPI_NAMESPACE_NODE             *Node;              /* RefOf or Namepath */
-     union acpi_operand_object       **Where;            /* Target of Index */
-     UINT32                          Value;              /* Used for Local/Arg/Index/DdbHandle */
+    UINT8                           Class;              /* Reference Class */
+    UINT8                           TargetType;         /* Used for Index Op */
+    UINT8                           Reserved;
+    void                            *Object;            /* NameOp=>HANDLE to obj, IndexOp=>ACPI_OPERAND_OBJECT */
+    ACPI_NAMESPACE_NODE             *Node;              /* RefOf or Namepath */
+    union acpi_operand_object       **Where;            /* Target of Index */
+    UINT8                           *IndexPointer;      /* Used for Buffers and Strings */
+    UINT32                          Value;              /* Used for Local/Arg/Index/DdbHandle */
 
 } ACPI_OBJECT_REFERENCE;
 
--- a/sys/external/bsd/acpica/dist/include/acoutput.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/include/acoutput.h	Tue Aug 18 09:53:33 2015 +0000
@@ -89,7 +89,8 @@
 #define ACPI_LV_DEBUG_OBJECT        0x00000002
 #define ACPI_LV_INFO                0x00000004
 #define ACPI_LV_REPAIR              0x00000008
-#define ACPI_LV_ALL_EXCEPTIONS      0x0000000F
+#define ACPI_LV_TRACE_POINT         0x00000010
+#define ACPI_LV_ALL_EXCEPTIONS      0x0000001F
 
 /* Trace verbosity level 1 [Standard Trace Level] */
 
@@ -149,6 +150,7 @@
 #define ACPI_DB_DEBUG_OBJECT        ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT)
 #define ACPI_DB_INFO                ACPI_DEBUG_LEVEL (ACPI_LV_INFO)
 #define ACPI_DB_REPAIR              ACPI_DEBUG_LEVEL (ACPI_LV_REPAIR)
+#define ACPI_DB_TRACE_POINT         ACPI_DEBUG_LEVEL (ACPI_LV_TRACE_POINT)
 #define ACPI_DB_ALL_EXCEPTIONS      ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS)
 
 /* Trace level -- also used in the global "DebugLevel" */
@@ -185,6 +187,21 @@
 #define ACPI_DEBUG_ALL              (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL)
 
 
+/*
+ * Global trace flags
+ */
+#define ACPI_TRACE_ENABLED          ((UINT32) 4)
+#define ACPI_TRACE_ONESHOT          ((UINT32) 2)
+#define ACPI_TRACE_OPCODE           ((UINT32) 1)
+
+/* Defaults for trace debugging level/layer */
+
+#define ACPI_TRACE_LEVEL_ALL        ACPI_LV_ALL
+#define ACPI_TRACE_LAYER_ALL        0x000001FF
+#define ACPI_TRACE_LEVEL_DEFAULT    ACPI_LV_TRACE_POINT
+#define ACPI_TRACE_LAYER_DEFAULT    ACPI_EXECUTER
+
+
 #if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES)
 /*
  * The module name is used primarily for error and debug messages.
@@ -298,8 +315,12 @@
 
 /* DEBUG_PRINT functions */
 
-#define ACPI_DEBUG_PRINT(plist)         ACPI_ACTUAL_DEBUG plist
-#define ACPI_DEBUG_PRINT_RAW(plist)     ACPI_ACTUAL_DEBUG_RAW plist
+#ifndef COMPILER_VA_MACRO
+
+#define ACPI_DEBUG_PRINT(plist)         AcpiDebugPrint plist
+#define ACPI_DEBUG_PRINT_RAW(plist)     AcpiDebugPrintRaw plist
+
+#else
 
 /* Helper macros for DEBUG_PRINT */
 
@@ -319,6 +340,11 @@
     ACPI_DO_DEBUG_PRINT (AcpiDebugPrintRaw, Level, Line, \
         Filename, Modulename, Component, __VA_ARGS__)
 
+#define ACPI_DEBUG_PRINT(plist)         ACPI_ACTUAL_DEBUG plist
+#define ACPI_DEBUG_PRINT_RAW(plist)     ACPI_ACTUAL_DEBUG_RAW plist
+
+#endif
+
 
 /*
  * Function entry tracing
@@ -430,6 +456,8 @@
 #define ACPI_DUMP_PATHNAME(a, b, c, d)  AcpiNsDumpPathname(a, b, c, d)
 #define ACPI_DUMP_BUFFER(a, b)          AcpiUtDebugDumpBuffer((UINT8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT)
 
+#define ACPI_TRACE_POINT(a, b, c, d)    AcpiTracePoint (a, b, c, d)
+
 #else /* ACPI_DEBUG_OUTPUT */
 /*
  * This is the non-debug case -- make everything go away,
@@ -451,6 +479,7 @@
 #define ACPI_DUMP_PATHNAME(a, b, c, d)
 #define ACPI_DUMP_BUFFER(a, b)
 #define ACPI_IS_DEBUG_ENABLED(Level, Component) 0
+#define ACPI_TRACE_POINT(a, b, c, d)
 
 /* Return macros must have a return statement at the minimum */
 
--- a/sys/external/bsd/acpica/dist/include/acparser.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/include/acparser.h	Tue Aug 18 09:53:33 2015 +0000
@@ -72,6 +72,9 @@
  *
  *****************************************************************************/
 
+extern const UINT8      AcpiGbl_ShortOpIndex[];
+extern const UINT8      AcpiGbl_LongOpIndex[];
+
 
 /*
  * psxface - Parser external interfaces
@@ -303,7 +306,7 @@
  */
 ACPI_PARSE_OBJECT *
 AcpiPsCreateScopeOp (
-    void);
+    UINT8                   *Aml);
 
 void
 AcpiPsInitOp (
@@ -312,7 +315,8 @@
 
 ACPI_PARSE_OBJECT *
 AcpiPsAllocOp (
-    UINT16                  opcode);
+    UINT16                  Opcode,
+    UINT8                   *Aml);
 
 void
 AcpiPsFreeOp (
--- a/sys/external/bsd/acpica/dist/include/acpredef.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/include/acpredef.h	Tue Aug 18 09:53:33 2015 +0000
@@ -106,6 +106,11 @@
  *      count = 0 (optional)
  *      (Used for _DLM)
  *
+ * ACPI_PTYPE2_VAR_VAR: Variable number of subpackages, each of either a
+ *      constant or variable length. The subpackages are preceded by a
+ *      constant number of objects.
+ *      (Used for _LPI, _RDI)
+ *
  * ACPI_PTYPE2_UUID_PAIR: Each subpackage is preceded by a UUID Buffer. The UUID
  *      defines the format of the package. Zero-length parent package is
  *      allowed.
@@ -125,7 +130,8 @@
     ACPI_PTYPE2_MIN         = 8,
     ACPI_PTYPE2_REV_FIXED   = 9,
     ACPI_PTYPE2_FIX_VAR     = 10,
-    ACPI_PTYPE2_UUID_PAIR   = 11
+    ACPI_PTYPE2_VAR_VAR     = 11,
+    ACPI_PTYPE2_UUID_PAIR   = 12
 };
 
 
@@ -177,7 +183,7 @@
  * These are the names that can actually be evaluated via AcpiEvaluateObject.
  * Not present in this table are the following:
  *
- *      1) Predefined/Reserved names that are never evaluated via
+ *      1) Predefined/Reserved names that are not usually evaluated via
  *         AcpiEvaluateObject:
  *              _Lxx and _Exx GPE methods
  *              _Qxx EC methods
@@ -363,6 +369,9 @@
                 METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (4 Int) */
                     PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0,0,0),
 
+    {{"_BTH",   METHOD_1ARGS (ACPI_TYPE_INTEGER),      /* ACPI 6.0 */
+                METHOD_NO_RETURN_VALUE}},
+
     {{"_BTM",   METHOD_1ARGS (ACPI_TYPE_INTEGER),
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
 
@@ -390,6 +399,9 @@
                 METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Ints/Bufs) */
                     PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER, 0,0,0,0),
 
+    {{"_CR3",   METHOD_0ARGS,                          /* ACPI 6.0 */
+                METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
+
     {{"_CRS",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
 
@@ -443,7 +455,7 @@
     {{"_DOS",   METHOD_1ARGS (ACPI_TYPE_INTEGER),
                 METHOD_NO_RETURN_VALUE}},
 
-    {{"_DSD",   METHOD_0ARGS,
+    {{"_DSD",   METHOD_0ARGS,                          /* ACPI 6.0 */
                 METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: 1 Buf, 1 Pkg */
                     PACKAGE_INFO (ACPI_PTYPE2_UUID_PAIR, ACPI_RTYPE_BUFFER, 1, ACPI_RTYPE_PACKAGE, 1,0),
 
@@ -597,6 +609,11 @@
                 METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (1 Int(rev), n Pkg (2 Int) */
                     PACKAGE_INFO (ACPI_PTYPE2_REV_FIXED, ACPI_RTYPE_INTEGER, 2,0,0,0),
 
+    {{"_LPI",   METHOD_0ARGS,                          /* ACPI 6.0 */
+                METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (3 Int, n Pkg (10 Int/Buf) */
+                    PACKAGE_INFO (ACPI_PTYPE2_VAR_VAR, ACPI_RTYPE_INTEGER, 3,
+                    ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER | ACPI_RTYPE_STRING, 10,0),
+
     {{"_MAT",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
 
@@ -614,6 +631,9 @@
     {{"_MSM",   METHOD_4ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER),
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
 
+    {{"_MTL",   METHOD_0ARGS,                          /* ACPI 6.0 */
+                METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
+
     {{"_NTT",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
 
@@ -701,6 +721,10 @@
                 METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */
                     PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0),
 
+    {{"_PRR",   METHOD_0ARGS,                          /* ACPI 6.0 */
+                METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (1 Ref) */
+                    PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_REFERENCE, 1,0,0,0),
+
     {{"_PRS",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
 
@@ -778,6 +802,11 @@
     {{"_PXM",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
 
+    {{"_RDI",   METHOD_0ARGS,                          /* ACPI 6.0 */
+                METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (1 Int, n Pkg (m Ref)) */
+                    PACKAGE_INFO (ACPI_PTYPE2_VAR_VAR, ACPI_RTYPE_INTEGER, 1,
+                    ACPI_RTYPE_REFERENCE,0,0),
+
     {{"_REG",   METHOD_2ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER),
                 METHOD_NO_RETURN_VALUE}},
 
@@ -790,6 +819,9 @@
     {{"_ROM",   METHOD_2ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER),
                 METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
 
+    {{"_RST",   METHOD_0ARGS,                          /* ACPI 6.0 */
+                METHOD_NO_RETURN_VALUE}},
+
     {{"_RTV",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
 
@@ -916,6 +948,9 @@
     {{"_TDL",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
 
+    {{"_TFP",   METHOD_0ARGS,                          /* ACPI 6.0 */
+                METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
+
     {{"_TIP",   METHOD_1ARGS (ACPI_TYPE_INTEGER),
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
 
@@ -939,6 +974,9 @@
                 METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each 5 Int with count */
                     PACKAGE_INFO (ACPI_PTYPE2_COUNT,ACPI_RTYPE_INTEGER, 5,0,0,0),
 
+    {{"_TSN",   METHOD_0ARGS,                          /* ACPI 6.0 */
+                METHOD_RETURNS (ACPI_RTYPE_REFERENCE)}},
+
     {{"_TSP",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
 
--- a/sys/external/bsd/acpica/dist/include/acstruct.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/include/acstruct.h	Tue Aug 18 09:53:33 2015 +0000
@@ -85,9 +85,10 @@
     UINT8                           ReturnUsed;
     UINT8                           ScopeDepth;
     UINT8                           PassNumber;         /* Parse pass during table load */
+    BOOLEAN                         NamespaceOverride;  /* Override existing objects */
     UINT8                           ResultSize;         /* Total elements for the result stack */
     UINT8                           ResultCount;        /* Current number of occupied elements of result stack */
-    UINT32                          AmlOffset;
+    UINT8                           *Aml;
     UINT32                          ArgTypes;
     UINT32                          MethodBreakpoint;   /* For single stepping */
     UINT32                          UserBreakpoint;     /* User AML breakpoint */
--- a/sys/external/bsd/acpica/dist/include/actbl.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/include/actbl.h	Tue Aug 18 09:53:33 2015 +0000
@@ -67,6 +67,7 @@
 #define ACPI_SIG_DSDT           "DSDT"      /* Differentiated System Description Table */
 #define ACPI_SIG_FADT           "FACP"      /* Fixed ACPI Description Table */
 #define ACPI_SIG_FACS           "FACS"      /* Firmware ACPI Control Structure */
+#define ACPI_SIG_OSDT           "OSDT"      /* Override System Description Table */
 #define ACPI_SIG_PSDT           "PSDT"      /* Persistent System Description Table */
 #define ACPI_SIG_RSDP           "RSD PTR "  /* Root System Description Pointer */
 #define ACPI_SIG_RSDT           "RSDT"      /* Root System Description Table */
@@ -310,6 +311,7 @@
     ACPI_GENERIC_ADDRESS    XGpe1Block;         /* 64-bit Extended General Purpose Event 1 Reg Blk address */
     ACPI_GENERIC_ADDRESS    SleepControl;       /* 64-bit Sleep Control register (ACPI 5.0) */
     ACPI_GENERIC_ADDRESS    SleepStatus;        /* 64-bit Sleep Status register (ACPI 5.0) */
+    UINT64                  HypervisorId;       /* Hypervisor Vendor ID (ACPI 6.0) */
 
 } ACPI_TABLE_FADT;
 
@@ -369,7 +371,7 @@
     PM_TABLET               = 8
 };
 
-/* Values for SleepStatus and SleepControl registers (V5 FADT) */
+/* Values for SleepStatus and SleepControl registers (V5+ FADT) */
 
 #define ACPI_X_WAKE_STATUS          0x80
 #define ACPI_X_SLEEP_TYPE_MASK      0x1C
@@ -434,15 +436,17 @@
  * FADT is the bottom line as to what the version really is.
  *
  * For reference, the values below are as follows:
- *     FADT V1  size: 0x074
- *     FADT V2  size: 0x084
- *     FADT V3  size: 0x0F4
- *     FADT V4  size: 0x0F4
- *     FADT V5  size: 0x10C
+ *     FADT V1 size: 0x074
+ *     FADT V2 size: 0x084
+ *     FADT V3 size: 0x0F4
+ *     FADT V4 size: 0x0F4
+ *     FADT V5 size: 0x10C
+ *     FADT V6 size: 0x114
  */
 #define ACPI_FADT_V1_SIZE       (UINT32) (ACPI_FADT_OFFSET (Flags) + 4)
 #define ACPI_FADT_V2_SIZE       (UINT32) (ACPI_FADT_OFFSET (MinorRevision) + 1)
 #define ACPI_FADT_V3_SIZE       (UINT32) (ACPI_FADT_OFFSET (SleepControl))
-#define ACPI_FADT_V5_SIZE       (UINT32) (sizeof (ACPI_TABLE_FADT))
+#define ACPI_FADT_V5_SIZE       (UINT32) (ACPI_FADT_OFFSET (HypervisorId))
+#define ACPI_FADT_V6_SIZE       (UINT32) (sizeof (ACPI_TABLE_FADT))
 
 #endif /* __ACTBL_H__ */
--- a/sys/external/bsd/acpica/dist/include/actbl2.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/include/actbl2.h	Tue Aug 18 09:53:33 2015 +0000
@@ -52,8 +52,8 @@
  * These tables are not consumed directly by the ACPICA subsystem, but are
  * included here to support device drivers and the AML disassembler.
  *
- * The tables in this file are defined by third-party specifications, and are
- * not defined directly by the ACPI specification itself.
+ * Generally, the tables in this file are defined by third-party specifications,
+ * and are not defined directly by the ACPI specification itself.
  *
  ******************************************************************************/
 
@@ -71,6 +71,7 @@
 #define ACPI_SIG_DMAR           "DMAR"      /* DMA Remapping table */
 #define ACPI_SIG_HPET           "HPET"      /* High Precision Event Timer table */
 #define ACPI_SIG_IBFT           "IBFT"      /* iSCSI Boot Firmware Table */
+#define ACPI_SIG_IORT           "IORT"      /* IO Remapping Table */
 #define ACPI_SIG_IVRS           "IVRS"      /* I/O Virtualization Reporting Structure */
 #define ACPI_SIG_LPIT           "LPIT"      /* Low Power Idle Table */
 #define ACPI_SIG_MCFG           "MCFG"      /* PCI Memory Mapped Configuration table */
@@ -81,6 +82,7 @@
 #define ACPI_SIG_SPCR           "SPCR"      /* Serial Port Console Redirection table */
 #define ACPI_SIG_SPMI           "SPMI"      /* Server Platform Management Interface table */
 #define ACPI_SIG_TCPA           "TCPA"      /* Trusted Computing Platform Alliance table */
+#define ACPI_SIG_TPM2           "TPM2"      /* Trusted Platform Module 2.0 H/W interface table */
 #define ACPI_SIG_UEFI           "UEFI"      /* Uefi Boot Optimization Table */
 #define ACPI_SIG_VRTC           "VRTC"      /* Virtual Real Time Clock Table */
 #define ACPI_SIG_WAET           "WAET"      /* Windows ACPI Emulated devices Table */
@@ -752,6 +754,156 @@
 
 /*******************************************************************************
  *
+ * IORT - IO Remapping Table
+ *
+ * Conforms to "IO Remapping Table System Software on ARM Platforms",
+ * Document number: ARM DEN 0049A, 2015
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_iort
+{
+    ACPI_TABLE_HEADER       Header;
+    UINT32                  NodeCount;
+    UINT32                  NodeOffset;
+    UINT32                  Reserved;
+
+} ACPI_TABLE_IORT;
+
+
+/*
+ * IORT subtables
+ */
+typedef struct acpi_iort_node
+{
+    UINT8                   Type;
+    UINT16                  Length;
+    UINT8                   Revision;
+    UINT32                  Reserved;
+    UINT32                  MappingCount;
+    UINT32                  MappingOffset;
+    char                    NodeData[1];
+
+} ACPI_IORT_NODE;
+
+/* Values for subtable Type above */
+
+enum AcpiIortNodeType
+{
+    ACPI_IORT_NODE_ITS_GROUP            = 0x00,
+    ACPI_IORT_NODE_NAMED_COMPONENT      = 0x01,
+    ACPI_IORT_NODE_PCI_ROOT_COMPLEX     = 0x02,
+    ACPI_IORT_NODE_SMMU                 = 0x03
+};
+
+
+typedef struct acpi_iort_id_mapping
+{
+    UINT32                  InputBase;          /* Lowest value in input range */
+    UINT32                  IdCount;            /* Number of IDs */
+    UINT32                  OutputBase;         /* Lowest value in output range */
+    UINT32                  OutputReference;    /* A reference to the output node */
+    UINT32                  Flags;
+
+} ACPI_IORT_ID_MAPPING;
+
+/* Masks for Flags field above for IORT subtable */
+
+#define ACPI_IORT_ID_SINGLE_MAPPING (1)
+
+
+typedef struct acpi_iort_memory_access
+{
+    UINT32                  CacheCoherency;
+    UINT8                   Hints;
+    UINT16                  Reserved;
+    UINT8                   MemoryFlags;
+
+} ACPI_IORT_MEMORY_ACCESS;
+
+/* Values for CacheCoherency field above */
+
+#define ACPI_IORT_NODE_COHERENT         0x00000001  /* The device node is fully coherent */
+#define ACPI_IORT_NODE_NOT_COHERENT     0x00000000  /* The device node is not coherent */
+
+/* Masks for Hints field above */
+
+#define ACPI_IORT_HT_TRANSIENT          (1)
+#define ACPI_IORT_HT_WRITE              (1<<1)
+#define ACPI_IORT_HT_READ               (1<<2)
+#define ACPI_IORT_HT_OVERRIDE           (1<<3)
+
+/* Masks for MemoryFlags field above */
+
+#define ACPI_IORT_MF_COHERENCY          (1)
+#define ACPI_IORT_MF_ATTRIBUTES         (1<<1)
+
+
+/*
+ * IORT node specific subtables
+ */
+typedef struct acpi_iort_its_group
+{
+    UINT32                  ItsCount;
+    UINT32                  Identifiers[1];         /* GIC ITS identifier arrary */
+
+} ACPI_IORT_ITS_GROUP;
+
+
+typedef struct acpi_iort_named_component
+{
+    UINT32                  NodeFlags;
+    UINT64                  MemoryProperties;       /* Memory access properties */
+    UINT8                   MemoryAddressLimit;     /* Memory address size limit */
+    char                    DeviceName[1];          /* Path of namespace object */
+
+} ACPI_IORT_NAMED_COMPONENT;
+
+
+typedef struct acpi_iort_root_complex
+{
+    UINT64                  MemoryProperties;       /* Memory access properties */
+    UINT32                  AtsAttribute;
+    UINT32                  PciSegmentNumber;
+
+} ACPI_IORT_ROOT_COMPLEX;
+
+/* Values for AtsAttribute field above */
+
+#define ACPI_IORT_ATS_SUPPORTED         0x00000001  /* The root complex supports ATS */
+#define ACPI_IORT_ATS_UNSUPPORTED       0x00000000  /* The root complex doesn't support ATS */
+
+
+typedef struct acpi_iort_smmu
+{
+    UINT64                  BaseAddress;            /* SMMU base address */
+    UINT64                  Span;                   /* Length of memory range */
+    UINT32                  Model;
+    UINT32                  Flags;
+    UINT32                  GlobalInterruptOffset;
+    UINT32                  ContextInterruptCount;
+    UINT32                  ContextInterruptOffset;
+    UINT32                  PmuInterruptCount;
+    UINT32                  PmuInterruptOffset;
+    UINT64                  Interrupts[1];          /* Interrupt array */
+
+} ACPI_IORT_SMMU;
+
+/* Values for Model field above */
+
+#define ACPI_IORT_SMMU_V1               0x00000000  /* Generic SMMUv1 */
+#define ACPI_IORT_SMMU_V2               0x00000001  /* Generic SMMUv2 */
+#define ACPI_IORT_SMMU_CORELINK_MMU400  0x00000002  /* ARM Corelink MMU-400 */
+#define ACPI_IORT_SMMU_CORELINK_MMU500  0x00000003  /* ARM Corelink MMU-500 */
+
+/* Masks for Flags field above */
+
+#define ACPI_IORT_SMMU_DVM_SUPPORTED    (1)
+#define ACPI_IORT_SMMU_COHERENT_WALK    (1<<1)
+
+
+/*******************************************************************************
+ *
  * IVRS - I/O Virtualization Reporting Structure
  *        Version 1
  *
@@ -952,7 +1104,7 @@
  *
  * LPIT - Low Power Idle Table
  *
- * Conforms to "ACPI Low Power Idle Table (LPIT) and _LPD Proposal (DRAFT)"
+ * Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014.
  *
  ******************************************************************************/
 
@@ -980,8 +1132,7 @@
 enum AcpiLpitType
 {
     ACPI_LPIT_TYPE_NATIVE_CSTATE    = 0x00,
-    ACPI_LPIT_TYPE_SIMPLE_IO        = 0x01,
-    ACPI_LPIT_TYPE_RESERVED         = 0x02      /* 2 and above are reserved */
+    ACPI_LPIT_TYPE_RESERVED         = 0x01      /* 1 and above are reserved */
 };
 
 /* Masks for Flags field above  */
@@ -1007,24 +1158,6 @@
 } ACPI_LPIT_NATIVE;
 
 
-/* 0x01: Simple I/O based LPI structure */
-
-typedef struct acpi_lpit_io
-{
-    ACPI_LPIT_HEADER        Header;
-    ACPI_GENERIC_ADDRESS    EntryTrigger;
-    UINT32                  TriggerAction;
-    UINT64                  TriggerValue;
-    UINT64                  TriggerMask;
-    ACPI_GENERIC_ADDRESS    MinimumIdleState;
-    UINT32                  Residency;
-    UINT32                  Latency;
-    ACPI_GENERIC_ADDRESS    ResidencyCounter;
-    UINT64                  CounterFrequency;
-
-} ACPI_LPIT_IO;
-
-
 /*******************************************************************************
  *
  * MCFG - PCI Memory Mapped Configuration table and subtable
@@ -1236,21 +1369,103 @@
 /*******************************************************************************
  *
  * TCPA - Trusted Computing Platform Alliance table
- *        Version 1
+ *        Version 2
  *
- * Conforms to "TCG PC Specific Implementation Specification",
- * Version 1.1, August 18, 2003
+ * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
+ * December 19, 2014
+ *
+ * NOTE: There are two versions of the table with the same signature --
+ * the client version and the server version. The common PlatformClass
+ * field is used to differentiate the two types of tables.
  *
  ******************************************************************************/
 
-typedef struct acpi_table_tcpa
+typedef struct acpi_table_tcpa_hdr
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT16                  Reserved;
-    UINT32                  MaxLogLength;       /* Maximum length for the event log area */
+    UINT16                  PlatformClass;
+
+} ACPI_TABLE_TCPA_HDR;
+
+/*
+ * Values for PlatformClass above.
+ * This is how the client and server subtables are differentiated
+ */
+#define ACPI_TCPA_CLIENT_TABLE          0
+#define ACPI_TCPA_SERVER_TABLE          1
+
+
+typedef struct acpi_table_tcpa_client
+{
+    UINT32                  MinimumLogLength;   /* Minimum length for the event log area */
     UINT64                  LogAddress;         /* Address of the event log area */
 
-} ACPI_TABLE_TCPA;
+} ACPI_TABLE_TCPA_CLIENT;
+
+typedef struct acpi_table_tcpa_server
+{
+    UINT16                  Reserved;
+    UINT64                  MinimumLogLength;   /* Minimum length for the event log area */
+    UINT64                  LogAddress;         /* Address of the event log area */
+    UINT16                  SpecRevision;
+    UINT8                   DeviceFlags;
+    UINT8                   InterruptFlags;
+    UINT8                   GpeNumber;
+    UINT8                   Reserved2[3];
+    UINT32                  GlobalInterrupt;
+    ACPI_GENERIC_ADDRESS    Address;
+    UINT32                  Reserved3;
+    ACPI_GENERIC_ADDRESS    ConfigAddress;
+    UINT8                   Group;
+    UINT8                   Bus;                /* PCI Bus/Segment/Function numbers */
+    UINT8                   Device;
+    UINT8                   Function;
+
+} ACPI_TABLE_TCPA_SERVER;
+
+/* Values for DeviceFlags above */
+
+#define ACPI_TCPA_PCI_DEVICE            (1)
+#define ACPI_TCPA_BUS_PNP               (1<<1)
+#define ACPI_TCPA_ADDRESS_VALID         (1<<2)
+
+/* Values for InterruptFlags above */
+
+#define ACPI_TCPA_INTERRUPT_MODE        (1)
+#define ACPI_TCPA_INTERRUPT_POLARITY    (1<<1)
+#define ACPI_TCPA_SCI_VIA_GPE           (1<<2)
+#define ACPI_TCPA_GLOBAL_INTERRUPT      (1<<3)
+
+
+/*******************************************************************************
+ *
+ * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
+ *        Version 4
+ *
+ * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
+ * December 19, 2014
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_tpm2
+{
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT16                  PlatformClass;
+    UINT16                  Reserved;
+    UINT64                  ControlAddress;
+    UINT32                  StartMethod;
+
+    /* Platform-specific data follows */
+
+} ACPI_TABLE_TPM2;
+
+/* Values for StartMethod above */
+
+#define ACPI_TPM2_NOT_ALLOWED                       0
+#define ACPI_TPM2_START_METHOD                      2
+#define ACPI_TPM2_MEMORY_MAPPED                     6
+#define ACPI_TPM2_COMMAND_BUFFER                    7
+#define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD  8
 
 
 /*******************************************************************************
--- a/sys/external/bsd/acpica/dist/include/actbl3.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/include/actbl3.h	Tue Aug 18 09:53:33 2015 +0000
@@ -52,7 +52,8 @@
  * These tables are not consumed directly by the ACPICA subsystem, but are
  * included here to support device drivers and the AML disassembler.
  *
- * The tables in this file are fully defined within the ACPI specification.
+ * In general, the tables in this file are fully defined within the ACPI
+ * specification.
  *
  ******************************************************************************/
 
@@ -70,7 +71,9 @@
 #define ACPI_SIG_PCCT           "PCCT"      /* Platform Communications Channel Table */
 #define ACPI_SIG_PMTT           "PMTT"      /* Platform Memory Topology Table */
 #define ACPI_SIG_RASF           "RASF"      /* RAS Feature table */
-#define ACPI_SIG_TPM2           "TPM2"      /* Trusted Platform Module 2.0 H/W interface table */
+#define ACPI_SIG_STAO           "STAO"      /* Status Override table */
+#define ACPI_SIG_WPBT           "WPBT"      /* Windows Platform Binary Table */
+#define ACPI_SIG_XENV           "XENV"      /* Xen Environment table */
 
 #define ACPI_SIG_S3PT           "S3PT"      /* S3 Performance (sub)Table */
 #define ACPI_SIG_PCCS           "PCC"       /* PCC Shared Memory Region */
@@ -79,7 +82,6 @@
 
 #define ACPI_SIG_MATR           "MATR"      /* Memory Address Translation Table */
 #define ACPI_SIG_MSDM           "MSDM"      /* Microsoft Data Management Table */
-#define ACPI_SIG_WPBT           "WPBT"      /* Windows Platform Binary Table */
 
 /*
  * All tables must be byte-packed to match the ACPI specification, since
@@ -123,6 +125,8 @@
 /*******************************************************************************
  *
  * DRTM - Dynamic Root of Trust for Measurement table
+ * Conforms to "TCG D-RTM Architecture" June 17 2013, Version 1.0.0
+ * Table version 1
  *
  ******************************************************************************/
 
@@ -141,29 +145,50 @@
 
 } ACPI_TABLE_DRTM;
 
-/* 1) Validated Tables List */
+/* Flag Definitions for above */
 
-typedef struct acpi_drtm_vtl_list
+#define ACPI_DRTM_ACCESS_ALLOWED            (1)
+#define ACPI_DRTM_ENABLE_GAP_CODE           (1<<1)
+#define ACPI_DRTM_INCOMPLETE_MEASUREMENTS   (1<<2)
+#define ACPI_DRTM_AUTHORITY_ORDER           (1<<3)
+
+
+/* 1) Validated Tables List (64-bit addresses) */
+
+typedef struct acpi_drtm_vtable_list
 {
-    UINT32                  ValidatedTableListCount;
+    UINT32                  ValidatedTableCount;
+    UINT64                  ValidatedTables[1];
+
+} ACPI_DRTM_VTABLE_LIST;
+
+/* 2) Resources List (of Resource Descriptors) */
 
-} ACPI_DRTM_VTL_LIST;
+/* Resource Descriptor */
 
-/* 2) Resources List */
+typedef struct acpi_drtm_resource
+{
+    UINT8                   Size[7];
+    UINT8                   Type;
+    UINT64                  Address;
+
+} ACPI_DRTM_RESOURCE;
 
 typedef struct acpi_drtm_resource_list
 {
-    UINT32                  ResourceListCount;
+    UINT32                  ResourceCount;
+    ACPI_DRTM_RESOURCE      Resources[1];
 
 } ACPI_DRTM_RESOURCE_LIST;
 
 /* 3) Platform-specific Identifiers List */
 
-typedef struct acpi_drtm_id_list
+typedef struct acpi_drtm_dps_id
 {
-    UINT32                  IdListCount;
+    UINT32                  DpsIdLength;
+    UINT8                   DpsId[16];
 
-} ACPI_DRTM_ID_LIST;
+} ACPI_DRTM_DPS_ID;
 
 
 /*******************************************************************************
@@ -805,37 +830,61 @@
 
 /*******************************************************************************
  *
- * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
- *        Version 3
+ * STAO - Status Override Table (_STA override) - ACPI 6.0
+ *        Version 1
+ *
+ * Conforms to "ACPI Specification for Status Override Table"
+ * 6 January 2015
  *
- * Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November 2011
+ ******************************************************************************/
+
+typedef struct acpi_table_stao
+{
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT8                   IgnoreUart;
+
+} ACPI_TABLE_STAO;
+
+
+/*******************************************************************************
+ *
+ * WPBT - Windows Platform Environment Table (ACPI 6.0)
+ *        Version 1
+ *
+ * Conforms to "Windows Platform Binary Table (WPBT)" 29 November 2011
  *
  ******************************************************************************/
 
-typedef struct acpi_table_tpm2
+typedef struct acpi_table_wpbt
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT32                  Flags;
-    UINT64                  ControlAddress;
-    UINT32                  StartMethod;
+    UINT32                  HandoffSize;
+    UINT64                  HandoffAddress;
+    UINT8                   Layout;
+    UINT8                   Type;
+    UINT16                  ArgumentsLength;
+
+} ACPI_TABLE_WPBT;
+
 
-} ACPI_TABLE_TPM2;
+/*******************************************************************************
+ *
+ * XENV - Xen Environment Table (ACPI 6.0)
+ *        Version 1
+ *
+ * Conforms to "ACPI Specification for Xen Environment Table" 4 January 2015
+ *
+ ******************************************************************************/
 
-/* Control area structure (not part of table, pointed to by ControlAddress) */
-
-typedef struct acpi_tpm2_control
+typedef struct acpi_table_xenv
 {
-    UINT32                  Reserved;
-    UINT32                  Error;
-    UINT32                  Cancel;
-    UINT32                  Start;
-    UINT64                  InterruptControl;
-    UINT32                  CommandSize;
-    UINT64                  CommandAddress;
-    UINT32                  ResponseSize;
-    UINT64                  ResponseAddress;
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT64                  GrantTableAddress;
+    UINT64                  GrantTableSize;
+    UINT32                  EventInterrupt;
+    UINT8                   EventFlags;
 
-} ACPI_TPM2_CONTROL;
+} ACPI_TABLE_XENV;
 
 
 /* Reset to default packing */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/acpica/dist/include/acuuid.h	Tue Aug 18 09:53:33 2015 +0000
@@ -0,0 +1,90 @@
+/******************************************************************************
+ *
+ * Name: acuuid.h - ACPI-related UUID/GUID definitions
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, 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 __ACUUID_H__
+#define __ACUUID_H__
+
+/*
+ * Note1: UUIDs and GUIDs are defined to be identical in ACPI.
+ *
+ * Note2: This file is standalone and should remain that way.
+ */
+
+/* Controllers */
+
+#define UUID_GPIO_CONTROLLER            "4f248f40-d5e2-499f-834c-27758ea1cd3f"
+#define UUID_USB_CONTROLLER             "ce2ee385-00e6-48cb-9f05-2edb927c4899"
+#define UUID_SATA_CONTROLLER            "e4db149b-fcfe-425b-a6d8-92357d78fc7f"
+
+/* Devices */
+
+#define UUID_PCI_HOST_BRIDGE            "33db4d5b-1ff7-401c-9657-7441c03dd766"
+#define UUID_I2C_DEVICE                 "3cdff6f7-4267-4555-ad05-b30a3d8938de"
+#define UUID_POWER_BUTTON               "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c"
+
+/* Interfaces */
+
+#define UUID_DEVICE_LABELING            "e5c937d0-3553-4d7a-9117-ea4d19c3434d"
+#define UUID_PHYSICAL_PRESENCE          "3dddfaa6-361b-4eb4-a424-8d10089d1653"
+
+/* NVDIMM - NFIT table */
+
+#define UUID_VOLATILE_MEMORY            "7305944f-fdda-44e3-b16c-3f22d252e5d0"
+#define UUID_PERSISTENT_MEMORY          "66f0d379-b4f3-4074-ac43-0d3318b78cdb"
+#define UUID_CONTROL_REGION             "92f701f6-13b4-405d-910b-299367e8234c"
+#define UUID_DATA_REGION                "91af0530-5d86-470e-a6b0-0a2db9408249"
+#define UUID_VOLATILE_VIRTUAL_DISK      "77ab535a-45fc-624b-5560-f7b281d1f96e"
+#define UUID_VOLATILE_VIRTUAL_CD        "3d5abd30-4175-87ce-6d64-d2ade523c4bb"
+#define UUID_PERSISTENT_VIRTUAL_DISK    "5cea02c9-4d07-69d3-269f-4496fbe096f9"
+#define UUID_PERSISTENT_VIRTUAL_CD      "08018188-42cd-bb48-100f-5387d53ded3d"
+
+/* Miscellaneous */
+
+#define UUID_PLATFORM_CAPABILITIES      "0811b06e-4a27-44f9-8d60-3cbbc22e7b48"
+#define UUID_DYNAMIC_ENUMERATION        "d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf"
+#define UUID_BATTERY_THERMAL_LIMIT      "4c2067e3-887d-475c-9720-4af1d3ed602e"
+#define UUID_THERMAL_EXTENSIONS         "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500"
+#define UUID_DEVICE_PROPERTIES          "daffd814-6eba-4d8c-8a91-bc9bbf4aa301"
+
+
+#endif /* __AUUID_H__ */
--- a/sys/external/bsd/acpica/dist/include/platform/acefi.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/include/platform/acefi.h	Tue Aug 18 09:53:33 2015 +0000
@@ -49,10 +49,153 @@
 #include <stdint.h>
 #include <unistd.h>
 #endif
-#include <efi.h>
-#include <efistdarg.h>
-#include <efilib.h>
+
+#if defined(__x86_64__)
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
+#define USE_MS_ABI 1
+#endif
+#endif
+
+#ifdef _MSC_EXTENSIONS
+#define EFIAPI __cdecl
+#elif USE_MS_ABI
+#define EFIAPI __attribute__((ms_abi))
+#else
+#define EFIAPI
+#endif
+
+typedef uint8_t     UINT8;
+typedef uint16_t    UINT16;
+typedef int16_t     INT16;
+typedef uint32_t    UINT32;
+typedef int32_t     INT32;
+typedef uint64_t    UINT64;
+typedef int64_t     INT64;
+typedef uint8_t     BOOLEAN;
+typedef uint16_t    CHAR16;
+
+#define VOID        void
+
+#if defined(__ia64__) || defined(__x86_64__)
+
+#define ACPI_MACHINE_WIDTH          64
+
+#if defined(__x86_64__)
+
+/* for x86_64, EFI_FUNCTION_WRAPPER must be defined */
+
+#ifndef USE_MS_ABI
+#define USE_EFI_FUNCTION_WRAPPER
+#endif
+
+#ifdef _MSC_EXTENSIONS
+#pragma warning ( disable : 4731 )  /* Suppress warnings about modification of EBP */
+#endif
+
+#endif
+
+typedef uint64_t    UINTN;
+typedef int64_t     INTN;
+
+#define EFIERR(a)           (0x8000000000000000 | a)
+
+#else
+
+#define ACPI_MACHINE_WIDTH          32
+#define ACPI_USE_NATIVE_DIVIDE
+
+typedef uint32_t UINTN;
+typedef int32_t INTN;
+
+#define EFIERR(a)           (0x80000000 | a)
+
+#endif
+
+
+#ifdef USE_EFI_FUNCTION_WRAPPER
+#define __VA_NARG__(...)                        \
+  __VA_NARG_(_0, ## __VA_ARGS__, __RSEQ_N())
+#define __VA_NARG_(...)                         \
+  __VA_ARG_N(__VA_ARGS__)
+#define __VA_ARG_N(                             \
+  _0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,N,...) N
+#define __RSEQ_N()                              \
+  10, 9,  8,  7,  6,  5,  4,  3,  2,  1,  0
 
+#define __VA_ARG_NSUFFIX__(prefix,...)                  \
+  __VA_ARG_NSUFFIX_N(prefix, __VA_NARG__(__VA_ARGS__))
+#define __VA_ARG_NSUFFIX_N(prefix,nargs)        \
+  __VA_ARG_NSUFFIX_N_(prefix, nargs)
+#define __VA_ARG_NSUFFIX_N_(prefix,nargs)       \
+  prefix ## nargs
+
+/* Prototypes of EFI cdecl -> stdcall trampolines */
+
+UINT64 efi_call0(void *func);
+UINT64 efi_call1(void *func, UINT64 arg1);
+UINT64 efi_call2(void *func, UINT64 arg1, UINT64 arg2);
+UINT64 efi_call3(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3);
+UINT64 efi_call4(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
+                 UINT64 arg4);
+UINT64 efi_call5(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
+                 UINT64 arg4, UINT64 arg5);
+UINT64 efi_call6(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
+                 UINT64 arg4, UINT64 arg5, UINT64 arg6);
+UINT64 efi_call7(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
+                 UINT64 arg4, UINT64 arg5, UINT64 arg6, UINT64 arg7);
+UINT64 efi_call8(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
+                 UINT64 arg4, UINT64 arg5, UINT64 arg6, UINT64 arg7,
+                 UINT64 arg8);
+UINT64 efi_call9(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
+                 UINT64 arg4, UINT64 arg5, UINT64 arg6, UINT64 arg7,
+                 UINT64 arg8, UINT64 arg9);
+UINT64 efi_call10(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
+                  UINT64 arg4, UINT64 arg5, UINT64 arg6, UINT64 arg7,
+                  UINT64 arg8, UINT64 arg9, UINT64 arg10);
+
+/* Front-ends to efi_callX to avoid compiler warnings */
+
+#define _cast64_efi_call0(f) \
+  efi_call0(f)
+#define _cast64_efi_call1(f,a1) \
+  efi_call1(f, (UINT64)(a1))
+#define _cast64_efi_call2(f,a1,a2) \
+  efi_call2(f, (UINT64)(a1), (UINT64)(a2))
+#define _cast64_efi_call3(f,a1,a2,a3) \
+  efi_call3(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3))
+#define _cast64_efi_call4(f,a1,a2,a3,a4) \
+  efi_call4(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4))
+#define _cast64_efi_call5(f,a1,a2,a3,a4,a5) \
+  efi_call5(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
+            (UINT64)(a5))
+#define _cast64_efi_call6(f,a1,a2,a3,a4,a5,a6) \
+  efi_call6(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
+            (UINT64)(a5), (UINT64)(a6))
+#define _cast64_efi_call7(f,a1,a2,a3,a4,a5,a6,a7) \
+  efi_call7(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
+            (UINT64)(a5), (UINT64)(a6), (UINT64)(a7))
+#define _cast64_efi_call8(f,a1,a2,a3,a4,a5,a6,a7,a8) \
+  efi_call8(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
+            (UINT64)(a5), (UINT64)(a6), (UINT64)(a7), (UINT64)(a8))
+#define _cast64_efi_call9(f,a1,a2,a3,a4,a5,a6,a7,a8,a9) \
+  efi_call9(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
+            (UINT64)(a5), (UINT64)(a6), (UINT64)(a7), (UINT64)(a8), \
+            (UINT64)(a9))
+#define _cast64_efi_call10(f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) \
+  efi_call10(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
+             (UINT64)(a5), (UINT64)(a6), (UINT64)(a7), (UINT64)(a8), \
+             (UINT64)(a9), (UINT64)(a10))
+
+/* main wrapper (va_num ignored) */
+
+#define uefi_call_wrapper(func,va_num,...)                        \
+  __VA_ARG_NSUFFIX__(_cast64_efi_call, __VA_ARGS__) (func , ##__VA_ARGS__)
+
+#else
+
+#define uefi_call_wrapper(func, va_num, ...) func(__VA_ARGS__)
+
+#endif
 
 /* AED EFI definitions */
 
@@ -96,10 +239,6 @@
 #undef ACPI_USE_NATIVE_DIVIDE
 #define ACPI_USE_SYSTEM_INTTYPES
 
-#define ACPI_FILE           SIMPLE_TEXT_OUTPUT_INTERFACE *
-#define ACPI_FILE_OUT       ST->ConOut
-#define ACPI_FILE_ERR       ST->ConOut
-
 /*
  * Math helpers
  */
@@ -116,21 +255,21 @@
         (n_hi) >>= 1;                   \
     } while (0)
 
-/*
- * EFI specific prototypes
- */
-EFI_STATUS
-efi_main (
-    EFI_HANDLE              Image,
-    EFI_SYSTEM_TABLE        *SystemTab);
-
-int
-acpi_main (
-    int                     argc,
-    char                    *argv[]);
-
 
 #endif
 
+struct _SIMPLE_TEXT_OUTPUT_INTERFACE;
+struct _SIMPLE_INPUT_INTERFACE;
+struct _EFI_FILE_IO_INTERFACE;
+struct _EFI_FILE_HANDLE;
+struct _EFI_BOOT_SERVICES;
+struct _EFI_SYSTEM_TABLE;
+
+extern struct _EFI_SYSTEM_TABLE         *ST;
+extern struct _EFI_BOOT_SERVICES        *BS;
+
+#define ACPI_FILE           struct _SIMPLE_TEXT_OUTPUT_INTERFACE *
+#define ACPI_FILE_OUT       ST->ConOut
+#define ACPI_FILE_ERR       ST->ConOut
 
 #endif /* __ACEFI_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/acpica/dist/include/platform/acefiex.h	Tue Aug 18 09:53:33 2015 +0000
@@ -0,0 +1,855 @@
+/******************************************************************************
+ *
+ * Name: acefiex.h - Extra OS specific defines, etc. for EFI
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, 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 __ACEFIEX_H__
+#define __ACEFIEX_H__
+
+
+#define EFI_ERROR(a)              (((INTN) a) < 0)
+#define EFI_SUCCESS                             0
+#define EFI_LOAD_ERROR                  EFIERR(1)
+#define EFI_INVALID_PARAMETER           EFIERR(2)
+#define EFI_UNSUPPORTED                 EFIERR(3)
+#define EFI_BAD_BUFFER_SIZE             EFIERR(4)
+#define EFI_BUFFER_TOO_SMALL            EFIERR(5)
+#define EFI_NOT_READY                   EFIERR(6)
+#define EFI_DEVICE_ERROR                EFIERR(7)
+#define EFI_WRITE_PROTECTED             EFIERR(8)
+#define EFI_OUT_OF_RESOURCES            EFIERR(9)
+#define EFI_VOLUME_CORRUPTED            EFIERR(10)
+#define EFI_VOLUME_FULL                 EFIERR(11)
+#define EFI_NO_MEDIA                    EFIERR(12)
+#define EFI_MEDIA_CHANGED               EFIERR(13)
+#define EFI_NOT_FOUND                   EFIERR(14)
+#define EFI_ACCESS_DENIED               EFIERR(15)
+#define EFI_NO_RESPONSE                 EFIERR(16)
+#define EFI_NO_MAPPING                  EFIERR(17)
+#define EFI_TIMEOUT                     EFIERR(18)
+#define EFI_NOT_STARTED                 EFIERR(19)
+#define EFI_ALREADY_STARTED             EFIERR(20)
+#define EFI_ABORTED                     EFIERR(21)
+#define EFI_PROTOCOL_ERROR              EFIERR(24)
+
+
+typedef UINTN EFI_STATUS;
+typedef VOID *EFI_HANDLE;
+typedef VOID *EFI_EVENT;
+
+typedef struct {
+    UINT32  Data1;
+    UINT16  Data2;
+    UINT16  Data3;
+    UINT8   Data4[8];
+} EFI_GUID;
+
+typedef struct _EFI_DEVICE_PATH {
+        UINT8                           Type;
+        UINT8                           SubType;
+        UINT8                           Length[2];
+} EFI_DEVICE_PATH;
+
+typedef UINT64          EFI_PHYSICAL_ADDRESS;
+typedef UINT64          EFI_VIRTUAL_ADDRESS;
+
+typedef enum {
+    AllocateAnyPages,
+    AllocateMaxAddress,
+    AllocateAddress,
+    MaxAllocateType
+} EFI_ALLOCATE_TYPE;
+
+typedef enum {
+    EfiReservedMemoryType,
+    EfiLoaderCode,
+    EfiLoaderData,
+    EfiBootServicesCode,
+    EfiBootServicesData,
+    EfiRuntimeServicesCode,
+    EfiRuntimeServicesData,
+    EfiConventionalMemory,
+    EfiUnusableMemory,
+    EfiACPIReclaimMemory,
+    EfiACPIMemoryNVS,
+    EfiMemoryMappedIO,
+    EfiMemoryMappedIOPortSpace,
+    EfiPalCode,
+    EfiMaxMemoryType
+} EFI_MEMORY_TYPE;
+
+/* possible caching types for the memory range */
+#define EFI_MEMORY_UC           0x0000000000000001
+#define EFI_MEMORY_WC           0x0000000000000002
+#define EFI_MEMORY_WT           0x0000000000000004
+#define EFI_MEMORY_WB           0x0000000000000008
+#define EFI_MEMORY_UCE          0x0000000000000010
+
+/* physical memory protection on range */
+#define EFI_MEMORY_WP           0x0000000000001000
+#define EFI_MEMORY_RP           0x0000000000002000
+#define EFI_MEMORY_XP           0x0000000000004000
+
+/* range requires a runtime mapping */
+#define EFI_MEMORY_RUNTIME      0x8000000000000000
+
+#define EFI_MEMORY_DESCRIPTOR_VERSION  1
+typedef struct {
+    UINT32                          Type;
+    UINT32                          Pad;
+    EFI_PHYSICAL_ADDRESS            PhysicalStart;
+    EFI_VIRTUAL_ADDRESS             VirtualStart;
+    UINT64                          NumberOfPages;
+    UINT64                          Attribute;
+} EFI_MEMORY_DESCRIPTOR;
+
+typedef struct _EFI_TABLE_HEARDER {
+    UINT64                      Signature;
+    UINT32                      Revision;
+    UINT32                      HeaderSize;
+    UINT32                      CRC32;
+    UINT32                      Reserved;
+} EFI_TABLE_HEADER;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UNKNOWN_INTERFACE) (
+    void);
+
+
+/*
+ * Text output protocol
+ */
+#define SIMPLE_TEXT_OUTPUT_PROTOCOL \
+    { 0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_RESET) (
+    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This,
+    BOOLEAN                                 ExtendedVerification);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_OUTPUT_STRING) (
+    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This,
+    CHAR16                                  *String);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_TEST_STRING) (
+    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This,
+    CHAR16                                  *String);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_QUERY_MODE) (
+    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This,
+    UINTN                                   ModeNumber,
+    UINTN                                   *Columns,
+    UINTN                                   *Rows);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_SET_MODE) (
+    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This,
+    UINTN                                   ModeNumber);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_SET_ATTRIBUTE) (
+    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This,
+    UINTN                                   Attribute);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_CLEAR_SCREEN) (
+    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_SET_CURSOR_POSITION) (
+    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This,
+    UINTN                                   Column,
+    UINTN                                   Row);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TEXT_ENABLE_CURSOR) (
+    struct _SIMPLE_TEXT_OUTPUT_INTERFACE    *This,
+    BOOLEAN                                 Enable);
+
+typedef struct {
+    INT32                           MaxMode;
+    INT32                           Mode;
+    INT32                           Attribute;
+    INT32                           CursorColumn;
+    INT32                           CursorRow;
+    BOOLEAN                         CursorVisible;
+} SIMPLE_TEXT_OUTPUT_MODE;
+
+typedef struct _SIMPLE_TEXT_OUTPUT_INTERFACE {
+    EFI_TEXT_RESET                  Reset;
+
+    EFI_TEXT_OUTPUT_STRING          OutputString;
+    EFI_TEXT_TEST_STRING            TestString;
+
+    EFI_TEXT_QUERY_MODE             QueryMode;
+    EFI_TEXT_SET_MODE               SetMode;
+    EFI_TEXT_SET_ATTRIBUTE          SetAttribute;
+
+    EFI_TEXT_CLEAR_SCREEN           ClearScreen;
+    EFI_TEXT_SET_CURSOR_POSITION    SetCursorPosition;
+    EFI_TEXT_ENABLE_CURSOR          EnableCursor;
+
+    SIMPLE_TEXT_OUTPUT_MODE         *Mode;
+} SIMPLE_TEXT_OUTPUT_INTERFACE;
+
+/*
+ * Text input protocol
+ */
+#define SIMPLE_TEXT_INPUT_PROTOCOL  \
+    { 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
+
+typedef struct {
+    UINT16                              ScanCode;
+    CHAR16                              UnicodeChar;
+} EFI_INPUT_KEY;
+
+/*
+ * Baseline unicode control chars
+ */
+#define CHAR_NULL                       0x0000
+#define CHAR_BACKSPACE                  0x0008
+#define CHAR_TAB                        0x0009
+#define CHAR_LINEFEED                   0x000A
+#define CHAR_CARRIAGE_RETURN            0x000D
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_INPUT_RESET) (
+    struct _SIMPLE_INPUT_INTERFACE              *This,
+    BOOLEAN                                     ExtendedVerification);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_INPUT_READ_KEY) (
+    struct _SIMPLE_INPUT_INTERFACE              *This,
+    EFI_INPUT_KEY                               *Key);
+
+typedef struct _SIMPLE_INPUT_INTERFACE {
+    EFI_INPUT_RESET                     Reset;
+    EFI_INPUT_READ_KEY                  ReadKeyStroke;
+    EFI_EVENT                           WaitForKey;
+} SIMPLE_INPUT_INTERFACE;
+
+
+/*
+ * Simple file system protocol
+ */
+#define SIMPLE_FILE_SYSTEM_PROTOCOL \
+    { 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_VOLUME_OPEN) (
+    struct _EFI_FILE_IO_INTERFACE               *This,
+    struct _EFI_FILE_HANDLE                     **Root);
+
+#define EFI_FILE_IO_INTERFACE_REVISION   0x00010000
+
+typedef struct _EFI_FILE_IO_INTERFACE {
+    UINT64                  Revision;
+    EFI_VOLUME_OPEN         OpenVolume;
+} EFI_FILE_IO_INTERFACE;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_OPEN) (
+    struct _EFI_FILE_HANDLE                     *File,
+    struct _EFI_FILE_HANDLE                     **NewHandle,
+    CHAR16                                      *FileName,
+    UINT64                                      OpenMode,
+    UINT64                                      Attributes);
+
+/* Values for OpenMode used above */
+
+#define EFI_FILE_MODE_READ      0x0000000000000001
+#define EFI_FILE_MODE_WRITE     0x0000000000000002
+#define EFI_FILE_MODE_CREATE    0x8000000000000000
+
+/* Values for Attribute used above */
+
+#define EFI_FILE_READ_ONLY      0x0000000000000001
+#define EFI_FILE_HIDDEN         0x0000000000000002
+#define EFI_FILE_SYSTEM         0x0000000000000004
+#define EFI_FILE_RESERVIED      0x0000000000000008
+#define EFI_FILE_DIRECTORY      0x0000000000000010
+#define EFI_FILE_ARCHIVE        0x0000000000000020
+#define EFI_FILE_VALID_ATTR     0x0000000000000037
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_CLOSE) (
+    struct _EFI_FILE_HANDLE                     *File);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_DELETE) (
+    struct _EFI_FILE_HANDLE                     *File);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_READ) (
+    struct _EFI_FILE_HANDLE                     *File,
+    UINTN                                       *BufferSize,
+    VOID                                        *Buffer);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_WRITE) (
+    struct _EFI_FILE_HANDLE                     *File,
+    UINTN                                       *BufferSize,
+    VOID                                        *Buffer);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_SET_POSITION) (
+    struct _EFI_FILE_HANDLE                     *File,
+    UINT64                                      Position);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_GET_POSITION) (
+    struct _EFI_FILE_HANDLE                     *File,
+    UINT64                                      *Position);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_GET_INFO) (
+    struct _EFI_FILE_HANDLE                     *File,
+    EFI_GUID                                    *InformationType,
+    UINTN                                       *BufferSize,
+    VOID                                        *Buffer);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_SET_INFO) (
+    struct _EFI_FILE_HANDLE                     *File,
+    EFI_GUID                                    *InformationType,
+    UINTN                                       BufferSize,
+    VOID                                        *Buffer);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_FLUSH) (
+    struct _EFI_FILE_HANDLE                     *File);
+
+
+#define EFI_FILE_HANDLE_REVISION         0x00010000
+
+typedef struct _EFI_FILE_HANDLE {
+    UINT64                  Revision;
+    EFI_FILE_OPEN           Open;
+    EFI_FILE_CLOSE          Close;
+    EFI_FILE_DELETE         Delete;
+    EFI_FILE_READ           Read;
+    EFI_FILE_WRITE          Write;
+    EFI_FILE_GET_POSITION   GetPosition;
+    EFI_FILE_SET_POSITION   SetPosition;
+    EFI_FILE_GET_INFO       GetInfo;
+    EFI_FILE_SET_INFO       SetInfo;
+    EFI_FILE_FLUSH          Flush;
+} EFI_FILE, *EFI_FILE_HANDLE;
+
+
+/*
+ * Loaded image protocol
+ */
+#define LOADED_IMAGE_PROTOCOL      \
+    { 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IMAGE_ENTRY_POINT) (
+    EFI_HANDLE                              ImageHandle,
+    struct _EFI_SYSTEM_TABLE                *SystemTable);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IMAGE_LOAD) (
+    BOOLEAN                         BootPolicy,
+    EFI_HANDLE                      ParentImageHandle,
+    EFI_DEVICE_PATH                 *FilePath,
+    VOID                            *SourceBuffer,
+    UINTN                           SourceSize,
+    EFI_HANDLE                      *ImageHandle);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IMAGE_START) (
+    EFI_HANDLE                      ImageHandle,
+    UINTN                           *ExitDataSize,
+    CHAR16                          **ExitData);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EXIT) (
+    EFI_HANDLE                      ImageHandle,
+    EFI_STATUS                      ExitStatus,
+    UINTN                           ExitDataSize,
+    CHAR16                          *ExitData);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IMAGE_UNLOAD) (
+    EFI_HANDLE                      ImageHandle);
+
+
+#define EFI_IMAGE_INFORMATION_REVISION      0x1000
+typedef struct {
+    UINT32                          Revision;
+    EFI_HANDLE                      ParentHandle;
+    struct _EFI_SYSTEM_TABLE        *SystemTable;
+    EFI_HANDLE                      DeviceHandle;
+    EFI_DEVICE_PATH                 *FilePath;
+    VOID                            *Reserved;
+    UINT32                          LoadOptionsSize;
+    VOID                            *LoadOptions;
+    VOID                            *ImageBase;
+    UINT64                          ImageSize;
+    EFI_MEMORY_TYPE                 ImageCodeType;
+    EFI_MEMORY_TYPE                 ImageDataType;
+    EFI_IMAGE_UNLOAD                Unload;
+
+} EFI_LOADED_IMAGE;
+
+
+/*
+ * EFI Memory
+ */
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ALLOCATE_PAGES) (
+    EFI_ALLOCATE_TYPE               Type,
+    EFI_MEMORY_TYPE                 MemoryType,
+    UINTN                           NoPages,
+    EFI_PHYSICAL_ADDRESS            *Memory);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FREE_PAGES) (
+    EFI_PHYSICAL_ADDRESS            Memory,
+    UINTN                           NoPages);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_GET_MEMORY_MAP) (
+    UINTN                           *MemoryMapSize,
+    EFI_MEMORY_DESCRIPTOR           *MemoryMap,
+    UINTN                           *MapKey,
+    UINTN                           *DescriptorSize,
+    UINT32                          *DescriptorVersion);
+
+#define NextMemoryDescriptor(Ptr,Size)  ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) Ptr) + Size))
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ALLOCATE_POOL) (
+    EFI_MEMORY_TYPE                 PoolType,
+    UINTN                           Size,
+    VOID                            **Buffer);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FREE_POOL) (
+    VOID                            *Buffer);
+
+
+/*
+ * Protocol handler functions
+ */
+typedef enum {
+    EFI_NATIVE_INTERFACE,
+    EFI_PCODE_INTERFACE
+} EFI_INTERFACE_TYPE;
+
+typedef enum {
+    AllHandles,
+    ByRegisterNotify,
+    ByProtocol
+} EFI_LOCATE_SEARCH_TYPE;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE) (
+    EFI_HANDLE                      *Handle,
+    EFI_GUID                        *Protocol,
+    EFI_INTERFACE_TYPE              InterfaceType,
+    VOID                            *Interface);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_REINSTALL_PROTOCOL_INTERFACE) (
+    EFI_HANDLE                      Handle,
+    EFI_GUID                        *Protocol,
+    VOID                            *OldInterface,
+    VOID                            *NewInterface);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UNINSTALL_PROTOCOL_INTERFACE) (
+    EFI_HANDLE                      Handle,
+    EFI_GUID                        *Protocol,
+    VOID                            *Interface);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HANDLE_PROTOCOL) (
+    EFI_HANDLE                      Handle,
+    EFI_GUID                        *Protocol,
+    VOID                            **Interface);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY) (
+    EFI_GUID                        *Protocol,
+    EFI_EVENT                       Event,
+    VOID                            **Registration);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LOCATE_HANDLE) (
+    EFI_LOCATE_SEARCH_TYPE          SearchType,
+    EFI_GUID                        *Protocol,
+    VOID                            *SearchKey,
+    UINTN                           *BufferSize,
+    EFI_HANDLE                      *Buffer);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LOCATE_DEVICE_PATH) (
+    EFI_GUID                        *Protocol,
+    EFI_DEVICE_PATH                 **DevicePath,
+    EFI_HANDLE                      *Device);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE) (
+    EFI_GUID                        *Guid,
+    VOID                            *Table);
+
+#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL  0x00000001
+#define EFI_OPEN_PROTOCOL_GET_PROTOCOL        0x00000002
+#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL       0x00000004
+#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
+#define EFI_OPEN_PROTOCOL_BY_DRIVER           0x00000010
+#define EFI_OPEN_PROTOCOL_EXCLUSIVE           0x00000020
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_OPEN_PROTOCOL) (
+    EFI_HANDLE                      Handle,
+    EFI_GUID                        *Protocol,
+    VOID                            **Interface,
+    EFI_HANDLE                      AgentHandle,
+    EFI_HANDLE                      ControllerHandle,
+    UINT32                          Attributes);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CLOSE_PROTOCOL) (
+    EFI_HANDLE                      Handle,
+    EFI_GUID                        *Protocol,
+    EFI_HANDLE                      AgentHandle,
+    EFI_HANDLE                      ControllerHandle);
+
+typedef struct {
+    EFI_HANDLE                  AgentHandle;
+    EFI_HANDLE                  ControllerHandle;
+    UINT32                      Attributes;
+    UINT32                      OpenCount;
+} EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION) (
+    EFI_HANDLE                      Handle,
+    EFI_GUID                        *Protocol,
+    EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
+    UINTN                           *EntryCount);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PROTOCOLS_PER_HANDLE) (
+    EFI_HANDLE                      Handle,
+    EFI_GUID                        ***ProtocolBuffer,
+    UINTN                           *ProtocolBufferCount);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LOCATE_HANDLE_BUFFER) (
+    EFI_LOCATE_SEARCH_TYPE          SearchType,
+    EFI_GUID                        *Protocol,
+    VOID                            *SearchKey,
+    UINTN                           *NoHandles,
+    EFI_HANDLE                      **Buffer);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LOCATE_PROTOCOL) (
+    EFI_GUID                        *Protocol,
+    VOID                            *Registration,
+    VOID                            **Interface);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
+    EFI_HANDLE                      *Handle,
+    ...);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
+    EFI_HANDLE                      Handle,
+    ...);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CALCULATE_CRC32) (
+    VOID                            *Data,
+    UINTN                           DataSize,
+    UINT32                          *Crc32);
+
+typedef
+VOID
+(EFIAPI *EFI_COPY_MEM) (
+    VOID                            *Destination,
+    VOID                            *Source,
+    UINTN                           Length);
+
+typedef
+VOID
+(EFIAPI *EFI_SET_MEM) (
+    VOID                            *Buffer,
+    UINTN                           Size,
+    UINT8                           Value);
+
+/*
+ * EFI Boot Services Table
+ */
+#define EFI_BOOT_SERVICES_SIGNATURE     0x56524553544f4f42
+#define EFI_BOOT_SERVICES_REVISION      (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION)
+
+typedef struct _EFI_BOOT_SERVICES {
+    EFI_TABLE_HEADER                Hdr;
+
+#if 0
+    EFI_RAISE_TPL                   RaiseTPL;
+    EFI_RESTORE_TPL                 RestoreTPL;
+#else
+    EFI_UNKNOWN_INTERFACE           RaiseTPL;
+    EFI_UNKNOWN_INTERFACE           RestoreTPL;
+#endif
+
+    EFI_ALLOCATE_PAGES              AllocatePages;
+    EFI_FREE_PAGES                  FreePages;
+    EFI_GET_MEMORY_MAP              GetMemoryMap;
+    EFI_ALLOCATE_POOL               AllocatePool;
+    EFI_FREE_POOL                   FreePool;
+
+#if 0
+    EFI_CREATE_EVENT                CreateEvent;
+    EFI_SET_TIMER                   SetTimer;
+    EFI_WAIT_FOR_EVENT              WaitForEvent;
+    EFI_SIGNAL_EVENT                SignalEvent;
+    EFI_CLOSE_EVENT                 CloseEvent;
+    EFI_CHECK_EVENT                 CheckEvent;
+#else
+    EFI_UNKNOWN_INTERFACE           CreateEvent;
+    EFI_UNKNOWN_INTERFACE           SetTimer;
+    EFI_UNKNOWN_INTERFACE           WaitForEvent;
+    EFI_UNKNOWN_INTERFACE           SignalEvent;
+    EFI_UNKNOWN_INTERFACE           CloseEvent;
+    EFI_UNKNOWN_INTERFACE           CheckEvent;
+#endif
+
+    EFI_INSTALL_PROTOCOL_INTERFACE  InstallProtocolInterface;
+    EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;
+    EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;
+    EFI_HANDLE_PROTOCOL             HandleProtocol;
+    EFI_HANDLE_PROTOCOL             PCHandleProtocol;
+    EFI_REGISTER_PROTOCOL_NOTIFY    RegisterProtocolNotify;
+    EFI_LOCATE_HANDLE               LocateHandle;
+    EFI_LOCATE_DEVICE_PATH          LocateDevicePath;
+    EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;
+
+    EFI_IMAGE_LOAD                  LoadImage;
+    EFI_IMAGE_START                 StartImage;
+    EFI_EXIT                        Exit;
+    EFI_IMAGE_UNLOAD                UnloadImage;
+
+#if 0
+    EFI_EXIT_BOOT_SERVICES          ExitBootServices;
+    EFI_GET_NEXT_MONOTONIC_COUNT    GetNextMonotonicCount;
+    EFI_STALL                       Stall;
+    EFI_SET_WATCHDOG_TIMER          SetWatchdogTimer;
+#else
+    EFI_UNKNOWN_INTERFACE           ExitBootServices;
+    EFI_UNKNOWN_INTERFACE           GetNextMonotonicCount;
+    EFI_UNKNOWN_INTERFACE           Stall;
+    EFI_UNKNOWN_INTERFACE           SetWatchdogTimer;
+#endif
+
+#if 0
+    EFI_CONNECT_CONTROLLER          ConnectController;
+    EFI_DISCONNECT_CONTROLLER       DisconnectController;
+#else
+    EFI_UNKNOWN_INTERFACE           ConnectController;
+    EFI_UNKNOWN_INTERFACE           DisconnectController;
+#endif
+
+    EFI_OPEN_PROTOCOL               OpenProtocol;
+    EFI_CLOSE_PROTOCOL              CloseProtocol;
+    EFI_OPEN_PROTOCOL_INFORMATION   OpenProtocolInformation;
+    EFI_PROTOCOLS_PER_HANDLE        ProtocolsPerHandle;
+    EFI_LOCATE_HANDLE_BUFFER        LocateHandleBuffer;
+    EFI_LOCATE_PROTOCOL             LocateProtocol;
+    EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces;
+    EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces;
+
+    EFI_CALCULATE_CRC32             CalculateCrc32;
+
+    EFI_COPY_MEM                    CopyMem;
+    EFI_SET_MEM                     SetMem;
+
+#if 0
+    EFI_CREATE_EVENT_EX             CreateEventEx;
+#else
+    EFI_UNKNOWN_INTERFACE           CreateEventEx;
+#endif
+} EFI_BOOT_SERVICES;
+
+
+/*
+ * EFI System Table
+ */
+
+/*
+ * EFI Configuration Table and GUID definitions
+ */
+#define ACPI_TABLE_GUID    \
+    { 0xeb9d2d30, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
+#define ACPI_20_TABLE_GUID  \
+    { 0x8868e871, 0xe4f1, 0x11d3, {0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} }
+
+typedef struct _EFI_CONFIGURATION_TABLE {
+    EFI_GUID                VendorGuid;
+    VOID                    *VendorTable;
+} EFI_CONFIGURATION_TABLE;
+
+
+#define EFI_SYSTEM_TABLE_SIGNATURE      0x5453595320494249
+#define EFI_SYSTEM_TABLE_REVISION      (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION)
+
+typedef struct _EFI_SYSTEM_TABLE {
+    EFI_TABLE_HEADER                Hdr;
+
+    CHAR16                          *FirmwareVendor;
+    UINT32                          FirmwareRevision;
+
+    EFI_HANDLE                      ConsoleInHandle;
+    SIMPLE_INPUT_INTERFACE          *ConIn;
+
+    EFI_HANDLE                      ConsoleOutHandle;
+    SIMPLE_TEXT_OUTPUT_INTERFACE    *ConOut;
+
+    EFI_HANDLE                      StandardErrorHandle;
+    SIMPLE_TEXT_OUTPUT_INTERFACE    *StdErr;
+
+#if 0
+    EFI_RUNTIME_SERVICES            *RuntimeServices;
+#else
+    EFI_HANDLE                      *RuntimeServices;
+#endif
+    EFI_BOOT_SERVICES               *BootServices;
+
+    UINTN                           NumberOfTableEntries;
+    EFI_CONFIGURATION_TABLE         *ConfigurationTable;
+
+} EFI_SYSTEM_TABLE;
+
+
+/* GNU EFI definitions */
+
+#if defined(_GNU_EFI)
+
+/*
+ * This is needed to hide platform specific code from ACPICA
+ */
+UINT64
+DivU64x32 (
+    UINT64                  Dividend,
+    UINTN                   Divisor,
+    UINTN                   *Remainder);
+
+/*
+ * EFI specific prototypes
+ */
+EFI_STATUS
+efi_main (
+    EFI_HANDLE              Image,
+    EFI_SYSTEM_TABLE        *SystemTab);
+
+int
+acpi_main (
+    int                     argc,
+    char                    *argv[]);
+
+
+#endif
+
+extern EFI_GUID AcpiGbl_LoadedImageProtocol;
+extern EFI_GUID AcpiGbl_TextInProtocol;
+extern EFI_GUID AcpiGbl_TextOutProtocol;
+extern EFI_GUID AcpiGbl_FileSystemProtocol;
+
+#endif /* __ACEFIEX_H__ */
--- a/sys/external/bsd/acpica/dist/include/platform/acenv.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/include/platform/acenv.h	Tue Aug 18 09:53:33 2015 +0000
@@ -175,6 +175,9 @@
 #elif defined(_APPLE) || defined(__APPLE__)
 #include "acmacosx.h"
 
+#elif defined(__DragonFly__)
+#include "acdragonfly.h"
+
 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #include "acfreebsd.h"
 
@@ -346,28 +349,6 @@
 
 /* We will be linking to the standard Clib functions */
 
-#define ACPI_STRSTR(s1,s2)      strstr((s1), (s2))
-#define ACPI_STRCHR(s1,c)       strchr((s1), (c))
-#define ACPI_STRLEN(s)          (ACPI_SIZE) strlen((s))
-#define ACPI_STRCPY(d,s)        (void) strcpy((d), (s))
-#define ACPI_STRNCPY(d,s,n)     (void) strncpy((d), (s), (ACPI_SIZE)(n))
-#define ACPI_STRNCMP(d,s,n)     strncmp((d), (s), (ACPI_SIZE)(n))
-#define ACPI_STRCMP(d,s)        strcmp((d), (s))
-#define ACPI_STRCAT(d,s)        (void) strcat((d), (s))
-#define ACPI_STRNCAT(d,s,n)     strncat((d), (s), (ACPI_SIZE)(n))
-#define ACPI_STRTOUL(d,s,n)     strtoul((d), (s), (ACPI_SIZE)(n))
-#define ACPI_MEMCMP(s1,s2,n)    memcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n))
-#define ACPI_MEMCPY(d,s,n)      (void) memcpy((d), (s), (ACPI_SIZE)(n))
-#define ACPI_MEMSET(d,s,n)      (void) memset((d), (s), (ACPI_SIZE)(n))
-#define ACPI_TOUPPER(i)         toupper((int) (i))
-#define ACPI_TOLOWER(i)         tolower((int) (i))
-#define ACPI_IS_XDIGIT(i)       isxdigit((int) (i))
-#define ACPI_IS_DIGIT(i)        isdigit((int) (i))
-#define ACPI_IS_SPACE(i)        isspace((int) (i))
-#define ACPI_IS_UPPER(i)        isupper((int) (i))
-#define ACPI_IS_PRINT(i)        isprint((int) (i))
-#define ACPI_IS_ALPHA(i)        isalpha((int) (i))
-
 #else
 
 /******************************************************************************
@@ -405,22 +386,6 @@
 
 /* Use the local (ACPICA) definitions of the clib functions */
 
-#define ACPI_STRSTR(s1,s2)      AcpiUtStrstr ((s1), (s2))
-#define ACPI_STRCHR(s1,c)       AcpiUtStrchr ((s1), (c))
-#define ACPI_STRLEN(s)          (ACPI_SIZE) AcpiUtStrlen ((s))
-#define ACPI_STRCPY(d,s)        (void) AcpiUtStrcpy ((d), (s))
-#define ACPI_STRNCPY(d,s,n)     (void) AcpiUtStrncpy ((d), (s), (ACPI_SIZE)(n))
-#define ACPI_STRNCMP(d,s,n)     AcpiUtStrncmp ((d), (s), (ACPI_SIZE)(n))
-#define ACPI_STRCMP(d,s)        AcpiUtStrcmp ((d), (s))
-#define ACPI_STRCAT(d,s)        (void) AcpiUtStrcat ((d), (s))
-#define ACPI_STRNCAT(d,s,n)     AcpiUtStrncat ((d), (s), (ACPI_SIZE)(n))
-#define ACPI_STRTOUL(d,s,n)     AcpiUtStrtoul ((d), (s), (ACPI_SIZE)(n))
-#define ACPI_MEMCMP(s1,s2,n)    AcpiUtMemcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n))
-#define ACPI_MEMCPY(d,s,n)      (void) AcpiUtMemcpy ((d), (s), (ACPI_SIZE)(n))
-#define ACPI_MEMSET(d,v,n)      (void) AcpiUtMemset ((d), (v), (ACPI_SIZE)(n))
-#define ACPI_TOUPPER(c)         AcpiUtToUpper ((int) (c))
-#define ACPI_TOLOWER(c)         AcpiUtToLower ((int) (c))
-
 #endif /* ACPI_USE_SYSTEM_CLIBRARY */
 
 #ifndef ACPI_FILE
--- a/sys/external/bsd/acpica/dist/include/platform/acenvex.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/include/platform/acenvex.h	Tue Aug 18 09:53:33 2015 +0000
@@ -56,6 +56,18 @@
 #if defined(_LINUX) || defined(__linux__)
 #include "aclinuxex.h"
 
+#elif defined(WIN32)
+#include "acwinex.h"
+
+#elif defined(_AED_EFI)
+#include "acefiex.h"
+
+#elif defined(_GNU_EFI)
+#include "acefiex.h"
+
+#elif defined(__DragonFly__)
+#include "acdragonflyex.h"
+
 #endif
 
 /*! [End] no source code translation !*/
--- a/sys/external/bsd/acpica/dist/include/platform/acgcc.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/include/platform/acgcc.h	Tue Aug 18 09:53:33 2015 +0000
@@ -75,4 +75,8 @@
 #undef strchr
 #endif
 
+/* GCC supports __VA_ARGS__ in macros */
+
+#define COMPILER_VA_MACRO               1
+
 #endif /* __ACGCC_H__ */
--- a/sys/external/bsd/acpica/dist/include/platform/acmsvc.h	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/include/platform/acmsvc.h	Tue Aug 18 09:53:33 2015 +0000
@@ -44,6 +44,7 @@
 #ifndef __ACMSVC_H__
 #define __ACMSVC_H__
 
+/* Note: do not include any C library headers here */
 
 /*
  * Map low I/O functions for MS. This allows us to disable MS language
@@ -56,7 +57,6 @@
 #define stat            _stat
 #define fstat           _fstat
 #define mkdir           _mkdir
-#define strlwr          _strlwr
 #define O_RDONLY        _O_RDONLY
 #define O_BINARY        _O_BINARY
 #define O_CREAT         _O_CREAT
@@ -147,14 +147,9 @@
 #endif
 
 
-/* Debug support. Must be last in this file, do not move. */
+/* Debug support. */
 
 #ifdef _DEBUG
-#define _CRTDBG_MAP_ALLOC /* Enables specific file/lineno for leaks */
-
-#include <stdlib.h>
-#include <malloc.h>
-#include <crtdbg.h>
 
 /*
  * Debugging memory corruption issues with windows:
@@ -185,4 +180,9 @@
 
 #endif
 
+#if _MSC_VER > 1200 /* Versions above VC++ 6 */
+#define COMPILER_VA_MACRO               1
+#else
+#endif
+
 #endif /* __ACMSVC_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/acpica/dist/include/platform/acmsvcex.h	Tue Aug 18 09:53:33 2015 +0000
@@ -0,0 +1,54 @@
+/******************************************************************************
+ *
+ * Name: acmsvcex.h - Extra VC specific defines, etc.
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, 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 __ACMSVCEX_H__
+#define __ACMSVCEX_H__
+
+/* Debug support. */
+
+#ifdef _DEBUG
+#define _CRTDBG_MAP_ALLOC /* Enables specific file/lineno for leaks */
+#include <crtdbg.h>
+#endif
+
+#endif /* __ACMSVCEX_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/acpica/dist/include/platform/acwinex.h	Tue Aug 18 09:53:33 2015 +0000
@@ -0,0 +1,52 @@
+/******************************************************************************
+ *
+ * Name: acwinex.h - Extra OS specific defines, etc.
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, 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 __ACWINEX_H__
+#define __ACWINEX_H__
+
+/* Windows uses VC */
+#ifdef _MSC_VER
+#include "acmsvcex.h"
+#endif
+
+#endif /* __ACWINEX_H__ */
--- a/sys/external/bsd/acpica/dist/namespace/nsconvert.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/namespace/nsconvert.c	Tue Aug 18 09:53:33 2015 +0000
@@ -202,7 +202,7 @@
          * Copy the raw buffer data with no transform. String is already NULL
          * terminated at Length+1.
          */
-        ACPI_MEMCPY (NewObject->String.Pointer,
+        memcpy (NewObject->String.Pointer,
             OriginalObject->Buffer.Pointer, Length);
         break;
 
@@ -269,7 +269,7 @@
             return (AE_NO_MEMORY);
         }
 
-        ACPI_MEMCPY (NewObject->Buffer.Pointer,
+        memcpy (NewObject->Buffer.Pointer,
             OriginalObject->String.Pointer, OriginalObject->String.Length);
         break;
 
--- a/sys/external/bsd/acpica/dist/namespace/nsnames.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/namespace/nsnames.c	Tue Aug 18 09:53:33 2015 +0000
@@ -53,82 +53,6 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    AcpiNsBuildExternalPath
- *
- * PARAMETERS:  Node            - NS node whose pathname is needed
- *              Size            - Size of the pathname
- *              *NameBuffer     - Where to return the pathname
- *
- * RETURN:      Status
- *              Places the pathname into the NameBuffer, in external format
- *              (name segments separated by path separators)
- *
- * DESCRIPTION: Generate a full pathaname
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiNsBuildExternalPath (
-    ACPI_NAMESPACE_NODE     *Node,
-    ACPI_SIZE               Size,
-    char                    *NameBuffer)
-{
-    ACPI_SIZE               Index;
-    ACPI_NAMESPACE_NODE     *ParentNode;
-
-
-    ACPI_FUNCTION_ENTRY ();
-
-
-    /* Special case for root */
-
-    Index = Size - 1;
-    if (Index < ACPI_NAME_SIZE)
-    {
-        NameBuffer[0] = AML_ROOT_PREFIX;
-        NameBuffer[1] = 0;
-        return (AE_OK);
-    }
-
-    /* Store terminator byte, then build name backwards */
-
-    ParentNode = Node;
-    NameBuffer[Index] = 0;
-
-    while ((Index > ACPI_NAME_SIZE) && (ParentNode != AcpiGbl_RootNode))
-    {
-        Index -= ACPI_NAME_SIZE;
-
-        /* Put the name into the buffer */
-
-        ACPI_MOVE_32_TO_32 ((NameBuffer + Index), &ParentNode->Name);
-        ParentNode = ParentNode->Parent;
-
-        /* Prefix name with the path separator */
-
-        Index--;
-        NameBuffer[Index] = ACPI_PATH_SEPARATOR;
-    }
-
-    /* Overwrite final separator with the root prefix character */
-
-    NameBuffer[Index] = AML_ROOT_PREFIX;
-
-    if (Index != 0)
-    {
-        ACPI_ERROR ((AE_INFO,
-            "Could not construct external pathname; index=%u, size=%u, Path=%s",
-            (UINT32) Index, (UINT32) Size, &NameBuffer[Size]));
-
-        return (AE_BAD_PARAMETER);
-    }
-
-    return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
  * FUNCTION:    AcpiNsGetExternalPathname
  *
  * PARAMETERS:  Node            - Namespace node whose pathname is needed
@@ -146,39 +70,13 @@
 AcpiNsGetExternalPathname (
     ACPI_NAMESPACE_NODE     *Node)
 {
-    ACPI_STATUS             Status;
     char                    *NameBuffer;
-    ACPI_SIZE               Size;
 
 
     ACPI_FUNCTION_TRACE_PTR (NsGetExternalPathname, Node);
 
 
-    /* Calculate required buffer size based on depth below root */
-
-    Size = AcpiNsGetPathnameLength (Node);
-    if (!Size)
-    {
-        return_PTR (NULL);
-    }
-
-    /* Allocate a buffer to be returned to caller */
-
-    NameBuffer = ACPI_ALLOCATE_ZEROED (Size);
-    if (!NameBuffer)
-    {
-        ACPI_ERROR ((AE_INFO, "Could not allocate %u bytes", (UINT32) Size));
-        return_PTR (NULL);
-    }
-
-    /* Build the path in the allocated buffer */
-
-    Status = AcpiNsBuildExternalPath (Node, Size, NameBuffer);
-    if (ACPI_FAILURE (Status))
-    {
-        ACPI_FREE (NameBuffer);
-        return_PTR (NULL);
-    }
+    NameBuffer = AcpiNsGetNormalizedPathname (Node, FALSE);
 
     return_PTR (NameBuffer);
 }
@@ -201,38 +99,14 @@
     ACPI_NAMESPACE_NODE     *Node)
 {
     ACPI_SIZE               Size;
-    ACPI_NAMESPACE_NODE     *NextNode;
 
 
     ACPI_FUNCTION_ENTRY ();
 
 
-    /*
-     * Compute length of pathname as 5 * number of name segments.
-     * Go back up the parent tree to the root
-     */
-    Size = 0;
-    NextNode = Node;
+    Size = AcpiNsBuildNormalizedPath (Node, NULL, 0, FALSE);
 
-    while (NextNode && (NextNode != AcpiGbl_RootNode))
-    {
-        if (ACPI_GET_DESCRIPTOR_TYPE (NextNode) != ACPI_DESC_TYPE_NAMED)
-        {
-            ACPI_ERROR ((AE_INFO,
-                "Invalid Namespace Node (%p) while traversing namespace",
-                NextNode));
-            return (0);
-        }
-        Size += ACPI_PATH_SEGMENT_LENGTH;
-        NextNode = NextNode->Parent;
-    }
-
-    if (!Size)
-    {
-        Size = 1; /* Root node case */
-    }
-
-    return (Size + 1);  /* +1 for null string terminator */
+    return (Size);
 }
 
 
@@ -243,6 +117,8 @@
  * PARAMETERS:  TargetHandle            - Handle of named object whose name is
  *                                        to be found
  *              Buffer                  - Where the pathname is returned
+ *              NoTrailing              - Remove trailing '_' for each name
+ *                                        segment
  *
  * RETURN:      Status, Buffer is filled with pathname if status is AE_OK
  *
@@ -253,7 +129,8 @@
 ACPI_STATUS
 AcpiNsHandleToPathname (
     ACPI_HANDLE             TargetHandle,
-    ACPI_BUFFER             *Buffer)
+    ACPI_BUFFER             *Buffer,
+    BOOLEAN                 NoTrailing)
 {
     ACPI_STATUS             Status;
     ACPI_NAMESPACE_NODE     *Node;
@@ -271,7 +148,7 @@
 
     /* Determine size required for the caller buffer */
 
-    RequiredSize = AcpiNsGetPathnameLength (Node);
+    RequiredSize = AcpiNsBuildNormalizedPath (Node, NULL, 0, NoTrailing);
     if (!RequiredSize)
     {
         return_ACPI_STATUS (AE_BAD_PARAMETER);
@@ -287,7 +164,8 @@
 
     /* Build the path in the caller buffer */
 
-    Status = AcpiNsBuildExternalPath (Node, RequiredSize, Buffer->Pointer);
+    (void) AcpiNsBuildNormalizedPath (Node, Buffer->Pointer,
+            RequiredSize, NoTrailing);
     if (ACPI_FAILURE (Status))
     {
         return_ACPI_STATUS (Status);
@@ -297,3 +175,169 @@
         (char *) Buffer->Pointer, (UINT32) RequiredSize));
     return_ACPI_STATUS (AE_OK);
 }
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiNsBuildNormalizedPath
+ *
+ * PARAMETERS:  Node        - Namespace node
+ *              FullPath    - Where the path name is returned
+ *              PathSize    - Size of returned path name buffer
+ *              NoTrailing  - Remove trailing '_' from each name segment
+ *
+ * RETURN:      Return 1 if the AML path is empty, otherwise returning (length
+ *              of pathname + 1) which means the 'FullPath' contains a trailing
+ *              null.
+ *
+ * DESCRIPTION: Build and return a full namespace pathname.
+ *              Note that if the size of 'FullPath' isn't large enough to
+ *              contain the namespace node's path name, the actual required
+ *              buffer length is returned, and it should be greater than
+ *              'PathSize'. So callers are able to check the returning value
+ *              to determine the buffer size of 'FullPath'.
+ *
+ ******************************************************************************/
+
+UINT32
+AcpiNsBuildNormalizedPath (
+    ACPI_NAMESPACE_NODE     *Node,
+    char                    *FullPath,
+    UINT32                  PathSize,
+    BOOLEAN                 NoTrailing)
+{
+    UINT32                  Length = 0, i;
+    char                    Name[ACPI_NAME_SIZE];
+    BOOLEAN                 DoNoTrailing;
+    char                    c, *Left, *Right;
+    ACPI_NAMESPACE_NODE     *NextNode;
+
+
+    ACPI_FUNCTION_TRACE_PTR (NsBuildNormalizedPath, Node);
+
+
+#define ACPI_PATH_PUT8(Path, Size, Byte, Length)    \
+    do {                                            \
+        if ((Length) < (Size))                      \
+        {                                           \
+            (Path)[(Length)] = (Byte);              \
+        }                                           \
+        (Length)++;                                 \
+    } while (0)
+
+    /*
+     * Make sure the PathSize is correct, so that we don't need to
+     * validate both FullPath and PathSize.
+     */
+    if (!FullPath)
+    {
+        PathSize = 0;
+    }
+
+    if (!Node)
+    {
+        goto BuildTrailingNull;
+    }
+
+    NextNode = Node;
+    while (NextNode && NextNode != AcpiGbl_RootNode)
+    {
+        if (NextNode != Node)
+        {
+            ACPI_PATH_PUT8(FullPath, PathSize, AML_DUAL_NAME_PREFIX, Length);
+        }
+        ACPI_MOVE_32_TO_32 (Name, &NextNode->Name);
+        DoNoTrailing = NoTrailing;
+        for (i = 0; i < 4; i++)
+        {
+            c = Name[4-i-1];
+            if (DoNoTrailing && c != '_')
+            {
+                DoNoTrailing = FALSE;
+            }
+            if (!DoNoTrailing)
+            {
+                ACPI_PATH_PUT8(FullPath, PathSize, c, Length);
+            }
+        }
+        NextNode = NextNode->Parent;
+    }
+    ACPI_PATH_PUT8(FullPath, PathSize, AML_ROOT_PREFIX, Length);
+
+    /* Reverse the path string */
+
+    if (Length <= PathSize)
+    {
+        Left = FullPath;
+        Right = FullPath+Length-1;
+        while (Left < Right)
+        {
+            c = *Left;
+            *Left++ = *Right;
+            *Right-- = c;
+        }
+    }
+
+    /* Append the trailing null */
+
+BuildTrailingNull:
+    ACPI_PATH_PUT8(FullPath, PathSize, '\0', Length);
+
+#undef ACPI_PATH_PUT8
+
+    return_UINT32 (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiNsGetNormalizedPathname
+ *
+ * PARAMETERS:  Node            - Namespace node whose pathname is needed
+ *              NoTrailing      - Remove trailing '_' from each name segment
+ *
+ * RETURN:      Pointer to storage containing the fully qualified name of
+ *              the node, In external format (name segments separated by path
+ *              separators.)
+ *
+ * DESCRIPTION: Used to obtain the full pathname to a namespace node, usually
+ *              for error and debug statements. All trailing '_' will be
+ *              removed from the full pathname if 'NoTrailing' is specified..
+ *
+ ******************************************************************************/
+
+char *
+AcpiNsGetNormalizedPathname (
+    ACPI_NAMESPACE_NODE     *Node,
+    BOOLEAN                 NoTrailing)
+{
+    char                    *NameBuffer;
+    ACPI_SIZE               Size;
+
+
+    ACPI_FUNCTION_TRACE_PTR (NsGetNormalizedPathname, Node);
+
+
+    /* Calculate required buffer size based on depth below root */
+
+    Size = AcpiNsBuildNormalizedPath (Node, NULL, 0, NoTrailing);
+    if (!Size)
+    {
+        return_PTR (NULL);
+    }
+
+    /* Allocate a buffer to be returned to caller */
+
+    NameBuffer = ACPI_ALLOCATE_ZEROED (Size);
+    if (!NameBuffer)
+    {
+        ACPI_ERROR ((AE_INFO, "Could not allocate %u bytes", (UINT32) Size));
+        return_PTR (NULL);
+    }
+
+    /* Build the path in the allocated buffer */
+
+    (void) AcpiNsBuildNormalizedPath (Node, NameBuffer, Size, NoTrailing);
+
+    return_PTR (NameBuffer);
+}
--- a/sys/external/bsd/acpica/dist/namespace/nsparse.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/namespace/nsparse.c	Tue Aug 18 09:53:33 2015 +0000
@@ -84,6 +84,22 @@
     ACPI_FUNCTION_TRACE (NsOneCompleteParse);
 
 
+    Status = AcpiGetTableByIndex (TableIndex, &Table);
+    if (ACPI_FAILURE (Status))
+    {
+        return_ACPI_STATUS (Status);
+    }
+
+    /* Table must consist of at least a complete header */
+
+    if (Table->Length < sizeof (ACPI_TABLE_HEADER))
+    {
+        return_ACPI_STATUS (AE_BAD_HEADER);
+    }
+
+    AmlStart = (UINT8 *) Table + sizeof (ACPI_TABLE_HEADER);
+    AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER);
+
     Status = AcpiTbGetOwnerId (TableIndex, &OwnerId);
     if (ACPI_FAILURE (Status))
     {
@@ -92,7 +108,7 @@
 
     /* Create and init a Root Node */
 
-    ParseRoot = AcpiPsCreateScopeOp ();
+    ParseRoot = AcpiPsCreateScopeOp (AmlStart);
     if (!ParseRoot)
     {
         return_ACPI_STATUS (AE_NO_MEMORY);
@@ -107,34 +123,22 @@
         return_ACPI_STATUS (AE_NO_MEMORY);
     }
 
-    Status = AcpiGetTableByIndex (TableIndex, &Table);
-    if (ACPI_FAILURE (Status))
-    {
-        AcpiDsDeleteWalkState (WalkState);
-        AcpiPsFreeOp (ParseRoot);
-        return_ACPI_STATUS (Status);
-    }
-
-    /* Table must consist of at least a complete header */
-
-    if (Table->Length < sizeof (ACPI_TABLE_HEADER))
-    {
-        Status = AE_BAD_HEADER;
-    }
-    else
-    {
-        AmlStart = (UINT8 *) Table + sizeof (ACPI_TABLE_HEADER);
-        AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER);
-        Status = AcpiDsInitAmlWalk (WalkState, ParseRoot, NULL,
-                    AmlStart, AmlLength, NULL, (UINT8) PassNumber);
-    }
-
+    Status = AcpiDsInitAmlWalk (WalkState, ParseRoot, NULL,
+                AmlStart, AmlLength, NULL, (UINT8) PassNumber);
     if (ACPI_FAILURE (Status))
     {
         AcpiDsDeleteWalkState (WalkState);
         goto Cleanup;
     }
 
+    /* Found OSDT table, enable the namespace override feature */
+
+    if (ACPI_COMPARE_NAME(Table->Signature, ACPI_SIG_OSDT) &&
+        PassNumber == ACPI_IMODE_LOAD_PASS1)
+    {
+        WalkState->NamespaceOverride = TRUE;
+    }
+
     /* StartNode is the default location to load the table  */
 
     if (StartNode && StartNode != AcpiGbl_RootNode)
--- a/sys/external/bsd/acpica/dist/namespace/nsprepkg.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/namespace/nsprepkg.c	Tue Aug 18 09:53:33 2015 +0000
@@ -321,6 +321,13 @@
         Status = AcpiNsCheckPackageList (Info, Package, Elements, Count);
         break;
 
+    case ACPI_PTYPE2_VAR_VAR:
+        /*
+         * Returns a variable list of packages, each with a variable list
+         * of objects.
+         */
+        break;
+
     case ACPI_PTYPE2_UUID_PAIR:
 
         /* The package must contain pairs of (UUID + type) */
@@ -490,6 +497,12 @@
             }
             break;
 
+        case ACPI_PTYPE2_VAR_VAR:
+            /*
+             * Each subpackage has a fixed or variable number of elements
+             */
+            break;
+
         case ACPI_PTYPE2_FIXED:
 
             /* Each subpackage has a fixed length */
--- a/sys/external/bsd/acpica/dist/namespace/nsrepair.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/namespace/nsrepair.c	Tue Aug 18 09:53:33 2015 +0000
@@ -523,10 +523,10 @@
     case ACPI_PTYPE2_MIN:
     case ACPI_PTYPE2_REV_FIXED:
     case ACPI_PTYPE2_FIX_VAR:
-
         break;
 
     default:
+    case ACPI_PTYPE2_VAR_VAR:
     case ACPI_PTYPE1_FIXED:
     case ACPI_PTYPE1_OPTION:
         return;
--- a/sys/external/bsd/acpica/dist/namespace/nssearch.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/namespace/nssearch.c	Tue Aug 18 09:53:33 2015 +0000
@@ -338,10 +338,42 @@
          * If we found it AND the request specifies that a find is an error,
          * return the error
          */
-        if ((Status == AE_OK) &&
-            (Flags & ACPI_NS_ERROR_IF_FOUND))
+        if (Status == AE_OK)
         {
-            Status = AE_ALREADY_EXISTS;
+            /* The node was found in the namespace */
+
+            /*
+             * If the namespace override feature is enabled for this node,
+             * delete any existing attached sub-object and make the node
+             * look like a new node that is owned by the override table.
+             */
+            if (Flags & ACPI_NS_OVERRIDE_IF_FOUND)
+            {
+                ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
+                    "Namespace override: %4.4s pass %u type %X Owner %X\n",
+                    ACPI_CAST_PTR(char, &TargetName), InterpreterMode,
+                    (*ReturnNode)->Type, WalkState->OwnerId));
+
+                AcpiNsDeleteChildren (*ReturnNode);
+                if (AcpiGbl_RuntimeNamespaceOverride)
+                {
+                    AcpiUtRemoveReference ((*ReturnNode)->Object);
+                    (*ReturnNode)->Object = NULL;
+                    (*ReturnNode)->OwnerId = WalkState->OwnerId;
+                }
+                else
+                {
+                    AcpiNsRemoveNode (*ReturnNode);
+                    *ReturnNode = ACPI_ENTRY_NOT_FOUND;
+                }
+            }
+
+            /* Return an error if we don't expect to find the object */
+
+            else if (Flags & ACPI_NS_ERROR_IF_FOUND)
+            {
+                Status = AE_ALREADY_EXISTS;
+            }
         }
 
 #ifdef ACPI_ASL_COMPILER
--- a/sys/external/bsd/acpica/dist/namespace/nsutils.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/namespace/nsutils.c	Tue Aug 18 09:53:33 2015 +0000
@@ -90,7 +90,7 @@
 
     Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
 
-    Status = AcpiNsHandleToPathname (Node, &Buffer);
+    Status = AcpiNsHandleToPathname (Node, &Buffer, FALSE);
     if (ACPI_SUCCESS (Status))
     {
         if (Message)
@@ -347,7 +347,7 @@
             {
                 /* Convert the character to uppercase and save it */
 
-                Result[i] = (char) ACPI_TOUPPER ((int) *ExternalName);
+                Result[i] = (char) toupper ((int) *ExternalName);
                 ExternalName++;
             }
         }
--- a/sys/external/bsd/acpica/dist/os_specific/service_layers/osbsdtbl.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/os_specific/service_layers/osbsdtbl.c	Tue Aug 18 09:53:33 2015 +0000
@@ -80,7 +80,7 @@
 
 
 /* Hints for RSDP */
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
 #define SYSTEM_KENV         "hint.acpi.0.rsdp"
 #define SYSTEM_SYSCTL       "machdep.acpi_root"
 #elif defined(__NetBSD__)
@@ -171,7 +171,7 @@
         return (AE_NO_MEMORY);
     }
 
-    ACPI_MEMCPY (LocalTable, MappedTable, MappedTable->Length);
+    memcpy (LocalTable, MappedTable, MappedTable->Length);
     AcpiOsUnmapMemory (MappedTable, MappedTable->Length);
 
     *Table = LocalTable;
@@ -405,7 +405,7 @@
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
     else if (kenv (KENV_GET, SYSTEM_KENV, Buffer, sizeof (Buffer)) > 0)
     {
-        Address = ACPI_STRTOUL (Buffer, NULL, 0);
+        Address = strtoul (Buffer, NULL, 0);
     }
 #endif
     if (!Address)
@@ -443,7 +443,7 @@
         return (AE_ERROR);
     }
 
-    ACPI_MEMCPY (&Gbl_Rsdp, TableAddress, sizeof (Gbl_Rsdp));
+    memcpy (&Gbl_Rsdp, TableAddress, sizeof (Gbl_Rsdp));
     AcpiOsUnmapMemory (RsdpAddress, RsdpSize);
 
     /* Get XSDT from memory */
@@ -468,7 +468,7 @@
             return (AE_NO_MEMORY);
         }
 
-        ACPI_MEMCPY (Gbl_Xsdt, MappedTable, MappedTable->Length);
+        memcpy (Gbl_Xsdt, MappedTable, MappedTable->Length);
         AcpiOsUnmapMemory (MappedTable, MappedTable->Length);
     }
 
@@ -493,7 +493,7 @@
             return (AE_NO_MEMORY);
         }
 
-        ACPI_MEMCPY (Gbl_Rsdt, MappedTable, MappedTable->Length);
+        memcpy (Gbl_Rsdt, MappedTable, MappedTable->Length);
         AcpiOsUnmapMemory (MappedTable, MappedTable->Length);
     }
 
@@ -530,7 +530,7 @@
         return (AE_NO_MEMORY);
     }
 
-    ACPI_MEMCPY (Gbl_Fadt, MappedTable, MappedTable->Length);
+    memcpy (Gbl_Fadt, MappedTable, MappedTable->Length);
     AcpiOsUnmapMemory (MappedTable, MappedTable->Length);
     Gbl_MainTableObtained = TRUE;
     return (AE_OK);
@@ -692,7 +692,7 @@
         return (AE_NO_MEMORY);
     }
 
-    ACPI_MEMCPY (LocalTable, MappedTable, MappedTable->Length);
+    memcpy (LocalTable, MappedTable, MappedTable->Length);
     AcpiOsUnmapMemory (MappedTable, MappedTable->Length);
     *Table = LocalTable;
     *Address = TableAddress;
--- a/sys/external/bsd/acpica/dist/os_specific/service_layers/osefitbl.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/os_specific/service_layers/osefitbl.c	Tue Aug 18 09:53:33 2015 +0000
@@ -185,7 +185,7 @@
         goto Exit;
     }
 
-    ACPI_MEMCPY (LocalTable, MappedTable, TableLength);
+    memcpy (LocalTable, MappedTable, TableLength);
 
 Exit:
     OslUnmapTable (MappedTable);
@@ -456,7 +456,7 @@
 
     Gbl_RsdpAddress = RsdpBase + (ACPI_CAST8 (MappedTable) - RsdpAddress);
 
-    ACPI_MEMCPY (&Gbl_Rsdp, MappedTable, sizeof (ACPI_TABLE_RSDP));
+    memcpy (&Gbl_Rsdp, MappedTable, sizeof (ACPI_TABLE_RSDP));
     AcpiOsUnmapMemory (RsdpAddress, RsdpSize);
 
     return (AE_OK);
@@ -911,7 +911,7 @@
         goto Exit;
     }
 
-    ACPI_MEMCPY (LocalTable, MappedTable, TableLength);
+    memcpy (LocalTable, MappedTable, TableLength);
     *Address = TableAddress;
     *Table = LocalTable;
 
--- a/sys/external/bsd/acpica/dist/os_specific/service_layers/osefixf.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/os_specific/service_layers/osefixf.c	Tue Aug 18 09:53:33 2015 +0000
@@ -91,6 +91,10 @@
 /* Local variables */
 
 static EFI_FILE_HANDLE      AcpiGbl_EfiCurrentVolume = NULL;
+EFI_GUID                    AcpiGbl_LoadedImageProtocol = LOADED_IMAGE_PROTOCOL;
+EFI_GUID                    AcpiGbl_TextInProtocol = SIMPLE_TEXT_INPUT_PROTOCOL;
+EFI_GUID                    AcpiGbl_TextOutProtocol = SIMPLE_TEXT_OUTPUT_PROTOCOL;
+EFI_GUID                    AcpiGbl_FileSystemProtocol = SIMPLE_FILE_SYSTEM_PROTOCOL;
 
 
 /******************************************************************************
@@ -331,7 +335,7 @@
     Mem = AcpiOsAllocate (Size);
     if (Mem)
     {
-        ACPI_MEMSET (Mem, 0, Size);
+        memset (Mem, 0, Size);
     }
 
     return (Mem);
@@ -403,7 +407,7 @@
 
     /* Allocate path buffer */
 
-    Count = ACPI_STRLEN (Path);
+    Count = strlen (Path);
     Path16 = ACPI_ALLOCATE_ZEROED ((Count + 1) * sizeof (CHAR16));
     if (!Path16)
     {
@@ -816,14 +820,14 @@
 
     while (*String != '\0')
     {
-        while (ACPI_IS_SPACE (*String))
+        while (isspace (*String))
         {
             *String++ = '\0';
         }
         Arg = CopyBuffer;
         while (*String != '\0')
         {
-            if (ACPI_IS_SPACE (*String) &&
+            if (isspace (*String) &&
                 !IsSingleQuote && !IsDoubleQuote && !IsEscape)
             {
                 *Arg++ = '\0';
@@ -1032,21 +1036,23 @@
     EFI_FILE_IO_INTERFACE   *Volume = NULL;
 
 
-    /* Initialize EFI library */
+    /* Initialize global variables */
 
-    InitializeLib (Image, SystemTab);
+    ST = SystemTab;
+    BS = SystemTab->BootServices;
 
     /* Retrieve image information */
 
     EfiStatus = uefi_call_wrapper (BS->HandleProtocol, 3,
-        Image, &LoadedImageProtocol, ACPI_CAST_PTR (VOID, &Info));
+        Image, &AcpiGbl_LoadedImageProtocol, ACPI_CAST_PTR (VOID, &Info));
     if (EFI_ERROR (EfiStatus))
     {
         AcpiLogError ("EFI_BOOT_SERVICES->HandleProtocol(LoadedImageProtocol) failure.\n");
         return (EfiStatus);
     }
+
     EfiStatus = uefi_call_wrapper (BS->HandleProtocol, 3,
-        Info->DeviceHandle, &FileSystemProtocol, (void **) &Volume);
+        Info->DeviceHandle, &AcpiGbl_FileSystemProtocol, (void **) &Volume);
     if (EFI_ERROR (EfiStatus))
     {
         AcpiLogError ("EFI_BOOT_SERVICES->HandleProtocol(FileSystemProtocol) failure.\n");
--- a/sys/external/bsd/acpica/dist/os_specific/service_layers/osunixmap.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/os_specific/service_layers/osunixmap.c	Tue Aug 18 09:53:33 2015 +0000
@@ -56,7 +56,7 @@
 #define O_BINARY 0
 #endif
 
-#ifdef _FreeBSD
+#if defined(_DragonFly) || defined(_FreeBSD)
 #define MMAP_FLAGS          MAP_SHARED
 #else
 #define MMAP_FLAGS          MAP_PRIVATE
--- a/sys/external/bsd/acpica/dist/os_specific/service_layers/oswintbl.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/os_specific/service_layers/oswintbl.c	Tue Aug 18 09:53:33 2015 +0000
@@ -238,7 +238,7 @@
 
     while (1)
     {
-        ACPI_STRCPY (KeyBuffer, "HARDWARE\\ACPI\\");
+        strcpy (KeyBuffer, "HARDWARE\\ACPI\\");
         if (AcpiUtSafeStrcat (KeyBuffer, sizeof (KeyBuffer), Signature))
         {
             return (AE_BUFFER_OVERFLOW);
--- a/sys/external/bsd/acpica/dist/parser/psargs.c	Tue Aug 18 09:43:38 2015 +0000
+++ b/sys/external/bsd/acpica/dist/parser/psargs.c	Tue Aug 18 09:53:33 2015 +0000
@@ -316,7 +316,7 @@
         ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
             "Control Method - %p Desc %p Path=%p\n", Node, MethodDesc, Path));
 
-        NameOp = AcpiPsAllocOp (AML_INT_NAMEPATH_OP);
+        NameOp = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, Start);
         if (!NameOp)
         {
             return_ACPI_STATUS (AE_NO_MEMORY);
@@ -524,7 +524,7 @@
 AcpiPsGetNextField (
     ACPI_PARSE_STATE        *ParserState)
 {
-    UINT32                  AmlOffset;
+    UINT8                   *Aml;
     ACPI_PARSE_OBJECT       *Field;
     ACPI_PARSE_OBJECT       *Arg = NULL;
     UINT16                  Opcode;
@@ -540,8 +540,7 @@
     ACPI_FUNCTION_TRACE (PsGetNextField);
 
 
-    AmlOffset = (UINT32) ACPI_PTR_DIFF (
-        ParserState->Aml, ParserState->AmlStart);
+    Aml = ParserState->Aml;
 
     /* Determine field type */