diff --git a/.acpica-tools.metadata b/.acpica-tools.metadata
new file mode 100644
index 0000000..232db2b
--- /dev/null
+++ b/.acpica-tools.metadata
@@ -0,0 +1,2 @@
+f2467ae9c55ee4b24c21c0b06b402c6bdd444260 SOURCES/acpica-unix2-20180629.tar.gz
+ccdf02b035f86624d0652b28580413ac2e21f6f6 SOURCES/acpitests-unix-20180629.tar.gz
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9230fc0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+SOURCES/acpica-unix2-20180629.tar.gz
+SOURCES/acpitests-unix-20180629.tar.gz
diff --git a/SOURCES/COPYING b/SOURCES/COPYING
new file mode 100644
index 0000000..d159169
--- /dev/null
+++ b/SOURCES/COPYING
@@ -0,0 +1,339 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                            NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/SOURCES/OPT_LDFLAGS.patch b/SOURCES/OPT_LDFLAGS.patch
new file mode 100644
index 0000000..a1ca276
--- /dev/null
+++ b/SOURCES/OPT_LDFLAGS.patch
@@ -0,0 +1,26 @@
+Index: acpica-unix2-20170728/generate/unix/Makefile.config
+===================================================================
+--- acpica-unix2-20170728.orig/generate/unix/Makefile.config
++++ acpica-unix2-20170728/generate/unix/Makefile.config
+@@ -23,6 +23,9 @@
+ # OPT_CFLAGS can be overridden on the make command line by
+ #   adding OPT_CFLAGS="..." to the invocation.
+ #
++# OPT_LDFLAGS can be overridden on the make command line by
++#   adding OPT_LDFLAGS="..." to the invocation.
++#
+ # Notes:
+ #   gcc should be version 4 or greater, otherwise some of the options
+ #     used will not be recognized.
+@@ -157,6 +160,11 @@ LDFLAGS +=-m32
+ endif
+ 
+ #
++# Common linker flags
++#
++OPT_LDFLAGS ?= 
++
++#
+ # Optionally disable optimizations. Optimization causes problems on
+ # some compilers such as gcc 4.4
+ #
diff --git a/SOURCES/README.Fedora b/SOURCES/README.Fedora
new file mode 100644
index 0000000..c1c7f25
--- /dev/null
+++ b/SOURCES/README.Fedora
@@ -0,0 +1,26 @@
+Packaging Notes for Fedora
+==========================
+The upstream source contains documentation that may or may not be licensed
+in a freely redistributable manner.  In an excess of caution, the manuals in
+question have been removed from the source we start with.  You can still get
+your own copies of the documentation from here:
+
+   https://www.acpica.org/documentation/
+
+The two manuals affected are:
+
+   (1) ACPICA Reference Manual, describing the ACPI Component Architecture
+       in some detail, and
+
+   (2) ASL Compiler Reference Manual, describing how to use iasl
+
+While there are man pages for the commands, they are very brief.  The
+documents above are recommended reading.
+
+
+Test Cases
+==========
+The aapits tests do not currently build properly.  They will be added to
+this package once they do.  In the meantime, ASL, template and misc tests
+will be run as part of %check.
+
diff --git a/SOURCES/acpibin.1 b/SOURCES/acpibin.1
new file mode 100644
index 0000000..b8448a5
--- /dev/null
+++ b/SOURCES/acpibin.1
@@ -0,0 +1,64 @@
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH ACPIBIN 1 "January 23, 2013"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+acpibin \- ACPI binary AML file utility
+.SH SYNOPSIS
+.B acpibin
+.RI [ <option> ... ]
+
+.SH DESCRIPTION
+This manual page briefly documents the
+.B acpibin
+command. The option list is taken from the acpibin interactive help.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
+.\" respectively.
+.B acpibin
+is a command provided to perform some basic and common operations on
+AML binary files.
+.PP
+Much more detailed documentation may be found at
+http://www.acpica.org/documentation/.
+
+.SH OPTIONS
+
+.PP
+.TP
+.B \-c <file1> <file2>
+Compare two binary AML files
+.TP
+.B \-d <in> <out>
+Dump AML binary to text file
+.TP
+.B \-e <sig> <in> <out>
+Extract binary AML table from acpidump file
+.TP
+.B \-h <file>
+Display table header for binary AML file
+.TP
+.B \-s <file>
+Update checksum for binary AML file
+.TP
+.B \-t
+Terse mode
+
+.SH AUTHOR
+acpibin was written by Robert Moore <robert.moore@intel.com>.
+.PP
+This manual page was written by Al Stone <ahs3@redhat.com> for the
+Fedora project (but may be used by others).
diff --git a/SOURCES/acpidump.1 b/SOURCES/acpidump.1
new file mode 100644
index 0000000..a3ab061
--- /dev/null
+++ b/SOURCES/acpidump.1
@@ -0,0 +1,106 @@
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH ACPIDUMP 1 "July 24, 2013"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+acpidump \- ACPI table dump utility
+.SH SYNOPSIS
+.B acpidump
+.RI [ <option> ... ]
+
+.SH DESCRIPTION
+This manual page briefly documents the
+.B acpidump
+command.  The option list is taken from the interactive help.
+.PP
+The
+.B acpidump
+command extracts the ACPI tables currently in use from the running
+kernel in a form usable for later processing by the
+.B acpixtract
+command.
+.PP
+Invocation of
+.B acpidump
+without parameters will dump all available ACPI tables.  Multiple mixed
+instances of the
+.B \-a
+,
+.B \-f
+, and
+.B \-n
+parameters can be used.
+
+.SH OPTIONS
+.PP
+.TP
+.B \-b
+Dump tables in binary format (versus the default human-readable form)
+
+.PP
+.TP
+.B \-h | \-?
+Display this help message
+
+.PP
+.TP
+.B \-o <file>
+Redirect output to a file.  This file can be used later by
+.B acpixtract
+to examine the contents of the ACPI tables.
+
+.PP
+.TP
+.B \-s
+Print table summaries only.
+
+.PP
+.TP
+.B \-v
+Print the version of this utility.
+
+.PP
+.TP
+.B \-z
+Verbose mode.
+
+.PP
+.TP
+.B \-a <address>
+Get a table from a physical address (must be superuser and you must be
+careful which address you use -- dmesg will typically report the addresses
+for the various tables).
+
+.PP
+.TP
+.B \-f <binary-file>
+Get a table from a binary file (see the
+.B \-b
+option).
+
+.PP
+.TP
+.B \-n <signature>
+Get a table via it's name or signature (e.g., MADT or SSDT).
+
+.SH SEE ALSO
+.B acpixtract(1)
+
+.SH AUTHOR
+acpidump was written by Robert Moore <robert.moore@intel.com> and
+Chao Guan <chao.guan@intel.com>.
+.PP
+This manual page was written by Al Stone <ahs3@redhat.com> for the
+Fedora project (but may be used by others).
diff --git a/SOURCES/acpiexamples.1 b/SOURCES/acpiexamples.1
new file mode 100644
index 0000000..a48aad6
--- /dev/null
+++ b/SOURCES/acpiexamples.1
@@ -0,0 +1,49 @@
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH ACPIEXAMPLES 1 "August 8, 2018"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+acpiexamples \- program showing what the code examples actually do
+.SH SYNOPSIS
+.B acpiexamples
+
+.SH DESCRIPTION
+This manual page briefly documents the
+.B acpiexamples
+command. This command has no options available.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
+.\" respectively.
+.B acpiexamples
+prints out the results of various calls using the ACPICA source code,
+showing what happens when the calls are made.  These results are from
+building and running the code provided in the
+/usr/share/doc/acpica-tools/examples directory that illustrate the
+proper sequencing of calls and how to make them.
+.PP
+Much more detailed documentation about ACPICA may be found at
+http://www.acpica.org/documentation/.
+
+.SH OPTIONS
+
+.PP
+None
+
+.SH AUTHOR
+acpiexamples was written by Robert Moore <robert.moore@intel.com>.
+.PP
+This manual page was written by Al Stone <ahs3@redhat.com> for the
+Fedora project (but may be used by others).
diff --git a/SOURCES/acpiexec.1 b/SOURCES/acpiexec.1
new file mode 100644
index 0000000..4b77daa
--- /dev/null
+++ b/SOURCES/acpiexec.1
@@ -0,0 +1,102 @@
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH ACPIEXEC 1 "January 23, 2013"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+acpiexec \- ACPI AML execution and debug utility
+.SH SYNOPSIS
+.B acpiexec
+.RI [ <option> ... ]
+.RI <aml-file>
+.B ...
+
+.SH DESCRIPTION
+This manual page briefly documents the
+.B acpiexec
+command. The option list is taken from the acpiexec interactive help.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
+.\" respectively.
+.B acpiexec
+provides a simulated execution environment for AML code so that it
+can be more easily tested and debugged.
+.PP
+Much more detailed documentation may be found at
+http://www.acpica.org/documentation/.
+
+.SH OPTIONS
+
+.PP
+.TP
+.B \-?
+Display the help message
+.TP
+.B \-b "command-line"
+Batch mode command line execution (cmd1;cmd2;...)
+.TP
+.B \-M [<method>]
+Batch mode method execution (Default: MAIN)
+.TP
+.B \-da
+Disable method abort on error
+.TP
+.B \-di
+Disable execution of _STA/_INI methods during init
+.TP
+.B \-do
+Disable Operation Region address simulation
+.TP
+.B \-dr
+Disable repair of method return values
+.TP
+.B \-dt
+Disable allocation tracking (performance)
+.TP
+.B \-ef
+Enable display of final memory statistics
+.TP
+.B \-ei
+Enable additional tests for ACPICA interfaces
+.TP
+.B \-em
+Enable interpreter Serialized mode
+.TP
+.B \-es
+Enable interpreter Slack mode
+.TP
+.B \-et
+Enable debug semaphore timeour
+.TP
+.B \-f <value>
+Operation Region initialization fill value
+.TP
+.B \-r
+Use hardware-reduced FADT V5
+.TP
+.B \-vi
+Verbose initialization output
+.TP
+.B \-vr
+Verbose region handler output
+.TP
+.B \-x <debug-level>
+Debug output level
+
+.SH AUTHOR
+acpiexec was written by Robert Moore <robert.moore@intel.com>.
+.PP
+This manual page was written by Al Stone <ahs3@redhat.com> for the
+Fedora project (but may be used by others).
diff --git a/SOURCES/acpihelp.1 b/SOURCES/acpihelp.1
new file mode 100644
index 0000000..fc61014
--- /dev/null
+++ b/SOURCES/acpihelp.1
@@ -0,0 +1,80 @@
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH ACPIHELP 1 "January 23, 2013"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+acpihelp \- ACPI help utility
+.SH SYNOPSIS
+.B acpihelp
+.RI <option> ...
+.RI [<name-prefix>|<hex-value>]
+
+.SH DESCRIPTION
+This manual page briefly documents the
+.B acpihelp
+command. The option list is taken from the acpihelp interactive help.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
+.\" respectively.
+.B acpihelp
+provides descriptive text for AML and ASL keywords, methods, and opcodes.
+.PP
+Much more detailed documentation may be found at
+http://www.acpica.org/documentation/.
+.PP
+If neither a <name-prefix> or a <hex-value> is provided,
+.B acpihelp
+will do the logical equivalent of a "display all."
+.PP
+A default search (that is, a search with no options) and a <name-prefix>
+can mean two different things: (1) if <name-prefix> does not start with
+an underscore, find ASL operator names, or (2) if <name-prefix> does start
+with an underscore, find ASL predefined method names.
+
+.SH OPTIONS
+
+.PP
+.SS ACPI Names and Symbols
+.TP
+.B \-k [<name-prefix>]
+Find/Display ASL non-operator keyword(s)
+.TP
+.B \-m [<name-prefix>]
+Find/Display AML opcode name(s)
+.TP
+.B \-p [<name-prefix>]
+Find/Display ASL predefined method name(s)
+.TP
+.B \-s [<name-prefix>]
+Find/Display ASL operator name(s)
+
+.PP
+.SS ACPI Values
+.TP
+.B \-e [<hex-value>]
+Decode ACPICA exception code
+.TP
+.B \-i
+Display known ACPI Device IDs (_HID)
+.TP
+.B \-i [<hex-value>]
+Decode hex AML opcode
+
+.SH AUTHOR
+acpihelp was written by Robert Moore <robert.moore@intel.com>.
+.PP
+This manual page was written by Al Stone <ahs3@redhat.com> for the
+Fedora project (but may be used by others).
diff --git a/SOURCES/acpinames.1 b/SOURCES/acpinames.1
new file mode 100644
index 0000000..315d235
--- /dev/null
+++ b/SOURCES/acpinames.1
@@ -0,0 +1,49 @@
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH ACPINAMES 1 "January 23, 2013"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+acpinames \- ACPI name space dump utility
+.SH SYNOPSIS
+.B acpinames
+.RI <option> ...
+.RI <aml-file>
+
+.SH DESCRIPTION
+This manual page briefly documents the
+.B acpinames
+command. The option list is taken from the acpinames interactive help.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
+.\" respectively.
+.B acpinames
+prints out the complete ACPI name space for an AML file.
+.PP
+Much more detailed documentation may be found at
+http://www.acpica.org/documentation/.
+
+.SH OPTIONS
+
+.PP
+.TP
+.B \-? [<name-prefix>]
+Display this help message
+
+.SH AUTHOR
+acpinames was written by Robert Moore <robert.moore@intel.com>.
+.PP
+This manual page was written by Al Stone <ahs3@redhat.com> for the
+Fedora project (but may be used by others).
diff --git a/SOURCES/acpisrc.1 b/SOURCES/acpisrc.1
new file mode 100644
index 0000000..37d8971
--- /dev/null
+++ b/SOURCES/acpisrc.1
@@ -0,0 +1,72 @@
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH ACPISRC 1 "January 23, 2013"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+acpisrc \- ACPICA source code conversion utility
+.SH SYNOPSIS
+.B acpisrc
+.RI [ -c | -l | -u] [-d] [-s] [-v] [-y] <source-dir> <dest-dir>
+.RI <aml-file>
+
+.SH DESCRIPTION
+This manual page briefly documents the
+.B acpisrc
+command. The option list is taken from the acpisrc interactive help.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
+.\" respectively.
+.B acpisrc
+converts the ACPICA into various forms for use with different operating
+systems.
+Source for ACPICA may be obtained from http://www.acpica.org/source/.
+.PP
+Much more detailed documentation may be found at
+http://www.acpica.org/documentation/.
+
+.SH OPTIONS
+
+.PP
+.TP
+.B \-c
+Generate cleaned version of the source
+.TP
+.B \-h
+Insert dual-license header into all module
+.TP
+.B \-l
+Generate Linux version of the source
+.TP
+.B \-u
+Generate custom source translation
+.TP
+.B \-d
+Leave debug statements in code
+.TP
+.B \-s
+Generate source statistics only
+.TP
+.B \-v
+Verbose mode
+.TP
+.B \-y
+Suppress file overwrite prompts
+
+.SH AUTHOR
+acpisrc was written by Robert Moore <robert.moore@intel.com>.
+.PP
+This manual page was written by Al Stone <ahs3@redhat.com> for the
+Fedora project (but may be used by others).
diff --git a/SOURCES/acpixtract.1 b/SOURCES/acpixtract.1
new file mode 100644
index 0000000..65239e9
--- /dev/null
+++ b/SOURCES/acpixtract.1
@@ -0,0 +1,60 @@
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH ACPIXTRACT 1 "January 23, 2013"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+acpixtract \- ACPICA source code conversion utility
+.SH SYNOPSIS
+.B acpixtract
+.RI [ <option> ... ]
+.RI <acpidump-file>
+
+.SH DESCRIPTION
+This manual page briefly documents the
+.B acpixtract
+command. The option list is taken from the acpixtract interactive help.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
+.\" respectively.
+.B acpixtract
+extracts binary ACPI tables from the output of the
+.B acpidump
+command (see the
+.B pm-tools
+package).  A default invocation will extract the DSDT and
+all SSDTs.
+.PP
+Much more detailed documentation may be found at
+http://www.acpica.org/documentation/.
+
+.SH OPTIONS
+
+.PP
+.TP
+.B \-a
+Extract all tables, not just DSDT/SSDT
+.TP
+.B \-l
+List table summaries, do not extract
+.TP
+.B \-s <signature>
+Extract all tables with <signature>
+
+.SH AUTHOR
+acpixtract was written by Robert Moore <robert.moore@intel.com>.
+.PP
+This manual page was written by Al Stone <ahs3@redhat.com> for the
+Fedora project (but may be used by others).
diff --git a/SOURCES/arm7hl.patch b/SOURCES/arm7hl.patch
new file mode 100644
index 0000000..fb10291
--- /dev/null
+++ b/SOURCES/arm7hl.patch
@@ -0,0 +1,20 @@
+diff -Naur acpica-unix2-20170119/source/include/acmacros.h acpica-unix2-20170119-arm7hl/source/include/acmacros.h
+--- acpica-unix2-20170119/source/include/acmacros.h	2017-01-30 17:25:54.346151952 -0700
++++ acpica-unix2-20170119-arm7hl/source/include/acmacros.h	2017-01-30 17:22:25.249388742 -0700
+@@ -178,6 +178,8 @@
+ 
+ /* 16-bit source, 16/32/64 destination */
+ 
++#define ACPI_MOVE_16_TO_8(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];}
++
+ #define ACPI_MOVE_16_TO_16(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];\
+                                          ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[1];}
+ 
+@@ -199,6 +201,7 @@
+ 
+ /* 64-bit source, 16/32/64 destination */
+ 
++#define ACPI_MOVE_64_TO_8(d, s)         ACPI_MOVE_16_TO_8(d, s)    /* Truncate to 8 */
+ #define ACPI_MOVE_64_TO_16(d, s)        ACPI_MOVE_16_TO_16(d, s)    /* Truncate to 16 */
+ #define ACPI_MOVE_64_TO_32(d, s)        ACPI_MOVE_32_TO_32(d, s)    /* Truncate to 32 */
+ #define ACPI_MOVE_64_TO_64(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];\
diff --git a/SOURCES/aslcodegen.patch b/SOURCES/aslcodegen.patch
new file mode 100644
index 0000000..a9a00be
--- /dev/null
+++ b/SOURCES/aslcodegen.patch
@@ -0,0 +1,28 @@
+Changes in the handling of comments caused some length fields to be used
+in new ways.  The new way broke the existing adaptation for big endian
+support; this patch repairs that adaptation.
+
+Signed-off-by: Al Stone <ahs3@redhat.com>
+
+diff -Naur acpica-unix2-20180531.orig/source/compiler/aslcodegen.c acpica-unix2-20180531/source/compiler/aslcodegen.c
+--- acpica-unix2-20180531.orig/source/compiler/aslcodegen.c	2018-07-06 20:28:35.255546578 -0400
++++ acpica-unix2-20180531/source/compiler/aslcodegen.c	2018-07-06 20:32:10.373797644 -0400
+@@ -494,8 +494,7 @@
+ 
+     /* Table length. Checksum zero for now, will rewrite later */
+ 
+-    DWord = sizeof (ACPI_TABLE_HEADER) + Op->Asl.AmlSubtreeLength;
+-    ACPI_MOVE_32_TO_32(&TableHeader.Length, &DWord);
++    TableHeader.Length = sizeof (ACPI_TABLE_HEADER) + Op->Asl.AmlSubtreeLength;
+ 
+     /* Calculate the comment lengths for this definition block parseOp */
+ 
+@@ -539,6 +538,8 @@
+         CvDbgPrint ("    Length: %u\n", CommentLength);
+         }
+     }
++    DWord = TableHeader.Length;
++    ACPI_MOVE_32_TO_32(&TableHeader.Length, &DWord);
+ 
+     TableHeader.Checksum = 0;
+ 
diff --git a/SOURCES/badcode.asl.result b/SOURCES/badcode.asl.result
new file mode 100644
index 0000000..100cb51
--- /dev/null
+++ b/SOURCES/badcode.asl.result
@@ -0,0 +1,266 @@
+badcode.asl     25:     Mutex (MTX1, 32)
+Error    6125 -                      ^ SyncLevel must be in the range 0-15
+
+badcode.asl     29:     Name (BIG, 0x1234567887654321)
+Warning  3038 -                                    ^ Truncating 64-bit constant found in 32-bit table
+
+badcode.asl     33:     Name (PKG1, Package(5) {0,1})
+Remark   2063 -                            ^ Initializer list shorter than declared package length
+
+badcode.asl     37:     Name (PATH, Buffer() {"\_SB_.PCI2._CRS"})
+Warning  3046 -                                ^ Invalid or unknown escape sequence
+
+badcode.asl     41:     Name (ESC1, "abcdefg\x00hijklmn")
+Warning  3055 -                                ^ Invalid Hex/Octal Escape - Non-ASCII or NULL
+
+badcode.asl     49:         FLD1, 8
+Error    6030 -               ^ Access width of Field Unit extends beyond region limit
+
+badcode.asl     55:     Field (OPR2, DWordAcc, NoLock, Preserve)
+Error    6100 -                  ^ Host Operation Region requires ByteAcc access
+
+badcode.asl     60:     Field (OPR3, WordAcc, NoLock, Preserve)
+Error    6099 -                  ^ Host Operation Region requires BufferAcc access
+
+badcode.asl     67:     Method (MTH1, 0, NotSerialized, 32)
+Error    6125 -     SyncLevel must be in the range 0-15 ^ 
+
+badcode.asl     71:         Store (Arg3, Local0)
+Warning  3144 -                              ^ Method Local is set but never used (Local0)
+
+badcode.asl     71:         Store (Arg3, Local0)
+Error    6006 -                      ^ Method argument is not initialized (Arg3)
+
+badcode.asl     71:         Store (Arg3, Local0)
+Remark   2087 -                      ^ Not a parameter, used as local only (Arg3)
+
+badcode.asl     72:         Store (Local1, Local2)
+Warning  3144 -                                ^ Method Local is set but never used (Local2)
+
+badcode.asl     72:         Store (Local1, Local2)
+Error    6066 -                        ^ Method local variable is not initialized (Local1)
+
+badcode.asl     76:         Subtract (MTX1, 4, Local3)
+Warning  3144 - Method Local is set but never used ^  (Local3)
+
+badcode.asl     76:         Subtract (MTX1, 4, Local3)
+Error    6058 -            Invalid type ^  ([Mutex] found, Subtract operator requires [Integer|String|Buffer])
+
+badcode.asl     80:         CreateField (BUF1, 0, Subtract (4, 4), FLD1)
+Remark   2089 -                             Object is not referenced ^  (Name [FLD1] is within a method [MTH1])
+
+badcode.asl     80:         CreateField (BUF1, 0, Subtract (4, 4), FLD1)
+Error    6083 -                  Operand evaluates to zero ^ 
+
+badcode.asl     84:         Acquire (MTX1, 100)
+Warning  3130 -                             ^ Result is not used, possible operator timeout will be missed
+
+badcode.asl     85:         Wait (EVT1, 1)
+Warning  3130 -                        ^ Result is not used, possible operator timeout will be missed
+
+badcode.asl     89:         Add (INT1, 8)
+Error    6114 -                    ^ Result is not used, operator has no effect
+
+badcode.asl     94:         Store (5, INT1)
+Warning  3134 -                   ^ Statement is unreachable
+
+badcode.asl     97:     Method (MTH2)
+Remark   2119 -                   ^ Control Method marked Serialized (Due to use of Switch operator)
+
+badcode.asl     97:     Method (MTH2)
+Warning  3115 -                   ^ Not all control paths return a value (MTH2)
+
+badcode.asl    101:         Switch (ToInteger (INT1))
+Error    6078 -                            ^ No Case statements under Switch
+
+badcode.asl    120:         Store (MTH2 (), Local0)
+Warning  3144 -                                 ^ Method Local is set but never used (Local0)
+
+badcode.asl    120:         Store (MTH2 (), Local0)
+Warning  3122 -                      ^ Called method may not always return a value
+
+badcode.asl    126:     Method (MTH5) {Store (MTH4(), Local0)}
+Warning  3144 -        Method Local is set but never used ^  (Local0)
+
+badcode.asl    126:     Method (MTH5) {Store (MTH4(), Local0)}
+Error    6080 -  Called method returns no value ^ 
+
+badcode.asl    132:         Name (_HID, "*PNP0C0A")     // Illegal leading asterisk
+Error    6061 -        Invalid leading asterisk ^  (*PNP0C0A)
+
+badcode.asl    136:         Name (_HID, "PNP")          // Too short, must be 7 or 8 chars
+Error    6033 -                            ^ _HID string must be exactly 7 or 8 characters (PNP)
+
+badcode.asl    140:         Name (_HID, "MYDEVICE01")   // Too long, must be 7 or 8 chars
+Error    6033 -                                   ^ _HID string must be exactly 7 or 8 characters (MYDEVICE01)
+
+badcode.asl    144:         Name (_HID, "acpi0001")     // non-hex chars must be uppercase
+Error    6034 -                                 ^ _HID prefix must be all uppercase or decimal digits (acpi0001)
+
+badcode.asl    148:         Name (_HID, "PNP-123")      // HID must be alphanumeric
+Error    6002 -                                ^ String must be entirely alphanumeric (PNP-123)
+
+badcode.asl    152:         Name (_HID, "")             // Illegal Null HID
+Error    6091 -                         ^ Invalid zero-length (null) string
+
+badcode.asl    153:         Name (_CID, "")             // Illegal Null CID
+Error    6091 -                         ^ Invalid zero-length (null) string
+
+badcode.asl    158:     Name (_PRW, 4)
+Error    6105 -                    ^ Invalid object type for reserved name (_PRW: found Integer, Package required)
+
+badcode.asl    159:     Name (_FDI, Buffer () {0})
+Error    6105 -                         ^ Invalid object type for reserved name (_FDI: found Buffer, Package required)
+
+badcode.asl    164:     Method (_OSC, 5)
+Warning  3101 -                   ^ Reserved method has too many arguments (_OSC requires 4)
+
+badcode.asl    164:     Method (_OSC, 5)
+Warning  3107 -                   ^ Reserved method must return a value (Buffer required for _OSC)
+
+badcode.asl    170:     Name (_L01, 1)
+Error    6103 -                 ^ Reserved name must be a control method (with zero arguments)
+
+badcode.asl    171:     Name (_E02, 2)
+Error    6103 -                 ^ Reserved name must be a control method (with zero arguments)
+
+badcode.asl    172:     Name (_Q03, 3)
+Error    6103 -                 ^ Reserved name must be a control method (with zero arguments)
+
+badcode.asl    173:     Name (_ON,  0)
+Error    6103 -                ^ Reserved name must be a control method (with zero arguments)
+
+badcode.asl    174:     Name (_INI, 1)
+Error    6103 -                 ^ Reserved name must be a control method (with zero arguments)
+
+badcode.asl    175:     Name (_PTP, 2)
+Error    6103 -                 ^ Reserved name must be a control method (with arguments)
+
+badcode.asl    184:         Method (_E1D)
+Error    6032 -                       ^ Name conflicts with a previous GPE method (_L1D)
+
+badcode.asl    193:         Return (Buffer(1){0x33})
+Warning  3104 -                         ^ Reserved method should not return a value (_FDM)
+
+badcode.asl    197:         Return ("Unexpected Return Value")
+Warning  3104 -  Reserved method should not return a value ^  (_Q22)
+
+badcode.asl    203:     Device (EC)
+Warning  3141 -                 ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+badcode.asl    205:         Method (_REG, 2)
+Warning  3079 -                       ^ _REG has no corresponding Operation Region
+
+badcode.asl    219:             StartDependentFn (0, 0)
+Error    6019 -                                  ^ Dependent function macros cannot be nested
+
+badcode.asl    225:     })
+Error    6070 -        ^ Missing EndDependentFn() macro in dependent resource list
+
+badcode.asl    242:             0x00002000,         // Length
+Error    6049 -                         ^ Length is larger than Min/Max window
+
+badcode.asl    247:             0x00001001,         // Range Minimum
+Error    6001 -                         ^ Must be a multiple of alignment/granularity value
+
+badcode.asl    248:             0x00002002,         // Range Maximum
+Error    6001 -                         ^ Must be a multiple of alignment/granularity value
+
+badcode.asl    255:             0xFFFF,             // Address
+Warning  3060 -                     ^ Maximum 10-bit ISA address (0x3FF)
+
+badcode.asl    264:             0x05                // Access Size
+Error    6042 -                   ^ Invalid AccessSize (Maximum is 4 - QWord access)
+
+badcode.asl    268:         QWordSpace (0xB0, ResourceConsumer, PosDecode, MinFixed, MaxFixed, 0xA5,
+Error    6139 -     Constant out of range ^  (0xB0, allowable: 0xC0-0xFF)
+
+badcode.asl    279:             0x0200,             // Range Minimum
+Error    6051 -                     ^ Address Min is greater than Address Max
+
+badcode.asl    291:             0x00001002,         // Length
+Error    6049 -                         ^ Length is larger than Min/Max window
+
+badcode.asl    296:             0x00000010,
+Error    6048 -                         ^ Granularity must be zero or a power of two minus one
+
+badcode.asl    305:             0x0000000000000B02, // Range Minimum
+Error    6001 -                                 ^ Must be a multiple of alignment/granularity value
+
+badcode.asl    315:             0x00000000002FFFFE, // Range Maximum
+Error    6001 -                                 ^ Must be a multiple of alignment/granularity value (-1)
+
+badcode.asl    326:             0x00000000,         // Length
+Error    6043 -                         ^ Invalid combination of Length and Min/Max fixed flags
+
+badcode.asl    335:             0x00000100,         // Length
+Error    6043 -                         ^ Invalid combination of Length and Min/Max fixed flags
+
+badcode.asl    344:             0x00000200,         // Length
+Error    6043 -                         ^ Invalid combination of Length and Min/Max fixed flags
+
+badcode.asl    349:             0x0000000F,         // Granularity
+Error    6047 -                         ^ Granularity must be zero for fixed Min/Max
+
+badcode.asl    358:         DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
+Error    6090 -                                    ^ Min/Max/Length/Gran are all zero, but no resource tag
+
+badcode.asl    368:         EndDependentFn ()
+Error    6071 -                            ^ Missing StartDependentFn() macro in dependent resource list
+
+badcode.asl    388:         CreateWordField (RSC3, \DWI1._LEN, LEN)
+Warning  3128 -              ResourceTag larger than Field ^  (Size mismatch, Tag: 32 bits, Field: 16 bits)
+
+badcode.asl    388:         CreateWordField (RSC3, \DWI1._LEN, LEN)
+Remark   2089 -                        Object is not referenced ^  (Name [LEN_] is within a method [REM1])
+
+badcode.asl    389:         CreateByteField (RSC3, \DWI1._MIN, MIN)
+Warning  3128 -              ResourceTag larger than Field ^  (Size mismatch, Tag: 32 bits, Field: 8 bits)
+
+badcode.asl    389:         CreateByteField (RSC3, \DWI1._MIN, MIN)
+Remark   2089 -                        Object is not referenced ^  (Name [MIN_] is within a method [REM1])
+
+badcode.asl    390:         CreateBitField (RSC3, \DWI1._RNG, RNG1)
+Warning  3128 -             ResourceTag larger than Field ^  (Size mismatch, Tag: 2 bits, Field: 1 bit)
+
+badcode.asl    390:         CreateBitField (RSC3, \DWI1._RNG, RNG1)
+Remark   2089 -                        Object is not referenced ^  (Name [RNG1] is within a method [REM1])
+
+badcode.asl    394:         CreateQWordField (RSC3, \DWI1._MAX, MAX)
+Warning  3129 -              ResourceTag smaller than Field ^  (Size mismatch, Tag: 32 bits, Field: 64 bits)
+
+badcode.asl    394:         CreateQWordField (RSC3, \DWI1._MAX, MAX)
+Remark   2089 -                         Object is not referenced ^  (Name [MAX_] is within a method [REM1])
+
+badcode.asl    395:         CreateBitField (RSC3, \DWI1._GRA, GRA)
+Warning  3128 -             ResourceTag larger than Field ^  (Size mismatch, Tag: 32 bits, Field: 1 bit)
+
+badcode.asl    395:         CreateBitField (RSC3, \DWI1._GRA, GRA)
+Remark   2089 -                       Object is not referenced ^  (Name [GRA_] is within a method [REM1])
+
+badcode.asl    396:         CreateField (RSC3, \DWI1._MIF, 5, MIF)
+Warning  3129 -         ResourceTag smaller than Field ^  (Size mismatch, Tag: 1 bit, Field: 5 bits)
+
+badcode.asl    396:         CreateField (RSC3, \DWI1._MIF, 5, MIF)
+Remark   2089 -                       Object is not referenced ^  (Name [MIF_] is within a method [REM1])
+
+badcode.asl    397:         CreateField (RSC3, \DWI1._RNG, 3, RNG2)
+Warning  3129 -         ResourceTag smaller than Field ^  (Size mismatch, Tag: 2 bits, Field: 3 bits)
+
+badcode.asl    397:         CreateField (RSC3, \DWI1._RNG, 3, RNG2)
+Remark   2089 -                        Object is not referenced ^  (Name [RNG2] is within a method [REM1])
+
+badcode.asl    404:         Store (40, Local0)
+Warning  3144 -                            ^ Method Local is set but never used (Local0)
+
+
+Intel ACPI Component Architecture
+ASL+ Optimizing Compiler/Disassembler version VVVVVVVV
+Copyright (c) 2000 - 2018 Intel Corporation
+
+Ignoring all errors, forcing AML file generation
+
+ASL Input:     badcode.asl - 408 lines, 11587 bytes, 81 keywords
+AML Output:    badcode.aml - 1195 bytes, 61 named objects, 20 executable opcodes
+
+Compilation complete. 46 Errors, 28 Warnings, 11 Remarks, 16 Optimizations, 1 Constants Folded
diff --git a/SOURCES/be-tpm2.patch b/SOURCES/be-tpm2.patch
new file mode 100644
index 0000000..c7c286e
--- /dev/null
+++ b/SOURCES/be-tpm2.patch
@@ -0,0 +1,40 @@
+diff -Naur acpica-unix2-20171110/source/compiler/dttable2.c acpica-unix2-20171110.patched/source/compiler/dttable2.c
+--- acpica-unix2-20171110/source/compiler/dttable2.c	2017-11-27 15:20:04.705226128 -0700
++++ acpica-unix2-20171110.patched/source/compiler/dttable2.c	2017-11-27 15:26:29.121734421 -0700
+@@ -1797,6 +1797,7 @@
+     ACPI_TABLE_TPM2         *Tpm2Header;
+     DT_SUBTABLE             *ParentTable;
+     ACPI_STATUS             Status = AE_OK;
++    UINT32		    Tmp32;
+ 
+ 
+     /* Compile the main table */
+@@ -1831,7 +1832,8 @@
+ 
+     /* Subtable type depends on the StartMethod */
+ 
+-    switch (Tpm2Header->StartMethod)
++    ACPI_MOVE_32_TO_32(&Tmp32, &Tpm2Header->StartMethod);
++    switch (Tmp32)
+     {
+     case ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC:
+ 
+@@ -1861,16 +1863,14 @@
+     case ACPI_TPM2_RESERVED9:
+     case ACPI_TPM2_RESERVED10:
+ 
+-        AcpiOsPrintf ("\n**** Reserved TPM2 Start Method type 0x%X\n",
+-            Tpm2Header->StartMethod);
++        AcpiOsPrintf ("\n**** Reserved TPM2 Start Method type 0x%X\n", Tmp32);
+         Status = AE_ERROR;
+         break;
+ 
+     case ACPI_TPM2_NOT_ALLOWED:
+     default:
+ 
+-        AcpiOsPrintf ("\n**** Unknown TPM2 Start Method type 0x%X\n",
+-            Tpm2Header->StartMethod);
++        AcpiOsPrintf ("\n**** Unknown TPM2 Start Method type 0x%X\n", Tmp32);
+         Status = AE_ERROR;
+         break;
+     }
diff --git a/SOURCES/big-endian-v2.patch b/SOURCES/big-endian-v2.patch
new file mode 100644
index 0000000..0c8831a
--- /dev/null
+++ b/SOURCES/big-endian-v2.patch
@@ -0,0 +1,18 @@
+Updated versions of upstream often contain fixes that were not seen
+in the original big-endian patch; we try to capture those here.
+
+Signed-off-by: Al Stone <ahs3@redhat.com>
+
+diff -Naur acpica-unix2-20170929.orig/source/compiler/asllookup.c acpica-unix2-20170929/source/compiler/asllookup.c
+--- acpica-unix2-20170929.orig/source/compiler/asllookup.c	2017-10-09 12:26:25.893508481 -0600
++++ acpica-unix2-20170929/source/compiler/asllookup.c	2017-10-17 11:45:42.230763844 -0600
+@@ -249,7 +249,8 @@
+      * ACPI names and are typically not referenced since they are meant
+      * to be called by the host OS.
+      */
+-    if (Node->Name.Ascii[0] == '_')
++    ACPI_MOVE_32_TO_32(&tmp.Ascii, Node->Name.Ascii);
++    if (tmp.Ascii[0] == '_')
+     {
+         return (AE_OK);
+     }
diff --git a/SOURCES/big-endian.patch b/SOURCES/big-endian.patch
new file mode 100644
index 0000000..b38f7b0
--- /dev/null
+++ b/SOURCES/big-endian.patch
@@ -0,0 +1,6607 @@
+Big-endian support
+
+This is a combined patch that folds all of the past and present changes
+for big-endian support into a single patch, hopefully eliminating any sort
+of redundancy but also capturing all such changes in a single location.
+
+To date, this has been critical for the s390x architecture only.
+
+Signed-off-by: Al Stone <ahs3@redhat.com>
+
+---
+ source/compiler/aslcodegen.c      |  109 ++++++++++++++++++------------
+ source/compiler/aslopcodes.c      |    4 +
+ source/compiler/aslrestype1.c     |   68 +++++++++++++------
+ source/compiler/aslrestype1i.c    |   38 +++++++---
+ source/compiler/aslrestype2.c     |   25 ++++---
+ source/compiler/aslrestype2d.c    |  134 +++++++++++++++++++++----------------
+ source/compiler/aslrestype2e.c    |   39 +++++++----
+ source/compiler/aslrestype2q.c    |  117 +++++++++++++++++++++-----------
+ source/compiler/aslrestype2s.c    |   86 +++++++++++++++++-------
+ source/compiler/aslrestype2w.c    |  127 +++++++++++++++++++++--------------
+ source/include/acmacros.h         |   15 +++-
+ source/include/platform/aclinux.h |    8 ++
+ 12 files changed, 487 insertions(+), 283 deletions(-)
+
+Index: acpica-unix2-20180629/source/compiler/aslcodegen.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/compiler/aslcodegen.c
++++ acpica-unix2-20180629/source/compiler/aslcodegen.c
+@@ -240,16 +240,12 @@ CgWriteAmlOpcode (
+     ACPI_PARSE_OBJECT       *Op)
+ {
+     UINT8                   PkgLenFirstByte;
+-    UINT32                  i;
+-    union {
+-        UINT16                  Opcode;
+-        UINT8                   OpcodeBytes[2];
+-    } Aml;
+-    union {
+-        UINT32                  Len;
+-        UINT8                   LenBytes[4];
+-    } PkgLen;
+-
++    UINT8                   Byte;
++    UINT16                  Word;
++    UINT32                  DWord;
++    UINT64                  QWord;
++    UINT16                  AmlOpcode;
++    UINT32                  PkgLen;
+ 
+     /* We expect some DEFAULT_ARGs, just ignore them */
+ 
+@@ -282,51 +278,52 @@ CgWriteAmlOpcode (
+ 
+         /* Special opcodes for within a field definition */
+ 
+-        Aml.Opcode = AML_FIELD_OFFSET_OP;
++        AmlOpcode = AML_FIELD_OFFSET_OP;
+         break;
+ 
+     case AML_INT_ACCESSFIELD_OP:
+ 
+-        Aml.Opcode = AML_FIELD_ACCESS_OP;
++        AmlOpcode = AML_FIELD_ACCESS_OP;
+         break;
+ 
+     case AML_INT_CONNECTION_OP:
+ 
+-        Aml.Opcode = AML_FIELD_CONNECTION_OP;
++        AmlOpcode = AML_FIELD_CONNECTION_OP;
+         break;
+ 
+     default:
+ 
+-        Aml.Opcode = Op->Asl.AmlOpcode;
++        AmlOpcode = Op->Asl.AmlOpcode;
+         break;
+     }
+ 
+ 
+-    switch (Aml.Opcode)
++    switch (AmlOpcode)
+     {
+     case AML_PACKAGE_LENGTH:
+ 
+         /* Value is the length to be encoded (Used in field definitions) */
+ 
+-        PkgLen.Len = (UINT32) Op->Asl.Value.Integer;
++        PkgLen = (UINT32) Op->Asl.Value.Integer;
+         break;
+ 
+     default:
+ 
+         /* Check for two-byte opcode */
+ 
+-        if (Aml.Opcode > 0x00FF)
++        if (AmlOpcode > 0x00FF)
+         {
+             /* Write the high byte first */
+-
+-            CgLocalWriteAmlData (Op, &Aml.OpcodeBytes[1], 1);
++	    Byte = ACPI_HIBYTE(AmlOpcode);
++	    CgLocalWriteAmlData (Op, &Byte, 1);
+         }
+ 
+-        CgLocalWriteAmlData (Op, &Aml.OpcodeBytes[0], 1);
++	Byte = ACPI_LOBYTE(AmlOpcode);
++        CgLocalWriteAmlData (Op, &Byte, 1);
+ 
+         /* Subtreelength doesn't include length of package length bytes */
+ 
+-        PkgLen.Len = Op->Asl.AmlSubtreeLength + Op->Asl.AmlPkgLenBytes;
++        PkgLen = Op->Asl.AmlSubtreeLength + Op->Asl.AmlPkgLenBytes;
+         break;
+     }
+ 
+@@ -337,8 +334,8 @@ CgWriteAmlOpcode (
+         if (Op->Asl.AmlPkgLenBytes == 1)
+         {
+             /* Simplest case -- no bytes to follow, just write the count */
+-
+-            CgLocalWriteAmlData (Op, &PkgLen.LenBytes[0], 1);
++            Byte = ACPI_LOBYTE(PkgLen);
++            CgLocalWriteAmlData (Op, &Byte, 1);
+         }
+         else if (Op->Asl.AmlPkgLenBytes != 0)
+         {
+@@ -348,7 +345,7 @@ CgWriteAmlOpcode (
+              */
+             PkgLenFirstByte = (UINT8)
+                 (((UINT32) (Op->Asl.AmlPkgLenBytes - 1) << 6) |
+-                (PkgLen.LenBytes[0] & 0x0F));
++                (PkgLen & 0x0F));
+ 
+             CgLocalWriteAmlData (Op, &PkgLenFirstByte, 1);
+ 
+@@ -356,39 +353,47 @@ CgWriteAmlOpcode (
+              * Shift the length over by the 4 bits we just stuffed
+              * in the first byte
+              */
+-            PkgLen.Len >>= 4;
++            PkgLen >>= 4;
+ 
+             /*
+              * Now we can write the remaining bytes -
+              * either 1, 2, or 3 bytes
+              */
+-            for (i = 0; i < (UINT32) (Op->Asl.AmlPkgLenBytes - 1); i++)
++            Byte = ACPI_LOBYTE(PkgLen);
++            CgLocalWriteAmlData (Op, &Byte, 1);
++            if (Op->Asl.AmlPkgLenBytes >= 3)
++            {
++                Byte = ACPI_HIBYTE(PkgLen);
++                CgLocalWriteAmlData (Op, &Byte, 1);
++            }
++            if (Op->Asl.AmlPkgLenBytes >= 4)
+             {
+-                CgLocalWriteAmlData (Op, &PkgLen.LenBytes[i], 1);
++                Byte = ACPI_LOBYTE(ACPI_HIWORD(PkgLen));
++                CgLocalWriteAmlData (Op, &Byte, 1);
+             }
+         }
+     }
+ 
+-    switch (Aml.Opcode)
++    switch (AmlOpcode)
+     {
+     case AML_BYTE_OP:
+-
+-        CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 1);
++        Byte = (UINT8) Op->Asl.Value.Integer;
++        CgLocalWriteAmlData (Op, &Byte, 1);
+         break;
+ 
+     case AML_WORD_OP:
+-
+-        CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 2);
++        ACPI_MOVE_64_TO_16(&Word, &Op->Asl.Value.Integer);
++        CgLocalWriteAmlData (Op, &Word, 2);
+        break;
+ 
+     case AML_DWORD_OP:
+-
+-        CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 4);
++        ACPI_MOVE_64_TO_32(&DWord, &Op->Asl.Value.Integer);
++        CgLocalWriteAmlData (Op, &DWord, 4);
+         break;
+ 
+     case AML_QWORD_OP:
+-
+-        CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 8);
++        ACPI_MOVE_64_TO_64(&QWord, &Op->Asl.Value.Integer);
++        CgLocalWriteAmlData (Op, &QWord, 8);
+         break;
+ 
+     case AML_STRING_OP:
+@@ -422,6 +427,7 @@ CgWriteTableHeader (
+     ACPI_PARSE_OBJECT       *Op)
+ {
+     ACPI_PARSE_OBJECT       *Child;
++    UINT32                  DWord;
+     UINT32                  CommentLength;
+     ACPI_COMMENT_NODE       *Current;
+ 
+@@ -475,7 +481,7 @@ CgWriteTableHeader (
+     /* OEM Revision */
+ 
+     Child = Child->Asl.Next;
+-    TableHeader.OemRevision = (UINT32) Child->Asl.Value.Integer;
++    ACPI_MOVE_64_TO_32(&TableHeader.OemRevision, &Child->Asl.Value.Integer);
+ 
+     /* Compiler ID */
+ 
+@@ -483,12 +489,13 @@ CgWriteTableHeader (
+ 
+     /* Compiler version */
+ 
+-    TableHeader.AslCompilerRevision = ACPI_CA_VERSION;
++    DWord = ACPI_CA_VERSION;
++    ACPI_MOVE_32_TO_32(&TableHeader.AslCompilerRevision, &DWord);
+ 
+     /* Table length. Checksum zero for now, will rewrite later */
+ 
+-    TableHeader.Length = sizeof (ACPI_TABLE_HEADER) +
+-        Op->Asl.AmlSubtreeLength;
++    DWord = sizeof (ACPI_TABLE_HEADER) + Op->Asl.AmlSubtreeLength;
++    ACPI_MOVE_32_TO_32(&TableHeader.Length, &DWord);
+ 
+     /* Calculate the comment lengths for this definition block parseOp */
+ 
+@@ -645,7 +652,10 @@ CgWriteNode (
+     ACPI_PARSE_OBJECT       *Op)
+ {
+     ASL_RESOURCE_NODE       *Rnode;
+-
++    UINT8                   Byte;
++    UINT16                  Word;
++    UINT32                  DWord;
++    UINT64                  QWord;
+ 
+     /* Write all comments here. */
+ 
+@@ -675,13 +685,24 @@ CgWriteNode (
+     switch (Op->Asl.AmlOpcode)
+     {
+     case AML_RAW_DATA_BYTE:
++        Byte = (UINT8) Op->Asl.Value.Integer;
++        CgLocalWriteAmlData (Op, &Byte, 1);
++        return;
++
+     case AML_RAW_DATA_WORD:
+-    case AML_RAW_DATA_DWORD:
+-    case AML_RAW_DATA_QWORD:
++        ACPI_MOVE_64_TO_16(&Word, &Op->Asl.Value.Integer);
++        CgLocalWriteAmlData (Op, &Word, 2);
++        return;
+ 
+-        CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, Op->Asl.AmlLength);
++    case AML_RAW_DATA_DWORD:
++        ACPI_MOVE_64_TO_32(&DWord, &Op->Asl.Value.Integer);
++        CgLocalWriteAmlData (Op, &DWord, 4);
+         return;
+ 
++    case AML_RAW_DATA_QWORD:
++        ACPI_MOVE_64_TO_64(&QWord, &Op->Asl.Value.Integer);
++        CgLocalWriteAmlData (Op, &QWord, 8);
++        return;
+ 
+     case AML_RAW_DATA_BUFFER:
+ 
+Index: acpica-unix2-20180629/source/compiler/aslopcodes.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/compiler/aslopcodes.c
++++ acpica-unix2-20180629/source/compiler/aslopcodes.c
+@@ -485,6 +485,7 @@ OpcDoUnicode (
+     UINT32                  i;
+     UINT8                   *AsciiString;
+     UINT16                  *UnicodeString;
++    UINT16                  UChar;
+     ACPI_PARSE_OBJECT       *BufferLengthOp;
+ 
+ 
+@@ -511,7 +512,8 @@ OpcDoUnicode (
+ 
+     for (i = 0; i < Count; i++)
+     {
+-        UnicodeString[i] = (UINT16) AsciiString[i];
++        UChar = (UINT16) AsciiString[i];
++        ACPI_MOVE_16_TO_16(&UnicodeString[i], &UChar);
+     }
+ 
+     /*
+Index: acpica-unix2-20180629/source/compiler/aslrestype1.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/compiler/aslrestype1.c
++++ acpica-unix2-20180629/source/compiler/aslrestype1.c
+@@ -142,6 +142,11 @@ RsDoMemory24Descriptor (
+     ACPI_PARSE_OBJECT       *LengthOp = NULL;
+     ASL_RESOURCE_NODE       *Rnode;
+     UINT32                  CurrentByteOffset;
++    UINT16                  Minimum = 0;
++    UINT16                  Maximum = 0;
++    UINT16                  AddressLength = 0;
++    UINT16                  Alignment = 0;
++    UINT16                  ResourceLength;
+     UINT32                  i;
+ 
+ 
+@@ -151,7 +156,8 @@ RsDoMemory24Descriptor (
+ 
+     Descriptor = Rnode->Buffer;
+     Descriptor->Memory24.DescriptorType = ACPI_RESOURCE_NAME_MEMORY24;
+-    Descriptor->Memory24.ResourceLength = 9;
++    ResourceLength = 9;
++    ACPI_MOVE_16_TO_16(&Descriptor->Memory24.ResourceLength, &ResourceLength);
+ 
+     /* Process all child initialization nodes */
+ 
+@@ -168,7 +174,7 @@ RsDoMemory24Descriptor (
+ 
+         case 1: /* Min Address */
+ 
+-            Descriptor->Memory24.Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
++            Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Minimum));
+             MinOp = InitializerOp;
+@@ -176,7 +182,7 @@ RsDoMemory24Descriptor (
+ 
+         case 2: /* Max Address */
+ 
+-            Descriptor->Memory24.Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
++            Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Maximum));
+             MaxOp = InitializerOp;
+@@ -184,14 +190,14 @@ RsDoMemory24Descriptor (
+ 
+         case 3: /* Alignment */
+ 
+-            Descriptor->Memory24.Alignment = (UINT16) InitializerOp->Asl.Value.Integer;
++            Alignment = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_ALIGNMENT,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Alignment));
+             break;
+ 
+         case 4: /* Length */
+ 
+-            Descriptor->Memory24.AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
++            AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.AddressLength));
+             LengthOp = InitializerOp;
+@@ -214,12 +220,17 @@ RsDoMemory24Descriptor (
+     /* Validate the Min/Max/Len/Align values (Alignment==0 means 64K) */
+ 
+     RsSmallAddressCheck (ACPI_RESOURCE_NAME_MEMORY24,
+-        Descriptor->Memory24.Minimum,
+-        Descriptor->Memory24.Maximum,
+-        Descriptor->Memory24.AddressLength,
+-        Descriptor->Memory24.Alignment,
++        Minimum,
++        Maximum,
++        AddressLength,
++        Alignment,
+         MinOp, MaxOp, LengthOp, NULL, Info->DescriptorTypeOp);
+ 
++    ACPI_MOVE_16_TO_16(&Descriptor->Memory24.Minimum, &Minimum);
++    ACPI_MOVE_16_TO_16(&Descriptor->Memory24.Maximum, &Maximum);
++    ACPI_MOVE_16_TO_16(&Descriptor->Memory24.AddressLength, &AddressLength);
++    ACPI_MOVE_16_TO_16(&Descriptor->Memory24.Alignment, &Alignment);
++
+     return (Rnode);
+ }
+ 
+@@ -248,6 +259,11 @@ RsDoMemory32Descriptor (
+     ACPI_PARSE_OBJECT       *AlignOp = NULL;
+     ASL_RESOURCE_NODE       *Rnode;
+     UINT32                  CurrentByteOffset;
++    UINT32                  Minimum = 0;
++    UINT32                  Maximum = 0;
++    UINT32                  AddressLength = 0;
++    UINT32                  Alignment = 0;
++    UINT16                  ResourceLength;
+     UINT32                  i;
+ 
+ 
+@@ -257,7 +273,8 @@ RsDoMemory32Descriptor (
+ 
+     Descriptor = Rnode->Buffer;
+     Descriptor->Memory32.DescriptorType = ACPI_RESOURCE_NAME_MEMORY32;
+-    Descriptor->Memory32.ResourceLength = 17;
++    ResourceLength = 17;
++    ACPI_MOVE_16_TO_16(&Descriptor->Memory32.ResourceLength, &ResourceLength);
+ 
+     /* Process all child initialization nodes */
+ 
+@@ -274,7 +291,7 @@ RsDoMemory32Descriptor (
+ 
+         case 1:  /* Min Address */
+ 
+-            Descriptor->Memory32.Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
++            Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Minimum));
+             MinOp = InitializerOp;
+@@ -282,7 +299,7 @@ RsDoMemory32Descriptor (
+ 
+         case 2: /* Max Address */
+ 
+-            Descriptor->Memory32.Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
++            Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Maximum));
+             MaxOp = InitializerOp;
+@@ -290,7 +307,7 @@ RsDoMemory32Descriptor (
+ 
+         case 3: /* Alignment */
+ 
+-            Descriptor->Memory32.Alignment = (UINT32) InitializerOp->Asl.Value.Integer;
++            Alignment = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_ALIGNMENT,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Alignment));
+             AlignOp = InitializerOp;
+@@ -298,7 +315,7 @@ RsDoMemory32Descriptor (
+ 
+         case 4: /* Length */
+ 
+-            Descriptor->Memory32.AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
++            AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.AddressLength));
+             LengthOp = InitializerOp;
+@@ -321,12 +338,17 @@ RsDoMemory32Descriptor (
+     /* Validate the Min/Max/Len/Align values */
+ 
+     RsSmallAddressCheck (ACPI_RESOURCE_NAME_MEMORY32,
+-        Descriptor->Memory32.Minimum,
+-        Descriptor->Memory32.Maximum,
+-        Descriptor->Memory32.AddressLength,
+-        Descriptor->Memory32.Alignment,
++        Minimum,
++        Maximum,
++        AddressLength,
++        Alignment,
+         MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
+ 
++    ACPI_MOVE_32_TO_32(&Descriptor->Memory32.Minimum, &Minimum);
++    ACPI_MOVE_32_TO_32(&Descriptor->Memory32.Maximum, &Maximum);
++    ACPI_MOVE_32_TO_32(&Descriptor->Memory32.AddressLength, &AddressLength);
++    ACPI_MOVE_32_TO_32(&Descriptor->Memory32.Alignment, &Alignment);
++
+     return (Rnode);
+ }
+ 
+@@ -351,6 +373,7 @@ RsDoMemory32FixedDescriptor (
+     ACPI_PARSE_OBJECT       *InitializerOp;
+     ASL_RESOURCE_NODE       *Rnode;
+     UINT32                  CurrentByteOffset;
++    UINT16                  ResourceLength;
+     UINT32                  i;
+ 
+ 
+@@ -360,7 +383,8 @@ RsDoMemory32FixedDescriptor (
+ 
+     Descriptor = Rnode->Buffer;
+     Descriptor->FixedMemory32.DescriptorType = ACPI_RESOURCE_NAME_FIXED_MEMORY32;
+-    Descriptor->FixedMemory32.ResourceLength = 9;
++    ResourceLength = 9;
++    ACPI_MOVE_16_TO_16(&Descriptor->FixedMemory32.ResourceLength, &ResourceLength);
+ 
+     /* Process all child initialization nodes */
+ 
+@@ -377,14 +401,16 @@ RsDoMemory32FixedDescriptor (
+ 
+         case 1: /* Address */
+ 
+-            Descriptor->FixedMemory32.Address = (UINT32) InitializerOp->Asl.Value.Integer;
++            ACPI_MOVE_64_TO_32(&Descriptor->FixedMemory32.Address,
++                &InitializerOp->Asl.Value.Integer);
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_BASEADDRESS,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedMemory32.Address));
+             break;
+ 
+         case 2: /* Length */
+ 
+-            Descriptor->FixedMemory32.AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
++            ACPI_MOVE_64_TO_32(&Descriptor->FixedMemory32.AddressLength,
++                &InitializerOp->Asl.Value.Integer);
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedMemory32.AddressLength));
+             break;
+Index: acpica-unix2-20180629/source/compiler/aslrestype1i.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/compiler/aslrestype1i.c
++++ acpica-unix2-20180629/source/compiler/aslrestype1i.c
+@@ -198,6 +198,8 @@ RsDoFixedDmaDescriptor (
+     ACPI_PARSE_OBJECT       *InitializerOp;
+     ASL_RESOURCE_NODE       *Rnode;
+     UINT32                  CurrentByteOffset;
++    UINT16                  RequestLines = 0;
++    UINT16                  Channels = 0;
+     UINT32                  i;
+ 
+ 
+@@ -217,14 +219,14 @@ RsDoFixedDmaDescriptor (
+         {
+         case 0: /* DMA Request Lines [WORD] (_DMA) */
+ 
+-            Descriptor->FixedDma.RequestLines = (UINT16) InitializerOp->Asl.Value.Integer;
++            RequestLines = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_DMA,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedDma.RequestLines));
+             break;
+ 
+         case 1: /* DMA Channel [WORD] (_TYP) */
+ 
+-            Descriptor->FixedDma.Channels = (UINT16) InitializerOp->Asl.Value.Integer;
++            Channels = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_DMATYPE,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedDma.Channels));
+             break;
+@@ -249,6 +251,9 @@ RsDoFixedDmaDescriptor (
+         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
+     }
+ 
++    ACPI_MOVE_16_TO_16(&Descriptor->FixedDma.RequestLines, &RequestLines);
++    ACPI_MOVE_16_TO_16(&Descriptor->FixedDma.Channels, &Channels);
++
+     return (Rnode);
+ }
+ 
+@@ -274,6 +279,7 @@ RsDoFixedIoDescriptor (
+     ACPI_PARSE_OBJECT       *AddressOp = NULL;
+     ASL_RESOURCE_NODE       *Rnode;
+     UINT32                  CurrentByteOffset;
++    UINT16                  Address = 0;
+     UINT32                  i;
+ 
+ 
+@@ -293,8 +299,7 @@ RsDoFixedIoDescriptor (
+         {
+         case 0: /* Base Address */
+ 
+-            Descriptor->FixedIo.Address =
+-                (UINT16) InitializerOp->Asl.Value.Integer;
++            Address = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_BASEADDRESS,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedIo.Address));
+             AddressOp = InitializerOp;
+@@ -324,11 +329,13 @@ RsDoFixedIoDescriptor (
+ 
+     /* Error checks */
+ 
+-    if (Descriptor->FixedIo.Address > 0x03FF)
++    if (Address > 0x03FF)
+     {
+         AslError (ASL_WARNING, ASL_MSG_ISA_ADDRESS, AddressOp, NULL);
+     }
+ 
++    ACPI_MOVE_16_TO_16(&Descriptor->FixedIo.Address, &Address);
++
+     return (Rnode);
+ }
+ 
+@@ -357,6 +364,8 @@ RsDoIoDescriptor (
+     ACPI_PARSE_OBJECT       *AlignOp = NULL;
+     ASL_RESOURCE_NODE       *Rnode;
+     UINT32                  CurrentByteOffset;
++    UINT16                  Minimum = 0;
++    UINT16                  Maximum = 0;
+     UINT32                  i;
+ 
+ 
+@@ -383,8 +392,7 @@ RsDoIoDescriptor (
+ 
+         case 1:  /* Min Address */
+ 
+-            Descriptor->Io.Minimum =
+-                (UINT16) InitializerOp->Asl.Value.Integer;
++            Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Io.Minimum));
+             MinOp = InitializerOp;
+@@ -392,8 +400,7 @@ RsDoIoDescriptor (
+ 
+         case 2: /* Max Address */
+ 
+-            Descriptor->Io.Maximum =
+-                (UINT16) InitializerOp->Asl.Value.Integer;
++            Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Io.Maximum));
+             MaxOp = InitializerOp;
+@@ -434,12 +441,15 @@ RsDoIoDescriptor (
+     /* Validate the Min/Max/Len/Align values */
+ 
+     RsSmallAddressCheck (ACPI_RESOURCE_NAME_IO,
+-        Descriptor->Io.Minimum,
+-        Descriptor->Io.Maximum,
++        Minimum,
++        Maximum,
+         Descriptor->Io.AddressLength,
+         Descriptor->Io.Alignment,
+         MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
+ 
++    ACPI_MOVE_16_TO_16(&Descriptor->Io.Minimum, &Minimum);
++    ACPI_MOVE_16_TO_16(&Descriptor->Io.Maximum, &Maximum);
++
+     return (Rnode);
+ }
+ 
+@@ -559,9 +569,9 @@ RsDoIrqDescriptor (
+         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
+     }
+ 
+-    /* Now we can set the channel mask */
++    /* Now we can set the interrupt mask */
+ 
+-    Descriptor->Irq.IrqMask = IrqMask;
++    ACPI_MOVE_16_TO_16(&Descriptor->Irq.IrqMask, &IrqMask);
+     return (Rnode);
+ }
+ 
+@@ -660,6 +670,6 @@ RsDoIrqNoFlagsDescriptor (
+ 
+     /* Now we can set the interrupt mask */
+ 
+-    Descriptor->Irq.IrqMask = IrqMask;
++    ACPI_MOVE_16_TO_16(&Descriptor->Irq.IrqMask, &IrqMask);
+     return (Rnode);
+ }
+Index: acpica-unix2-20180629/source/compiler/aslrestype2.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/compiler/aslrestype2.c
++++ acpica-unix2-20180629/source/compiler/aslrestype2.c
+@@ -76,6 +76,7 @@ RsDoGeneralRegisterDescriptor (
+     ACPI_PARSE_OBJECT       *InitializerOp;
+     ASL_RESOURCE_NODE       *Rnode;
+     UINT32                  CurrentByteOffset;
++    UINT16                  ResourceLength;
+     UINT32                  i;
+ 
+ 
+@@ -85,7 +86,9 @@ RsDoGeneralRegisterDescriptor (
+ 
+     Descriptor = Rnode->Buffer;
+     Descriptor->GenericReg.DescriptorType = ACPI_RESOURCE_NAME_GENERIC_REGISTER;
+-    Descriptor->GenericReg.ResourceLength = 12;
++    ResourceLength = 12;
++    ACPI_MOVE_16_TO_16(&Descriptor->GenericReg.ResourceLength,
++		    &ResourceLength);
+ 
+     /* Process all child initialization nodes */
+ 
+@@ -95,35 +98,52 @@ RsDoGeneralRegisterDescriptor (
+         {
+         case 0: /* Address space */
+ 
++	    /*
+             Descriptor->GenericReg.AddressSpaceId = (UINT8) InitializerOp->Asl.Value.Integer;
++	    */
++            ACPI_MOVE_64_TO_8(&Descriptor->GenericReg.AddressSpaceId,
++			      &InitializerOp->Asl.Value.Integer);
+             RsCreateByteField (InitializerOp, ACPI_RESTAG_ADDRESSSPACE,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.AddressSpaceId));
+            break;
+ 
+         case 1: /* Register Bit Width */
+ 
++	    /*
+             Descriptor->GenericReg.BitWidth = (UINT8) InitializerOp->Asl.Value.Integer;
++	    */
++            ACPI_MOVE_64_TO_8(&Descriptor->GenericReg.BitWidth,
++			      &InitializerOp->Asl.Value.Integer);
+             RsCreateByteField (InitializerOp, ACPI_RESTAG_REGISTERBITWIDTH,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.BitWidth));
+             break;
+ 
+         case 2: /* Register Bit Offset */
+ 
++	    /*
+             Descriptor->GenericReg.BitOffset = (UINT8) InitializerOp->Asl.Value.Integer;
++	    */
++            ACPI_MOVE_64_TO_8(&Descriptor->GenericReg.BitOffset,
++			      &InitializerOp->Asl.Value.Integer);
+             RsCreateByteField (InitializerOp, ACPI_RESTAG_REGISTERBITOFFSET,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.BitOffset));
+             break;
+ 
+         case 3: /* Register Address */
+ 
+-            Descriptor->GenericReg.Address = InitializerOp->Asl.Value.Integer;
++	    ACPI_MOVE_64_TO_64(&Descriptor->GenericReg.Address,
++			    &InitializerOp->Asl.Value.Integer);
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_ADDRESS,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.Address));
+             break;
+ 
+         case 4: /* Access Size (ACPI 3.0) */
+ 
++	    /*
+             Descriptor->GenericReg.AccessSize = (UINT8) InitializerOp->Asl.Value.Integer;
++	    */
++	    ACPI_MOVE_64_TO_8(&Descriptor->GenericReg.AccessSize,
++			      &InitializerOp->Asl.Value.Integer);
+             RsCreateByteField (InitializerOp, ACPI_RESTAG_ACCESSSIZE,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.AccessSize));
+ 
+@@ -177,6 +197,7 @@ RsDoInterruptDescriptor (
+     AML_RESOURCE            *Rover = NULL;
+     ACPI_PARSE_OBJECT       *InitializerOp;
+     ASL_RESOURCE_NODE       *Rnode;
++    UINT16                  ResourceLength = 0;
+     UINT16                  StringLength = 0;
+     UINT32                  OptionIndex = 0;
+     UINT32                  CurrentByteOffset;
+@@ -225,7 +246,7 @@ RsDoInterruptDescriptor (
+      * Initial descriptor length -- may be enlarged if there are
+      * optional fields present
+      */
+-    Descriptor->ExtendedIrq.ResourceLength  = 2;  /* Flags and table length byte */
++    ResourceLength  = 2;  /* Flags and table length byte */
+     Descriptor->ExtendedIrq.InterruptCount  = 0;
+ 
+     Rover = ACPI_CAST_PTR (AML_RESOURCE,
+@@ -333,10 +354,11 @@ RsDoInterruptDescriptor (
+ 
+             /* Save the integer and move pointer to the next one */
+ 
+-            Rover->DwordItem = (UINT32) InitializerOp->Asl.Value.Integer;
++            ACPI_MOVE_64_TO_32(&Rover->DwordItem,
++                &InitializerOp->Asl.Value.Integer);
+             Rover = ACPI_ADD_PTR (AML_RESOURCE, &(Rover->DwordItem), 4);
+             Descriptor->ExtendedIrq.InterruptCount++;
+-            Descriptor->ExtendedIrq.ResourceLength += 4;
++            ResourceLength += 4;
+ 
+             /* Case 7: First interrupt number in list */
+ 
+@@ -372,7 +394,7 @@ RsDoInterruptDescriptor (
+     {
+         Rover->ByteItem = ResSourceIndex;
+         Rover = ACPI_ADD_PTR (AML_RESOURCE, &(Rover->ByteItem), 1);
+-        Descriptor->ExtendedIrq.ResourceLength += 1;
++        ResourceLength += 1;
+     }
+ 
+     /* Add optional ResSource string if present */
+@@ -384,14 +406,15 @@ RsDoInterruptDescriptor (
+         Rover = ACPI_ADD_PTR (
+                     AML_RESOURCE, &(Rover->ByteItem), StringLength);
+ 
+-        Descriptor->ExtendedIrq.ResourceLength = (UINT16)
+-            (Descriptor->ExtendedIrq.ResourceLength + StringLength);
++        ResourceLength = (UINT16) (ResourceLength + StringLength);
+     }
+ 
+     Rnode->BufferLength =
+         (ASL_RESDESC_OFFSET (ExtendedIrq.Interrupts[0]) -
+         ASL_RESDESC_OFFSET (ExtendedIrq.DescriptorType))
+         + OptionIndex + StringLength;
++    ACPI_MOVE_16_TO_16(&Descriptor->ExtendedIrq.ResourceLength,
++		    &ResourceLength);
+     return (Rnode);
+ }
+ 
+@@ -439,7 +462,7 @@ RsDoVendorLargeDescriptor (
+ 
+     Descriptor = Rnode->Buffer;
+     Descriptor->VendorLarge.DescriptorType = ACPI_RESOURCE_NAME_VENDOR_LARGE;
+-    Descriptor->VendorLarge.ResourceLength = (UINT16) i;
++    ACPI_MOVE_32_TO_16(&Descriptor->VendorLarge.ResourceLength, &i);
+ 
+     /* Point to end-of-descriptor for vendor data */
+ 
+Index: acpica-unix2-20180629/source/compiler/aslrestype2d.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/compiler/aslrestype2d.c
++++ acpica-unix2-20180629/source/compiler/aslrestype2d.c
+@@ -79,7 +79,13 @@ RsDoDwordIoDescriptor (
+     ACPI_PARSE_OBJECT       *GranOp = NULL;
+     ASL_RESOURCE_NODE       *Rnode;
+     UINT16                  StringLength = 0;
++    UINT16                  ResourceLength = 0;
+     UINT32                  OptionIndex = 0;
++    UINT32                  Minimum = 0;
++    UINT32                  Maximum = 0;
++    UINT32                  AddressLength = 0;
++    UINT32                  Granularity = 0;
++    UINT32                  TranslationOffset = 0;
+     UINT8                   *OptionalFields;
+     UINT32                  CurrentByteOffset;
+     UINT32                  i;
+@@ -102,8 +108,7 @@ RsDoDwordIoDescriptor (
+      * optional fields present
+      */
+     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32);
+-    Descriptor->Address32.ResourceLength = (UINT16)
+-        (sizeof (AML_RESOURCE_ADDRESS32) -
++    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS32) -
+          sizeof (AML_RESOURCE_LARGE_HEADER));
+ 
+     /* Process all child initialization nodes */
+@@ -147,8 +152,7 @@ RsDoDwordIoDescriptor (
+ 
+         case 5: /* Address Granularity */
+ 
+-            Descriptor->Address32.Granularity =
+-                (UINT32) InitializerOp->Asl.Value.Integer;
++            Granularity = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
+             GranOp = InitializerOp;
+@@ -156,8 +160,7 @@ RsDoDwordIoDescriptor (
+ 
+         case 6: /* Address Min */
+ 
+-            Descriptor->Address32.Minimum =
+-                (UINT32) InitializerOp->Asl.Value.Integer;
++            Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
+             MinOp = InitializerOp;
+@@ -165,8 +168,7 @@ RsDoDwordIoDescriptor (
+ 
+         case 7: /* Address Max */
+ 
+-            Descriptor->Address32.Maximum =
+-                (UINT32) InitializerOp->Asl.Value.Integer;
++            Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
+             MaxOp = InitializerOp;
+@@ -174,16 +176,14 @@ RsDoDwordIoDescriptor (
+ 
+         case 8: /* Translation Offset */
+ 
+-            Descriptor->Address32.TranslationOffset =
+-                (UINT32) InitializerOp->Asl.Value.Integer;
++            TranslationOffset = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
+             break;
+ 
+         case 9: /* Address Length */
+ 
+-            Descriptor->Address32.AddressLength =
+-                (UINT32) InitializerOp->Asl.Value.Integer;
++            AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
+             LengthOp = InitializerOp;
+@@ -197,7 +197,7 @@ RsDoDwordIoDescriptor (
+ 
+                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
+                 OptionIndex++;
+-                Descriptor->Address32.ResourceLength++;
++                ResourceLength++;
+                 ResSourceIndex = TRUE;
+             }
+             break;
+@@ -211,8 +211,7 @@ RsDoDwordIoDescriptor (
+                 {
+                     /* Found a valid ResourceSource */
+ 
+-                    Descriptor->Address32.ResourceLength = (UINT16)
+-                        (Descriptor->Address32.ResourceLength + StringLength);
++                    ResourceLength = (UINT16) (ResourceLength + StringLength);
+ 
+                     strcpy ((char *)
+                         &OptionalFields[OptionIndex],
+@@ -272,13 +271,20 @@ RsDoDwordIoDescriptor (
+     /* Validate the Min/Max/Len/Gran values */
+ 
+     RsLargeAddressCheck (
+-        (UINT64) Descriptor->Address32.Minimum,
+-        (UINT64) Descriptor->Address32.Maximum,
+-        (UINT64) Descriptor->Address32.AddressLength,
+-        (UINT64) Descriptor->Address32.Granularity,
++        Minimum,
++        Maximum,
++        AddressLength,
++        Granularity,
+         Descriptor->Address32.Flags,
+         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
+ 
++    ACPI_MOVE_16_TO_16(&Descriptor->Address32.ResourceLength, &ResourceLength);
++    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Minimum, &Minimum);
++    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Maximum, &Maximum);
++    ACPI_MOVE_32_TO_32(&Descriptor->Address32.AddressLength, &AddressLength);
++    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Granularity, &Granularity);
++    ACPI_MOVE_32_TO_32(&Descriptor->Address32.TranslationOffset, &TranslationOffset);
++
+     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
+         OptionIndex + StringLength;
+     return (Rnode);
+@@ -310,7 +316,13 @@ RsDoDwordMemoryDescriptor (
+     ASL_RESOURCE_NODE       *Rnode;
+     UINT8                   *OptionalFields;
+     UINT16                  StringLength = 0;
++    UINT16                  ResourceLength = 0;
+     UINT32                  OptionIndex = 0;
++    UINT32                  Minimum = 0;
++    UINT32                  Maximum = 0;
++    UINT32                  AddressLength = 0;
++    UINT32                  Granularity = 0;
++    UINT32                  TranslationOffset = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  i;
+     BOOLEAN                 ResSourceIndex = FALSE;
+@@ -332,11 +344,9 @@ RsDoDwordMemoryDescriptor (
+      * optional fields present
+      */
+     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32);
+-    Descriptor->Address32.ResourceLength = (UINT16)
+-        (sizeof (AML_RESOURCE_ADDRESS32) -
++    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS32) -
+          sizeof (AML_RESOURCE_LARGE_HEADER));
+ 
+-
+     /* Process all child initialization nodes */
+ 
+     for (i = 0; InitializerOp; i++)
+@@ -385,8 +395,7 @@ RsDoDwordMemoryDescriptor (
+ 
+         case 6: /* Address Granularity */
+ 
+-            Descriptor->Address32.Granularity =
+-                (UINT32) InitializerOp->Asl.Value.Integer;
++            Granularity = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
+             GranOp = InitializerOp;
+@@ -394,8 +403,7 @@ RsDoDwordMemoryDescriptor (
+ 
+         case 7: /* Min Address */
+ 
+-            Descriptor->Address32.Minimum =
+-                (UINT32) InitializerOp->Asl.Value.Integer;
++            Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
+             MinOp = InitializerOp;
+@@ -403,8 +411,7 @@ RsDoDwordMemoryDescriptor (
+ 
+         case 8: /* Max Address */
+ 
+-            Descriptor->Address32.Maximum =
+-                (UINT32) InitializerOp->Asl.Value.Integer;
++            Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
+             MaxOp = InitializerOp;
+@@ -412,16 +419,14 @@ RsDoDwordMemoryDescriptor (
+ 
+         case 9: /* Translation Offset */
+ 
+-            Descriptor->Address32.TranslationOffset =
+-                (UINT32) InitializerOp->Asl.Value.Integer;
++            TranslationOffset = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
+             break;
+ 
+         case 10: /* Address Length */
+ 
+-            Descriptor->Address32.AddressLength =
+-                (UINT32) InitializerOp->Asl.Value.Integer;
++            AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
+             LengthOp = InitializerOp;
+@@ -433,7 +438,7 @@ RsDoDwordMemoryDescriptor (
+             {
+                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
+                 OptionIndex++;
+-                Descriptor->Address32.ResourceLength++;
++                ResourceLength++;
+                 ResSourceIndex = TRUE;
+             }
+             break;
+@@ -445,8 +450,8 @@ RsDoDwordMemoryDescriptor (
+             {
+                 if (StringLength)
+                 {
+-                    Descriptor->Address32.ResourceLength = (UINT16)
+-                        (Descriptor->Address32.ResourceLength + StringLength);
++
++                    ResourceLength = (UINT16) (ResourceLength + StringLength);
+ 
+                     strcpy ((char *)
+                         &OptionalFields[OptionIndex],
+@@ -507,13 +512,20 @@ RsDoDwordMemoryDescriptor (
+     /* Validate the Min/Max/Len/Gran values */
+ 
+     RsLargeAddressCheck (
+-        (UINT64) Descriptor->Address32.Minimum,
+-        (UINT64) Descriptor->Address32.Maximum,
+-        (UINT64) Descriptor->Address32.AddressLength,
+-        (UINT64) Descriptor->Address32.Granularity,
++        Minimum,
++        Maximum,
++        AddressLength,
++        Granularity,
+         Descriptor->Address32.Flags,
+         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
+ 
++    ACPI_MOVE_16_TO_16(&Descriptor->Address32.ResourceLength, &ResourceLength);
++    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Minimum, &Minimum);
++    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Maximum, &Maximum);
++    ACPI_MOVE_32_TO_32(&Descriptor->Address32.AddressLength, &AddressLength);
++    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Granularity, &Granularity);
++    ACPI_MOVE_32_TO_32(&Descriptor->Address32.TranslationOffset, &TranslationOffset);
++
+     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
+         OptionIndex + StringLength;
+     return (Rnode);
+@@ -545,7 +557,13 @@ RsDoDwordSpaceDescriptor (
+     ASL_RESOURCE_NODE       *Rnode;
+     UINT8                   *OptionalFields;
+     UINT16                  StringLength = 0;
++    UINT16                  ResourceLength = 0;
+     UINT32                  OptionIndex = 0;
++    UINT32                  Minimum = 0;
++    UINT32                  Maximum = 0;
++    UINT32                  AddressLength = 0;
++    UINT32                  Granularity = 0;
++    UINT32                  TranslationOffset = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  i;
+     BOOLEAN                 ResSourceIndex = FALSE;
+@@ -566,8 +584,7 @@ RsDoDwordSpaceDescriptor (
+      * optional fields present
+      */
+     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32);
+-    Descriptor->Address32.ResourceLength = (UINT16)
+-        (sizeof (AML_RESOURCE_ADDRESS32) -
++    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS32) -
+          sizeof (AML_RESOURCE_LARGE_HEADER));
+ 
+     /* Process all child initialization nodes */
+@@ -616,8 +633,7 @@ RsDoDwordSpaceDescriptor (
+ 
+         case 6: /* Address Granularity */
+ 
+-            Descriptor->Address32.Granularity =
+-                (UINT32) InitializerOp->Asl.Value.Integer;
++            Granularity = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
+             GranOp = InitializerOp;
+@@ -625,8 +641,7 @@ RsDoDwordSpaceDescriptor (
+ 
+         case 7: /* Min Address */
+ 
+-            Descriptor->Address32.Minimum =
+-                (UINT32) InitializerOp->Asl.Value.Integer;
++            Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
+             MinOp = InitializerOp;
+@@ -634,8 +649,7 @@ RsDoDwordSpaceDescriptor (
+ 
+         case 8: /* Max Address */
+ 
+-            Descriptor->Address32.Maximum =
+-                (UINT32) InitializerOp->Asl.Value.Integer;
++            Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
+             MaxOp = InitializerOp;
+@@ -643,16 +657,14 @@ RsDoDwordSpaceDescriptor (
+ 
+         case 9: /* Translation Offset */
+ 
+-            Descriptor->Address32.TranslationOffset =
+-                (UINT32) InitializerOp->Asl.Value.Integer;
++            TranslationOffset = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
+             break;
+ 
+         case 10: /* Address Length */
+ 
+-            Descriptor->Address32.AddressLength =
+-                (UINT32) InitializerOp->Asl.Value.Integer;
++            AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
+             LengthOp = InitializerOp;
+@@ -664,7 +676,7 @@ RsDoDwordSpaceDescriptor (
+             {
+                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
+                 OptionIndex++;
+-                Descriptor->Address32.ResourceLength++;
++                ResourceLength++;
+                 ResSourceIndex = TRUE;
+             }
+             break;
+@@ -676,8 +688,7 @@ RsDoDwordSpaceDescriptor (
+             {
+                 if (StringLength)
+                 {
+-                    Descriptor->Address32.ResourceLength = (UINT16)
+-                        (Descriptor->Address32.ResourceLength + StringLength);
++                    ResourceLength = (UINT16) (ResourceLength + StringLength);
+ 
+                     strcpy ((char *)
+                         &OptionalFields[OptionIndex],
+@@ -724,13 +735,20 @@ RsDoDwordSpaceDescriptor (
+     /* Validate the Min/Max/Len/Gran values */
+ 
+     RsLargeAddressCheck (
+-        (UINT64) Descriptor->Address32.Minimum,
+-        (UINT64) Descriptor->Address32.Maximum,
+-        (UINT64) Descriptor->Address32.AddressLength,
+-        (UINT64) Descriptor->Address32.Granularity,
++        Minimum,
++        Maximum,
++        AddressLength,
++        Granularity,
+         Descriptor->Address32.Flags,
+         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
+ 
++    ACPI_MOVE_16_TO_16(&Descriptor->Address32.ResourceLength, &ResourceLength);
++    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Minimum, &Minimum);
++    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Maximum, &Maximum);
++    ACPI_MOVE_32_TO_32(&Descriptor->Address32.AddressLength, &AddressLength);
++    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Granularity, &Granularity);
++    ACPI_MOVE_32_TO_32(&Descriptor->Address32.TranslationOffset, &TranslationOffset);
++
+     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
+         OptionIndex + StringLength;
+     return (Rnode);
+Index: acpica-unix2-20180629/source/compiler/aslrestype2e.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/compiler/aslrestype2e.c
++++ acpica-unix2-20180629/source/compiler/aslrestype2e.c
+@@ -78,6 +78,13 @@ RsDoExtendedIoDescriptor (
+     ACPI_PARSE_OBJECT       *GranOp = NULL;
+     ASL_RESOURCE_NODE       *Rnode;
+     UINT16                  StringLength = 0;
++    UINT16                  ResourceLength = 0;
++    UINT64                  Minimum = 0;
++    UINT64                  Maximum = 0;
++    UINT64                  AddressLength = 0;
++    UINT64                  Granularity = 0;
++    UINT64                  TranslationOffset = 0;
++    UINT64                  TypeSpecific = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  i;
+ 
+@@ -94,9 +101,10 @@ RsDoExtendedIoDescriptor (
+     Descriptor->ExtAddress64.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE;
+     Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
+ 
+-    Descriptor->ExtAddress64.ResourceLength = (UINT16)
+-        (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
++    ResourceLength  = (UINT16) (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
+          sizeof (AML_RESOURCE_LARGE_HEADER));
++    ACPI_MOVE_16_TO_16(&Descriptor->ExtAddress64.ResourceLength,
++        &ResourceLength);
+ 
+     /* Process all child initialization nodes */
+ 
+@@ -139,7 +147,7 @@ RsDoExtendedIoDescriptor (
+ 
+         case 5: /* Address Granularity */
+ 
+-            Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer;
++            Granularity = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity));
+             GranOp = InitializerOp;
+@@ -147,7 +155,7 @@ RsDoExtendedIoDescriptor (
+ 
+         case 6: /* Address Min */
+ 
+-            Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer;
++            Minimum = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum));
+             MinOp = InitializerOp;
+@@ -155,7 +163,7 @@ RsDoExtendedIoDescriptor (
+ 
+         case 7: /* Address Max */
+ 
+-            Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer;
++            Maximum = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum));
+             MaxOp = InitializerOp;
+@@ -163,14 +171,14 @@ RsDoExtendedIoDescriptor (
+ 
+         case 8: /* Translation Offset */
+ 
+-            Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer;
++            TranslationOffset = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset));
+             break;
+ 
+         case 9: /* Address Length */
+ 
+-            Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer;
++            AddressLength = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength));
+             LengthOp = InitializerOp;
+@@ -178,7 +186,7 @@ RsDoExtendedIoDescriptor (
+ 
+         case 10: /* Type-Specific Attributes */
+ 
+-            Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer;
++            TypeSpecific = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific));
+             break;
+@@ -214,13 +222,20 @@ RsDoExtendedIoDescriptor (
+     /* Validate the Min/Max/Len/Gran values */
+ 
+     RsLargeAddressCheck (
+-        Descriptor->ExtAddress64.Minimum,
+-        Descriptor->ExtAddress64.Maximum,
+-        Descriptor->ExtAddress64.AddressLength,
+-        Descriptor->ExtAddress64.Granularity,
++        Minimum,
++        Maximum,
++        AddressLength,
++        Granularity,
+         Descriptor->ExtAddress64.Flags,
+         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
+ 
++    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Minimum, &Minimum);
++    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Maximum, &Maximum);
++    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.AddressLength, &AddressLength);
++    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Granularity, &Granularity);
++    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.TranslationOffset, &TranslationOffset);
++    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.TypeSpecific, &TypeSpecific);
++
+     Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) +
+         StringLength;
+     return (Rnode);
+Index: acpica-unix2-20180629/source/compiler/aslrestype2q.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/compiler/aslrestype2q.c
++++ acpica-unix2-20180629/source/compiler/aslrestype2q.c
+@@ -80,7 +80,13 @@ RsDoQwordIoDescriptor (
+     ASL_RESOURCE_NODE       *Rnode;
+     UINT8                   *OptionalFields;
+     UINT16                  StringLength = 0;
++    UINT16                  ResourceLength = 0;
+     UINT32                  OptionIndex = 0;
++    UINT64                  Minimum = 0;
++    UINT64                  Maximum = 0;
++    UINT64                  AddressLength = 0;
++    UINT64                  Granularity = 0;
++    UINT64                  TranslationOffset = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  i;
+     BOOLEAN                 ResSourceIndex = FALSE;
+@@ -102,8 +108,7 @@ RsDoQwordIoDescriptor (
+      * optional fields present
+      */
+     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64);
+-    Descriptor->Address64.ResourceLength = (UINT16)
+-        (sizeof (AML_RESOURCE_ADDRESS64) -
++    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS64) -
+          sizeof (AML_RESOURCE_LARGE_HEADER));
+ 
+     /* Process all child initialization nodes */
+@@ -147,7 +152,7 @@ RsDoQwordIoDescriptor (
+ 
+         case 5: /* Address Granularity */
+ 
+-            Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
++            Granularity = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
+             GranOp = InitializerOp;
+@@ -155,7 +160,7 @@ RsDoQwordIoDescriptor (
+ 
+         case 6: /* Address Min */
+ 
+-            Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
++            Minimum = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
+             MinOp = InitializerOp;
+@@ -163,7 +168,7 @@ RsDoQwordIoDescriptor (
+ 
+         case 7: /* Address Max */
+ 
+-            Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
++            Maximum = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
+             MaxOp = InitializerOp;
+@@ -171,14 +176,14 @@ RsDoQwordIoDescriptor (
+ 
+         case 8: /* Translation Offset */
+ 
+-            Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
++            TranslationOffset = InitializerOp->Asl.Value.Integer;
+             RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
+             break;
+ 
+         case 9: /* Address Length */
+ 
+-            Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
++            AddressLength = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
+             LengthOp = InitializerOp;
+@@ -190,7 +195,7 @@ RsDoQwordIoDescriptor (
+             {
+                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
+                 OptionIndex++;
+-                Descriptor->Address64.ResourceLength++;
++                ResourceLength++;
+                 ResSourceIndex = TRUE;
+             }
+             break;
+@@ -202,8 +207,7 @@ RsDoQwordIoDescriptor (
+             {
+                 if (StringLength)
+                 {
+-                    Descriptor->Address64.ResourceLength = (UINT16)
+-                        (Descriptor->Address64.ResourceLength + StringLength);
++                    ResourceLength = (UINT16) (ResourceLength + StringLength);
+ 
+                     strcpy ((char *)
+                         &OptionalFields[OptionIndex],
+@@ -263,13 +267,20 @@ RsDoQwordIoDescriptor (
+     /* Validate the Min/Max/Len/Gran values */
+ 
+     RsLargeAddressCheck (
+-        Descriptor->Address64.Minimum,
+-        Descriptor->Address64.Maximum,
+-        Descriptor->Address64.AddressLength,
+-        Descriptor->Address64.Granularity,
++        Minimum,
++        Maximum,
++        AddressLength,
++        Granularity,
+         Descriptor->Address64.Flags,
+         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
+ 
++    ACPI_MOVE_16_TO_16(&Descriptor->Address64.ResourceLength, &ResourceLength);
++    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Minimum, &Minimum);
++    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Maximum, &Maximum);
++    ACPI_MOVE_64_TO_64(&Descriptor->Address64.AddressLength, &AddressLength);
++    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Granularity, &Granularity);
++    ACPI_MOVE_64_TO_64(&Descriptor->Address64.TranslationOffset, &TranslationOffset);
++
+     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
+         OptionIndex + StringLength;
+     return (Rnode);
+@@ -301,7 +312,13 @@ RsDoQwordMemoryDescriptor (
+     ASL_RESOURCE_NODE       *Rnode;
+     UINT8                   *OptionalFields;
+     UINT16                  StringLength = 0;
++    UINT16                  ResourceLength = 0;
+     UINT32                  OptionIndex = 0;
++    UINT64                  Minimum = 0;
++    UINT64                  Maximum = 0;
++    UINT64                  AddressLength = 0;
++    UINT64                  Granularity = 0;
++    UINT64                  TranslationOffset = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  i;
+     BOOLEAN                 ResSourceIndex = FALSE;
+@@ -323,8 +340,7 @@ RsDoQwordMemoryDescriptor (
+      * optional fields present
+      */
+     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64);
+-    Descriptor->Address64.ResourceLength = (UINT16)
+-        (sizeof (AML_RESOURCE_ADDRESS64) -
++    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS64) -
+          sizeof (AML_RESOURCE_LARGE_HEADER));
+ 
+     /* Process all child initialization nodes */
+@@ -375,7 +391,7 @@ RsDoQwordMemoryDescriptor (
+ 
+         case 6: /* Address Granularity */
+ 
+-            Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
++            Granularity = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
+             GranOp = InitializerOp;
+@@ -383,7 +399,7 @@ RsDoQwordMemoryDescriptor (
+ 
+         case 7: /* Min Address */
+ 
+-            Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
++            Minimum = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
+             MinOp = InitializerOp;
+@@ -391,7 +407,7 @@ RsDoQwordMemoryDescriptor (
+ 
+         case 8: /* Max Address */
+ 
+-            Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
++            Maximum = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
+             MaxOp = InitializerOp;
+@@ -399,14 +415,14 @@ RsDoQwordMemoryDescriptor (
+ 
+         case 9: /* Translation Offset */
+ 
+-            Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
++            TranslationOffset = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
+             break;
+ 
+         case 10: /* Address Length */
+ 
+-            Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
++            AddressLength = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
+             LengthOp = InitializerOp;
+@@ -418,7 +434,7 @@ RsDoQwordMemoryDescriptor (
+             {
+                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
+                 OptionIndex++;
+-                Descriptor->Address64.ResourceLength++;
++                ResourceLength++;
+                 ResSourceIndex = TRUE;
+             }
+             break;
+@@ -430,8 +446,7 @@ RsDoQwordMemoryDescriptor (
+             {
+                 if (StringLength)
+                 {
+-                    Descriptor->Address64.ResourceLength = (UINT16)
+-                        (Descriptor->Address64.ResourceLength + StringLength);
++                    ResourceLength = (UINT16) (ResourceLength + StringLength);
+ 
+                     strcpy ((char *)
+                         &OptionalFields[OptionIndex],
+@@ -492,13 +507,20 @@ RsDoQwordMemoryDescriptor (
+     /* Validate the Min/Max/Len/Gran values */
+ 
+     RsLargeAddressCheck (
+-        Descriptor->Address64.Minimum,
+-        Descriptor->Address64.Maximum,
+-        Descriptor->Address64.AddressLength,
+-        Descriptor->Address64.Granularity,
++        Minimum,
++        Maximum,
++        AddressLength,
++        Granularity,
+         Descriptor->Address64.Flags,
+         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
+ 
++    ACPI_MOVE_16_TO_16(&Descriptor->Address64.ResourceLength, &ResourceLength);
++    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Minimum, &Minimum);
++    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Maximum, &Maximum);
++    ACPI_MOVE_64_TO_64(&Descriptor->Address64.AddressLength, &AddressLength);
++    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Granularity, &Granularity);
++    ACPI_MOVE_64_TO_64(&Descriptor->Address64.TranslationOffset, &TranslationOffset);
++
+     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
+         OptionIndex + StringLength;
+     return (Rnode);
+@@ -530,9 +552,15 @@ RsDoQwordSpaceDescriptor (
+     ASL_RESOURCE_NODE       *Rnode;
+     UINT8                   *OptionalFields;
+     UINT16                  StringLength = 0;
++    UINT16                  ResourceLength = 0;
+     UINT32                  OptionIndex = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  i;
++    UINT64                  Minimum = 0;
++    UINT64                  Maximum = 0;
++    UINT64                  AddressLength = 0;
++    UINT64                  Granularity = 0;
++    UINT64                  TranslationOffset = 0;
+     BOOLEAN                 ResSourceIndex = FALSE;
+ 
+ 
+@@ -551,8 +579,7 @@ RsDoQwordSpaceDescriptor (
+      * optional fields present
+      */
+     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64);
+-    Descriptor->Address64.ResourceLength = (UINT16)
+-        (sizeof (AML_RESOURCE_ADDRESS64) -
++    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS64) -
+          sizeof (AML_RESOURCE_LARGE_HEADER));
+ 
+     /* Process all child initialization nodes */
+@@ -601,7 +628,7 @@ RsDoQwordSpaceDescriptor (
+ 
+         case 6: /* Address Granularity */
+ 
+-            Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
++            Granularity = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
+             GranOp = InitializerOp;
+@@ -609,7 +636,7 @@ RsDoQwordSpaceDescriptor (
+ 
+         case 7: /* Min Address */
+ 
+-            Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
++            Minimum = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
+             MinOp = InitializerOp;
+@@ -617,7 +644,7 @@ RsDoQwordSpaceDescriptor (
+ 
+         case 8: /* Max Address */
+ 
+-            Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
++            Maximum = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
+             MaxOp = InitializerOp;
+@@ -625,14 +652,14 @@ RsDoQwordSpaceDescriptor (
+ 
+         case 9: /* Translation Offset */
+ 
+-            Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
++            TranslationOffset = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
+             break;
+ 
+         case 10: /* Address Length */
+ 
+-            Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
++            AddressLength = InitializerOp->Asl.Value.Integer;
+             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
+             LengthOp = InitializerOp;
+@@ -644,7 +671,7 @@ RsDoQwordSpaceDescriptor (
+             {
+                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
+                 OptionIndex++;
+-                Descriptor->Address64.ResourceLength++;
++                ResourceLength++;
+                 ResSourceIndex = TRUE;
+             }
+             break;
+@@ -656,8 +683,7 @@ RsDoQwordSpaceDescriptor (
+             {
+                 if (StringLength)
+                 {
+-                    Descriptor->Address64.ResourceLength = (UINT16)
+-                        (Descriptor->Address64.ResourceLength + StringLength);
++                    ResourceLength = (UINT16) (ResourceLength + StringLength);
+ 
+                     strcpy ((char *)
+                         &OptionalFields[OptionIndex],
+@@ -703,13 +729,20 @@ RsDoQwordSpaceDescriptor (
+     /* Validate the Min/Max/Len/Gran values */
+ 
+     RsLargeAddressCheck (
+-        Descriptor->Address64.Minimum,
+-        Descriptor->Address64.Maximum,
+-        Descriptor->Address64.AddressLength,
+-        Descriptor->Address64.Granularity,
++        Minimum,
++        Maximum,
++        AddressLength,
++        Granularity,
+         Descriptor->Address64.Flags,
+         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
+ 
++    ACPI_MOVE_16_TO_16(&Descriptor->Address64.ResourceLength, &ResourceLength);
++    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Minimum, &Minimum);
++    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Maximum, &Maximum);
++    ACPI_MOVE_64_TO_64(&Descriptor->Address64.AddressLength, &AddressLength);
++    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Granularity, &Granularity);
++    ACPI_MOVE_64_TO_64(&Descriptor->Address64.TranslationOffset, &TranslationOffset);
++
+     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
+         OptionIndex + StringLength;
+     return (Rnode);
+Index: acpica-unix2-20180629/source/compiler/aslrestype2s.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/compiler/aslrestype2s.c
++++ acpica-unix2-20180629/source/compiler/aslrestype2s.c
+@@ -340,9 +340,14 @@ RsDoGpioIntDescriptor (
+     UINT16                  VendorLength;
+     UINT16                  InterruptLength;
+     UINT16                  DescriptorSize;
++    UINT16                  IntFlags = 0;
++    UINT16                  DebounceTimeout = 0;
++    UINT16                  Flags = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  PinCount = 0;
+     UINT32                  i;
++    UINT16		    Tmp16;
++    UINT16		    Val16;
+ 
+ 
+     InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+@@ -367,7 +372,7 @@ RsDoGpioIntDescriptor (
+         sizeof (AML_RESOURCE_LARGE_HEADER));
+ 
+     Descriptor = Rnode->Buffer;
+-    Descriptor->Gpio.ResourceLength = DescriptorSize;
++    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.ResourceLength, &DescriptorSize);
+     Descriptor->Gpio.DescriptorType = ACPI_RESOURCE_NAME_GPIO;
+     Descriptor->Gpio.RevisionId = AML_RESOURCE_GPIO_REVISION;
+     Descriptor->Gpio.ConnectionType = AML_RESOURCE_GPIO_TYPE_INT;
+@@ -382,11 +387,11 @@ RsDoGpioIntDescriptor (
+ 
+     /* Setup offsets within the descriptor */
+ 
+-    Descriptor->Gpio.PinTableOffset = (UINT16)
+-        ACPI_PTR_DIFF (InterruptList, Descriptor);
++    Tmp16 = (UINT16) ACPI_PTR_DIFF (InterruptList, Descriptor);
++    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.PinTableOffset, &Tmp16);
+ 
+-    Descriptor->Gpio.ResSourceOffset = (UINT16)
+-        ACPI_PTR_DIFF (ResourceSource, Descriptor);
++    Tmp16 = (UINT16) ACPI_PTR_DIFF (ResourceSource, Descriptor);
++    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.ResSourceOffset, &Tmp16);
+ 
+     /* Process all child initialization nodes */
+ 
+@@ -396,21 +401,21 @@ RsDoGpioIntDescriptor (
+         {
+         case 0: /* Interrupt Mode - edge/level [Flag] (_MOD) */
+ 
+-            RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 0, 0);
++            RsSetFlagBits16 (&IntFlags, InitializerOp, 0, 0);
+             RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 0);
+             break;
+ 
+         case 1: /* Interrupt Polarity - Active high/low [Flags] (_POL) */
+ 
+-            RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 1, 0);
++            RsSetFlagBits16 (&IntFlags, InitializerOp, 1, 0);
+             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_POLARITY,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 1, 2);
+             break;
+ 
+         case 2: /* Share Type - Default: exclusive (0) [Flags] (_SHR) */
+ 
+-            RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 3, 0);
++            RsSetFlagBits16 (&IntFlags, InitializerOp, 3, 0);
+             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 3, 2);
+             break;
+@@ -424,7 +429,7 @@ RsDoGpioIntDescriptor (
+ 
+         case 4: /* Debounce Timeout [WORD] (_DBT) */
+ 
+-            Descriptor->Gpio.DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer;
++            DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_DEBOUNCETIME,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.DebounceTimeout));
+             break;
+@@ -451,7 +456,7 @@ RsDoGpioIntDescriptor (
+ 
+         case 7: /* Resource Usage (consumer/producer) */
+ 
+-            RsSetFlagBits16 (&Descriptor->Gpio.Flags, InitializerOp, 0, 1);
++            RsSetFlagBits16 (&Flags, InitializerOp, 0, 1);
+             break;
+ 
+         case 8: /* Resource Tag (Descriptor Name) */
+@@ -466,13 +471,14 @@ RsDoGpioIntDescriptor (
+              * This field is required in order to calculate the length
+              * of the ResourceSource at runtime.
+              */
+-            Descriptor->Gpio.VendorOffset = (UINT16)
+-                ACPI_PTR_DIFF (VendorData, Descriptor);
++            Tmp16 = (UINT16) ACPI_PTR_DIFF (VendorData, Descriptor);
++            ACPI_MOVE_16_TO_16(&Descriptor->Gpio.VendorOffset, &Tmp16);
+ 
+             if (RsGetVendorData (InitializerOp, VendorData,
+-                (CurrentByteOffset +  Descriptor->Gpio.VendorOffset)))
++                (CurrentByteOffset + Tmp16)))
+             {
+-                Descriptor->Gpio.VendorLength = VendorLength;
++                ACPI_MOVE_16_TO_16(&Descriptor->Gpio.VendorLength,
++				   &VendorLength);
+             }
+             break;
+ 
+@@ -485,7 +491,9 @@ RsDoGpioIntDescriptor (
+              *  (implies resource source must immediately follow the pin list.)
+              *  Name: _PIN
+              */
+-            *InterruptList = (UINT16) InitializerOp->Asl.Value.Integer;
++            Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
++            ACPI_MOVE_16_TO_16(&Val16, &Tmp16);
++            *InterruptList = Val16;
+             InterruptList++;
+             PinCount++;
+ 
+@@ -507,8 +515,10 @@ RsDoGpioIntDescriptor (
+ 
+                 /* Create a named field at the start of the list */
+ 
+-                RsCreateWordField (InitializerOp, ACPI_RESTAG_PIN,
+-                    CurrentByteOffset + Descriptor->Gpio.PinTableOffset);
++		ACPI_MOVE_16_TO_16(&Tmp16, &Descriptor->Gpio.PinTableOffset);
++		Tmp16 += CurrentByteOffset;
++	        ACPI_MOVE_16_TO_16(&Val16, &Tmp16);
++                RsCreateWordField (InitializerOp, ACPI_RESTAG_PIN, Val16);
+             }
+             break;
+         }
+@@ -516,6 +526,10 @@ RsDoGpioIntDescriptor (
+         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
+     }
+ 
++    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.IntFlags, &IntFlags);
++    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.DebounceTimeout, &DebounceTimeout);
++    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.Flags, &Flags);
++
+     MpSaveGpioInfo (Info->MappingOp, Descriptor,
+         PinCount, PinList, ResourceSource);
+     return (Rnode);
+@@ -549,9 +563,15 @@ RsDoGpioIoDescriptor (
+     UINT16                  VendorLength;
+     UINT16                  InterruptLength;
+     UINT16                  DescriptorSize;
++    UINT16                  IntFlags = 0;
++    UINT16                  DebounceTimeout = 0;
++    UINT16                  DriveStrength = 0;
++    UINT16                  Flags = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  PinCount = 0;
+     UINT32                  i;
++    UINT16		    Tmp16;
++    UINT16		    Val16;
+ 
+ 
+     InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+@@ -577,7 +597,7 @@ RsDoGpioIoDescriptor (
+         sizeof (AML_RESOURCE_LARGE_HEADER));
+ 
+     Descriptor = Rnode->Buffer;
+-    Descriptor->Gpio.ResourceLength = DescriptorSize;
++    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.ResourceLength, &DescriptorSize);
+     Descriptor->Gpio.DescriptorType = ACPI_RESOURCE_NAME_GPIO;
+     Descriptor->Gpio.RevisionId = AML_RESOURCE_GPIO_REVISION;
+     Descriptor->Gpio.ConnectionType = AML_RESOURCE_GPIO_TYPE_IO;
+@@ -591,11 +611,11 @@ RsDoGpioIoDescriptor (
+ 
+     /* Setup offsets within the descriptor */
+ 
+-    Descriptor->Gpio.PinTableOffset = (UINT16)
+-        ACPI_PTR_DIFF (InterruptList, Descriptor);
++    Tmp16 = (UINT16) ACPI_PTR_DIFF (InterruptList, Descriptor);
++    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.PinTableOffset, &Tmp16);
+ 
+-    Descriptor->Gpio.ResSourceOffset = (UINT16)
+-        ACPI_PTR_DIFF (ResourceSource, Descriptor);
++    Tmp16 = (UINT16) ACPI_PTR_DIFF (ResourceSource, Descriptor);
++    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.ResSourceOffset, &Tmp16);
+ 
+     /* Process all child initialization nodes */
+ 
+@@ -605,7 +625,7 @@ RsDoGpioIoDescriptor (
+         {
+         case 0: /* Share Type [Flags] (_SHR) */
+ 
+-            RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 3, 0);
++            RsSetFlagBits16 (&IntFlags, InitializerOp, 3, 0);
+             RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 3);
+             break;
+@@ -619,21 +639,21 @@ RsDoGpioIoDescriptor (
+ 
+         case 2: /* Debounce Timeout [WORD] (_DBT) */
+ 
+-            Descriptor->Gpio.DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer;
++            DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_DEBOUNCETIME,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.DebounceTimeout));
+             break;
+ 
+         case 3: /* Drive Strength [WORD] (_DRS) */
+ 
+-            Descriptor->Gpio.DriveStrength = (UINT16) InitializerOp->Asl.Value.Integer;
++            DriveStrength = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_DRIVESTRENGTH,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.DriveStrength));
+             break;
+ 
+         case 4: /* I/O Restriction [Flag] (_IOR) */
+ 
+-            RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 0, 0);
++            RsSetFlagBits16 (&IntFlags, InitializerOp, 0, 0);
+             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_IORESTRICTION,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 0, 2);
+             break;
+@@ -659,7 +679,7 @@ RsDoGpioIoDescriptor (
+ 
+         case 7: /* Resource Usage (consumer/producer) */
+ 
+-            RsSetFlagBits16 (&Descriptor->Gpio.Flags, InitializerOp, 0, 1);
++            RsSetFlagBits16 (&Flags, InitializerOp, 0, 1);
+             break;
+ 
+         case 8: /* Resource Tag (Descriptor Name) */
+@@ -673,13 +693,14 @@ RsDoGpioIoDescriptor (
+              * This field is required in order to calculate the length
+              * of the ResourceSource at runtime.
+              */
+-            Descriptor->Gpio.VendorOffset = (UINT16)
+-                ACPI_PTR_DIFF (VendorData, Descriptor);
++            Tmp16 = (UINT16) ACPI_PTR_DIFF (VendorData, Descriptor);
++            ACPI_MOVE_16_TO_16(&Descriptor->Gpio.VendorOffset, &Tmp16);
+ 
+             if (RsGetVendorData (InitializerOp, VendorData,
+                 (CurrentByteOffset + Descriptor->Gpio.VendorOffset)))
+             {
+-                Descriptor->Gpio.VendorLength = VendorLength;
++                ACPI_MOVE_16_TO_16(&Descriptor->Gpio.VendorLength,
++				   &VendorLength);
+             }
+             break;
+ 
+@@ -692,7 +713,9 @@ RsDoGpioIoDescriptor (
+              *  (implies resource source must immediately follow the pin list.)
+              *  Name: _PIN
+              */
+-            *InterruptList = (UINT16) InitializerOp->Asl.Value.Integer;
++            Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
++	    ACPI_MOVE_16_TO_16(&Val16, &Tmp16);
++            *InterruptList = Val16;
+             InterruptList++;
+             PinCount++;
+ 
+@@ -723,6 +746,11 @@ RsDoGpioIoDescriptor (
+         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
+     }
+ 
++    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.IntFlags, &IntFlags);
++    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.DebounceTimeout, &DebounceTimeout);
++    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.DriveStrength, &DriveStrength);
++    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.Flags, &Flags);
++
+     MpSaveGpioInfo (Info->MappingOp, Descriptor,
+         PinCount, PinList, ResourceSource);
+     return (Rnode);
+@@ -753,8 +781,12 @@ RsDoI2cSerialBusDescriptor (
+     UINT16                  ResSourceLength;
+     UINT16                  VendorLength;
+     UINT16                  DescriptorSize;
++    UINT16                  SlaveAddress = 0;
++    UINT32                  ConnectionSpeed = 0;
++    UINT16                  TypeSpecificFlags = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  i;
++    UINT16		    Tmp16;
+ 
+ 
+     InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+@@ -777,12 +809,14 @@ RsDoI2cSerialBusDescriptor (
+         sizeof (AML_RESOURCE_LARGE_HEADER));
+ 
+     Descriptor = Rnode->Buffer;
+-    Descriptor->I2cSerialBus.ResourceLength = DescriptorSize;
++    ACPI_MOVE_16_TO_16(&Descriptor->I2cSerialBus.ResourceLength,
++		       &DescriptorSize);
+     Descriptor->I2cSerialBus.DescriptorType = ACPI_RESOURCE_NAME_SERIAL_BUS;
+     Descriptor->I2cSerialBus.RevisionId = AML_RESOURCE_I2C_REVISION;
+     Descriptor->I2cSerialBus.TypeRevisionId = AML_RESOURCE_I2C_TYPE_REVISION;
+     Descriptor->I2cSerialBus.Type = AML_RESOURCE_I2C_SERIALBUSTYPE;
+-    Descriptor->I2cSerialBus.TypeDataLength = AML_RESOURCE_I2C_MIN_DATA_LEN + VendorLength;
++    Tmp16 = AML_RESOURCE_I2C_MIN_DATA_LEN + VendorLength;
++    ACPI_MOVE_16_TO_16(&Descriptor->I2cSerialBus.TypeDataLength, &Tmp16);
+ 
+     if (Info->DescriptorTypeOp->Asl.ParseOpcode == PARSEOP_I2C_SERIALBUS_V2)
+     {
+@@ -802,7 +836,7 @@ RsDoI2cSerialBusDescriptor (
+         {
+         case 0: /* Slave Address [WORD] (_ADR) */
+ 
+-            Descriptor->I2cSerialBus.SlaveAddress = (UINT16) InitializerOp->Asl.Value.Integer;
++            SlaveAddress = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_ADDRESS,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.SlaveAddress));
+             break;
+@@ -816,14 +850,14 @@ RsDoI2cSerialBusDescriptor (
+ 
+         case 2: /* Connection Speed [DWORD] (_SPE) */
+ 
+-            Descriptor->I2cSerialBus.ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer;
++            ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.ConnectionSpeed));
+             break;
+ 
+         case 3: /* Addressing Mode [Flag] (_MOD) */
+ 
+-            RsSetFlagBits16 (&Descriptor->I2cSerialBus.TypeSpecificFlags, InitializerOp, 0, 0);
++            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 0, 0);
+             RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.TypeSpecificFlags), 0);
+             break;
+@@ -883,6 +917,9 @@ RsDoI2cSerialBusDescriptor (
+         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
+     }
+ 
++    ACPI_MOVE_16_TO_16(&Descriptor->I2cSerialBus.SlaveAddress, &SlaveAddress);
++    ACPI_MOVE_32_TO_32(&Descriptor->I2cSerialBus.ConnectionSpeed, &ConnectionSpeed);
++    ACPI_MOVE_16_TO_16(&Descriptor->I2cSerialBus.TypeSpecificFlags, &TypeSpecificFlags);
+     MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
+     return (Rnode);
+ }
+@@ -912,6 +949,9 @@ RsDoSpiSerialBusDescriptor (
+     UINT16                  ResSourceLength;
+     UINT16                  VendorLength;
+     UINT16                  DescriptorSize;
++    UINT16                  DeviceSelection = 0;
++    UINT32                  ConnectionSpeed = 0;
++    UINT16                  TypeSpecificFlags = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  i;
+ 
+@@ -962,21 +1002,21 @@ RsDoSpiSerialBusDescriptor (
+         {
+         case 0: /* Device Selection [WORD] (_ADR) */
+ 
+-            Descriptor->SpiSerialBus.DeviceSelection = (UINT16) InitializerOp->Asl.Value.Integer;
++            DeviceSelection = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_ADDRESS,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.DeviceSelection));
+             break;
+ 
+         case 1: /* Device Polarity [Flag] (_DPL) */
+ 
+-            RsSetFlagBits16 (&Descriptor->SpiSerialBus.TypeSpecificFlags, InitializerOp, 1, 0);
++            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 1, 0);
+             RsCreateBitField (InitializerOp, ACPI_RESTAG_DEVICEPOLARITY,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.TypeSpecificFlags), 1);
+             break;
+ 
+         case 2: /* Wire Mode [Flag] (_MOD) */
+ 
+-            RsSetFlagBits16 (&Descriptor->SpiSerialBus.TypeSpecificFlags, InitializerOp, 0, 0);
++            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 0, 0);
+             RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.TypeSpecificFlags), 0);
+             break;
+@@ -997,7 +1037,7 @@ RsDoSpiSerialBusDescriptor (
+ 
+         case 5: /* Connection Speed [DWORD] (_SPE) */
+ 
+-            Descriptor->SpiSerialBus.ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer;
++            ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.ConnectionSpeed));
+             break;
+@@ -1071,6 +1111,10 @@ RsDoSpiSerialBusDescriptor (
+         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
+     }
+ 
++    ACPI_MOVE_16_TO_16(&Descriptor->SpiSerialBus.DeviceSelection, &DeviceSelection);
++    ACPI_MOVE_32_TO_32(&Descriptor->SpiSerialBus.ConnectionSpeed, &ConnectionSpeed);
++    ACPI_MOVE_16_TO_16(&Descriptor->SpiSerialBus.TypeSpecificFlags, &TypeSpecificFlags);
++
+     MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
+     return (Rnode);
+ }
+@@ -1100,6 +1144,10 @@ RsDoUartSerialBusDescriptor (
+     UINT16                  ResSourceLength;
+     UINT16                  VendorLength;
+     UINT16                  DescriptorSize;
++    UINT32                  DefaultBaudRate = 0;
++    UINT16                  TypeSpecificFlags = 0;
++    UINT16                  RxFifoSize = 0;
++    UINT16                  TxFifoSize = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  i;
+ 
+@@ -1149,21 +1197,21 @@ RsDoUartSerialBusDescriptor (
+         {
+         case 0: /* Connection Speed (Baud Rate) [DWORD] (_SPE) */
+ 
+-            Descriptor->UartSerialBus.DefaultBaudRate = (UINT32) InitializerOp->Asl.Value.Integer;
++            DefaultBaudRate = (UINT32) InitializerOp->Asl.Value.Integer;
+             RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.DefaultBaudRate));
+             break;
+ 
+         case 1: /* Bits Per Byte [Flags] (_LEN) */
+ 
+-            RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 4, 3);
++            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 4, 3);
+             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_LENGTH,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 4, 3);
+             break;
+ 
+         case 2: /* Stop Bits [Flags] (_STB) */
+ 
+-            RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 2, 1);
++            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 2, 1);
+             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_STOPBITS,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 2, 2);
+             break;
+@@ -1177,7 +1225,7 @@ RsDoUartSerialBusDescriptor (
+ 
+         case 4: /* Endianness [Flag] (_END) */
+ 
+-            RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 7, 0);
++            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 7, 0);
+             RsCreateBitField (InitializerOp, ACPI_RESTAG_ENDIANNESS,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 7);
+             break;
+@@ -1191,21 +1239,21 @@ RsDoUartSerialBusDescriptor (
+ 
+         case 6: /* Flow Control [Flags] (_FLC) */
+ 
+-            RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 0, 0);
++            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 0, 0);
+             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_FLOWCONTROL,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 0, 2);
+             break;
+ 
+         case 7: /* Rx Buffer Size [WORD] (_RXL) */
+ 
+-            Descriptor->UartSerialBus.RxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer;
++            RxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH_RX,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.RxFifoSize));
+             break;
+ 
+         case 8: /* Tx Buffer Size [WORD] (_TXL) */
+ 
+-            Descriptor->UartSerialBus.TxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer;
++            TxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH_TX,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TxFifoSize));
+             break;
+@@ -1275,6 +1323,11 @@ RsDoUartSerialBusDescriptor (
+         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
+     }
+ 
++    ACPI_MOVE_32_TO_32(&Descriptor->UartSerialBus.DefaultBaudRate, &DefaultBaudRate);
++    ACPI_MOVE_16_TO_16(&Descriptor->UartSerialBus.TypeSpecificFlags, &TypeSpecificFlags);
++    ACPI_MOVE_16_TO_16(&Descriptor->UartSerialBus.RxFifoSize, &RxFifoSize);
++    ACPI_MOVE_16_TO_16(&Descriptor->UartSerialBus.TxFifoSize, &TxFifoSize);
++
+     MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
+     return (Rnode);
+ }
+Index: acpica-unix2-20180629/source/compiler/aslrestype2w.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/compiler/aslrestype2w.c
++++ acpica-unix2-20180629/source/compiler/aslrestype2w.c
+@@ -81,6 +81,12 @@ RsDoWordIoDescriptor (
+     UINT8                   *OptionalFields;
+     UINT16                  StringLength = 0;
+     UINT32                  OptionIndex = 0;
++    UINT16                  ResourceLength = 0;
++    UINT16                  Minimum = 0;
++    UINT16                  Maximum = 0;
++    UINT16                  AddressLength = 0;
++    UINT16                  Granularity = 0;
++    UINT16                  TranslationOffset = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  i;
+     BOOLEAN                 ResSourceIndex = FALSE;
+@@ -102,8 +108,7 @@ RsDoWordIoDescriptor (
+      * optional fields present
+      */
+     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS16);
+-    Descriptor->Address16.ResourceLength = (UINT16)
+-        (sizeof (AML_RESOURCE_ADDRESS16) -
++    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS16) -
+          sizeof (AML_RESOURCE_LARGE_HEADER));
+ 
+     /* Process all child initialization nodes */
+@@ -147,7 +152,7 @@ RsDoWordIoDescriptor (
+ 
+         case 5: /* Address Granularity */
+ 
+-            Descriptor->Address16.Granularity = (UINT16) InitializerOp->Asl.Value.Integer;
++            Granularity = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
+             GranOp = InitializerOp;
+@@ -155,7 +160,7 @@ RsDoWordIoDescriptor (
+ 
+         case 6: /* Address Min */
+ 
+-            Descriptor->Address16.Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
++            Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
+             MinOp = InitializerOp;
+@@ -163,7 +168,7 @@ RsDoWordIoDescriptor (
+ 
+         case 7: /* Address Max */
+ 
+-            Descriptor->Address16.Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
++            Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
+             MaxOp = InitializerOp;
+@@ -171,14 +176,14 @@ RsDoWordIoDescriptor (
+ 
+         case 8: /* Translation Offset */
+ 
+-            Descriptor->Address16.TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer;
++            TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
+             break;
+ 
+         case 9: /* Address Length */
+ 
+-            Descriptor->Address16.AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
++            AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
+                  CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength));
+             LengthOp = InitializerOp;
+@@ -190,7 +195,7 @@ RsDoWordIoDescriptor (
+             {
+                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
+                 OptionIndex++;
+-                Descriptor->Address16.ResourceLength++;
++                ResourceLength++;
+                 ResSourceIndex = TRUE;
+             }
+             break;
+@@ -202,8 +207,7 @@ RsDoWordIoDescriptor (
+             {
+                 if (StringLength)
+                 {
+-                    Descriptor->Address16.ResourceLength = (UINT16)
+-                        (Descriptor->Address16.ResourceLength + StringLength);
++                    ResourceLength = (UINT16) (ResourceLength + StringLength);
+ 
+                     strcpy ((char *)
+                         &OptionalFields[OptionIndex],
+@@ -263,13 +267,20 @@ RsDoWordIoDescriptor (
+     /* Validate the Min/Max/Len/Gran values */
+ 
+     RsLargeAddressCheck (
+-        (UINT64) Descriptor->Address16.Minimum,
+-        (UINT64) Descriptor->Address16.Maximum,
+-        (UINT64) Descriptor->Address16.AddressLength,
+-        (UINT64) Descriptor->Address16.Granularity,
++        Minimum,
++        Maximum,
++        AddressLength,
++        Granularity,
+         Descriptor->Address16.Flags,
+         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
+ 
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.ResourceLength, &ResourceLength);
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Minimum, &Minimum);
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Maximum, &Maximum);
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.AddressLength, &AddressLength);
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Granularity, &Granularity);
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.TranslationOffset, &TranslationOffset);
++
+     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
+         OptionIndex + StringLength;
+     return (Rnode);
+@@ -302,6 +313,12 @@ RsDoWordBusNumberDescriptor (
+     UINT8                   *OptionalFields;
+     UINT16                  StringLength = 0;
+     UINT32                  OptionIndex = 0;
++    UINT16                  ResourceLength = 0;
++    UINT16                  Minimum = 0;
++    UINT16                  Maximum = 0;
++    UINT16                  AddressLength = 0;
++    UINT16                  Granularity = 0;
++    UINT16                  TranslationOffset = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  i;
+     BOOLEAN                 ResSourceIndex = FALSE;
+@@ -323,8 +340,7 @@ RsDoWordBusNumberDescriptor (
+      * optional fields present
+      */
+     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS16);
+-    Descriptor->Address16.ResourceLength = (UINT16)
+-        (sizeof (AML_RESOURCE_ADDRESS16) -
++    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS16) -
+          sizeof (AML_RESOURCE_LARGE_HEADER));
+ 
+     /* Process all child initialization nodes */
+@@ -361,8 +377,7 @@ RsDoWordBusNumberDescriptor (
+ 
+         case 4: /* Address Granularity */
+ 
+-            Descriptor->Address16.Granularity =
+-                (UINT16) InitializerOp->Asl.Value.Integer;
++            Granularity = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
+             GranOp = InitializerOp;
+@@ -370,8 +385,7 @@ RsDoWordBusNumberDescriptor (
+ 
+         case 5: /* Min Address */
+ 
+-            Descriptor->Address16.Minimum =
+-                (UINT16) InitializerOp->Asl.Value.Integer;
++            Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
+             MinOp = InitializerOp;
+@@ -379,8 +393,7 @@ RsDoWordBusNumberDescriptor (
+ 
+         case 6: /* Max Address */
+ 
+-            Descriptor->Address16.Maximum =
+-                (UINT16) InitializerOp->Asl.Value.Integer;
++            Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
+             MaxOp = InitializerOp;
+@@ -388,16 +401,14 @@ RsDoWordBusNumberDescriptor (
+ 
+         case 7: /* Translation Offset */
+ 
+-            Descriptor->Address16.TranslationOffset =
+-                (UINT16) InitializerOp->Asl.Value.Integer;
++            TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
+             break;
+ 
+         case 8: /* Address Length */
+ 
+-            Descriptor->Address16.AddressLength =
+-                (UINT16) InitializerOp->Asl.Value.Integer;
++            AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
+                  CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength));
+             LengthOp = InitializerOp;
+@@ -409,7 +420,7 @@ RsDoWordBusNumberDescriptor (
+             {
+                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
+                 OptionIndex++;
+-                Descriptor->Address16.ResourceLength++;
++                ResourceLength++;
+                 ResSourceIndex = TRUE;
+             }
+             break;
+@@ -421,8 +432,7 @@ RsDoWordBusNumberDescriptor (
+             {
+                 if (StringLength)
+                 {
+-                    Descriptor->Address16.ResourceLength = (UINT16)
+-                        (Descriptor->Address16.ResourceLength + StringLength);
++                    ResourceLength = (UINT16) (ResourceLength + StringLength);
+ 
+                     strcpy ((char *)
+                         &OptionalFields[OptionIndex],
+@@ -468,13 +478,20 @@ RsDoWordBusNumberDescriptor (
+     /* Validate the Min/Max/Len/Gran values */
+ 
+     RsLargeAddressCheck (
+-        (UINT64) Descriptor->Address16.Minimum,
+-        (UINT64) Descriptor->Address16.Maximum,
+-        (UINT64) Descriptor->Address16.AddressLength,
+-        (UINT64) Descriptor->Address16.Granularity,
++        Minimum,
++        Maximum,
++        AddressLength,
++        Granularity,
+         Descriptor->Address16.Flags,
+         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
+ 
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.ResourceLength, &ResourceLength);
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Minimum, &Minimum);
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Maximum, &Maximum);
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.AddressLength, &AddressLength);
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Granularity, &Granularity);
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.TranslationOffset, &TranslationOffset);
++
+     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
+         OptionIndex + StringLength;
+     return (Rnode);
+@@ -507,6 +524,12 @@ RsDoWordSpaceDescriptor (
+     UINT8                   *OptionalFields;
+     UINT16                  StringLength = 0;
+     UINT32                  OptionIndex = 0;
++    UINT16                  Minimum = 0;
++    UINT16                  Maximum = 0;
++    UINT16                  AddressLength = 0;
++    UINT16                  Granularity = 0;
++    UINT16                  TranslationOffset = 0;
++    UINT16                  ResourceLength = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  i;
+     BOOLEAN                 ResSourceIndex = FALSE;
+@@ -527,8 +550,7 @@ RsDoWordSpaceDescriptor (
+      * optional fields present
+      */
+     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS16);
+-    Descriptor->Address16.ResourceLength = (UINT16)
+-        (sizeof (AML_RESOURCE_ADDRESS16) -
++    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS16) -
+          sizeof (AML_RESOURCE_LARGE_HEADER));
+ 
+     /* Process all child initialization nodes */
+@@ -577,8 +599,7 @@ RsDoWordSpaceDescriptor (
+ 
+         case 6: /* Address Granularity */
+ 
+-            Descriptor->Address16.Granularity =
+-                (UINT16) InitializerOp->Asl.Value.Integer;
++            Granularity = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
+             GranOp = InitializerOp;
+@@ -586,8 +607,7 @@ RsDoWordSpaceDescriptor (
+ 
+         case 7: /* Min Address */
+ 
+-            Descriptor->Address16.Minimum =
+-                (UINT16) InitializerOp->Asl.Value.Integer;
++            Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
+             MinOp = InitializerOp;
+@@ -595,8 +615,7 @@ RsDoWordSpaceDescriptor (
+ 
+         case 8: /* Max Address */
+ 
+-            Descriptor->Address16.Maximum =
+-                (UINT16) InitializerOp->Asl.Value.Integer;
++            Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
+             MaxOp = InitializerOp;
+@@ -604,16 +623,14 @@ RsDoWordSpaceDescriptor (
+ 
+         case 9: /* Translation Offset */
+ 
+-            Descriptor->Address16.TranslationOffset =
+-                (UINT16) InitializerOp->Asl.Value.Integer;
++            TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
+             break;
+ 
+         case 10: /* Address Length */
+ 
+-            Descriptor->Address16.AddressLength =
+-                (UINT16) InitializerOp->Asl.Value.Integer;
++            AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
+             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
+                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength));
+             LengthOp = InitializerOp;
+@@ -625,7 +642,7 @@ RsDoWordSpaceDescriptor (
+             {
+                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
+                 OptionIndex++;
+-                Descriptor->Address16.ResourceLength++;
++                ResourceLength++;
+                 ResSourceIndex = TRUE;
+             }
+             break;
+@@ -637,8 +654,7 @@ RsDoWordSpaceDescriptor (
+             {
+                 if (StringLength)
+                 {
+-                    Descriptor->Address16.ResourceLength = (UINT16)
+-                        (Descriptor->Address16.ResourceLength + StringLength);
++                    ResourceLength = (UINT16) (ResourceLength + StringLength);
+ 
+                     strcpy ((char *)
+                         &OptionalFields[OptionIndex],
+@@ -684,13 +700,20 @@ RsDoWordSpaceDescriptor (
+     /* Validate the Min/Max/Len/Gran values */
+ 
+     RsLargeAddressCheck (
+-        (UINT64) Descriptor->Address16.Minimum,
+-        (UINT64) Descriptor->Address16.Maximum,
+-        (UINT64) Descriptor->Address16.AddressLength,
+-        (UINT64) Descriptor->Address16.Granularity,
++        Minimum,
++        Maximum,
++        AddressLength,
++        Granularity,
+         Descriptor->Address16.Flags,
+         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
+ 
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.ResourceLength, &ResourceLength);
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Minimum, &Minimum);
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Maximum, &Maximum);
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.AddressLength, &AddressLength);
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Granularity, &Granularity);
++    ACPI_MOVE_16_TO_16(&Descriptor->Address16.TranslationOffset, &TranslationOffset);
++
+     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
+         OptionIndex + StringLength;
+     return (Rnode);
+Index: acpica-unix2-20180629/source/include/acmacros.h
+===================================================================
+--- acpica-unix2-20180629.orig/source/include/acmacros.h
++++ acpica-unix2-20180629/source/include/acmacros.h
+@@ -98,9 +98,12 @@
+                                            ((UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[1];\
+                                            ((UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[0];}
+ 
+-/* 32-bit source, 16/32/64 destination */
++/* 32-bit source, 8/16/32/64 destination */
+ 
+-#define ACPI_MOVE_32_TO_16(d, s)        ACPI_MOVE_16_TO_16(d, s)    /* Truncate to 16 */
++#define ACPI_MOVE_32_TO_8(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[3];}
++
++#define ACPI_MOVE_32_TO_16(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[3];\
++                                         ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[2];}
+ 
+ #define ACPI_MOVE_32_TO_32(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[3];\
+                                          ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[2];\
+@@ -113,11 +116,17 @@
+                                            ((UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[1];\
+                                            ((UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[0];}
+ 
+-/* 64-bit source, 16/32/64 destination */
++/* 64-bit source, 8/16/32/64 destination */
+ 
+-#define ACPI_MOVE_64_TO_16(d, s)        ACPI_MOVE_16_TO_16(d, s)    /* Truncate to 16 */
++#define ACPI_MOVE_64_TO_8(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[7];}
+ 
+-#define ACPI_MOVE_64_TO_32(d, s)        ACPI_MOVE_32_TO_32(d, s)    /* Truncate to 32 */
++#define ACPI_MOVE_64_TO_16(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[7];\
++                                         ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[6];}
++
++#define ACPI_MOVE_64_TO_32(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[7];\
++                                         ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[6];\
++                                         ((  UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[5];\
++                                         ((  UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[4];}
+ 
+ #define ACPI_MOVE_64_TO_64(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[7];\
+                                          ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[6];\
+@@ -136,20 +145,26 @@
+ 
+ /* The hardware supports unaligned transfers, just do the little-endian move */
+ 
+-/* 16-bit source, 16/32/64 destination */
++/* 16-bit source, 8/16/32/64 destination */
+ 
++#define ACPI_MOVE_16_TO_8(d, s)         *(UINT8 *)(void *)(d) = *(UINT16 *)(void *)(s)
+ #define ACPI_MOVE_16_TO_16(d, s)        *(UINT16 *)(void *)(d) = *(UINT16 *)(void *)(s)
+ #define ACPI_MOVE_16_TO_32(d, s)        *(UINT32 *)(void *)(d) = *(UINT16 *)(void *)(s)
+ #define ACPI_MOVE_16_TO_64(d, s)        *(UINT64 *)(void *)(d) = *(UINT16 *)(void *)(s)
+ 
+-/* 32-bit source, 16/32/64 destination */
++/* 32-bit source, 8/16/32/64 destination */
++
++#define ACPI_MOVE_32_TO_8(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];}
++
++#define ACPI_MOVE_32_TO_16(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];\
++                                         ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[1];}
+ 
+-#define ACPI_MOVE_32_TO_16(d, s)        ACPI_MOVE_16_TO_16(d, s)    /* Truncate to 16 */
+ #define ACPI_MOVE_32_TO_32(d, s)        *(UINT32 *)(void *)(d) = *(UINT32 *)(void *)(s)
+ #define ACPI_MOVE_32_TO_64(d, s)        *(UINT64 *)(void *)(d) = *(UINT32 *)(void *)(s)
+ 
+-/* 64-bit source, 16/32/64 destination */
++/* 64-bit source, 8/16/32/64 destination */
+ 
++#define ACPI_MOVE_64_TO_8(d, s)         ACPI_MOVE_16_TO_8(d, s)    /* Truncate to 8 */
+ #define ACPI_MOVE_64_TO_16(d, s)        ACPI_MOVE_16_TO_16(d, s)    /* Truncate to 16 */
+ #define ACPI_MOVE_64_TO_32(d, s)        ACPI_MOVE_32_TO_32(d, s)    /* Truncate to 32 */
+ #define ACPI_MOVE_64_TO_64(d, s)        *(UINT64 *)(void *)(d) = *(UINT64 *)(void *)(s)
+@@ -169,7 +184,9 @@
+ #define ACPI_MOVE_16_TO_32(d, s)        {(*(UINT32 *)(void *)(d)) = 0; ACPI_MOVE_16_TO_16(d, s);}
+ #define ACPI_MOVE_16_TO_64(d, s)        {(*(UINT64 *)(void *)(d)) = 0; ACPI_MOVE_16_TO_16(d, s);}
+ 
+-/* 32-bit source, 16/32/64 destination */
++/* 32-bit source, 8/16/32/64 destination */
++
++#define ACPI_MOVE_32_TO_8(d, s)         ACPI_MOVE_16_TO_8(d, s)    /* Truncate to 8 */
+ 
+ #define ACPI_MOVE_32_TO_16(d, s)        ACPI_MOVE_16_TO_16(d, s)    /* Truncate to 16 */
+ 
+Index: acpica-unix2-20180629/source/include/platform/aclinux.h
+===================================================================
+--- acpica-unix2-20180629.orig/source/include/platform/aclinux.h
++++ acpica-unix2-20180629/source/include/platform/aclinux.h
+@@ -193,6 +193,7 @@
+ 
+ #ifdef ACPI_USE_STANDARD_HEADERS
+ #include <unistd.h>
++#include <endian.h>
+ #endif
+ 
+ /* Define/disable kernel-specific declarators */
+@@ -227,6 +228,10 @@
+ #define __cdecl
+ #endif
+ 
++#if defined(__PPC64__) || defined(__s390x__)
++#define ACPI_BIG_ENDIAN
++#endif
++
+ #endif /* __KERNEL__ */
+ 
+ #endif /* __ACLINUX_H__ */
+Index: acpica-unix2-20180629/source/compiler/aslanalyze.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/compiler/aslanalyze.c
++++ acpica-unix2-20180629/source/compiler/aslanalyze.c
+@@ -461,7 +461,7 @@ ApCheckForGpeNameConflict (
+ 
+     /* Need a null-terminated string version of NameSeg */
+ 
+-    ACPI_MOVE_32_TO_32 (Name, &Op->Asl.NameSeg);
++    ACPI_MOVE_NAME (Name, &Op->Asl.NameSeg);
+     Name[ACPI_NAME_SIZE] = 0;
+ 
+     /*
+@@ -488,7 +488,7 @@ ApCheckForGpeNameConflict (
+      * We are now sure we have an _Lxx or _Exx.
+      * Create the target name that would cause collision (Flip E/L)
+      */
+-    ACPI_MOVE_32_TO_32 (Target, Name);
++    ACPI_MOVE_NAME (Target, Name);
+ 
+     /* Inject opposite letter ("L" versus "E") */
+ 
+Index: acpica-unix2-20180629/source/compiler/asllookup.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/compiler/asllookup.c
++++ acpica-unix2-20180629/source/compiler/asllookup.c
+@@ -119,6 +119,7 @@ LkIsObjectUsed (
+ {
+     ACPI_NAMESPACE_NODE     *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
+     ACPI_NAMESPACE_NODE     *Next;
++    ACPI_NAME_UNION         tmp, tmp2;
+     ASL_METHOD_LOCAL        *MethodLocals;
+     ASL_METHOD_LOCAL        *MethodArgs;
+     UINT32                  i;
+@@ -175,7 +176,8 @@ LkIsObjectUsed (
+                  * We ignore the predefined methods since often, not
+                  * all arguments are needed or used.
+                  */
+-                if ((Node->Name.Ascii[0] != '_') &&
++                ACPI_MOVE_32_TO_32(&tmp.Ascii, Node->Name.Ascii);
++                if ((tmp.Ascii[0] != '_') &&
+                     (!(MethodArgs[i].Flags & ASL_ARG_REFERENCED)))
+                 {
+                     sprintf (MsgBuffer, "Arg%u", i);
+@@ -228,8 +230,10 @@ LkIsObjectUsed (
+              * Issue a remark even if it is a reserved name (starts
+              * with an underscore).
+              */
++            ACPI_MOVE_32_TO_32(&tmp.Ascii, Node->Name.Ascii);
++            ACPI_MOVE_32_TO_32(&tmp2.Ascii, Next->Name.Ascii);
+             sprintf (MsgBuffer, "Name [%4.4s] is within a method [%4.4s]",
+-                Node->Name.Ascii, Next->Name.Ascii);
++                tmp.Ascii, tmp2.Ascii);
+             AslError (ASL_REMARK, ASL_MSG_NOT_REFERENCED,
+                 LkGetNameOp (Node->Op), MsgBuffer);
+             return (AE_OK);
+Index: acpica-unix2-20180629/source/compiler/aslmain.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/compiler/aslmain.c
++++ acpica-unix2-20180629/source/compiler/aslmain.c
+@@ -101,18 +101,6 @@ main (
+ 
+     signal (SIGINT, AslSignalHandler);
+ 
+-    /*
+-     * Big-endian machines are not currently supported. ACPI tables must
+-     * be little-endian, and support for big-endian machines needs to
+-     * be implemented.
+-     */
+-    if (UtIsBigEndianMachine ())
+-    {
+-        fprintf (stderr,
+-            "iASL is not currently supported on big-endian machines.\n");
+-        return (-1);
+-    }
+-
+     AcpiOsInitialize ();
+     ACPI_DEBUG_INITIALIZE (); /* For debug version only */
+ 
+Index: acpica-unix2-20180629/source/common/acfileio.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/common/acfileio.c
++++ acpica-unix2-20180629/source/common/acfileio.c
+@@ -280,6 +280,7 @@ AcGetOneTableFromFile (
+     ACPI_TABLE_HEADER       *Table;
+     INT32                   Count;
+     long                    TableOffset;
++    UINT32		    TableLen;
+ 
+ 
+     *ReturnTable = NULL;
+@@ -319,7 +320,8 @@ AcGetOneTableFromFile (
+ 
+     /* Allocate a buffer for the entire table */
+ 
+-    Table = AcpiOsAllocate ((ACPI_SIZE) TableHeader.Length);
++    ACPI_MOVE_32_TO_32(&TableLen, &TableHeader.Length);
++    Table = AcpiOsAllocate ((ACPI_SIZE) TableLen);
+     if (!Table)
+     {
+         return (AE_NO_MEMORY);
+@@ -329,13 +331,13 @@ AcGetOneTableFromFile (
+ 
+     fseek (File, TableOffset, SEEK_SET);
+ 
+-    Count = fread (Table, 1, TableHeader.Length, File);
++    Count = fread (Table, 1, TableLen, File);
+ 
+     /*
+      * Checks for data table headers happen later in the execution. Only verify
+      * for Aml tables at this point in the code.
+      */
+-    if (GetOnlyAmlTables && Count != (INT32) TableHeader.Length)
++    if (GetOnlyAmlTables && Count != TableLen)
+     {
+         Status = AE_ERROR;
+         goto ErrorExit;
+@@ -343,7 +345,7 @@ AcGetOneTableFromFile (
+ 
+     /* Validate the checksum (just issue a warning) */
+ 
+-    Status = AcpiTbVerifyChecksum (Table, TableHeader.Length);
++    Status = AcpiTbVerifyChecksum (Table, TableLen);
+     if (ACPI_FAILURE (Status))
+     {
+         Status = AcCheckTextModeCorruption (Table);
+@@ -435,6 +437,7 @@ AcValidateTableHeader (
+     ACPI_SIZE               Actual;
+     long                    OriginalOffset;
+     UINT32                  FileSize;
++    UINT32                  TableLength;
+     UINT32                  i;
+ 
+ 
+@@ -464,11 +467,12 @@ AcValidateTableHeader (
+     /* Validate table length against bytes remaining in the file */
+ 
+     FileSize = CmGetFileSize (File);
+-    if (TableHeader.Length > (UINT32) (FileSize - TableOffset))
++    ACPI_MOVE_32_TO_32(&TableLength, &TableHeader.Length);
++    if (TableLength > (UINT32) (FileSize - TableOffset))
+     {
+         fprintf (stderr, "Table [%4.4s] is too long for file - "
+             "needs: 0x%.2X, remaining in file: 0x%.2X\n",
+-            TableHeader.Signature, TableHeader.Length,
++            TableHeader.Signature, TableLength,
+             (UINT32) (FileSize - TableOffset));
+         return (AE_BAD_HEADER);
+     }
+Index: acpica-unix2-20180629/source/common/dmtable.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/common/dmtable.c
++++ acpica-unix2-20180629/source/common/dmtable.c
+@@ -550,7 +550,7 @@ AcpiDmDumpDataTable (
+      */
+     if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS))
+     {
+-        Length = Table->Length;
++        ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+         Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);
+         if (ACPI_FAILURE (Status))
+         {
+@@ -564,13 +564,14 @@ AcpiDmDumpDataTable (
+     else if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_S3PT))
+     {
+         Length = AcpiDmDumpS3pt (Table);
++        ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+     }
+     else
+     {
+         /*
+          * All other tables must use the common ACPI table header, dump it now
+          */
+-        Length = Table->Length;
++        ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+         Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHeader);
+         if (ACPI_FAILURE (Status))
+         {
+@@ -781,6 +782,7 @@ AcpiDmDumpTable (
+     BOOLEAN                 LastOutputBlankLine = FALSE;
+     ACPI_STATUS             Status;
+     char                    RepairedName[8];
++    UINT16		    Val16;
+ 
+ 
+     if (!Info)
+@@ -1177,8 +1179,9 @@ AcpiDmDumpTable (
+             /* Checksum, display and validate */
+ 
+             AcpiOsPrintf ("%2.2X", *Target);
+-            Temp8 = AcpiDmGenerateChecksum (Table,
+-                ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
++	    ACPI_MOVE_32_TO_32(&Temp32,
++			&ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length);
++            Temp8 = AcpiDmGenerateChecksum (Table, Temp32,
+                 ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);
+ 
+             if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum)
+@@ -1243,14 +1246,14 @@ AcpiDmDumpTable (
+ 
+             /* DMAR subtable types */
+ 
+-            Temp16 = ACPI_GET16 (Target);
++            Val16 = ACPI_GET16 (Target);
++	    ACPI_MOVE_16_TO_16(&Temp16, &Val16);
+             if (Temp16 > ACPI_DMAR_TYPE_RESERVED)
+             {
+                 Temp16 = ACPI_DMAR_TYPE_RESERVED;
+             }
+ 
+-            AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
+-                AcpiDmDmarSubnames[Temp16]);
++            AcpiOsPrintf (UINT16_FORMAT, Temp16, AcpiDmDmarSubnames[Temp16]);
+             break;
+ 
+         case ACPI_DMT_DMAR_SCOPE:
+@@ -1341,14 +1344,14 @@ AcpiDmDumpTable (
+ 
+             /* HEST subtable types */
+ 
+-            Temp16 = ACPI_GET16 (Target);
++            Val16 = ACPI_GET16 (Target);
++	    ACPI_MOVE_16_TO_16(&Temp16, &Val16);
+             if (Temp16 > ACPI_HEST_TYPE_RESERVED)
+             {
+                 Temp16 = ACPI_HEST_TYPE_RESERVED;
+             }
+ 
+-            AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
+-                AcpiDmHestSubnames[Temp16]);
++            AcpiOsPrintf (UINT16_FORMAT, Temp16, AcpiDmHestSubnames[Temp16]);
+             break;
+ 
+         case ACPI_DMT_HESTNTFY:
+@@ -1428,13 +1431,14 @@ AcpiDmDumpTable (
+ 
+             /* NFIT subtable types */
+ 
+-            Temp16 = ACPI_GET16 (Target);
++            Val16 = ACPI_GET16 (Target);
++            ACPI_MOVE_16_TO_16(&Temp16, &Val16);
+             if (Temp16 > ACPI_NFIT_TYPE_RESERVED)
+             {
+                 Temp16 = ACPI_NFIT_TYPE_RESERVED;
+             }
+ 
+-            AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
++            AcpiOsPrintf (UINT16_FORMAT, Temp16,
+                 AcpiDmNfitSubnames[Temp16]);
+             break;
+ 
+Index: acpica-unix2-20180629/source/common/dmtables.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/common/dmtables.c
++++ acpica-unix2-20180629/source/common/dmtables.c
+@@ -142,7 +142,9 @@ AdCreateTableHeader (
+     ACPI_TABLE_HEADER       *Table)
+ {
+     UINT8                   Checksum;
+-
++    UINT32		    TableLen;
++    UINT32		    OemRev;
++    UINT32		    CompilerRev;
+ 
+     /* Reset globals for External statements */
+ 
+@@ -154,9 +156,10 @@ AdCreateTableHeader (
+      */
+     AdDisassemblerHeader (Filename, ACPI_IS_AML_TABLE);
+ 
++    ACPI_MOVE_32_TO_32(&TableLen, &Table->Length);
+     AcpiOsPrintf (" * Original Table Header:\n");
+     AcpiOsPrintf (" *     Signature        \"%4.4s\"\n",    Table->Signature);
+-    AcpiOsPrintf (" *     Length           0x%8.8X (%u)\n", Table->Length, Table->Length);
++    AcpiOsPrintf (" *     Length           0x%8.8X (%u)\n", TableLen, TableLen);
+ 
+     /* Print and validate the revision */
+ 
+@@ -188,7 +191,7 @@ AdCreateTableHeader (
+ 
+     AcpiOsPrintf ("\n *     Checksum         0x%2.2X",        Table->Checksum);
+ 
+-    Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), Table->Length);
++    Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), TableLen);
+     if (Checksum)
+     {
+         AcpiOsPrintf (" **** Incorrect checksum, should be 0x%2.2X",
+@@ -198,9 +201,11 @@ AdCreateTableHeader (
+     AcpiOsPrintf ("\n");
+     AcpiOsPrintf (" *     OEM ID           \"%.6s\"\n",     Table->OemId);
+     AcpiOsPrintf (" *     OEM Table ID     \"%.8s\"\n",     Table->OemTableId);
+-    AcpiOsPrintf (" *     OEM Revision     0x%8.8X (%u)\n", Table->OemRevision, Table->OemRevision);
++    ACPI_MOVE_32_TO_32(&OemRev, &Table->OemRevision);
++    AcpiOsPrintf (" *     OEM Revision     0x%8.8X (%u)\n", OemRev, OemRev);
+     AcpiOsPrintf (" *     Compiler ID      \"%.4s\"\n",     Table->AslCompilerId);
+-    AcpiOsPrintf (" *     Compiler Version 0x%8.8X (%u)\n", Table->AslCompilerRevision, Table->AslCompilerRevision);
++    ACPI_MOVE_32_TO_32(&CompilerRev, &Table->AslCompilerRevision);
++    AcpiOsPrintf (" *     Compiler Version 0x%8.8X (%u)\n", CompilerRev, CompilerRev);
+     AcpiOsPrintf (" */\n");
+ 
+     /*
+@@ -221,7 +226,7 @@ AdCreateTableHeader (
+     AcpiOsPrintf (
+         "DefinitionBlock (\"\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
+         Table->Signature, Table->Revision,
+-        Table->OemId, Table->OemTableId, Table->OemRevision);
++        Table->OemId, Table->OemTableId, OemRev);
+ }
+ 
+ 
+@@ -396,7 +401,8 @@ AdParseTable (
+ 
+     fprintf (stderr, "Pass 1 parse of [%4.4s]\n", (char *) Table->Signature);
+ 
+-    AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER);
++    ACPI_MOVE_32_TO_32(&AmlLength, &Table->Length);
++    AmlLength -= sizeof (ACPI_TABLE_HEADER);
+     AmlStart = ((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER));
+     ASL_CV_INIT_FILETREE(Table, AmlStart, AmlLength);
+ 
+Index: acpica-unix2-20180629/source/common/dmtbdump.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/common/dmtbdump.c
++++ acpica-unix2-20180629/source/common/dmtbdump.c
+@@ -277,6 +277,8 @@ AcpiDmDumpRsdt (
+     UINT32                  Entries;
+     UINT32                  Offset;
+     UINT32                  i;
++    UINT32		    Length;
++    UINT32		    Address;
+ 
+ 
+     /* Point to start of table pointer array */
+@@ -286,12 +288,14 @@ AcpiDmDumpRsdt (
+ 
+     /* RSDT uses 32-bit pointers */
+ 
+-    Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT32);
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
++    Entries = (Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT32);
+ 
+     for (i = 0; i < Entries; i++)
+     {
+         AcpiDmLineHeader2 (Offset, sizeof (UINT32), "ACPI Table Address", i);
+-        AcpiOsPrintf ("%8.8X\n", Array[i]);
++	ACPI_MOVE_32_TO_32(&Address, &Array[i]);
++        AcpiOsPrintf ("%8.8X\n", Address);
+         Offset += sizeof (UINT32);
+     }
+ }
+@@ -317,6 +321,8 @@ AcpiDmDumpXsdt (
+     UINT32                  Entries;
+     UINT32                  Offset;
+     UINT32                  i;
++    UINT32                  Length;
++    UINT64		    Address;
+ 
+ 
+     /* Point to start of table pointer array */
+@@ -326,12 +332,14 @@ AcpiDmDumpXsdt (
+ 
+     /* XSDT uses 64-bit pointers */
+ 
+-    Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT64);
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
++    Entries = (Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT64);
+ 
+     for (i = 0; i < Entries; i++)
+     {
+         AcpiDmLineHeader2 (Offset, sizeof (UINT64), "ACPI Table Address", i);
+-        AcpiOsPrintf ("%8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Array[i]));
++	ACPI_MOVE_64_TO_64(&Address, &Array[i]);
++        AcpiOsPrintf ("%8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Address));
+         Offset += sizeof (UINT64);
+     }
+ }
+@@ -358,12 +366,12 @@ AcpiDmDumpFadt (
+     ACPI_TABLE_HEADER       *Table)
+ {
+     ACPI_STATUS             Status;
+-
++    UINT32		    Length;
+ 
+     /* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */
+ 
+-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+-        AcpiDmTableInfoFadt1);
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
++    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFadt1);
+     if (ACPI_FAILURE (Status))
+     {
+         return;
+@@ -371,11 +379,9 @@ AcpiDmDumpFadt (
+ 
+     /* Check for FADT revision 2 fields (ACPI 1.0B MS extensions) */
+ 
+-    if ((Table->Length > ACPI_FADT_V1_SIZE) &&
+-        (Table->Length <= ACPI_FADT_V2_SIZE))
++    if ((Length > ACPI_FADT_V1_SIZE) && (Length <= ACPI_FADT_V2_SIZE))
+     {
+-        Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+-            AcpiDmTableInfoFadt2);
++        Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFadt2);
+         if (ACPI_FAILURE (Status))
+         {
+             return;
+@@ -384,10 +390,9 @@ AcpiDmDumpFadt (
+ 
+     /* Check for FADT revision 3/4 fields and up (ACPI 2.0+ extended data) */
+ 
+-    else if (Table->Length > ACPI_FADT_V2_SIZE)
++    else if (Length > ACPI_FADT_V2_SIZE)
+     {
+-        Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+-            AcpiDmTableInfoFadt3);
++        Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFadt3);
+         if (ACPI_FAILURE (Status))
+         {
+             return;
+@@ -395,9 +400,9 @@ AcpiDmDumpFadt (
+ 
+         /* Check for FADT revision 5 fields and up (ACPI 5.0+) */
+ 
+-        if (Table->Length > ACPI_FADT_V3_SIZE)
++        if (Length > ACPI_FADT_V3_SIZE)
+         {
+-            Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
++            Status = AcpiDmDumpTable (Length, 0, Table, 0,
+                 AcpiDmTableInfoFadt5);
+             if (ACPI_FAILURE (Status))
+             {
+@@ -407,9 +412,9 @@ AcpiDmDumpFadt (
+ 
+         /* Check for FADT revision 6 fields and up (ACPI 6.0+) */
+ 
+-        if (Table->Length > ACPI_FADT_V3_SIZE)
++        if (Length > ACPI_FADT_V3_SIZE)
+         {
+-            Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
++            Status = AcpiDmDumpTable (Length, 0, Table, 0,
+                 AcpiDmTableInfoFadt6);
+             if (ACPI_FAILURE (Status))
+             {
+@@ -420,11 +425,11 @@ AcpiDmDumpFadt (
+ 
+     /* Validate various fields in the FADT, including length */
+ 
+-    AcpiTbCreateLocalFadt (Table, Table->Length);
++    AcpiTbCreateLocalFadt (Table, Length);
+ 
+     /* Validate FADT length against the revision */
+ 
+-    AcpiDmValidateFadtLength (Table->Revision, Table->Length);
++    AcpiDmValidateFadtLength (Table->Revision, Length);
+ }
+ 
+ 
+@@ -450,6 +455,7 @@ AcpiDmValidateFadtLength (
+     UINT32                  Length)
+ {
+     UINT32                  ExpectedLength;
++    UINT32		    Tmp32;
+ 
+ 
+     switch (Revision)
+@@ -485,7 +491,8 @@ AcpiDmValidateFadtLength (
+         return;
+     }
+ 
+-    if (Length == ExpectedLength)
++    ACPI_MOVE_32_TO_32(&Tmp32, &Length);
++    if (Tmp32 == ExpectedLength)
+     {
+         return;
+     }
+@@ -493,5 +500,5 @@ AcpiDmValidateFadtLength (
+     AcpiOsPrintf (
+         "\n// ACPI Warning: FADT revision %X does not match length: "
+         "found %X expected %X\n",
+-        Revision, Length, ExpectedLength);
++        Revision, Tmp32, ExpectedLength);
+ }
+Index: acpica-unix2-20180629/source/common/dmtbdump1.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/common/dmtbdump1.c
++++ acpica-unix2-20180629/source/common/dmtbdump1.c
+@@ -79,17 +79,21 @@ AcpiDmDumpAsf (
+     UINT32                  DataOffset = 0;
+     UINT32                  i;
+     UINT8                   Type;
++    UINT32		    Len;
++    UINT16		    SubLen;
+ 
+ 
+     /* No main table, only subtables */
+ 
++    ACPI_MOVE_32_TO_32(&Len, &Table->Length);
+     Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Len)
+     {
+         /* Common subtable header */
+ 
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+-            Subtable->Header.Length, AcpiDmTableInfoAsfHdr);
++	ACPI_MOVE_16_TO_16(&SubLen, &Subtable->Header.Length);
++        Status = AcpiDmDumpTable (Len, Offset, Subtable,
++            SubLen, AcpiDmTableInfoAsfHdr);
+         if (ACPI_FAILURE (Status))
+         {
+             return;
+@@ -146,8 +150,7 @@ AcpiDmDumpAsf (
+             return;
+         }
+ 
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+-            Subtable->Header.Length, InfoTable);
++        Status = AcpiDmDumpTable (Len, Offset, Subtable, SubLen, InfoTable);
+         if (ACPI_FAILURE (Status))
+         {
+             return;
+@@ -163,7 +166,7 @@ AcpiDmDumpAsf (
+             for (i = 0; i < DataCount; i++)
+             {
+                 AcpiOsPrintf ("\n");
+-                Status = AcpiDmDumpTable (Table->Length, DataOffset,
++                Status = AcpiDmDumpTable (Len, DataOffset,
+                     DataTable, DataLength, DataInfoTable);
+                 if (ACPI_FAILURE (Status))
+                 {
+@@ -209,15 +212,14 @@ AcpiDmDumpAsf (
+ 
+         /* Point to next subtable */
+ 
+-        if (!Subtable->Header.Length)
++        if (!SubLen)
+         {
+             AcpiOsPrintf ("Invalid zero subtable header length\n");
+             return;
+         }
+ 
+-        Offset += Subtable->Header.Length;
+-        Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Subtable,
+-            Subtable->Header.Length);
++        Offset += SubLen;
++        Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Subtable, SubLen);
+     }
+ }
+ 
+@@ -241,12 +243,13 @@ AcpiDmDumpCpep (
+ {
+     ACPI_STATUS             Status;
+     ACPI_CPEP_POLLING       *Subtable;
+-    UINT32                  Length = Table->Length;
++    UINT32                  Length;
+     UINT32                  Offset = sizeof (ACPI_TABLE_CPEP);
+ 
+ 
+     /* Main table */
+ 
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoCpep);
+     if (ACPI_FAILURE (Status))
+     {
+@@ -256,7 +259,7 @@ AcpiDmDumpCpep (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         AcpiOsPrintf ("\n");
+         Status = AcpiDmDumpTable (Length, Offset, Subtable,
+@@ -296,7 +299,10 @@ AcpiDmDumpCsrt (
+     ACPI_CSRT_GROUP         *Subtable;
+     ACPI_CSRT_SHARED_INFO   *SharedInfoTable;
+     ACPI_CSRT_DESCRIPTOR    *SubSubtable;
+-    UINT32                  Length = Table->Length;
++    UINT32                  Length;
++    UINT32                  SubLength;
++    UINT32                  SubSubLength;
++    UINT32                  SharedInfoLength;
+     UINT32                  Offset = sizeof (ACPI_TABLE_CSRT);
+     UINT32                  SubOffset;
+     UINT32                  SubSubOffset;
+@@ -307,14 +313,16 @@ AcpiDmDumpCsrt (
+ 
+     /* Subtables (Resource Groups) */
+ 
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+     Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         /* Resource group subtable */
+ 
+         AcpiOsPrintf ("\n");
++        ACPI_MOVE_32_TO_32(&SubLength, &Subtable->Length);
+         Status = AcpiDmDumpTable (Length, Offset, Subtable,
+-            Subtable->Length, AcpiDmTableInfoCsrt0);
++            SubLength, AcpiDmTableInfoCsrt0);
+         if (ACPI_FAILURE (Status))
+         {
+             return;
+@@ -334,19 +342,20 @@ AcpiDmDumpCsrt (
+             return;
+         }
+ 
+-        SubOffset += Subtable->SharedInfoLength;
++	ACPI_MOVE_32_TO_32(&SharedInfoLength, &Subtable->SharedInfoLength);
++        SubOffset += SharedInfoLength;
+ 
+         /* Sub-Subtables (Resource Descriptors) */
+ 
+         SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table,
+             Offset + SubOffset);
+ 
+-        while ((SubOffset < Subtable->Length) &&
+-              ((Offset + SubOffset) < Table->Length))
++        while ((SubOffset < SubLength) && ((Offset + SubOffset) < Length))
+         {
+             AcpiOsPrintf ("\n");
++	    ACPI_MOVE_32_TO_32(&SubSubLength, &SubSubtable->Length);
+             Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubtable,
+-                SubSubtable->Length, AcpiDmTableInfoCsrt2);
++                SubSubLength, AcpiDmTableInfoCsrt2);
+             if (ACPI_FAILURE (Status))
+             {
+                 return;
+@@ -356,7 +365,7 @@ AcpiDmDumpCsrt (
+ 
+             /* Resource-specific info buffer */
+ 
+-            InfoLength = SubSubtable->Length - SubSubOffset;
++            InfoLength = SubSubLength - SubSubOffset;
+             if (InfoLength)
+             {
+                 Status = AcpiDmDumpTable (Length,
+@@ -371,16 +380,15 @@ AcpiDmDumpCsrt (
+ 
+             /* Point to next sub-subtable */
+ 
+-            SubOffset += SubSubtable->Length;
++            SubOffset += SubSubLength;
+             SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubtable,
+-                SubSubtable->Length);
++                SubSubLength);
+         }
+ 
+         /* Point to next subtable */
+ 
+-        Offset += Subtable->Length;
+-        Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Subtable,
+-            Subtable->Length);
++        Offset += SubLength;
++        Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Subtable, SubLength);
+     }
+ }
+ 
+@@ -404,16 +412,20 @@ AcpiDmDumpDbg2 (
+ {
+     ACPI_STATUS             Status;
+     ACPI_DBG2_DEVICE        *Subtable;
+-    UINT32                  Length = Table->Length;
++    UINT32                  Length;
++    UINT16                  SubLength;
+     UINT32                  Offset = sizeof (ACPI_TABLE_DBG2);
+     UINT32                  i;
+     UINT32                  ArrayOffset;
+     UINT32                  AbsoluteOffset;
+     UINT8                   *Array;
++    UINT16		    Tmp16;
++    UINT16		    AlsoTmp16;
+ 
+ 
+     /* Main table */
+ 
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDbg2);
+     if (ACPI_FAILURE (Status))
+     {
+@@ -423,11 +435,12 @@ AcpiDmDumpDbg2 (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         AcpiOsPrintf ("\n");
++        ACPI_MOVE_16_TO_16(&SubLength, &Subtable->Length);
+         Status = AcpiDmDumpTable (Length, Offset, Subtable,
+-            Subtable->Length, AcpiDmTableInfoDbg2Device);
++            SubLength, AcpiDmTableInfoDbg2Device);
+         if (ACPI_FAILURE (Status))
+         {
+             return;
+@@ -437,13 +450,13 @@ AcpiDmDumpDbg2 (
+ 
+         for (i = 0; i < Subtable->RegisterCount; i++)
+         {
+-            ArrayOffset = Subtable->BaseAddressOffset +
+-                (sizeof (ACPI_GENERIC_ADDRESS) * i);
++	    ACPI_MOVE_16_TO_16(&Tmp16, &Subtable->BaseAddressOffset);
++            ArrayOffset = Tmp16 + (sizeof (ACPI_GENERIC_ADDRESS) * i);
+             AbsoluteOffset = Offset + ArrayOffset;
+             Array = (UINT8 *) Subtable + ArrayOffset;
+ 
+             Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
+-                Subtable->Length, AcpiDmTableInfoDbg2Addr);
++                SubLength, AcpiDmTableInfoDbg2Addr);
+             if (ACPI_FAILURE (Status))
+             {
+                 return;
+@@ -454,13 +467,13 @@ AcpiDmDumpDbg2 (
+ 
+         for (i = 0; i < Subtable->RegisterCount; i++)
+         {
+-            ArrayOffset = Subtable->AddressSizeOffset +
+-                (sizeof (UINT32) * i);
++	    ACPI_MOVE_16_TO_16(&Tmp16, &Subtable->AddressSizeOffset);
++            ArrayOffset = Tmp16 + (sizeof (UINT32) * i);
+             AbsoluteOffset = Offset + ArrayOffset;
+             Array = (UINT8 *) Subtable + ArrayOffset;
+ 
+             Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
+-                Subtable->Length, AcpiDmTableInfoDbg2Size);
++                SubLength, AcpiDmTableInfoDbg2Size);
+             if (ACPI_FAILURE (Status))
+             {
+                 return;
+@@ -470,12 +483,13 @@ AcpiDmDumpDbg2 (
+         /* Dump the Namestring (required) */
+ 
+         AcpiOsPrintf ("\n");
+-        ArrayOffset = Subtable->NamepathOffset;
++	ACPI_MOVE_16_TO_16(&Tmp16, &Subtable->NamepathOffset);
++        ArrayOffset = Tmp16;
+         AbsoluteOffset = Offset + ArrayOffset;
+         Array = (UINT8 *) Subtable + ArrayOffset;
+ 
+         Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
+-            Subtable->Length, AcpiDmTableInfoDbg2Name);
++            SubLength, AcpiDmTableInfoDbg2Name);
+         if (ACPI_FAILURE (Status))
+         {
+             return;
+@@ -485,9 +499,10 @@ AcpiDmDumpDbg2 (
+ 
+         if (Subtable->OemDataOffset)
+         {
+-            Status = AcpiDmDumpTable (Length, Offset + Subtable->OemDataOffset,
+-                Table, Subtable->OemDataLength,
+-                AcpiDmTableInfoDbg2OemData);
++	    ACPI_MOVE_16_TO_16(&Tmp16, &Subtable->OemDataOffset);
++	    ACPI_MOVE_16_TO_16(&AlsoTmp16, &Subtable->OemDataLength);
++            Status = AcpiDmDumpTable (Length, Offset + Tmp16,
++                Table, AlsoTmp16, AcpiDmTableInfoDbg2OemData);
+             if (ACPI_FAILURE (Status))
+             {
+                 return;
+@@ -496,9 +511,9 @@ AcpiDmDumpDbg2 (
+ 
+         /* Point to next subtable */
+ 
+-        Offset += Subtable->Length;
++        Offset += SubLength;
+         Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Subtable,
+-            Subtable->Length);
++            SubLength);
+     }
+ }
+ 
+@@ -522,17 +537,20 @@ AcpiDmDumpDmar (
+ {
+     ACPI_STATUS             Status;
+     ACPI_DMAR_HEADER        *Subtable;
+-    UINT32                  Length = Table->Length;
++    UINT32                  Length;
++    UINT16                  SubLength;
+     UINT32                  Offset = sizeof (ACPI_TABLE_DMAR);
+     ACPI_DMTABLE_INFO       *InfoTable;
+     ACPI_DMAR_DEVICE_SCOPE  *ScopeTable;
+     UINT32                  ScopeOffset;
+     UINT8                   *PciPath;
+     UINT32                  PathOffset;
++    UINT16		    SubType;
+ 
+ 
+     /* Main table */
+ 
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDmar);
+     if (ACPI_FAILURE (Status))
+     {
+@@ -542,13 +560,14 @@ AcpiDmDumpDmar (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         /* Common subtable header */
+ 
+         AcpiOsPrintf ("\n");
++	ACPI_MOVE_16_TO_16(&SubLength, &Subtable->Length);
+         Status = AcpiDmDumpTable (Length, Offset, Subtable,
+-            Subtable->Length, AcpiDmTableInfoDmarHdr);
++            SubLength, AcpiDmTableInfoDmarHdr);
+         if (ACPI_FAILURE (Status))
+         {
+             return;
+@@ -556,7 +575,8 @@ AcpiDmDumpDmar (
+ 
+         AcpiOsPrintf ("\n");
+ 
+-        switch (Subtable->Type)
++	ACPI_MOVE_16_TO_16(&SubType, &Subtable->Type);
++        switch (SubType)
+         {
+         case ACPI_DMAR_TYPE_HARDWARE_UNIT:
+ 
+@@ -591,12 +611,12 @@ AcpiDmDumpDmar (
+         default:
+ 
+             AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n",
+-                Subtable->Type);
++                SubType);
+             return;
+         }
+ 
+         Status = AcpiDmDumpTable (Length, Offset, Subtable,
+-            Subtable->Length, InfoTable);
++            SubLength, InfoTable);
+         if (ACPI_FAILURE (Status))
+         {
+             return;
+@@ -605,8 +625,8 @@ AcpiDmDumpDmar (
+         /*
+          * Dump the optional device scope entries
+          */
+-        if ((Subtable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
+-            (Subtable->Type == ACPI_DMAR_TYPE_NAMESPACE))
++        if ((SubType == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
++            (SubType == ACPI_DMAR_TYPE_NAMESPACE))
+         {
+             /* These types do not support device scopes */
+ 
+@@ -614,7 +634,7 @@ AcpiDmDumpDmar (
+         }
+ 
+         ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable, ScopeOffset);
+-        while (ScopeOffset < Subtable->Length)
++        while (ScopeOffset < SubLength)
+         {
+             AcpiOsPrintf ("\n");
+             Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
+@@ -655,9 +675,8 @@ AcpiDmDumpDmar (
+ NextSubtable:
+         /* Point to next subtable */
+ 
+-        Offset += Subtable->Length;
+-        Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Subtable,
+-            Subtable->Length);
++        Offset += SubLength;
++        Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Subtable, SubLength);
+     }
+ }
+ 
+@@ -684,12 +703,15 @@ AcpiDmDumpDrtm (
+     ACPI_DRTM_RESOURCE_LIST *DrtmRl;
+     ACPI_DRTM_DPS_ID        *DrtmDps;
+     UINT32                  Count;
++    UINT32                  ValidatedCount;
++    UINT32                  ResourceCount;
++    UINT32		    Length;
+ 
+ 
+     /* Main table */
+ 
+-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+-        AcpiDmTableInfoDrtm);
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
++    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDrtm);
+     if (ACPI_FAILURE (Status))
+     {
+         return;
+@@ -703,7 +725,7 @@ AcpiDmDumpDrtm (
+ 
+     DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset);
+     AcpiOsPrintf ("\n");
+-    Status = AcpiDmDumpTable (Table->Length, Offset,
++    Status = AcpiDmDumpTable (Length, Offset,
+         DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables),
+         AcpiDmTableInfoDrtm0);
+     if (ACPI_FAILURE (Status))
+@@ -716,10 +738,11 @@ AcpiDmDumpDrtm (
+     /* Dump Validated table addresses */
+ 
+     Count = 0;
+-    while ((Offset < Table->Length) &&
+-            (DrtmVtl->ValidatedTableCount > Count))
++    ACPI_MOVE_32_TO_32(&ValidatedCount, &DrtmVtl->ValidatedTableCount);
++    while ((Offset < Length) &&
++            (ValidatedCount > Count))
+     {
+-        Status = AcpiDmDumpTable (Table->Length, Offset,
++        Status = AcpiDmDumpTable (Length, Offset,
+             ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64),
+             AcpiDmTableInfoDrtm0a);
+         if (ACPI_FAILURE (Status))
+@@ -735,7 +758,7 @@ AcpiDmDumpDrtm (
+ 
+     DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset);
+     AcpiOsPrintf ("\n");
+-    Status = AcpiDmDumpTable (Table->Length, Offset,
++    Status = AcpiDmDumpTable (Length, Offset,
+         DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources),
+         AcpiDmTableInfoDrtm1);
+     if (ACPI_FAILURE (Status))
+@@ -748,10 +771,11 @@ AcpiDmDumpDrtm (
+     /* Dump the Resource List */
+ 
+     Count = 0;
+-    while ((Offset < Table->Length) &&
+-           (DrtmRl->ResourceCount > Count))
++    ACPI_MOVE_32_TO_32(&ResourceCount, &DrtmRl->ResourceCount);
++    while ((Offset < Length) &&
++           (ResourceCount > Count))
+     {
+-        Status = AcpiDmDumpTable (Table->Length, Offset,
++        Status = AcpiDmDumpTable (Length, Offset,
+             ACPI_ADD_PTR (void, Table, Offset),
+             sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a);
+         if (ACPI_FAILURE (Status))
+@@ -767,7 +791,7 @@ AcpiDmDumpDrtm (
+ 
+     DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset);
+     AcpiOsPrintf ("\n");
+-    (void) AcpiDmDumpTable (Table->Length, Offset,
++    (void) AcpiDmDumpTable (Length, Offset,
+         DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2);
+ }
+ 
+@@ -791,12 +815,13 @@ AcpiDmDumpEinj (
+ {
+     ACPI_STATUS             Status;
+     ACPI_WHEA_HEADER        *Subtable;
+-    UINT32                  Length = Table->Length;
++    UINT32                  Length;
+     UINT32                  Offset = sizeof (ACPI_TABLE_EINJ);
+ 
+ 
+     /* Main table */
+ 
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoEinj);
+     if (ACPI_FAILURE (Status))
+     {
+@@ -806,7 +831,7 @@ AcpiDmDumpEinj (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         AcpiOsPrintf ("\n");
+         Status = AcpiDmDumpTable (Length, Offset, Subtable,
+@@ -844,12 +869,13 @@ AcpiDmDumpErst (
+ {
+     ACPI_STATUS             Status;
+     ACPI_WHEA_HEADER        *Subtable;
+-    UINT32                  Length = Table->Length;
++    UINT32                  Length;
+     UINT32                  Offset = sizeof (ACPI_TABLE_ERST);
+ 
+ 
+     /* Main table */
+ 
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoErst);
+     if (ACPI_FAILURE (Status))
+     {
+@@ -859,7 +885,7 @@ AcpiDmDumpErst (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         AcpiOsPrintf ("\n");
+         Status = AcpiDmDumpTable (Length, Offset, Subtable,
+@@ -897,17 +923,19 @@ AcpiDmDumpFpdt (
+ {
+     ACPI_STATUS             Status;
+     ACPI_FPDT_HEADER        *Subtable;
+-    UINT32                  Length = Table->Length;
++    UINT32                  Length;
+     UINT32                  Offset = sizeof (ACPI_TABLE_FPDT);
+     ACPI_DMTABLE_INFO       *InfoTable;
++    UINT16		    Type;
+ 
+ 
+     /* There is no main table (other than the standard ACPI header) */
+ 
+     /* Subtables */
+ 
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+     Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         /* Common subtable header */
+ 
+@@ -919,7 +947,8 @@ AcpiDmDumpFpdt (
+             return;
+         }
+ 
+-        switch (Subtable->Type)
++	ACPI_MOVE_16_TO_16(&Type, &Subtable->Type);
++        switch (Type)
+         {
+         case ACPI_FPDT_TYPE_BOOT:
+ 
+@@ -933,8 +962,7 @@ AcpiDmDumpFpdt (
+ 
+         default:
+ 
+-            AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n",
+-                Subtable->Type);
++            AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", Type);
+ 
+             /* Attempt to continue */
+ 
+@@ -982,16 +1010,19 @@ AcpiDmDumpGtdt (
+ {
+     ACPI_STATUS             Status;
+     ACPI_GTDT_HEADER        *Subtable;
+-    UINT32                  Length = Table->Length;
++    UINT32                  Length;
++    UINT16                  SubLength;
+     UINT32                  Offset = sizeof (ACPI_TABLE_GTDT);
+     ACPI_DMTABLE_INFO       *InfoTable;
+     UINT32                  SubtableLength;
+     UINT32                  GtCount;
++    UINT32                  Tmp32;
+     ACPI_GTDT_TIMER_ENTRY   *GtxTable;
+ 
+ 
+     /* Main table */
+ 
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoGtdt);
+     if (ACPI_FAILURE (Status))
+     {
+@@ -1001,7 +1032,7 @@ AcpiDmDumpGtdt (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         /* Common subtable header */
+ 
+@@ -1019,8 +1050,9 @@ AcpiDmDumpGtdt (
+         case ACPI_GTDT_TYPE_TIMER_BLOCK:
+ 
+             SubtableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
+-            GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
++            Tmp32 = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
+                 Subtable))->TimerCount;
++	    ACPI_MOVE_32_TO_32(&GtCount, &Tmp32);
+ 
+             InfoTable = AcpiDmTableInfoGtdt0;
+             break;
+@@ -1041,8 +1073,9 @@ AcpiDmDumpGtdt (
+             return;
+         }
+ 
++	ACPI_MOVE_16_TO_16(&SubLength, &Subtable->Length);
+         Status = AcpiDmDumpTable (Length, Offset, Subtable,
+-            Subtable->Length, InfoTable);
++            SubLength, InfoTable);
+         if (ACPI_FAILURE (Status))
+         {
+             return;
+@@ -1101,16 +1134,18 @@ AcpiDmDumpHest (
+ {
+     ACPI_STATUS             Status;
+     ACPI_HEST_HEADER        *Subtable;
+-    UINT32                  Length = Table->Length;
++    UINT32                  Length;
+     UINT32                  Offset = sizeof (ACPI_TABLE_HEST);
+     ACPI_DMTABLE_INFO       *InfoTable;
+     UINT32                  SubtableLength;
+     UINT32                  BankCount;
+     ACPI_HEST_IA_ERROR_BANK *BankTable;
++    UINT16		    SubType;
+ 
+ 
+     /* Main table */
+ 
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHest);
+     if (ACPI_FAILURE (Status))
+     {
+@@ -1120,10 +1155,11 @@ AcpiDmDumpHest (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         BankCount = 0;
+-        switch (Subtable->Type)
++	ACPI_MOVE_16_TO_16(&SubType, &Subtable->Type);
++        switch (SubType)
+         {
+         case ACPI_HEST_TYPE_IA32_CHECK:
+ 
+Index: acpica-unix2-20180629/source/common/dmtbdump2.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/common/dmtbdump2.c
++++ acpica-unix2-20180629/source/common/dmtbdump2.c
+@@ -75,15 +75,21 @@ AcpiDmDumpIort (
+     ACPI_IORT_SMMU          *IortSmmu = NULL;
+     UINT32                  Offset;
+     UINT32                  NodeOffset;
++    UINT16		    NodeLength;
+     UINT32                  Length;
+     ACPI_DMTABLE_INFO       *InfoTable;
+     char                    *String;
+     UINT32                  i;
+-
++    UINT32		    TableLen;
++    UINT32		    ItsCount;
++    UINT32		    MappingCount;
++    UINT32		    CtxIntCount;
++    UINT32		    PmuIntCount;
+ 
+     /* Main table */
+ 
+-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIort);
++    ACPI_MOVE_32_TO_32(&TableLen, &Table->Length);
++    Status = AcpiDmDumpTable (TableLen, 0, Table, 0, AcpiDmTableInfoIort);
+     if (ACPI_FAILURE (Status))
+     {
+         return;
+@@ -94,18 +100,19 @@ AcpiDmDumpIort (
+ 
+     /* Dump the OptionalPadding (optional) */
+ 
+-    if (Iort->NodeOffset > Offset)
++    ACPI_MOVE_32_TO_32(&NodeOffset, &Iort->NodeOffset);
++    if (NodeOffset > Offset)
+     {
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Table,
+-            Iort->NodeOffset - Offset, AcpiDmTableInfoIortPad);
++        Status = AcpiDmDumpTable (TableLen, Offset, Table,
++            NodeOffset - Offset, AcpiDmTableInfoIortPad);
+         if (ACPI_FAILURE (Status))
+         {
+             return;
+         }
+     }
+ 
+-    Offset = Iort->NodeOffset;
+-    while (Offset < Table->Length)
++    ACPI_MOVE_32_TO_32(&Offset, &Iort->NodeOffset);
++    while (Offset < TableLen)
+     {
+         /* Common subtable header */
+ 
+@@ -141,7 +148,8 @@ AcpiDmDumpIort (
+         case ACPI_IORT_NODE_PCI_ROOT_COMPLEX:
+ 
+             InfoTable = AcpiDmTableInfoIort2;
+-            Length = IortNode->Length - NodeOffset;
++	    ACPI_MOVE_16_TO_16(&NodeLength, &IortNode->Length);
++            Length = NodeLength - NodeOffset;
+             break;
+ 
+         case ACPI_IORT_NODE_SMMU:
+@@ -154,7 +162,8 @@ AcpiDmDumpIort (
+         case ACPI_IORT_NODE_SMMU_V3:
+ 
+             InfoTable = AcpiDmTableInfoIort4;
+-            Length = IortNode->Length - NodeOffset;
++	    ACPI_MOVE_16_TO_16(&NodeLength, &IortNode->Length);
++            Length = NodeLength - NodeOffset;
+             break;
+ 
+         case ACPI_IORT_NODE_PMCG:
+@@ -170,7 +179,8 @@ AcpiDmDumpIort (
+ 
+             /* Attempt to continue */
+ 
+-            if (!IortNode->Length)
++	    ACPI_MOVE_16_TO_16(&NodeLength, &IortNode->Length);
++            if (!NodeLength)
+             {
+                 AcpiOsPrintf ("Invalid zero length IORT node\n");
+                 return;
+@@ -181,7 +191,7 @@ AcpiDmDumpIort (
+         /* Dump the node subtable header */
+ 
+         AcpiOsPrintf ("\n");
+-        Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
++        Status = AcpiDmDumpTable (TableLen, Offset + NodeOffset,
+             ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+             Length, InfoTable);
+         if (ACPI_FAILURE (Status))
+@@ -201,9 +211,10 @@ AcpiDmDumpIort (
+ 
+             if (IortItsGroup)
+             {
+-                for (i = 0; i < IortItsGroup->ItsCount; i++)
++	        ACPI_MOVE_32_TO_32(&ItsCount, &IortItsGroup->ItsCount);
++                for (i = 0; i < ItsCount; i++)
+                 {
+-                    Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
++                    Status = AcpiDmDumpTable (TableLen, Offset + NodeOffset,
+                         ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+                         4, AcpiDmTableInfoIort0a);
+                     NodeOffset += 4;
+@@ -215,11 +226,11 @@ AcpiDmDumpIort (
+ 
+             /* Dump the Padding (optional) */
+ 
+-            if (IortNode->Length > NodeOffset)
++	    ACPI_MOVE_16_TO_16(&NodeLength, &IortNode->Length);
++            if (NodeLength > NodeOffset)
+             {
+-                Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
+-                    Table, IortNode->Length - NodeOffset,
+-                    AcpiDmTableInfoIort1a);
++                Status = AcpiDmDumpTable (TableLen, Offset + NodeOffset,
++                    Table, NodeLength - NodeOffset, AcpiDmTableInfoIort1a);
+                 if (ACPI_FAILURE (Status))
+                 {
+                     return;
+@@ -236,8 +247,8 @@ AcpiDmDumpIort (
+             if (IortSmmu)
+             {
+                 Length = 2 * sizeof (UINT64);
+-                NodeOffset = IortSmmu->GlobalInterruptOffset;
+-                Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
++                ACPI_MOVE_32_TO_32(&NodeOffset, &IortSmmu->GlobalInterruptOffset);
++                Status = AcpiDmDumpTable (TableLen, Offset + NodeOffset,
+                     ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+                     Length, AcpiDmTableInfoIort3a);
+                 if (ACPI_FAILURE (Status))
+@@ -245,10 +256,11 @@ AcpiDmDumpIort (
+                     return;
+                 }
+ 
+-                NodeOffset = IortSmmu->ContextInterruptOffset;
+-                for (i = 0; i < IortSmmu->ContextInterruptCount; i++)
++                ACPI_MOVE_32_TO_32(&NodeOffset, &IortSmmu->ContextInterruptOffset);
++                ACPI_MOVE_32_TO_32(&CtxIntCount, &IortSmmu->ContextInterruptCount);
++                for (i = 0; i < CtxIntCount; i++)
+                 {
+-                    Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
++                    Status = AcpiDmDumpTable (TableLen, Offset + NodeOffset,
+                         ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+                         8, AcpiDmTableInfoIort3b);
+                     if (ACPI_FAILURE (Status))
+@@ -259,10 +271,11 @@ AcpiDmDumpIort (
+                     NodeOffset += 8;
+                 }
+ 
+-                NodeOffset = IortSmmu->PmuInterruptOffset;
+-                for (i = 0; i < IortSmmu->PmuInterruptCount; i++)
++                ACPI_MOVE_32_TO_32(&NodeOffset, &IortSmmu->PmuInterruptOffset);
++                ACPI_MOVE_32_TO_32(&PmuIntCount, &IortSmmu->PmuInterruptCount);
++                for (i = 0; i < PmuIntCount; i++)
+                 {
+-                    Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
++                    Status = AcpiDmDumpTable (TableLen, Offset + NodeOffset,
+                         ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+                         8, AcpiDmTableInfoIort3c);
+                     if (ACPI_FAILURE (Status))
+@@ -282,12 +295,13 @@ AcpiDmDumpIort (
+ 
+         /* Dump the ID mappings */
+ 
+-        NodeOffset = IortNode->MappingOffset;
+-        for (i = 0; i < IortNode->MappingCount; i++)
++        ACPI_MOVE_32_TO_32(&NodeOffset, &IortNode->MappingOffset);
++        ACPI_MOVE_32_TO_32(&MappingCount, &IortNode->MappingCount);
++        for (i = 0; i < MappingCount; i++)
+         {
+             AcpiOsPrintf ("\n");
+             Length = sizeof (ACPI_IORT_ID_MAPPING);
+-            Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
++            Status = AcpiDmDumpTable (TableLen, Offset + NodeOffset,
+                 ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+                 Length, AcpiDmTableInfoIortMap);
+             if (ACPI_FAILURE (Status))
+@@ -301,8 +315,9 @@ AcpiDmDumpIort (
+ NextSubtable:
+         /* Point to next node subtable */
+ 
+-        Offset += IortNode->Length;
+-        IortNode = ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, IortNode->Length);
++	ACPI_MOVE_16_TO_16(&NodeLength, &IortNode->Length);
++        Offset += NodeLength;
++        IortNode = ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeLength);
+     }
+ }
+ 
+@@ -333,11 +348,14 @@ AcpiDmDumpIvrs (
+     ACPI_IVRS_DE_HEADER     *DeviceEntry;
+     ACPI_IVRS_HEADER        *Subtable;
+     ACPI_DMTABLE_INFO       *InfoTable;
++    UINT32		    Length;
++    UINT16		    SubLength;
+ 
+ 
+     /* Main table */
+ 
+-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIvrs);
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
++    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoIvrs);
+     if (ACPI_FAILURE (Status))
+     {
+         return;
+@@ -346,13 +364,14 @@ AcpiDmDumpIvrs (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         /* Common subtable header */
+ 
+         AcpiOsPrintf ("\n");
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+-            Subtable->Length, AcpiDmTableInfoIvrsHdr);
++        ACPI_MOVE_16_TO_16(&SubLength, &Subtable->Length);
++        Status = AcpiDmDumpTable (Length, Offset, Subtable,
++            SubLength, AcpiDmTableInfoIvrsHdr);
+         if (ACPI_FAILURE (Status))
+         {
+             return;
+@@ -379,7 +398,7 @@ AcpiDmDumpIvrs (
+ 
+             /* Attempt to continue */
+ 
+-            if (!Subtable->Length)
++            if (!SubLength)
+             {
+                 AcpiOsPrintf ("Invalid zero length subtable\n");
+                 return;
+@@ -390,8 +409,8 @@ AcpiDmDumpIvrs (
+         /* Dump the subtable */
+ 
+         AcpiOsPrintf ("\n");
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+-            Subtable->Length, InfoTable);
++        Status = AcpiDmDumpTable (Length, Offset, Subtable,
++            SubLength, InfoTable);
+         if (ACPI_FAILURE (Status))
+         {
+             return;
+@@ -405,7 +424,7 @@ AcpiDmDumpIvrs (
+             DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, Subtable,
+                 sizeof (ACPI_IVRS_HARDWARE));
+ 
+-            while (EntryOffset < (Offset + Subtable->Length))
++            while (EntryOffset < (Offset + SubLength))
+             {
+                 AcpiOsPrintf ("\n");
+                 /*
+@@ -467,7 +486,7 @@ AcpiDmDumpIvrs (
+ 
+                 /* Dump the Device Entry */
+ 
+-                Status = AcpiDmDumpTable (Table->Length, EntryOffset,
++                Status = AcpiDmDumpTable (Length, EntryOffset,
+                     DeviceEntry, EntryLength, InfoTable);
+                 if (ACPI_FAILURE (Status))
+                 {
+@@ -483,8 +502,8 @@ AcpiDmDumpIvrs (
+ NextSubtable:
+         /* Point to next subtable */
+ 
+-        Offset += Subtable->Length;
+-        Subtable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Subtable, Subtable->Length);
++        Offset += SubLength;
++        Subtable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Subtable, SubLength);
+     }
+ }
+ 
+@@ -510,7 +529,7 @@ AcpiDmDumpLpit (
+ {
+     ACPI_STATUS             Status;
+     ACPI_LPIT_HEADER        *Subtable;
+-    UINT32                  Length = Table->Length;
++    UINT32                  Length;
+     UINT32                  Offset = sizeof (ACPI_TABLE_LPIT);
+     ACPI_DMTABLE_INFO       *InfoTable;
+     UINT32                  SubtableLength;
+@@ -518,8 +537,9 @@ AcpiDmDumpLpit (
+ 
+     /* Subtables */
+ 
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+     Subtable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         /* Common subtable header */
+ 
+@@ -583,13 +603,14 @@ AcpiDmDumpMadt (
+ {
+     ACPI_STATUS             Status;
+     ACPI_SUBTABLE_HEADER    *Subtable;
+-    UINT32                  Length = Table->Length;
++    UINT32                  Length;
+     UINT32                  Offset = sizeof (ACPI_TABLE_MADT);
+     ACPI_DMTABLE_INFO       *InfoTable;
+ 
+ 
+     /* Main table */
+ 
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoMadt);
+     if (ACPI_FAILURE (Status))
+     {
+@@ -599,7 +620,7 @@ AcpiDmDumpMadt (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         /* Common subtable header */
+ 
+@@ -745,11 +766,13 @@ AcpiDmDumpMcfg (
+     ACPI_STATUS             Status;
+     UINT32                  Offset = sizeof (ACPI_TABLE_MCFG);
+     ACPI_MCFG_ALLOCATION    *Subtable;
++    UINT32		    Len;
+ 
+ 
+     /* Main table */
+ 
+-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMcfg);
++    ACPI_MOVE_32_TO_32(&Len, &Table->Length);
++    Status = AcpiDmDumpTable (Len, 0, Table, 0, AcpiDmTableInfoMcfg);
+     if (ACPI_FAILURE (Status))
+     {
+         return;
+@@ -758,17 +781,17 @@ AcpiDmDumpMcfg (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Len)
+     {
+-        if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length)
++        if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Len)
+         {
+             AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n",
+-                sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length));
++                sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Len));
+             return;
+         }
+ 
+         AcpiOsPrintf ("\n");
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
++        Status = AcpiDmDumpTable (Len, Offset, Subtable,
+             sizeof (ACPI_MCFG_ALLOCATION), AcpiDmTableInfoMcfg0);
+         if (ACPI_FAILURE (Status))
+         {
+@@ -802,6 +825,7 @@ AcpiDmDumpMpst (
+ {
+     ACPI_STATUS             Status;
+     UINT32                  Offset = sizeof (ACPI_TABLE_MPST);
++    ACPI_TABLE_MPST	    *Mpst;
+     ACPI_MPST_POWER_NODE    *Subtable0;
+     ACPI_MPST_POWER_STATE   *Subtable0A;
+     ACPI_MPST_COMPONENT     *Subtable0B;
+@@ -810,11 +834,13 @@ AcpiDmDumpMpst (
+     UINT16                  SubtableCount;
+     UINT32                  PowerStateCount;
+     UINT32                  ComponentCount;
++    UINT32		    Length;
+ 
+ 
+     /* Main table */
+ 
+-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMpst);
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
++    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoMpst);
+     if (ACPI_FAILURE (Status))
+     {
+         return;
+@@ -822,13 +848,14 @@ AcpiDmDumpMpst (
+ 
+     /* Subtable: Memory Power Node(s) */
+ 
+-    SubtableCount = (ACPI_CAST_PTR (ACPI_TABLE_MPST, Table))->PowerNodeCount;
++    Mpst = ACPI_CAST_PTR (ACPI_TABLE_MPST, Table);
++    ACPI_MOVE_16_TO_16(&SubtableCount, &Mpst->PowerNodeCount);
+     Subtable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Table, Offset);
+ 
+-    while ((Offset < Table->Length) && SubtableCount)
++    while ((Offset < Length) && SubtableCount)
+     {
+         AcpiOsPrintf ("\n");
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable0,
++        Status = AcpiDmDumpTable (Length, Offset, Subtable0,
+             sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0);
+         if (ACPI_FAILURE (Status))
+         {
+@@ -837,8 +864,8 @@ AcpiDmDumpMpst (
+ 
+         /* Extract the sub-subtable counts */
+ 
+-        PowerStateCount = Subtable0->NumPowerStates;
+-        ComponentCount = Subtable0->NumPhysicalComponents;
++        ACPI_MOVE_32_TO_32(&PowerStateCount, &Subtable0->NumPowerStates);
++        ACPI_MOVE_32_TO_32(&ComponentCount, &Subtable0->NumPhysicalComponents);
+         Offset += sizeof (ACPI_MPST_POWER_NODE);
+ 
+         /* Sub-subtables - Memory Power State Structure(s) */
+@@ -849,7 +876,7 @@ AcpiDmDumpMpst (
+         while (PowerStateCount)
+         {
+             AcpiOsPrintf ("\n");
+-            Status = AcpiDmDumpTable (Table->Length, Offset, Subtable0A,
++            Status = AcpiDmDumpTable (Length, Offset, Subtable0A,
+                 sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A);
+             if (ACPI_FAILURE (Status))
+             {
+@@ -859,7 +886,7 @@ AcpiDmDumpMpst (
+             Subtable0A++;
+             PowerStateCount--;
+             Offset += sizeof (ACPI_MPST_POWER_STATE);
+-       }
++        }
+ 
+         /* Sub-subtables - Physical Component ID Structure(s) */
+ 
+@@ -872,7 +899,7 @@ AcpiDmDumpMpst (
+ 
+         while (ComponentCount)
+         {
+-            Status = AcpiDmDumpTable (Table->Length, Offset, Subtable0B,
++            Status = AcpiDmDumpTable (Length, Offset, Subtable0B,
+                 sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B);
+             if (ACPI_FAILURE (Status))
+             {
+@@ -887,17 +914,19 @@ AcpiDmDumpMpst (
+         /* Point to next Memory Power Node subtable */
+ 
+         SubtableCount--;
++        ACPI_MOVE_32_TO_32(&PowerStateCount, &Subtable0->NumPowerStates);
++        ACPI_MOVE_32_TO_32(&ComponentCount, &Subtable0->NumPhysicalComponents);
+         Subtable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Subtable0,
+             sizeof (ACPI_MPST_POWER_NODE) +
+-            (sizeof (ACPI_MPST_POWER_STATE) * Subtable0->NumPowerStates) +
+-            (sizeof (ACPI_MPST_COMPONENT) * Subtable0->NumPhysicalComponents));
++            (sizeof (ACPI_MPST_POWER_STATE) * PowerStateCount) +
++            (sizeof (ACPI_MPST_COMPONENT) * ComponentCount));
+     }
+ 
+     /* Subtable: Count of Memory Power State Characteristic structures */
+ 
+     AcpiOsPrintf ("\n");
+     Subtable1 = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, Subtable0);
+-    Status = AcpiDmDumpTable (Table->Length, Offset, Subtable1,
++    Status = AcpiDmDumpTable (Length, Offset, Subtable1,
+         sizeof (ACPI_MPST_DATA_HDR), AcpiDmTableInfoMpst1);
+     if (ACPI_FAILURE (Status))
+     {
+@@ -912,10 +941,10 @@ AcpiDmDumpMpst (
+     Subtable2 = ACPI_ADD_PTR (ACPI_MPST_POWER_DATA, Subtable1,
+         sizeof (ACPI_MPST_DATA_HDR));
+ 
+-    while ((Offset < Table->Length) && SubtableCount)
++    while ((Offset < Length) && SubtableCount)
+     {
+         AcpiOsPrintf ("\n");
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable2,
++        Status = AcpiDmDumpTable (Length, Offset, Subtable2,
+             sizeof (ACPI_MPST_POWER_DATA), AcpiDmTableInfoMpst2);
+         if (ACPI_FAILURE (Status))
+         {
+@@ -948,11 +977,13 @@ AcpiDmDumpMsct (
+     ACPI_STATUS             Status;
+     UINT32                  Offset = sizeof (ACPI_TABLE_MSCT);
+     ACPI_MSCT_PROXIMITY     *Subtable;
++    UINT32		    Length;
+ 
+ 
+     /* Main table */
+ 
+-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMsct);
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
++    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoMsct);
+     if (ACPI_FAILURE (Status))
+     {
+         return;
+@@ -961,12 +992,12 @@ AcpiDmDumpMsct (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         /* Common subtable header */
+ 
+         AcpiOsPrintf ("\n");
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
++        Status = AcpiDmDumpTable (Length, Offset, Subtable,
+             sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0);
+         if (ACPI_FAILURE (Status))
+         {
+@@ -1001,11 +1032,13 @@ AcpiDmDumpMtmr (
+     ACPI_STATUS             Status;
+     UINT32                  Offset = sizeof (ACPI_TABLE_MTMR);
+     ACPI_MTMR_ENTRY         *Subtable;
++    UINT32		    Length;
+ 
+ 
+     /* Main table */
+ 
+-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMtmr);
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
++    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoMtmr);
+     if (ACPI_FAILURE (Status))
+     {
+         return;
+@@ -1014,12 +1047,12 @@ AcpiDmDumpMtmr (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         /* Common subtable header */
+ 
+         AcpiOsPrintf ("\n");
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
++        Status = AcpiDmDumpTable (Length, Offset, Subtable,
+             sizeof (ACPI_MTMR_ENTRY), AcpiDmTableInfoMtmr0);
+         if (ACPI_FAILURE (Status))
+         {
+@@ -1061,11 +1094,17 @@ AcpiDmDumpNfit (
+     ACPI_NFIT_SMBIOS        *SmbiosInfo = NULL;
+     ACPI_NFIT_FLUSH_ADDRESS *Hint = NULL;
+     UINT32                  i;
++    UINT32                  TableLength;
++    UINT16                  SubLength;
++    UINT16                  SubType;
++    UINT32                  Count;
++    UINT16                  Count16;
+ 
+ 
+     /* Main table */
+ 
+-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoNfit);
++    ACPI_MOVE_32_TO_32(&TableLength, &Table->Length);
++    Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoNfit);
+     if (ACPI_FAILURE (Status))
+     {
+         return;
+@@ -1074,19 +1113,21 @@ AcpiDmDumpNfit (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < TableLength)
+     {
+         /* NFIT subtable header */
+ 
+         AcpiOsPrintf ("\n");
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+-            Subtable->Length, AcpiDmTableInfoNfitHdr);
++	ACPI_MOVE_16_TO_16(&SubLength, &Subtable->Length);
++        Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
++            SubLength, AcpiDmTableInfoNfitHdr);
+         if (ACPI_FAILURE (Status))
+         {
+             return;
+         }
+ 
+-        switch (Subtable->Type)
++	ACPI_MOVE_16_TO_16(&SubType, &Subtable->Type);
++        switch (SubType)
+         {
+         case ACPI_NFIT_TYPE_SYSTEM_ADDRESS:
+ 
+@@ -1143,7 +1184,7 @@ AcpiDmDumpNfit (
+ 
+             /* Attempt to continue */
+ 
+-            if (!Subtable->Length)
++            if (!SubLength)
+             {
+                 AcpiOsPrintf ("Invalid zero length subtable\n");
+                 return;
+@@ -1152,8 +1193,8 @@ AcpiDmDumpNfit (
+         }
+ 
+         AcpiOsPrintf ("\n");
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+-            Subtable->Length, InfoTable);
++        Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
++            SubLength, InfoTable);
+         if (ACPI_FAILURE (Status))
+         {
+             return;
+@@ -1161,13 +1202,14 @@ AcpiDmDumpNfit (
+ 
+         /* Per-subtable variable-length fields */
+ 
+-        switch (Subtable->Type)
++        switch (SubType)
+         {
+         case ACPI_NFIT_TYPE_INTERLEAVE:
+ 
+-            for (i = 0; i < Interleave->LineCount; i++)
++	    ACPI_MOVE_32_TO_32(&Count, &Interleave->LineCount);
++            for (i = 0; i < Count; i++)
+             {
+-                Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
++                Status = AcpiDmDumpTable (TableLength, Offset + FieldOffset,
+                     &Interleave->LineOffset[i],
+                     sizeof (UINT32), AcpiDmTableInfoNfit2a);
+                 if (ACPI_FAILURE (Status))
+@@ -1181,12 +1223,11 @@ AcpiDmDumpNfit (
+ 
+         case ACPI_NFIT_TYPE_SMBIOS:
+ 
+-            Length = Subtable->Length -
+-                sizeof (ACPI_NFIT_SMBIOS) + sizeof (UINT8);
++            Length = SubLength - sizeof (ACPI_NFIT_SMBIOS) + sizeof (UINT8);
+ 
+             if (Length)
+             {
+-                Status = AcpiDmDumpTable (Table->Length,
++                Status = AcpiDmDumpTable (TableLength,
+                     sizeof (ACPI_NFIT_SMBIOS) - sizeof (UINT8),
+                     SmbiosInfo,
+                     Length, AcpiDmTableInfoNfit3a);
+@@ -1200,9 +1241,10 @@ AcpiDmDumpNfit (
+ 
+         case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
+ 
+-            for (i = 0; i < Hint->HintCount; i++)
++	    ACPI_MOVE_16_TO_16(&Count16, &Hint->HintCount);
++            for (i = 0; i < Count16; i++)
+             {
+-                Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
++                Status = AcpiDmDumpTable (TableLength, Offset + FieldOffset,
+                     &Hint->HintAddress[i],
+                     sizeof (UINT64), AcpiDmTableInfoNfit6a);
+                 if (ACPI_FAILURE (Status))
+@@ -1221,8 +1263,8 @@ AcpiDmDumpNfit (
+ NextSubtable:
+         /* Point to next subtable */
+ 
+-        Offset += Subtable->Length;
+-        Subtable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, Subtable, Subtable->Length);
++        Offset += SubLength;
++        Subtable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, Subtable, SubLength);
+     }
+ }
+ 
+@@ -1247,12 +1289,13 @@ AcpiDmDumpPcct (
+     ACPI_STATUS             Status;
+     ACPI_PCCT_SUBSPACE      *Subtable;
+     ACPI_DMTABLE_INFO       *InfoTable;
+-    UINT32                  Length = Table->Length;
++    UINT32                  Length;
+     UINT32                  Offset = sizeof (ACPI_TABLE_PCCT);
+ 
+ 
+     /* Main table */
+ 
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPcct);
+     if (ACPI_FAILURE (Status))
+     {
+@@ -1262,7 +1305,7 @@ AcpiDmDumpPcct (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         /* Common subtable header */
+ 
+@@ -1402,16 +1445,21 @@ AcpiDmDumpPmtt (
+     ACPI_PMTT_HEADER        *MemSubtable;
+     ACPI_PMTT_HEADER        *DimmSubtable;
+     ACPI_PMTT_DOMAIN        *DomainArray;
+-    UINT32                  Length = Table->Length;
++    UINT32                  Length;
+     UINT32                  Offset = sizeof (ACPI_TABLE_PMTT);
+     UINT32                  MemOffset;
+     UINT32                  DimmOffset;
+     UINT32                  DomainOffset;
+-    UINT32                  DomainCount;
++    UINT16                  DomainCount;
++    UINT16		    SubLength;
++    UINT16		    Tmp16;
++    UINT16		    MemLength;
++    UINT16		    DimmLength;
+ 
+ 
+     /* Main table */
+ 
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPmtt);
+     if (ACPI_FAILURE (Status))
+     {
+@@ -1421,13 +1469,14 @@ AcpiDmDumpPmtt (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         /* Common subtable header */
+ 
+         AcpiOsPrintf ("\n");
++        ACPI_MOVE_16_TO_16(&SubLength, &Subtable->Length);
+         Status = AcpiDmDumpTable (Length, Offset, Subtable,
+-            Subtable->Length, AcpiDmTableInfoPmttHdr);
++            SubLength, AcpiDmTableInfoPmttHdr);
+         if (ACPI_FAILURE (Status))
+         {
+             return;
+@@ -1446,7 +1495,7 @@ AcpiDmDumpPmtt (
+         /* Dump the fixed-length portion of the subtable */
+ 
+         Status = AcpiDmDumpTable (Length, Offset, Subtable,
+-            Subtable->Length, AcpiDmTableInfoPmtt0);
++            SubLength, AcpiDmTableInfoPmtt0);
+         if (ACPI_FAILURE (Status))
+         {
+             return;
+@@ -1458,15 +1507,16 @@ AcpiDmDumpPmtt (
+         MemSubtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Subtable,
+             sizeof (ACPI_PMTT_SOCKET));
+ 
+-        while (((Offset + MemOffset) < Table->Length) &&
+-            (MemOffset < Subtable->Length))
++        while (((Offset + MemOffset) < Length) &&
++            (MemOffset < SubLength))
+         {
+             /* Common subtable header */
+ 
+             AcpiOsPrintf ("\n");
++	    ACPI_MOVE_16_TO_16(&MemLength, &MemSubtable->Length);
+             Status = AcpiDmDumpTable (Length,
+                 Offset + MemOffset, MemSubtable,
+-                MemSubtable->Length, AcpiDmTableInfoPmttHdr);
++                MemLength, AcpiDmTableInfoPmttHdr);
+             if (ACPI_FAILURE (Status))
+             {
+                 return;
+@@ -1486,7 +1536,7 @@ AcpiDmDumpPmtt (
+ 
+             Status = AcpiDmDumpTable (Length,
+                 Offset + MemOffset, MemSubtable,
+-                MemSubtable->Length, AcpiDmTableInfoPmtt1);
++                MemLength, AcpiDmTableInfoPmtt1);
+             if (ACPI_FAILURE (Status))
+             {
+                 return;
+@@ -1494,13 +1544,14 @@ AcpiDmDumpPmtt (
+ 
+             /* Walk the variable count of proximity domains */
+ 
+-            DomainCount = ((ACPI_PMTT_CONTROLLER *) MemSubtable)->DomainCount;
++	    Tmp16 = ((ACPI_PMTT_CONTROLLER *) MemSubtable)->DomainCount;
++            ACPI_MOVE_16_TO_16(&DomainCount, &Tmp16);
+             DomainOffset = sizeof (ACPI_PMTT_CONTROLLER);
+             DomainArray = ACPI_ADD_PTR (ACPI_PMTT_DOMAIN, MemSubtable,
+                 sizeof (ACPI_PMTT_CONTROLLER));
+ 
+-            while (((Offset + MemOffset + DomainOffset) < Table->Length) &&
+-                ((MemOffset + DomainOffset) < Subtable->Length) &&
++            while (((Offset + MemOffset + DomainOffset) < Length) &&
++                ((MemOffset + DomainOffset) < SubLength) &&
+                 DomainCount)
+             {
+                 Status = AcpiDmDumpTable (Length,
+@@ -1528,15 +1579,16 @@ AcpiDmDumpPmtt (
+             DimmSubtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, MemSubtable,
+                 DomainOffset);
+ 
+-            while (((Offset + MemOffset + DimmOffset) < Table->Length) &&
+-                (DimmOffset < MemSubtable->Length))
++            while (((Offset + MemOffset + DimmOffset) < Length) &&
++                (DimmOffset < MemLength))
+             {
+                 /* Common subtable header */
+ 
+                 AcpiOsPrintf ("\n");
++		ACPI_MOVE_16_TO_16(&DimmLength, &DimmSubtable->Length);
+                 Status = AcpiDmDumpTable (Length,
+                     Offset + MemOffset + DimmOffset, DimmSubtable,
+-                    DimmSubtable->Length, AcpiDmTableInfoPmttHdr);
++                    DimmLength, AcpiDmTableInfoPmttHdr);
+                 if (ACPI_FAILURE (Status))
+                 {
+                     return;
+@@ -1556,7 +1608,7 @@ AcpiDmDumpPmtt (
+ 
+                 Status = AcpiDmDumpTable (Length,
+                     Offset + MemOffset + DimmOffset, DimmSubtable,
+-                    DimmSubtable->Length, AcpiDmTableInfoPmtt2);
++                    DimmLength, AcpiDmTableInfoPmtt2);
+                 if (ACPI_FAILURE (Status))
+                 {
+                     return;
+@@ -1564,23 +1616,22 @@ AcpiDmDumpPmtt (
+ 
+                 /* Point to next DIMM subtable */
+ 
+-                DimmOffset += DimmSubtable->Length;
++                DimmOffset += DimmLength;
+                 DimmSubtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
+-                    DimmSubtable, DimmSubtable->Length);
++                    DimmSubtable, DimmLength);
+             }
+ 
+             /* Point to next Controller subtable */
+ 
+-            MemOffset += MemSubtable->Length;
++            MemOffset += MemLength;
+             MemSubtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
+-                MemSubtable, MemSubtable->Length);
++                MemSubtable, MemLength);
+         }
+ 
+         /* Point to next Socket subtable */
+ 
+-        Offset += Subtable->Length;
+-        Subtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
+-            Subtable, Subtable->Length);
++        Offset += SubLength;
++        Subtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Subtable, SubLength);
+     }
+ }
+ 
+@@ -1736,6 +1787,8 @@ AcpiDmDumpS3pt (
+     ACPI_FPDT_HEADER        *Subtable;
+     ACPI_DMTABLE_INFO       *InfoTable;
+     ACPI_TABLE_S3PT         *S3ptTable = ACPI_CAST_PTR (ACPI_TABLE_S3PT, Tables);
++    UINT32		    Length;
++    UINT16                  SubType;
+ 
+ 
+     /* Main table */
+@@ -1746,20 +1799,22 @@ AcpiDmDumpS3pt (
+         return 0;
+     }
+ 
++    ACPI_MOVE_32_TO_32(&Length, &S3ptTable->Length);
+     Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, S3ptTable, Offset);
+-    while (Offset < S3ptTable->Length)
++    while (Offset < Length)
+     {
+         /* Common subtable header */
+ 
+         AcpiOsPrintf ("\n");
+-        Status = AcpiDmDumpTable (S3ptTable->Length, Offset, Subtable,
++        Status = AcpiDmDumpTable (Length, Offset, Subtable,
+             Subtable->Length, AcpiDmTableInfoS3ptHdr);
+         if (ACPI_FAILURE (Status))
+         {
+             return 0;
+         }
+ 
+-        switch (Subtable->Type)
++        ACPI_MOVE_16_TO_16(&SubType, &Subtable->Type);
++        switch (SubType)
+         {
+         case ACPI_S3PT_TYPE_RESUME:
+ 
+@@ -1774,7 +1829,7 @@ AcpiDmDumpS3pt (
+         default:
+ 
+             AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n",
+-                Subtable->Type);
++                SubType);
+ 
+             /* Attempt to continue */
+ 
+@@ -1787,7 +1842,7 @@ AcpiDmDumpS3pt (
+         }
+ 
+         AcpiOsPrintf ("\n");
+-        Status = AcpiDmDumpTable (S3ptTable->Length, Offset, Subtable,
++        Status = AcpiDmDumpTable (Length, Offset, Subtable,
+             Subtable->Length, InfoTable);
+         if (ACPI_FAILURE (Status))
+         {
+Index: acpica-unix2-20180629/source/common/dmtbdump3.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/common/dmtbdump3.c
++++ acpica-unix2-20180629/source/common/dmtbdump3.c
+@@ -68,9 +68,11 @@ void
+ AcpiDmDumpSlic (
+     ACPI_TABLE_HEADER       *Table)
+ {
++    UINT32	Length;
+ 
+-    (void) AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table,
+-        Table->Length - sizeof (*Table), AcpiDmTableInfoSlic);
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
++    (void) AcpiDmDumpTable (Length, sizeof (ACPI_TABLE_HEADER), Table,
++        Length - sizeof (*Table), AcpiDmTableInfoSlic);
+ }
+ 
+ 
+@@ -93,14 +95,17 @@ AcpiDmDumpSlit (
+     ACPI_STATUS             Status;
+     UINT32                  Offset;
+     UINT8                   *Row;
+-    UINT32                  Localities;
++    UINT64                  Localities;
+     UINT32                  i;
+     UINT32                  j;
++    UINT32		    Length;
++    UINT64                  Tmp64;
+ 
+ 
+     /* Main table */
+ 
+-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSlit);
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
++    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoSlit);
+     if (ACPI_FAILURE (Status))
+     {
+         return;
+@@ -108,7 +113,8 @@ AcpiDmDumpSlit (
+ 
+     /* Display the Locality NxN Matrix */
+ 
+-    Localities = (UINT32) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount;
++    Tmp64 = (UINT64) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount;
++    ACPI_MOVE_64_TO_64(&Localities, &Tmp64);
+     Offset = ACPI_OFFSET (ACPI_TABLE_SLIT, Entry[0]);
+     Row = (UINT8 *) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->Entry;
+ 
+@@ -121,7 +127,7 @@ AcpiDmDumpSlit (
+         {
+             /* Check for beyond EOT */
+ 
+-            if (Offset >= Table->Length)
++            if (Offset >= Length)
+             {
+                 AcpiOsPrintf (
+                     "\n**** Not enough room in table for all localities\n");
+@@ -173,11 +179,13 @@ AcpiDmDumpSrat (
+     UINT32                  Offset = sizeof (ACPI_TABLE_SRAT);
+     ACPI_SUBTABLE_HEADER    *Subtable;
+     ACPI_DMTABLE_INFO       *InfoTable;
++    UINT32		    Length;
+ 
+ 
+     /* Main table */
+ 
+-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSrat);
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
++    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoSrat);
+     if (ACPI_FAILURE (Status))
+     {
+         return;
+@@ -186,12 +194,12 @@ AcpiDmDumpSrat (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         /* Common subtable header */
+ 
+         AcpiOsPrintf ("\n");
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
++        Status = AcpiDmDumpTable (Length, Offset, Subtable,
+             Subtable->Length, AcpiDmTableInfoSratHdr);
+         if (ACPI_FAILURE (Status))
+         {
+@@ -240,7 +248,7 @@ AcpiDmDumpSrat (
+         }
+ 
+         AcpiOsPrintf ("\n");
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
++        Status = AcpiDmDumpTable (Length, Offset, Subtable,
+             Subtable->Length, InfoTable);
+         if (ACPI_FAILURE (Status))
+         {
+@@ -277,13 +285,14 @@ AcpiDmDumpStao (
+ {
+     ACPI_STATUS             Status;
+     char                    *Namepath;
+-    UINT32                  Length = Table->Length;
++    UINT32                  Length;
+     UINT32                  StringLength;
+     UINT32                  Offset = sizeof (ACPI_TABLE_STAO);
+ 
+ 
+     /* Main table */
+ 
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoStao);
+     if (ACPI_FAILURE (Status))
+     {
+@@ -292,7 +301,7 @@ AcpiDmDumpStao (
+ 
+     /* The rest of the table consists of Namepath strings */
+ 
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         Namepath = ACPI_ADD_PTR (char, Table, Offset);
+         StringLength = strlen (Namepath) + 1;
+@@ -334,11 +343,14 @@ AcpiDmDumpTcpa (
+     ACPI_TABLE_TCPA_HDR     *Subtable = ACPI_ADD_PTR (
+                                 ACPI_TABLE_TCPA_HDR, Table, Offset);
+     ACPI_STATUS             Status;
++    UINT32		    Length;
++    UINT16		    PlatformClass;
+ 
+ 
+     /* Main table */
+ 
+-    Status = AcpiDmDumpTable (Table->Length, 0, Table,
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
++    Status = AcpiDmDumpTable (Length, 0, Table,
+         0, AcpiDmTableInfoTcpaHdr);
+     if (ACPI_FAILURE (Status))
+     {
+@@ -349,18 +361,19 @@ AcpiDmDumpTcpa (
+      * Examine the PlatformClass field to determine the table type.
+      * Either a client or server table. Only one.
+      */
+-    switch (CommonHeader->PlatformClass)
++    ACPI_MOVE_16_TO_16(&PlatformClass, &CommonHeader->PlatformClass);
++    switch (PlatformClass)
+     {
+     case ACPI_TCPA_CLIENT_TABLE:
+ 
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+-            Table->Length - Offset, AcpiDmTableInfoTcpaClient);
++        Status = AcpiDmDumpTable (Length, Offset, Subtable,
++            Length - Offset, AcpiDmTableInfoTcpaClient);
+         break;
+ 
+     case ACPI_TCPA_SERVER_TABLE:
+ 
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+-            Table->Length - Offset, AcpiDmTableInfoTcpaServer);
++        Status = AcpiDmDumpTable (Length, Offset, Subtable,
++            Length - Offset, AcpiDmTableInfoTcpaServer);
+         break;
+ 
+     default:
+@@ -455,11 +468,13 @@ AcpiDmDumpVrtc (
+     ACPI_STATUS             Status;
+     UINT32                  Offset = sizeof (ACPI_TABLE_VRTC);
+     ACPI_VRTC_ENTRY         *Subtable;
++    UINT32		    Length;
+ 
+ 
+     /* Main table */
+ 
+-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoVrtc);
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
++    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoVrtc);
+     if (ACPI_FAILURE (Status))
+     {
+         return;
+@@ -468,12 +483,12 @@ AcpiDmDumpVrtc (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         /* Common subtable header */
+ 
+         AcpiOsPrintf ("\n");
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
++        Status = AcpiDmDumpTable (Length, Offset, Subtable,
+             sizeof (ACPI_VRTC_ENTRY), AcpiDmTableInfoVrtc0);
+         if (ACPI_FAILURE (Status))
+         {
+@@ -508,11 +523,13 @@ AcpiDmDumpWdat (
+     ACPI_STATUS             Status;
+     UINT32                  Offset = sizeof (ACPI_TABLE_WDAT);
+     ACPI_WDAT_ENTRY         *Subtable;
++    UINT32		    Length;
+ 
+ 
+     /* Main table */
+ 
+-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoWdat);
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
++    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoWdat);
+     if (ACPI_FAILURE (Status))
+     {
+         return;
+@@ -521,12 +538,12 @@ AcpiDmDumpWdat (
+     /* Subtables */
+ 
+     Subtable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset);
+-    while (Offset < Table->Length)
++    while (Offset < Length)
+     {
+         /* Common subtable header */
+ 
+         AcpiOsPrintf ("\n");
+-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
++        Status = AcpiDmDumpTable (Length, Offset, Subtable,
+             sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0);
+         if (ACPI_FAILURE (Status))
+         {
+@@ -561,12 +578,13 @@ AcpiDmDumpWpbt (
+ {
+     ACPI_STATUS             Status;
+     ACPI_TABLE_WPBT         *Subtable;
+-    UINT32                  Length = Table->Length;
++    UINT32                  Length;
+     UINT16                  ArgumentsLength;
+ 
+ 
+     /* Dump the main table */
+ 
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoWpbt);
+     if (ACPI_FAILURE (Status))
+     {
+@@ -576,10 +594,10 @@ AcpiDmDumpWpbt (
+     /* Extract the arguments buffer length from the main table */
+ 
+     Subtable = ACPI_CAST_PTR (ACPI_TABLE_WPBT, Table);
+-    ArgumentsLength = Subtable->ArgumentsLength;
++    ACPI_MOVE_16_TO_16(&ArgumentsLength, &Subtable->ArgumentsLength);
+ 
+     /* Dump the arguments buffer */
+ 
+-    (void) AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength,
++    (void) AcpiDmDumpTable (Length, 0, Table, ArgumentsLength,
+         AcpiDmTableInfoWpbt0);
+ }
+Index: acpica-unix2-20180629/source/compiler/dtfield.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/compiler/dtfield.c
++++ acpica-unix2-20180629/source/compiler/dtfield.c
+@@ -359,7 +359,27 @@ DtCompileInteger (
+         DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer);
+     }
+ 
+-    memcpy (Buffer, &Value, ByteLength);
++    switch (ByteLength) {
++    case 1:
++	ACPI_MOVE_64_TO_8(Buffer, &Value);
++	break;
++
++    case 2:
++	ACPI_MOVE_64_TO_16(Buffer, &Value);
++	break;
++
++    case 4:
++	ACPI_MOVE_64_TO_32(Buffer, &Value);
++	break;
++
++    case 8:
++	ACPI_MOVE_64_TO_64(Buffer, &Value);
++	break;
++
++    default:
++	memcpy (Buffer, &Value, ByteLength);
++	break;
++    }
+     return;
+ }
+ 
+Index: acpica-unix2-20180629/source/compiler/dtsubtable.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/compiler/dtsubtable.c
++++ acpica-unix2-20180629/source/compiler/dtsubtable.c
+@@ -378,6 +378,21 @@ DtSetSubtableLength (
+         return;
+     }
+ 
+-    memcpy (Subtable->LengthField, &Subtable->TotalLength,
+-        Subtable->SizeOfLengthField);
++    switch(Subtable->SizeOfLengthField) {
++    case 1:
++	ACPI_MOVE_32_TO_8(Subtable->LengthField, &Subtable->TotalLength);
++	break;
++
++    case 2:
++	ACPI_MOVE_32_TO_16(Subtable->LengthField, &Subtable->TotalLength);
++	break;
++
++    case 4:
++	ACPI_MOVE_32_TO_32(Subtable->LengthField, &Subtable->TotalLength);
++	break;
++
++    default:
++    	memcpy (Subtable->LengthField, &Subtable->TotalLength,
++        	Subtable->SizeOfLengthField);
++    }
+ }
+Index: acpica-unix2-20180629/source/compiler/dttable1.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/compiler/dttable1.c
++++ acpica-unix2-20180629/source/compiler/dttable1.c
+@@ -281,6 +281,8 @@ DtCompileCsrt (
+     DT_FIELD                **PFieldList = (DT_FIELD **) List;
+     UINT32                  DescriptorCount;
+     UINT32                  GroupLength;
++    ACPI_CSRT_GROUP	    *Pgrp;
++    UINT32		    Tmp32;
+ 
+ 
+     /* Subtables (Resource Groups) */
+@@ -299,12 +301,20 @@ DtCompileCsrt (
+ 
+         /* Compute the number of resource descriptors */
+ 
++	/*
+         GroupLength =
+             (ACPI_CAST_PTR (ACPI_CSRT_GROUP,
+                 Subtable->Buffer))->Length -
+             (ACPI_CAST_PTR (ACPI_CSRT_GROUP,
+                 Subtable->Buffer))->SharedInfoLength -
+             sizeof (ACPI_CSRT_GROUP);
++	*/
++	Pgrp = ACPI_CAST_PTR(ACPI_CSRT_GROUP, Subtable->Buffer);
++	ACPI_MOVE_32_TO_32(&Tmp32, &Pgrp->Length);
++	GroupLength = Tmp32;
++	ACPI_MOVE_32_TO_32(&Tmp32, &Pgrp->SharedInfoLength);
++	GroupLength -= Tmp32;
++        GroupLength -= sizeof (ACPI_CSRT_GROUP);
+ 
+         DescriptorCount = (GroupLength  /
+             sizeof (ACPI_CSRT_DESCRIPTOR));
+@@ -392,6 +402,8 @@ DtCompileDbg2 (
+     ACPI_DBG2_DEVICE        *DeviceInfo;
+     UINT16                  CurrentOffset;
+     UINT32                  i;
++    UINT16                  Tmp16;
++    UINT32                  Tmp32;
+ 
+ 
+     /* Main table */
+@@ -408,10 +420,11 @@ DtCompileDbg2 (
+     /* Main table fields */
+ 
+     Dbg2Header = ACPI_CAST_PTR (ACPI_DBG2_HEADER, Subtable->Buffer);
+-    Dbg2Header->InfoOffset = sizeof (ACPI_TABLE_HEADER) + ACPI_PTR_DIFF (
++    Tmp32 = sizeof (ACPI_TABLE_HEADER) + ACPI_PTR_DIFF (
+         ACPI_ADD_PTR (UINT8, Dbg2Header, sizeof (ACPI_DBG2_HEADER)), Dbg2Header);
++    ACPI_MOVE_32_TO_32(&Dbg2Header->InfoOffset, &Tmp32);
+ 
+-    SubtableCount = Dbg2Header->InfoCount;
++    ACPI_MOVE_32_TO_32(&SubtableCount, &Dbg2Header->InfoCount);
+     DtPushSubtable (Subtable);
+ 
+     /* Process all Device Information subtables (Count = InfoCount) */
+@@ -438,7 +451,7 @@ DtCompileDbg2 (
+ 
+         /* BaseAddressRegister GAS array (Required, size is RegisterCount) */
+ 
+-        DeviceInfo->BaseAddressOffset = CurrentOffset;
++        ACPI_MOVE_16_TO_16(&DeviceInfo->BaseAddressOffset, &CurrentOffset);
+         for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
+         {
+             Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Addr,
+@@ -454,7 +467,7 @@ DtCompileDbg2 (
+ 
+         /* AddressSize array (Required, size = RegisterCount) */
+ 
+-        DeviceInfo->AddressSizeOffset = CurrentOffset;
++        ACPI_MOVE_16_TO_16(&DeviceInfo->AddressSizeOffset, &CurrentOffset);
+         for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
+         {
+             Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Size,
+@@ -470,7 +483,7 @@ DtCompileDbg2 (
+ 
+         /* NamespaceString device identifier (Required, size = NamePathLength) */
+ 
+-        DeviceInfo->NamepathOffset = CurrentOffset;
++        ACPI_MOVE_16_TO_16(&DeviceInfo->NamepathOffset, &CurrentOffset);
+         Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Name,
+             &Subtable);
+         if (ACPI_FAILURE (Status))
+@@ -480,8 +493,9 @@ DtCompileDbg2 (
+ 
+         /* Update the device info header */
+ 
+-        DeviceInfo->NamepathLength = (UINT16) Subtable->Length;
+-        CurrentOffset += (UINT16) DeviceInfo->NamepathLength;
++        ACPI_MOVE_32_TO_16(&DeviceInfo->NamepathLength, &Subtable->Length);
++        ACPI_MOVE_16_TO_16(&Tmp16, &DeviceInfo->NamepathLength);
++        CurrentOffset += Tmp16;
+         DtInsertSubtable (ParentTable, Subtable);
+ 
+         /* OemData - Variable-length data (Optional, size = OemDataLength) */
+@@ -508,8 +522,8 @@ DtCompileDbg2 (
+ 
+         if (Subtable && Subtable->Length)
+         {
+-            DeviceInfo->OemDataOffset = CurrentOffset;
+-            DeviceInfo->OemDataLength = (UINT16) Subtable->Length;
++            ACPI_MOVE_16_TO_16(&DeviceInfo->OemDataOffset, &CurrentOffset);
++            ACPI_MOVE_32_TO_16(&DeviceInfo->OemDataLength, &Subtable->Length);
+ 
+             DtInsertSubtable (ParentTable, Subtable);
+         }
+@@ -549,6 +563,8 @@ DtCompileDmar (
+     ACPI_DMAR_DEVICE_SCOPE  *DmarDeviceScope;
+     UINT32                  DeviceScopeLength;
+     UINT32                  PciPathLength;
++    UINT16		    Tmp16;
++    UINT16		    HdrType;
+ 
+ 
+     Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmar, &Subtable);
+@@ -578,8 +594,11 @@ DtCompileDmar (
+         DtPushSubtable (Subtable);
+ 
+         DmarHeader = ACPI_CAST_PTR (ACPI_DMAR_HEADER, Subtable->Buffer);
++	ACPI_MOVE_16_TO_16(&Tmp16, &DmarHeader->Length);
++	DmarHeader->Length = Tmp16;
+ 
+-        switch (DmarHeader->Type)
++	ACPI_MOVE_16_TO_16(&HdrType, &DmarHeader->Type);
++        switch (HdrType)
+         {
+         case ACPI_DMAR_TYPE_HARDWARE_UNIT:
+ 
+@@ -626,8 +645,8 @@ DtCompileDmar (
+         /*
+          * Optional Device Scope subtables
+          */
+-        if ((DmarHeader->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
+-            (DmarHeader->Type == ACPI_DMAR_TYPE_NAMESPACE))
++        if ((HdrType == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
++            (HdrType == ACPI_DMAR_TYPE_NAMESPACE))
+         {
+             /* These types do not support device scopes */
+ 
+@@ -637,7 +656,7 @@ DtCompileDmar (
+ 
+         DtPushSubtable (Subtable);
+         DeviceScopeLength = DmarHeader->Length - Subtable->Length -
+-            ParentTable->Length;
++		ParentTable->Length;
+         while (DeviceScopeLength)
+         {
+             Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarScope,
+@@ -762,7 +781,7 @@ DtCompileDrtm (
+         Count++;
+     }
+ 
+-    DrtmVtl->ValidatedTableCount = Count;
++    ACPI_MOVE_32_TO_32(&DrtmVtl->ValidatedTableCount, &Count);
+     DtPopSubtable ();
+     ParentTable = DtPeekSubtable ();
+ 
+@@ -800,7 +819,7 @@ DtCompileDrtm (
+         Count++;
+     }
+ 
+-    DrtmRl->ResourceCount = Count;
++    ACPI_MOVE_32_TO_32(&DrtmRl->ResourceCount, &Count);
+     DtPopSubtable ();
+     ParentTable = DtPeekSubtable ();
+ 
+@@ -894,6 +913,7 @@ DtCompileGtdt (
+     ACPI_SUBTABLE_HEADER    *GtdtHeader;
+     ACPI_DMTABLE_INFO       *InfoTable;
+     UINT32                  GtCount;
++    ACPI_GTDT_TIMER_BLOCK   *TimerBlock;
+ 
+ 
+     Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt,
+@@ -960,8 +980,9 @@ DtCompileGtdt (
+             DtPushSubtable (Subtable);
+             ParentTable = DtPeekSubtable ();
+ 
+-            GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
+-                Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
++	    TimerBlock = ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
++                Subtable->Buffer - sizeof(ACPI_GTDT_HEADER));
++	    ACPI_MOVE_32_TO_32(&GtCount, &TimerBlock->TimerCount);
+ 
+             while (GtCount)
+             {
+@@ -1014,6 +1035,7 @@ DtCompileFpdt (
+     ACPI_DMTABLE_INFO       *InfoTable;
+     DT_FIELD                **PFieldList = (DT_FIELD **) List;
+     DT_FIELD                *SubtableStart;
++    UINT16		    HdrType;
+ 
+ 
+     while (*PFieldList)
+@@ -1032,7 +1054,8 @@ DtCompileFpdt (
+ 
+         FpdtHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
+ 
+-        switch (FpdtHeader->Type)
++	ACPI_MOVE_16_TO_16(&HdrType, &FpdtHeader->Type);
++        switch (HdrType)
+         {
+         case ACPI_FPDT_TYPE_BOOT:
+ 
+@@ -1090,6 +1113,7 @@ DtCompileHest (
+     ACPI_DMTABLE_INFO       *InfoTable;
+     UINT16                  Type;
+     UINT32                  BankCount;
++    UINT16		    Tmp16;
+ 
+ 
+     Status = DtCompileTable (PFieldList, AcpiDmTableInfoHest,
+@@ -1107,8 +1131,9 @@ DtCompileHest (
+         /* Get subtable type */
+ 
+         SubtableStart = *PFieldList;
+-        DtCompileInteger ((UINT8 *) &Type, *PFieldList, 2, 0);
++        DtCompileInteger ((UINT8 *) &Tmp16, *PFieldList, 2, 0);
+ 
++	ACPI_MOVE_16_TO_16(&Type, &Tmp16);
+         switch (Type)
+         {
+         case ACPI_HEST_TYPE_IA32_CHECK:
+@@ -1458,11 +1483,13 @@ DtCompileIort (
+     ACPI_IORT_SMMU          *IortSmmu;
+     UINT32                  NodeNumber;
+     UINT32                  NodeLength;
++    UINT32                  NodeOffset;
+     UINT32                  IdMappingNumber;
+     UINT32                  ItsNumber;
+     UINT32                  ContextIrptNumber;
+     UINT32                  PmuIrptNumber;
+     UINT32                  PaddingLength;
++    UINT32                  MappingOffset;
+ 
+ 
+     ParentTable = DtPeekSubtable ();
+@@ -1488,7 +1515,7 @@ DtCompileIort (
+      * Optionally allows the generic data types to be used for filling
+      * this field.
+      */
+-    Iort->NodeOffset = sizeof (ACPI_TABLE_IORT);
++    NodeOffset = sizeof (ACPI_TABLE_IORT);
+     Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortPad,
+         &Subtable);
+     if (ACPI_FAILURE (Status))
+@@ -1498,7 +1525,7 @@ DtCompileIort (
+     if (Subtable)
+     {
+         DtInsertSubtable (ParentTable, Subtable);
+-        Iort->NodeOffset += Subtable->Length;
++        NodeOffset += Subtable->Length;
+     }
+     else
+     {
+@@ -1508,8 +1535,9 @@ DtCompileIort (
+         {
+             return (Status);
+         }
+-        Iort->NodeOffset += PaddingLength;
++        NodeOffset += PaddingLength;
+     }
++    ACPI_MOVE_32_TO_32(&Iort->NodeOffset, &NodeOffset);
+ 
+     NodeNumber = 0;
+     while (*PFieldList)
+@@ -1563,7 +1591,7 @@ DtCompileIort (
+                 ItsNumber++;
+             }
+ 
+-            IortItsGroup->ItsCount = ItsNumber;
++            ACPI_MOVE_32_TO_32(&IortItsGroup->ItsCount, &ItsNumber);
+             break;
+ 
+         case ACPI_IORT_NODE_NAMED_COMPONENT:
+@@ -1597,15 +1625,16 @@ DtCompileIort (
+             }
+             else
+             {
+-                if (NodeLength > IortNode->MappingOffset)
++		ACPI_MOVE_32_TO_32(&MappingOffset, &IortNode->MappingOffset);
++                if (NodeLength > MappingOffset)
+                 {
+                     return (AE_BAD_DATA);
+                 }
+ 
+-                if (NodeLength < IortNode->MappingOffset)
++                if (NodeLength < MappingOffset)
+                 {
+                     Status = DtCompilePadding (
+-                        IortNode->MappingOffset - NodeLength,
++                        MappingOffset - NodeLength,
+                         &Subtable);
+                     if (ACPI_FAILURE (Status))
+                     {
+@@ -1613,7 +1642,8 @@ DtCompileIort (
+                     }
+ 
+                     DtInsertSubtable (ParentTable, Subtable);
+-                    NodeLength = IortNode->MappingOffset;
++		    ACPI_MOVE_32_TO_32(&MappingOffset, &IortNode->MappingOffset);
++                    NodeLength = MappingOffset;
+                 }
+             }
+             break;
+@@ -1646,7 +1676,7 @@ DtCompileIort (
+ 
+             /* Compile global interrupt array */
+ 
+-            IortSmmu->GlobalInterruptOffset = NodeLength;
++            ACPI_MOVE_32_TO_32(&IortSmmu->GlobalInterruptOffset, &NodeLength);
+             Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3a,
+                 &Subtable);
+             if (ACPI_FAILURE (Status))
+@@ -1660,7 +1690,7 @@ DtCompileIort (
+             /* Compile context interrupt array */
+ 
+             ContextIrptNumber = 0;
+-            IortSmmu->ContextInterruptOffset = NodeLength;
++            ACPI_MOVE_32_TO_32(&IortSmmu->ContextInterruptOffset, &NodeLength);
+             while (*PFieldList)
+             {
+                 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3b,
+@@ -1680,12 +1710,12 @@ DtCompileIort (
+                 ContextIrptNumber++;
+             }
+ 
+-            IortSmmu->ContextInterruptCount = ContextIrptNumber;
++            ACPI_MOVE_32_TO_32(&IortSmmu->ContextInterruptCount, &ContextIrptNumber);
+ 
+             /* Compile PMU interrupt array */
+ 
+             PmuIrptNumber = 0;
+-            IortSmmu->PmuInterruptOffset = NodeLength;
++            ACPI_MOVE_32_TO_32(&IortSmmu->PmuInterruptOffset, &NodeLength);
+             while (*PFieldList)
+             {
+                 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3c,
+@@ -1705,7 +1735,7 @@ DtCompileIort (
+                 PmuIrptNumber++;
+             }
+ 
+-            IortSmmu->PmuInterruptCount = PmuIrptNumber;
++            ACPI_MOVE_32_TO_32(&IortSmmu->PmuInterruptCount, &PmuIrptNumber);
+             break;
+ 
+         case ACPI_IORT_NODE_SMMU_V3:
+@@ -1742,7 +1772,7 @@ DtCompileIort (
+ 
+         /* Compile Array of ID mappings */
+ 
+-        IortNode->MappingOffset = NodeLength;
++        ACPI_MOVE_32_TO_32(&IortNode->MappingOffset, &NodeLength);
+         IdMappingNumber = 0;
+         while (*PFieldList)
+         {
+@@ -1763,7 +1793,7 @@ DtCompileIort (
+             IdMappingNumber++;
+         }
+ 
+-        IortNode->MappingCount = IdMappingNumber;
++        ACPI_MOVE_32_TO_32(&IortNode->MappingCount, &IdMappingNumber);
+         if (!IdMappingNumber)
+         {
+             IortNode->MappingOffset = 0;
+@@ -1778,7 +1808,7 @@ DtCompileIort (
+         NodeNumber++;
+     }
+ 
+-    Iort->NodeCount = NodeNumber;
++    ACPI_MOVE_32_TO_32(&Iort->NodeCount, &NodeNumber);
+     return (AE_OK);
+ }
+ 
+Index: acpica-unix2-20180629/source/compiler/dttable2.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/compiler/dttable2.c
++++ acpica-unix2-20180629/source/compiler/dttable2.c
+@@ -345,7 +345,7 @@ DtCompileMpst (
+     DtPushSubtable (Subtable);
+ 
+     MpstChannelInfo = ACPI_CAST_PTR (ACPI_MPST_CHANNEL, Subtable->Buffer);
+-    SubtableCount = MpstChannelInfo->PowerNodeCount;
++    ACPI_MOVE_16_TO_16(&SubtableCount, &MpstChannelInfo->PowerNodeCount);
+ 
+     while (*PFieldList && SubtableCount)
+     {
+@@ -363,8 +363,8 @@ DtCompileMpst (
+         DtPushSubtable (Subtable);
+ 
+         MpstPowerNode = ACPI_CAST_PTR (ACPI_MPST_POWER_NODE, Subtable->Buffer);
+-        PowerStateCount = MpstPowerNode->NumPowerStates;
+-        ComponentCount = MpstPowerNode->NumPhysicalComponents;
++        ACPI_MOVE_32_TO_32(&PowerStateCount, &MpstPowerNode->NumPowerStates);
++        ACPI_MOVE_32_TO_32(&ComponentCount, &MpstPowerNode->NumPhysicalComponents);
+ 
+         ParentTable = DtPeekSubtable ();
+ 
+@@ -517,6 +517,7 @@ DtCompileNfit (
+     UINT32                  Count;
+     ACPI_NFIT_INTERLEAVE    *Interleave = NULL;
+     ACPI_NFIT_FLUSH_ADDRESS *Hint = NULL;
++    UINT16		    SubType;
+ 
+ 
+     /* Main table */
+@@ -550,7 +551,8 @@ DtCompileNfit (
+ 
+         NfitHeader = ACPI_CAST_PTR (ACPI_NFIT_HEADER, Subtable->Buffer);
+ 
+-        switch (NfitHeader->Type)
++	ACPI_MOVE_16_TO_16(&SubType, &NfitHeader->Type);
++        switch (SubType)
+         {
+         case ACPI_NFIT_TYPE_SYSTEM_ADDRESS:
+ 
+@@ -610,7 +612,7 @@ DtCompileNfit (
+         DtInsertSubtable (ParentTable, Subtable);
+         DtPopSubtable ();
+ 
+-        switch (NfitHeader->Type)
++        switch (SubType)
+         {
+         case ACPI_NFIT_TYPE_INTERLEAVE:
+ 
+@@ -636,7 +638,7 @@ DtCompileNfit (
+                 Count++;
+             }
+ 
+-            Interleave->LineCount = Count;
++            ACPI_MOVE_32_TO_32(&Interleave->LineCount, &Count);
+             break;
+ 
+         case ACPI_NFIT_TYPE_SMBIOS:
+@@ -681,7 +683,7 @@ DtCompileNfit (
+                 Count++;
+             }
+ 
+-            Hint->HintCount = (UINT16) Count;
++            ACPI_MOVE_32_TO_16(&Hint->HintCount, &Count);
+             break;
+ 
+         default:
+@@ -957,7 +959,7 @@ DtCompilePmtt (
+ 
+             PmttController = ACPI_CAST_PTR (ACPI_PMTT_CONTROLLER,
+                 (Subtable->Buffer - sizeof (ACPI_PMTT_HEADER)));
+-            DomainCount = PmttController->DomainCount;
++            ACPI_MOVE_16_TO_16(&DomainCount, &PmttController->DomainCount);
+ 
+             while (DomainCount)
+             {
+@@ -1177,6 +1179,7 @@ DtCompileS3pt (
+     DT_SUBTABLE             *ParentTable;
+     ACPI_DMTABLE_INFO       *InfoTable;
+     DT_FIELD                *SubtableStart;
++    UINT16		    HdrType;
+ 
+ 
+     Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3pt,
+@@ -1204,7 +1207,8 @@ DtCompileS3pt (
+ 
+         S3ptHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
+ 
+-        switch (S3ptHeader->Type)
++	ACPI_MOVE_16_TO_16(&HdrType, &S3ptHeader->Type);
++        switch (HdrType)
+         {
+         case ACPI_S3PT_TYPE_RESUME:
+ 
+@@ -1514,6 +1518,7 @@ DtCompileSlit (
+     DT_FIELD                *FieldList;
+     UINT32                  Localities;
+     UINT8                   *LocalityBuffer;
++    UINT32		    Tmp;
+ 
+ 
+     Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlit,
+@@ -1526,7 +1531,8 @@ DtCompileSlit (
+     ParentTable = DtPeekSubtable ();
+     DtInsertSubtable (ParentTable, Subtable);
+ 
+-    Localities = *ACPI_CAST_PTR (UINT32, Subtable->Buffer);
++    Tmp = *ACPI_CAST_PTR (UINT32, Subtable->Buffer);
++    ACPI_MOVE_32_TO_32(&Localities, &Tmp);
+     LocalityBuffer = UtLocalCalloc (Localities);
+ 
+     /* Compile each locality buffer */
+@@ -1720,6 +1726,7 @@ DtCompileTcpa (
+     ACPI_TABLE_TCPA_HDR     *TcpaHeader;
+     DT_SUBTABLE             *ParentTable;
+     ACPI_STATUS             Status;
++    UINT16		    PlatClass;
+ 
+ 
+     /* Compile the main table */
+@@ -1740,7 +1747,8 @@ DtCompileTcpa (
+      */
+     TcpaHeader = ACPI_CAST_PTR (ACPI_TABLE_TCPA_HDR, ParentTable->Buffer);
+ 
+-    switch (TcpaHeader->PlatformClass)
++    ACPI_MOVE_16_TO_16(&PlatClass, &TcpaHeader->PlatformClass);
++    switch (PlatClass)
+     {
+     case ACPI_TCPA_CLIENT_TABLE:
+ 
+@@ -2039,6 +2047,9 @@ DtCompileWpbt (
+     ACPI_TABLE_WPBT         *Table;
+     ACPI_STATUS             Status;
+     UINT16                  Length;
++    UINT16                  Tmp16;
++    UINT16		    *Ptr16;
++    UINT32		    ii;
+ 
+ 
+     /* Compile the main table */
+@@ -2066,7 +2077,16 @@ DtCompileWpbt (
+ 
+     Length = (UINT16) Subtable->TotalLength;
+     Table = ACPI_CAST_PTR (ACPI_TABLE_WPBT, ParentTable->Buffer);
+-    Table->ArgumentsLength = Length;
++    ACPI_MOVE_16_TO_16(&Table->ArgumentsLength, &Length);
++
++    /* The arguments are in Unicode, so make sure the byte order is correct */
++    Ptr16 = (UINT16 *)Subtable->Buffer;
++    for (ii = 0; ii < Length; ii++)
++    {
++	ACPI_MOVE_16_TO_16(&Tmp16, Ptr16);
++	*Ptr16 = Tmp16;
++        Ptr16++;
++    }
+ 
+     ParentTable = DtPeekSubtable ();
+     DtInsertSubtable (ParentTable, Subtable);
+Index: acpica-unix2-20180629/source/components/disassembler/dmbuffer.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/disassembler/dmbuffer.c
++++ acpica-unix2-20180629/source/components/disassembler/dmbuffer.c
+@@ -204,7 +204,7 @@ AcpiDmByteList (
+ 
+ 
+     ByteData = Op->Named.Data;
+-    ByteCount = (UINT32) Op->Common.Value.Integer;
++    ByteCount = (UINT32) Op->Common.Value.Size;
+ 
+     /*
+      * The byte list belongs to a buffer, and can be produced by either
+@@ -304,7 +304,8 @@ AcpiDmIsUuidBuffer (
+     /* Extract the byte list info */
+ 
+     ByteData = NextOp->Named.Data;
+-    ByteCount = (UINT32) NextOp->Common.Value.Integer;
++    /* ByteCount = (UINT32) NextOp->Common.Value.Integer; */
++    ByteCount = (UINT32) NextOp->Common.Value.Size;
+ 
+     /* Byte count must be exactly 16 */
+ 
+@@ -424,7 +425,8 @@ AcpiDmIsUnicodeBuffer (
+     /* Extract the byte list info */
+ 
+     ByteData = NextOp->Named.Data;
+-    ByteCount = (UINT32) NextOp->Common.Value.Integer;
++    /* ByteCount = (UINT32) NextOp->Common.Value.Integer; */
++    ByteCount = (UINT32) NextOp->Common.Value.Size;
+     WordCount = ACPI_DIV_2 (ByteCount);
+ 
+     /*
+@@ -852,19 +854,22 @@ AcpiDmUnicode (
+     UINT32                  WordCount;
+     UINT32                  i;
+     int                     OutputValue;
++    UINT16		    Tmp16;
+ 
+ 
+     /* Extract the buffer info as a WORD buffer */
+ 
+     WordData = ACPI_CAST_PTR (UINT16, Op->Named.Data);
+-    WordCount = ACPI_DIV_2 (((UINT32) Op->Common.Value.Integer));
++    WordCount = ACPI_DIV_2 (((UINT32) Op->Common.Value.Size));
+ 
+     /* Write every other byte as an ASCII character */
+ 
+     AcpiOsPrintf ("\"");
+     for (i = 0; i < (WordCount - 1); i++)
+     {
+-        OutputValue = (int) WordData[i];
++        /* OutputValue = (int) WordData[i]; */
++	ACPI_MOVE_16_TO_16(&Tmp16, &WordData[i]);
++	OutputValue = (int) Tmp16;
+ 
+         /* Handle values that must be escaped */
+ 
+@@ -973,16 +978,18 @@ AcpiDmCheckForHardwareId (
+     ACPI_PARSE_OBJECT       *Op)
+ {
+     UINT32                  Name;
++    UINT32                  TmpName;
+     ACPI_PARSE_OBJECT       *NextOp;
+ 
+ 
+     /* Get the NameSegment */
+ 
+-    Name = AcpiPsGetName (Op);
+-    if (!Name)
++    TmpName = AcpiPsGetName (Op);
++    if (!TmpName)
+     {
+         return;
+     }
++    ACPI_MOVE_32_TO_32(&Name, &TmpName);
+ 
+     NextOp = AcpiPsGetDepthNext (NULL, Op);
+     if (!NextOp)
+Index: acpica-unix2-20180629/source/components/disassembler/dmopcode.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/disassembler/dmopcode.c
++++ acpica-unix2-20180629/source/components/disassembler/dmopcode.c
+@@ -244,6 +244,7 @@ AcpiDmPredefinedDescription (
+     char                        *NameString;
+     int                         LastCharIsDigit;
+     int                         LastCharsAreHex;
++    char			TmpName[ACPI_NAME_SIZE + 1];
+ 
+ 
+     if (!Op)
+@@ -261,7 +262,9 @@ AcpiDmPredefinedDescription (
+ 
+     /* Predefined name must start with an underscore */
+ 
+-    NameString = ACPI_CAST_PTR (char, &Op->Named.Name);
++    memset(TmpName, 0, ACPI_NAME_SIZE + 1);
++    ACPI_MOVE_32_TO_32(TmpName, &Op->Named.Name);
++    NameString = TmpName;
+     if (NameString[0] != '_')
+     {
+         return;
+@@ -880,25 +883,29 @@ AcpiDmDisassembleOneOp (
+         AcpiDmNamestring (Op->Common.Value.Name);
+         break;
+ 
+-    case AML_INT_NAMEDFIELD_OP:
++    case AML_INT_NAMEDFIELD_OP: {
+ 
+-        Length = AcpiDmDumpName (Op->Named.Name);
++	UINT32 TmpName;
++
++	ACPI_MOVE_32_TO_32(&TmpName, &Op->Named.Name);
++        Length = AcpiDmDumpName (TmpName);
+ 
+         AcpiOsPrintf (",");
+         ASL_CV_PRINT_ONE_COMMENT (Op, AML_NAMECOMMENT, NULL, 0);
+         AcpiOsPrintf ("%*.s  %u", (unsigned) (5 - Length), " ",
+-            (UINT32) Op->Common.Value.Integer);
++            (UINT32) Op->Common.Value.Size);
+ 
+         AcpiDmCommaIfFieldMember (Op);
+ 
+-        Info->BitOffset += (UINT32) Op->Common.Value.Integer;
++        Info->BitOffset += (UINT32) Op->Common.Value.Size;
+         break;
++    }
+ 
+     case AML_INT_RESERVEDFIELD_OP:
+ 
+         /* Offset() -- Must account for previous offsets */
+ 
+-        Offset = (UINT32) Op->Common.Value.Integer;
++        Offset = Op->Common.Value.Size;
+         Info->BitOffset += Offset;
+ 
+         if (Info->BitOffset % 8 == 0)
+@@ -942,10 +949,15 @@ AcpiDmDisassembleOneOp (
+ 
+         if (Child->Common.AmlOpcode == AML_INT_BYTELIST_OP)
+         {
++	    /* UINT64 Tmp64; */
++
+             AcpiOsPrintf ("\n");
+ 
+             Aml = Child->Named.Data;
++	    /*
+             Length = (UINT32) Child->Common.Value.Integer;
++	    */
++            Length = (UINT32) Child->Common.Value.Size;
+ 
+             Info->Level += 1;
+             Info->MappingOp = Op;
+Index: acpica-unix2-20180629/source/components/disassembler/dmresrcl.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/disassembler/dmresrcl.c
++++ acpica-unix2-20180629/source/components/disassembler/dmresrcl.c
+@@ -141,7 +141,8 @@ AcpiDmMemoryFields (
+     UINT32                  Level)
+ {
+     UINT32                  i;
+-
++    UINT16		    Tmp16;
++    UINT32		    Tmp32;
+ 
+     for (i = 0; i < 4; i++)
+     {
+@@ -151,14 +152,14 @@ AcpiDmMemoryFields (
+         {
+         case 16:
+ 
+-            AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i],
+-                AcpiDmMemoryNames[i]);
++	    ACPI_MOVE_16_TO_16(&Tmp16, &(ACPI_CAST_PTR (UINT16, Source)[i]));
++            AcpiDmDumpInteger16 (Tmp16, AcpiDmMemoryNames[i]);
+             break;
+ 
+         case 32:
+ 
+-            AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i],
+-                AcpiDmMemoryNames[i]);
++	    ACPI_MOVE_32_TO_32(&Tmp32, &(ACPI_CAST_PTR (UINT32, Source)[i]));
++            AcpiDmDumpInteger32 (Tmp32, AcpiDmMemoryNames[i]);
+             break;
+ 
+         default:
+@@ -190,7 +191,9 @@ AcpiDmAddressFields (
+     UINT32                  Level)
+ {
+     UINT32                  i;
+-
++    UINT16		    Tmp16;
++    UINT32		    Tmp32;
++    UINT64		    Tmp64;
+ 
+     AcpiOsPrintf ("\n");
+ 
+@@ -202,20 +205,20 @@ AcpiDmAddressFields (
+         {
+         case 16:
+ 
+-            AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i],
+-                AcpiDmAddressNames[i]);
++	    ACPI_MOVE_16_TO_16(&Tmp16, &(ACPI_CAST_PTR (UINT16, Source)[i]));
++            AcpiDmDumpInteger16 (Tmp16, AcpiDmAddressNames[i]);
+             break;
+ 
+         case 32:
+ 
+-            AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i],
+-                AcpiDmAddressNames[i]);
++	    ACPI_MOVE_32_TO_32(&Tmp32, &(ACPI_CAST_PTR (UINT32, Source)[i]));
++            AcpiDmDumpInteger32 (Tmp32, AcpiDmAddressNames[i]);
+             break;
+ 
+         case 64:
+ 
+-            AcpiDmDumpInteger64 (ACPI_CAST_PTR (UINT64, Source)[i],
+-                AcpiDmAddressNames[i]);
++	    ACPI_MOVE_64_TO_64(&Tmp64, &(ACPI_CAST_PTR (UINT64, Source)[i]));
++            AcpiDmDumpInteger64 (Tmp64, AcpiDmAddressNames[i]);
+             break;
+ 
+         default:
+@@ -868,6 +871,7 @@ AcpiDmFixedMemory32Descriptor (
+     UINT32                  Length,
+     UINT32                  Level)
+ {
++    UINT32 Tmp;
+ 
+     /* Dump name and read/write flag */
+ 
+@@ -876,12 +880,12 @@ AcpiDmFixedMemory32Descriptor (
+         AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->FixedMemory32.Flags)]);
+ 
+     AcpiDmIndent (Level + 1);
+-    AcpiDmDumpInteger32 (Resource->FixedMemory32.Address,
+-        "Address Base");
++    ACPI_MOVE_32_TO_32(&Tmp, &Resource->FixedMemory32.Address);
++    AcpiDmDumpInteger32 (Tmp, "Address Base");
+ 
+     AcpiDmIndent (Level + 1);
+-    AcpiDmDumpInteger32 (Resource->FixedMemory32.AddressLength,
+-        "Address Length");
++    ACPI_MOVE_32_TO_32(&Tmp, &Resource->FixedMemory32.AddressLength);
++    AcpiDmDumpInteger32 (Tmp, "Address Length");
+ 
+     /* Insert a descriptor name */
+ 
+@@ -913,6 +917,7 @@ AcpiDmGenericRegisterDescriptor (
+     UINT32                  Length,
+     UINT32                  Level)
+ {
++    UINT64		    Tmp64;
+ 
+     AcpiDmIndent (Level);
+     AcpiOsPrintf ("Register (");
+@@ -926,7 +931,9 @@ AcpiDmGenericRegisterDescriptor (
+     AcpiDmDumpInteger8 (Resource->GenericReg.BitOffset, "Bit Offset");
+ 
+     AcpiDmIndent (Level + 1);
+-    AcpiDmDumpInteger64 (Resource->GenericReg.Address, "Address");
++    /* AcpiDmDumpInteger64 (Resource->GenericReg.Address, "Address"); */
++    ACPI_MOVE_64_TO_64(&Tmp64, &Resource->GenericReg.Address);
++    AcpiDmDumpInteger64 (Tmp64, "Address");
+ 
+     /* Optional field for ACPI 3.0 */
+ 
+@@ -972,7 +979,7 @@ AcpiDmInterruptDescriptor (
+     UINT32                  Level)
+ {
+     UINT32                  i;
+-
++    UINT16		    Tmp16;
+ 
+     AcpiDmIndent (Level);
+     AcpiOsPrintf ("Interrupt (%s, %s, %s, %s, ",
+@@ -986,10 +993,11 @@ AcpiDmInterruptDescriptor (
+      * list. Must compute length based on length of the list. First xrupt
+      * is included in the struct (reason for -1 below)
+      */
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->ExtendedIrq.ResourceLength);
+     AcpiDmResourceSource (Resource,
+         sizeof (AML_RESOURCE_EXTENDED_IRQ) +
+             ((UINT32) Resource->ExtendedIrq.InterruptCount - 1) * sizeof (UINT32),
+-        Resource->ExtendedIrq.ResourceLength);
++        Tmp16);
+ 
+     /* Insert a descriptor name */
+ 
+@@ -1002,9 +1010,12 @@ AcpiDmInterruptDescriptor (
+     AcpiOsPrintf ("{\n");
+     for (i = 0; i < Resource->ExtendedIrq.InterruptCount; i++)
+     {
++	UINT32 Tmp32, Val32;
++
+         AcpiDmIndent (Level + 1);
+-        AcpiOsPrintf ("0x%8.8X,\n",
+-            (UINT32) Resource->ExtendedIrq.Interrupts[i]);
++	Val32 = (UINT32) Resource->ExtendedIrq.Interrupts[i];
++	ACPI_MOVE_32_TO_32(&Tmp32, &Val32);
++        AcpiOsPrintf ("0x%8.8X,\n", Tmp32);
+     }
+ 
+     AcpiDmIndent (Level);
+Index: acpica-unix2-20180629/source/components/disassembler/dmresrcl2.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/disassembler/dmresrcl2.c
++++ acpica-unix2-20180629/source/components/disassembler/dmresrcl2.c
+@@ -191,22 +191,24 @@ AcpiDmGpioCommon (
+     char                    *DeviceName = NULL;
+     UINT32                  PinCount;
+     UINT32                  i;
++    UINT16		    Tmp16;
+ 
+ 
+     /* ResourceSource, ResourceSourceIndex, ResourceType */
+ 
+     AcpiDmIndent (Level + 1);
+-    if (Resource->Gpio.ResSourceOffset)
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.ResSourceOffset);
++    if (Tmp16)
+     {
+-        DeviceName = ACPI_ADD_PTR (char,
+-            Resource, Resource->Gpio.ResSourceOffset),
++        DeviceName = ACPI_ADD_PTR (char, Resource, Tmp16),
+         AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
+     }
+ 
+     AcpiOsPrintf (", ");
+     AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.ResSourceIndex);
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.Flags);
+     AcpiOsPrintf ("%s, ",
+-        AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.Flags)]);
++        AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Tmp16)]);
+ 
+     /* Insert a descriptor name */
+ 
+@@ -215,15 +217,16 @@ AcpiDmGpioCommon (
+ 
+     /* Dump the vendor data */
+ 
+-    if (Resource->Gpio.VendorOffset)
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.VendorOffset);
++    if (Tmp16)
+     {
+         AcpiOsPrintf ("\n");
+         AcpiDmIndent (Level + 1);
+-        VendorData = ACPI_ADD_PTR (UINT8, Resource,
+-            Resource->Gpio.VendorOffset);
++	ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.VendorOffset);
++        VendorData = ACPI_ADD_PTR (UINT8, Resource, Tmp16);
+ 
+-        AcpiDmDumpRawDataBuffer (VendorData,
+-            Resource->Gpio.VendorLength, Level);
++	ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.VendorLength);
++        AcpiDmDumpRawDataBuffer (VendorData, Tmp16, Level);
+     }
+ 
+     AcpiOsPrintf (")\n");
+@@ -233,17 +236,25 @@ AcpiDmGpioCommon (
+     AcpiDmIndent (Level + 1);
+     AcpiOsPrintf ("{   // Pin list\n");
+ 
++    /*
+     PinCount = ((UINT32) (Resource->Gpio.ResSourceOffset -
+         Resource->Gpio.PinTableOffset)) /
+         sizeof (UINT16);
++    */
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.ResSourceOffset);
++    PinCount = (UINT32) Tmp16;
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.PinTableOffset);
++    PinCount -= (UINT32) Tmp16;
++    PinCount /= sizeof (UINT16);
+ 
+-    PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
+-        Resource->Gpio.PinTableOffset);
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.PinTableOffset);
++    PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource, Tmp16);
+ 
+     for (i = 0; i < PinCount; i++)
+     {
+         AcpiDmIndent (Level + 2);
+-        AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
++	ACPI_MOVE_16_TO_16(&Tmp16, &PinList[i]);
++        AcpiOsPrintf ("0x%4.4X%s\n", Tmp16,
+             ((i + 1) < PinCount) ? "," : "");
+     }
+ 
+@@ -277,16 +288,18 @@ AcpiDmGpioIntDescriptor (
+     UINT32                  Length,
+     UINT32                  Level)
+ {
++    UINT16		    Tmp16;
+ 
+     /* Dump the GpioInt-specific portion of the descriptor */
+ 
+     /* EdgeLevel, ActiveLevel, Shared */
+ 
+     AcpiDmIndent (Level);
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.IntFlags);
+     AcpiOsPrintf ("GpioInt (%s, %s, %s, ",
+-        AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.IntFlags)],
+-        AcpiGbl_LlDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 1)],
+-        AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
++        AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Tmp16)],
++        AcpiGbl_LlDecode [ACPI_EXTRACT_2BIT_FLAG (Tmp16, 1)],
++        AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Tmp16, 3)]);
+ 
+     /* PinConfig, DebounceTimeout */
+ 
+@@ -299,7 +312,8 @@ AcpiDmGpioIntDescriptor (
+     {
+         AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig);
+     }
+-    AcpiOsPrintf ("0x%4.4X,\n", Resource->Gpio.DebounceTimeout);
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.DebounceTimeout);
++    AcpiOsPrintf ("0x%4.4X,\n", Tmp16);
+ 
+     /* Dump the GpioInt/GpioIo common portion of the descriptor */
+ 
+@@ -329,14 +343,16 @@ AcpiDmGpioIoDescriptor (
+     UINT32                  Length,
+     UINT32                  Level)
+ {
++    UINT16		    Tmp16;
+ 
+     /* Dump the GpioIo-specific portion of the descriptor */
+ 
+     /* Shared, PinConfig */
+ 
+     AcpiDmIndent (Level);
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.IntFlags);
+     AcpiOsPrintf ("GpioIo (%s, ",
+-        AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
++        AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Tmp16, 3)]);
+ 
+     if (Resource->Gpio.PinConfig <= 3)
+     {
+@@ -350,10 +366,13 @@ AcpiDmGpioIoDescriptor (
+ 
+     /* DebounceTimeout, DriveStrength, IoRestriction */
+ 
+-    AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DebounceTimeout);
+-    AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DriveStrength);
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.DebounceTimeout);
++    AcpiOsPrintf ("0x%4.4X, ", Tmp16);
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.DriveStrength);
++    AcpiOsPrintf ("0x%4.4X, ", Tmp16);
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.IntFlags);
+     AcpiOsPrintf ("%s,\n",
+-        AcpiGbl_IorDecode [ACPI_GET_2BIT_FLAG (Resource->Gpio.IntFlags)]);
++        AcpiGbl_IorDecode [ACPI_GET_2BIT_FLAG (Tmp16)]);
+ 
+     /* Dump the GpioInt/GpioIo common portion of the descriptor */
+ 
+@@ -533,6 +552,7 @@ AcpiDmDumpSerialBusVendorData (
+ {
+     UINT8                   *VendorData;
+     UINT32                  VendorLength;
++    UINT16                  Tmp16;
+ 
+ 
+     /* Get the (optional) vendor data and length */
+@@ -541,8 +561,8 @@ AcpiDmDumpSerialBusVendorData (
+     {
+     case AML_RESOURCE_I2C_SERIALBUSTYPE:
+ 
+-        VendorLength = Resource->CommonSerialBus.TypeDataLength -
+-            AML_RESOURCE_I2C_MIN_DATA_LEN;
++	ACPI_MOVE_16_TO_16(&Tmp16, &Resource->CommonSerialBus.TypeDataLength);
++        VendorLength = Tmp16 - AML_RESOURCE_I2C_MIN_DATA_LEN;
+ 
+         VendorData = ACPI_ADD_PTR (UINT8, Resource,
+             sizeof (AML_RESOURCE_I2C_SERIALBUS));
+@@ -550,8 +570,8 @@ AcpiDmDumpSerialBusVendorData (
+ 
+     case AML_RESOURCE_SPI_SERIALBUSTYPE:
+ 
+-        VendorLength = Resource->CommonSerialBus.TypeDataLength -
+-            AML_RESOURCE_SPI_MIN_DATA_LEN;
++	ACPI_MOVE_16_TO_16(&Tmp16, &Resource->CommonSerialBus.TypeDataLength);
++        VendorLength = Tmp16 - AML_RESOURCE_SPI_MIN_DATA_LEN;
+ 
+         VendorData = ACPI_ADD_PTR (UINT8, Resource,
+             sizeof (AML_RESOURCE_SPI_SERIALBUS));
+@@ -559,8 +579,8 @@ AcpiDmDumpSerialBusVendorData (
+ 
+     case AML_RESOURCE_UART_SERIALBUSTYPE:
+ 
+-        VendorLength = Resource->CommonSerialBus.TypeDataLength -
+-            AML_RESOURCE_UART_MIN_DATA_LEN;
++	ACPI_MOVE_16_TO_16(&Tmp16, &Resource->CommonSerialBus.TypeDataLength);
++        VendorLength = Tmp16 - AML_RESOURCE_UART_MIN_DATA_LEN;
+ 
+         VendorData = ACPI_ADD_PTR (UINT8, Resource,
+             sizeof (AML_RESOURCE_UART_SERIALBUS));
+@@ -601,24 +621,29 @@ AcpiDmI2cSerialBusDescriptor (
+ {
+     UINT32                  ResourceSourceOffset;
+     char                    *DeviceName;
++    UINT16		    Tmp16;
++    UINT32		    Tmp32;
+ 
+ 
+     /* SlaveAddress, SlaveMode, ConnectionSpeed, AddressingMode */
+ 
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->I2cSerialBus.SlaveAddress);
++    ACPI_MOVE_32_TO_32(&Tmp32, &Resource->I2cSerialBus.ConnectionSpeed);
+     AcpiDmIndent (Level);
+     AcpiOsPrintf ("I2cSerialBusV2 (0x%4.4X, %s, 0x%8.8X,\n",
+-        Resource->I2cSerialBus.SlaveAddress,
++        Tmp16,
+         AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.Flags)],
+-        Resource->I2cSerialBus.ConnectionSpeed);
++        Tmp32);
+ 
+     AcpiDmIndent (Level + 1);
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->I2cSerialBus.TypeSpecificFlags);
+     AcpiOsPrintf ("%s, ",
+-        AcpiGbl_AmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.TypeSpecificFlags)]);
++        AcpiGbl_AmDecode [ACPI_GET_1BIT_FLAG (Tmp16)]);
+ 
+     /* ResourceSource is a required field */
+ 
+-    ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
+-        Resource->CommonSerialBus.TypeDataLength;
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->CommonSerialBus.TypeDataLength);
++    ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) + Tmp16;
+ 
+     DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
+     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
+Index: acpica-unix2-20180629/source/components/disassembler/dmresrcs.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/disassembler/dmresrcs.c
++++ acpica-unix2-20180629/source/components/disassembler/dmresrcs.c
+@@ -72,6 +72,7 @@ AcpiDmIrqDescriptor (
+     UINT32                  Length,
+     UINT32                  Level)
+ {
++    UINT16 Tmp;
+ 
+     AcpiDmIndent (Level);
+     AcpiOsPrintf ("%s (",
+@@ -93,7 +94,8 @@ AcpiDmIrqDescriptor (
+     AcpiOsPrintf (")\n");
+ 
+     AcpiDmIndent (Level + 1);
+-    AcpiDmBitList (Resource->Irq.IrqMask);
++    ACPI_MOVE_16_TO_16(&Tmp, &Resource->Irq.IrqMask);
++    AcpiDmBitList (Tmp);
+ }
+ 
+ 
+@@ -204,16 +206,19 @@ AcpiDmIoDescriptor (
+     UINT32                  Length,
+     UINT32                  Level)
+ {
++    UINT16 Tmp16;
+ 
+     AcpiDmIndent (Level);
+     AcpiOsPrintf ("IO (%s,\n",
+         AcpiGbl_IoDecode [ACPI_GET_1BIT_FLAG (Resource->Io.Flags)]);
+ 
+     AcpiDmIndent (Level + 1);
+-    AcpiDmDumpInteger16 (Resource->Io.Minimum, "Range Minimum");
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Io.Minimum);
++    AcpiDmDumpInteger16 (Tmp16, "Range Minimum");
+ 
+     AcpiDmIndent (Level + 1);
+-    AcpiDmDumpInteger16 (Resource->Io.Maximum, "Range Maximum");
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Io.Maximum);
++    AcpiDmDumpInteger16 (Tmp16, "Range Maximum");
+ 
+     AcpiDmIndent (Level + 1);
+     AcpiDmDumpInteger8 (Resource->Io.Alignment, "Alignment");
+@@ -251,12 +256,14 @@ AcpiDmFixedIoDescriptor (
+     UINT32                  Length,
+     UINT32                  Level)
+ {
++    UINT16                  Tmp16;
+ 
+     AcpiDmIndent (Level);
+     AcpiOsPrintf ("FixedIO (\n");
+ 
+     AcpiDmIndent (Level + 1);
+-    AcpiDmDumpInteger16 (Resource->FixedIo.Address, "Address");
++    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->FixedIo.Address);
++    AcpiDmDumpInteger16 (Tmp16, "Address");
+ 
+     AcpiDmIndent (Level + 1);
+     AcpiDmDumpInteger8 (Resource->FixedIo.AddressLength, "Length");
+Index: acpica-unix2-20180629/source/components/dispatcher/dsfield.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/dispatcher/dsfield.c
++++ acpica-unix2-20180629/source/components/dispatcher/dsfield.c
+@@ -321,6 +321,7 @@ AcpiDsGetFieldNames (
+     ACPI_STATUS             Status;
+     UINT64                  Position;
+     ACPI_PARSE_OBJECT       *Child;
++    UINT32 TmpName;
+ 
+ 
+     ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info);
+@@ -428,10 +429,17 @@ AcpiDsGetFieldNames (
+ 
+             /* Lookup the name, it should already exist */
+ 
++	    ACPI_MOVE_32_TO_32(&TmpName, &Arg->Named.Name);
++            Status = AcpiNsLookup (WalkState->ScopeInfo,
++                (char *) &TmpName, Info->FieldType,
++                ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
++                WalkState, &Info->FieldNode);
++	/*
+             Status = AcpiNsLookup (WalkState->ScopeInfo,
+                 (char *) &Arg->Named.Name, Info->FieldType,
+                 ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
+                 WalkState, &Info->FieldNode);
++	*/
+             if (ACPI_FAILURE (Status))
+             {
+                 ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
+@@ -660,9 +668,17 @@ AcpiDsInitFieldObjects (
+          */
+         if (Arg->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
+         {
++	    UINT32 TmpName;
++
++            ACPI_MOVE_32_TO_32(&TmpName, &Arg->Named.Name);
++            Status = AcpiNsLookup (WalkState->ScopeInfo,
++                (char *) &TmpName, Type, ACPI_IMODE_LOAD_PASS1,
++                Flags, WalkState, &Node);
++	/*
+             Status = AcpiNsLookup (WalkState->ScopeInfo,
+                 (char *) &Arg->Named.Name, Type, ACPI_IMODE_LOAD_PASS1,
+                 Flags, WalkState, &Node);
++	*/
+             if (ACPI_FAILURE (Status))
+             {
+                 ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
+Index: acpica-unix2-20180629/source/components/events/evgpeblk.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/events/evgpeblk.c
++++ acpica-unix2-20180629/source/components/events/evgpeblk.c
+@@ -376,6 +376,7 @@ AcpiEvCreateGpeBlock (
+     ACPI_STATUS             Status;
+     ACPI_GPE_BLOCK_INFO     *GpeBlock;
+     ACPI_GPE_WALK_INFO      WalkInfo;
++    char		    Name[ACPI_NAME_SIZE + 1];
+ 
+ 
+     ACPI_FUNCTION_TRACE (EvCreateGpeBlock);
+@@ -396,7 +397,7 @@ AcpiEvCreateGpeBlock (
+ 
+     /* Initialize the new GPE block */
+ 
+-    GpeBlock->Address = Address;
++    ACPI_MOVE_64_TO_64(&GpeBlock->Address, &Address);
+     GpeBlock->SpaceId = SpaceId;
+     GpeBlock->Node = GpeDevice;
+     GpeBlock->GpeCount = (UINT16) (RegisterCount * ACPI_GPE_REGISTER_WIDTH);
+@@ -445,11 +446,13 @@ AcpiEvCreateGpeBlock (
+         (*ReturnGpeBlock) = GpeBlock;
+     }
+ 
++    memset(&Name, 0, ACPI_NAME_SIZE + 1);
++    ACPI_MOVE_32_TO_32(&Name, &GpeDevice->Name.Ascii);
+     ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
+         "    Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X%s\n",
+         (UINT32) GpeBlock->BlockBaseNumber,
+         (UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1)),
+-        GpeDevice->Name.Ascii, GpeBlock->RegisterCount, InterruptNumber,
++        Name, GpeBlock->RegisterCount, InterruptNumber,
+         InterruptNumber == AcpiGbl_FADT.SciInterrupt ? " (SCI)" : ""));
+ 
+     /* Update global count of currently available GPEs */
+Index: acpica-unix2-20180629/source/components/hardware/hwregs.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/hardware/hwregs.c
++++ acpica-unix2-20180629/source/components/hardware/hwregs.c
+@@ -197,7 +197,7 @@ AcpiHwValidateRegister (
+      * Address must not be null. A null address also indicates an optional
+      * ACPI register that is not supported, so no error message.
+      */
+-    ACPI_MOVE_64_TO_64 (Address, &Reg->Address);
++    *Address =  Reg->Address;
+     if (!(*Address))
+     {
+         return (AE_BAD_ADDRESS);
+Index: acpica-unix2-20180629/source/components/hardware/hwvalid.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/hardware/hwvalid.c
++++ acpica-unix2-20180629/source/components/hardware/hwvalid.c
+@@ -135,6 +135,8 @@ AcpiHwValidateIoRequest (
+     UINT32                  ByteWidth;
+     ACPI_IO_ADDRESS         LastAddress;
+     const ACPI_PORT_INFO    *PortInfo;
++    UINT64                  Max16;
++    UINT64                  Tmp64;
+ 
+ 
+     ACPI_FUNCTION_TRACE (HwValidateIoRequest);
+@@ -162,7 +164,10 @@ AcpiHwValidateIoRequest (
+ 
+     /* Maximum 16-bit address in I/O space */
+ 
+-    if (LastAddress > ACPI_UINT16_MAX)
++    Max16 = (UINT64) ACPI_UINT16_MAX;
++    ACPI_MOVE_64_TO_64(&Tmp64, &Max16);
++
++    if ((UINT64)LastAddress > Tmp64)
+     {
+         ACPI_ERROR ((AE_INFO,
+             "Illegal I/O port address/length above 64K: %8.8X%8.8X/0x%X",
+Index: acpica-unix2-20180629/source/components/namespace/nsaccess.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/namespace/nsaccess.c
++++ acpica-unix2-20180629/source/components/namespace/nsaccess.c
+@@ -313,6 +313,7 @@ AcpiNsLookup (
+     ACPI_OBJECT_TYPE        ThisSearchType;
+     UINT32                  SearchParentFlag = ACPI_NS_SEARCH_PARENT;
+     UINT32                  LocalFlags;
++    UINT32		    Tmp32;
+ 
+ 
+     ACPI_FUNCTION_TRACE (NsLookup);
+@@ -695,9 +696,10 @@ AcpiNsLookup (
+             {
+                 /* Complain about a type mismatch */
+ 
++		ACPI_MOVE_32_TO_32(&Tmp32, &SimpleName);
+                 ACPI_WARNING ((AE_INFO,
+                     "NsLookup: Type mismatch on %4.4s (%s), searching for (%s)",
+-                    ACPI_CAST_PTR (char, &SimpleName),
++                    ACPI_CAST_PTR (char, &Tmp32),
+                     AcpiUtGetTypeName (ThisNode->Type),
+                     AcpiUtGetTypeName (TypeToCheckFor)));
+             }
+Index: acpica-unix2-20180629/source/components/namespace/nsparse.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/namespace/nsparse.c
++++ acpica-unix2-20180629/source/components/namespace/nsparse.c
+@@ -206,13 +206,14 @@ AcpiNsOneCompleteParse (
+ 
+     /* Table must consist of at least a complete header */
+ 
+-    if (Table->Length < sizeof (ACPI_TABLE_HEADER))
++    ACPI_MOVE_32_TO_32(&AmlLength, &Table->Length);
++    if (AmlLength < sizeof (ACPI_TABLE_HEADER))
+     {
+         return_ACPI_STATUS (AE_BAD_HEADER);
+     }
+ 
+     AmlStart = (UINT8 *) Table + sizeof (ACPI_TABLE_HEADER);
+-    AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER);
++    AmlLength -= sizeof (ACPI_TABLE_HEADER);
+ 
+     Status = AcpiTbGetOwnerId (TableIndex, &OwnerId);
+     if (ACPI_FAILURE (Status))
+Index: acpica-unix2-20180629/source/components/tables/tbdata.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/tables/tbdata.c
++++ acpica-unix2-20180629/source/components/tables/tbdata.c
+@@ -552,6 +552,7 @@ AcpiTbVerifyTempTable (
+     UINT32                  *TableIndex)
+ {
+     ACPI_STATUS             Status = AE_OK;
++    UINT32		    Length;
+ 
+ 
+     ACPI_FUNCTION_TRACE (TbVerifyTempTable);
+@@ -581,7 +582,8 @@ AcpiTbVerifyTempTable (
+     {
+         /* Verify the checksum */
+ 
+-        Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length);
++        ACPI_MOVE_32_TO_32(&Length, &TableDesc->Length);
++        Status = AcpiTbVerifyChecksum (TableDesc->Pointer, Length);
+         if (ACPI_FAILURE (Status))
+         {
+             ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
+Index: acpica-unix2-20180629/source/components/tables/tbfadt.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/tables/tbfadt.c
++++ acpica-unix2-20180629/source/components/tables/tbfadt.c
+@@ -424,18 +424,20 @@ AcpiTbCreateLocalFadt (
+     ACPI_TABLE_HEADER       *Table,
+     UINT32                  Length)
+ {
++    UINT32 Tmp32;
+ 
+     /*
+      * Check if the FADT is larger than the largest table that we expect
+      * (typically the current ACPI specification version). If so, truncate
+      * the table, and issue a warning.
+      */
+-    if (Length > sizeof (ACPI_TABLE_FADT))
++    ACPI_MOVE_32_TO_32(&Tmp32, &Length);
++    if (Tmp32 > sizeof (ACPI_TABLE_FADT))
+     {
+         ACPI_BIOS_WARNING ((AE_INFO,
+             "FADT (revision %u) is longer than %s length, "
+             "truncating length %u to %u",
+-            Table->Revision, ACPI_FADT_CONFORMANCE, Length,
++            Table->Revision, ACPI_FADT_CONFORMANCE, Tmp32,
+             (UINT32) sizeof (ACPI_TABLE_FADT)));
+     }
+ 
+@@ -446,7 +448,7 @@ AcpiTbCreateLocalFadt (
+     /* Copy the original FADT, up to sizeof (ACPI_TABLE_FADT) */
+ 
+     memcpy (&AcpiGbl_FADT, Table,
+-        ACPI_MIN (Length, sizeof (ACPI_TABLE_FADT)));
++        ACPI_MIN (Tmp32, sizeof (ACPI_TABLE_FADT)));
+ 
+     /* Take a copy of the Hardware Reduced flag */
+ 
+@@ -520,6 +522,8 @@ AcpiTbConvertFadt (
+     UINT8                   Length;
+     UINT8                   Flags;
+     UINT32                  i;
++    UINT32		    Tmp32;
++    UINT64		    Tmp64;
+ 
+ 
+     /*
+@@ -533,7 +537,8 @@ AcpiTbConvertFadt (
+      * Note: The FADT revision value is unreliable. Only the length can be
+      * trusted.
+      */
+-    if (AcpiGbl_FADT.Header.Length <= ACPI_FADT_V2_SIZE)
++    ACPI_MOVE_32_TO_32(&Tmp32, &AcpiGbl_FADT.Header.Length);
++    if (Tmp32 <= ACPI_FADT_V2_SIZE)
+     {
+         AcpiGbl_FADT.PreferredProfile = 0;
+         AcpiGbl_FADT.PstateControl = 0;
+@@ -546,14 +551,15 @@ AcpiTbConvertFadt (
+      * current FADT version as defined by the ACPI specification.
+      * Thus, we will have a common FADT internally.
+      */
+-    AcpiGbl_FADT.Header.Length = sizeof (ACPI_TABLE_FADT);
++    Tmp32 = sizeof (ACPI_TABLE_FADT);
++    ACPI_MOVE_32_TO_32(&AcpiGbl_FADT.Header.Length, &Tmp32);
+ 
+     /*
+      * Expand the 32-bit DSDT addresses to 64-bit as necessary.
+      * Later ACPICA code will always use the X 64-bit field.
+      */
+-    AcpiGbl_FADT.XDsdt = AcpiTbSelectAddress ("DSDT",
+-        AcpiGbl_FADT.Dsdt, AcpiGbl_FADT.XDsdt);
++    Tmp64 = AcpiTbSelectAddress ("DSDT", AcpiGbl_FADT.Dsdt, AcpiGbl_FADT.XDsdt);
++    ACPI_MOVE_64_TO_64(&AcpiGbl_FADT.XDsdt, &Tmp64);
+ 
+     /* If Hardware Reduced flag is set, we are all done */
+ 
+@@ -614,7 +620,9 @@ AcpiTbConvertFadt (
+         {
+             if (Address64->Address)
+             {
+-                if (Address64->Address != (UINT64) Address32)
++		ACPI_MOVE_32_TO_32(&Tmp32, &Address32);
++		ACPI_MOVE_64_TO_64(&Tmp64, &Address64->Address);
++                if (Tmp64 != (UINT64) Tmp32)
+                 {
+                     /* Address mismatch */
+ 
+@@ -655,9 +663,11 @@ AcpiTbConvertFadt (
+              */
+             if (!Address64->Address || AcpiGbl_Use32BitFadtAddresses)
+             {
++		ACPI_MOVE_32_TO_32(&Tmp32, &Address32); /* back to host order */
++		Tmp64 = (UINT64) Tmp32;			/* promote only */
+                 AcpiTbInitGenericAddress (Address64,
+                     ACPI_ADR_SPACE_SYSTEM_IO, Length,
+-                    (UINT64) Address32, Name, Flags);
++                    Tmp64, Name, Flags);
+             }
+         }
+ 
+@@ -780,10 +790,14 @@ AcpiTbSetupFadtRegisters (
+ 
+         if (Source64->Address)
+         {
++	    UINT64 Tmp64, Addr64;
++
++	    ACPI_MOVE_64_TO_64(&Tmp64, &Source64->Address);
++	    Tmp64 += (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth);
++	    ACPI_MOVE_64_TO_64(&Addr64, &Tmp64);
+             AcpiTbInitGenericAddress (FadtPmInfoTable[i].Target,
+                 Source64->SpaceId, Pm1RegisterByteWidth,
+-                Source64->Address +
+-                    (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth),
++                Addr64,
+                 "PmRegisters", 0);
+         }
+     }
+Index: acpica-unix2-20180629/source/components/tables/tbfind.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/tables/tbfind.c
++++ acpica-unix2-20180629/source/components/tables/tbfind.c
+@@ -108,8 +108,11 @@ AcpiTbFindTable (
+     (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+     for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
+     {
++        UINT32 Tmp32;
++
++        ACPI_MOVE_32_TO_32(&Tmp32, &Header.Signature);
+         if (memcmp (&(AcpiGbl_RootTableList.Tables[i].Signature),
+-            Header.Signature, ACPI_NAME_SIZE))
++            &Tmp32, ACPI_NAME_SIZE))
+         {
+             /* Not the requested table */
+ 
+Index: acpica-unix2-20180629/source/components/tables/tbprint.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/tables/tbprint.c
++++ acpica-unix2-20180629/source/components/tables/tbprint.c
+@@ -143,15 +143,18 @@ AcpiTbPrintTableHeader (
+     ACPI_TABLE_HEADER       *Header)
+ {
+     ACPI_TABLE_HEADER       LocalHeader;
++    UINT32		    Len;
++    UINT32		    OemRev;
++    UINT32		    CompilerRev;
+ 
+ 
+     if (ACPI_COMPARE_NAME (Header->Signature, ACPI_SIG_FACS))
+     {
+         /* FACS only has signature and length fields */
+ 
++	ACPI_MOVE_32_TO_32(&Len, &Header->Length);
+         ACPI_INFO (("%-4.4s 0x%8.8X%8.8X %06X",
+-            Header->Signature, ACPI_FORMAT_UINT64 (Address),
+-            Header->Length));
++            Header->Signature, ACPI_FORMAT_UINT64 (Address), Len));
+     }
+     else if (ACPI_VALIDATE_RSDP_SIG (Header->Signature))
+     {
+@@ -174,13 +177,16 @@ AcpiTbPrintTableHeader (
+ 
+         AcpiTbCleanupTableHeader (&LocalHeader, Header);
+ 
++	ACPI_MOVE_32_TO_32(&Len, &LocalHeader.Length);
++	ACPI_MOVE_32_TO_32(&OemRev, &LocalHeader.OemRevision);
++	ACPI_MOVE_32_TO_32(&CompilerRev, &LocalHeader.AslCompilerRevision);
+         ACPI_INFO ((
+             "%-4.4s 0x%8.8X%8.8X"
+             " %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)",
+             LocalHeader.Signature, ACPI_FORMAT_UINT64 (Address),
+-            LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId,
+-            LocalHeader.OemTableId, LocalHeader.OemRevision,
+-            LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision));
++            Len, LocalHeader.Revision, LocalHeader.OemId,
++            LocalHeader.OemTableId, OemRev,
++            LocalHeader.AslCompilerId, CompilerRev));
+     }
+ }
+ 
+Index: acpica-unix2-20180629/source/components/tables/tbutils.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/tables/tbutils.c
++++ acpica-unix2-20180629/source/components/tables/tbutils.c
+@@ -238,7 +238,7 @@ AcpiTbGetRootTableEntry (
+          * 64-bit platform, XSDT: Move (unaligned) 64-bit to local,
+          *  return 64-bit
+          */
+-        ACPI_MOVE_64_TO_64 (&Address64, TableEntry);
++	Address64 = (UINT64) TableEntry;
+ 
+ #if ACPI_MACHINE_WIDTH == 32
+         if (Address64 > ACPI_UINT32_MAX)
+@@ -251,7 +251,8 @@ AcpiTbGetRootTableEntry (
+                 ACPI_FORMAT_UINT64 (Address64)));
+         }
+ #endif
+-        return ((ACPI_PHYSICAL_ADDRESS) (Address64));
++        return ((ACPI_PHYSICAL_ADDRESS) (*ACPI_CAST_PTR (
++            UINT64, Address64)));
+     }
+ }
+ 
+@@ -287,6 +288,7 @@ AcpiTbParseRootTable (
+     UINT8                   *TableEntry;
+     ACPI_STATUS             Status;
+     UINT32                  TableIndex;
++    UINT32                  Tmp32;
+ 
+ 
+     ACPI_FUNCTION_TRACE (TbParseRootTable);
+@@ -345,7 +347,7 @@ AcpiTbParseRootTable (
+      * Validate length of the table, and map entire table.
+      * Minimum length table must contain at least one entry.
+      */
+-    Length = Table->Length;
++    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
+     AcpiOsUnmapMemory (Table, sizeof (ACPI_TABLE_HEADER));
+ 
+     if (Length < (sizeof (ACPI_TABLE_HEADER) + TableEntrySize))
+@@ -372,7 +374,7 @@ AcpiTbParseRootTable (
+ 
+     /* Get the number of entries and pointer to first entry */
+ 
+-    TableCount = (UINT32) ((Table->Length - sizeof (ACPI_TABLE_HEADER)) /
++    TableCount = (UINT32) ((Length - sizeof (ACPI_TABLE_HEADER)) /
+         TableEntrySize);
+     TableEntry = ACPI_ADD_PTR (UINT8, Table, sizeof (ACPI_TABLE_HEADER));
+ 
+@@ -394,10 +396,10 @@ AcpiTbParseRootTable (
+         Status = AcpiTbInstallStandardTable (Address,
+             ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, FALSE, TRUE, &TableIndex);
+ 
++	ACPI_MOVE_32_TO_32(&Tmp32,
++			   &AcpiGbl_RootTableList.Tables[TableIndex].Signature);
+         if (ACPI_SUCCESS (Status) &&
+-            ACPI_COMPARE_NAME (
+-                &AcpiGbl_RootTableList.Tables[TableIndex].Signature,
+-                ACPI_SIG_FADT))
++            ACPI_COMPARE_NAME (&Tmp32, ACPI_SIG_FADT))
+         {
+             AcpiGbl_FadtIndex = TableIndex;
+             AcpiTbParseFadt ();
+Index: acpica-unix2-20180629/source/components/tables/tbxface.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/tables/tbxface.c
++++ acpica-unix2-20180629/source/components/tables/tbxface.c
+@@ -293,8 +293,11 @@ AcpiGetTableHeader (
+ 
+     for (i = 0, j = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
+     {
++	UINT32 Tmp32;
++
++	ACPI_MOVE_32_TO_32(&Tmp32, (UINT32 *)Signature);
+         if (!ACPI_COMPARE_NAME (
+-                &(AcpiGbl_RootTableList.Tables[i].Signature), Signature))
++                &(AcpiGbl_RootTableList.Tables[i].Signature), &Tmp32))
+         {
+             continue;
+         }
+Index: acpica-unix2-20180629/source/components/tables/tbxfload.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/components/tables/tbxfload.c
++++ acpica-unix2-20180629/source/components/tables/tbxfload.c
+@@ -159,6 +159,7 @@ AcpiTbLoadNamespace (
+     ACPI_TABLE_DESC         *Table;
+     UINT32                  TablesLoaded = 0;
+     UINT32                  TablesFailed = 0;
++    UINT32		    Tmp32;
+ 
+ 
+     ACPI_FUNCTION_TRACE (TbLoadNamespace);
+@@ -172,8 +173,9 @@ AcpiTbLoadNamespace (
+      */
+     Table = &AcpiGbl_RootTableList.Tables[AcpiGbl_DsdtIndex];
+ 
++    ACPI_MOVE_32_TO_32(&Tmp32, &Table->Signature.Ascii);
+     if (!AcpiGbl_RootTableList.CurrentTableCount ||
+-        !ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_DSDT) ||
++        !ACPI_COMPARE_NAME (&Tmp32, ACPI_SIG_DSDT) ||
+          ACPI_FAILURE (AcpiTbValidateTable (Table)))
+     {
+         Status = AE_NO_ACPI_TABLES;
+Index: acpica-unix2-20180629/source/tools/acpiexec/aetables.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/tools/acpiexec/aetables.c
++++ acpica-unix2-20180629/source/tools/acpiexec/aetables.c
+@@ -146,21 +146,25 @@ AeInitializeTableHeader (
+     char                    *Signature,
+     UINT32                  Length)
+ {
++    UINT16		    Tmp16;
++    UINT32		    Tmp32;
+ 
+     ACPI_MOVE_NAME (Header->Signature, Signature);
+-    Header->Length = Length;
++    ACPI_MOVE_32_TO_32(&Header->Length, &Length);
+ 
+-    Header->OemRevision = 0x1001;
++    Tmp16 = 0x1001;
++    ACPI_MOVE_16_TO_16(&Header->OemRevision, &Tmp16);
+     memcpy (Header->OemId, "Intel ", ACPI_OEM_ID_SIZE);
+     memcpy (Header->OemTableId, "AcpiExec", ACPI_OEM_TABLE_ID_SIZE);
+     ACPI_MOVE_NAME (Header->AslCompilerId, "INTL");
+-    Header->AslCompilerRevision = ACPI_CA_VERSION;
++    Tmp32 = ACPI_CA_VERSION;
++    ACPI_MOVE_32_TO_32(&Header->AslCompilerRevision, &Tmp32);
+ 
+     /* Set the checksum, must set to zero first */
+ 
+     Header->Checksum = 0;
+     Header->Checksum = (UINT8) -AcpiTbChecksum (
+-        (void *) Header, Header->Length);
++        (void *) Header, Length);
+ }
+ 
+ 
+@@ -188,6 +192,7 @@ AeBuildLocalTables (
+     ACPI_NEW_TABLE_DESC     *NextTable;
+     UINT32                  NextIndex;
+     ACPI_TABLE_FADT         *ExternalFadt = NULL;
++    UINT32		    Tmp32;
+ 
+ 
+     /*
+@@ -374,6 +379,8 @@ AeBuildLocalTables (
+     }
+     else
+     {
++        UINT64		    Tmp64;
++
+         /*
+          * Build a local FADT so we can test the hardware/event init
+          */
+@@ -385,34 +392,44 @@ AeBuildLocalTables (
+         LocalFADT.Facs = 0;
+ 
+         LocalFADT.XDsdt = DsdtAddress;
+-        LocalFADT.XFacs = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
++        Tmp64 = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
++        ACPI_MOVE_64_TO_64(&LocalFADT.XFacs, &Tmp64);
+ 
+         /* Miscellaneous FADT fields */
+ 
+         LocalFADT.Gpe0BlockLength = 0x20;
+-        LocalFADT.Gpe0Block = 0x00003210;
++        Tmp32 = 0x00003210;
++        ACPI_MOVE_32_TO_32(&LocalFADT.Gpe0Block, &Tmp32);
+ 
+         LocalFADT.Gpe1BlockLength = 0x20;
+-        LocalFADT.Gpe1Block = 0x0000BA98;
++        Tmp32 = 0x0000BA98;
++        ACPI_MOVE_32_TO_32(&LocalFADT.Gpe1Block, &Tmp32);
+         LocalFADT.Gpe1Base = 0x80;
+ 
+         LocalFADT.Pm1EventLength = 4;
+-        LocalFADT.Pm1aEventBlock = 0x00001aaa;
+-        LocalFADT.Pm1bEventBlock = 0x00001bbb;
++        Tmp32 = 0x00001aaa;
++        ACPI_MOVE_32_TO_32(&LocalFADT.Pm1aEventBlock, &Tmp32);
++        Tmp32 = 0x00001bbb;
++        ACPI_MOVE_32_TO_32(&LocalFADT.Pm1bEventBlock, &Tmp32);
+ 
+         LocalFADT.Pm1ControlLength = 2;
+-        LocalFADT.Pm1aControlBlock = 0xB0;
++        Tmp32 = 0xB0;
++        ACPI_MOVE_32_TO_32(&LocalFADT.Pm1aControlBlock, &Tmp32);
+ 
+         LocalFADT.PmTimerLength = 4;
+-        LocalFADT.PmTimerBlock = 0xA0;
++        Tmp32 = 0xA0;
++        ACPI_MOVE_32_TO_32(&LocalFADT.PmTimerBlock, &Tmp32);
+ 
+-        LocalFADT.Pm2ControlBlock = 0xC0;
++        Tmp32 = 0xC0;
++        ACPI_MOVE_32_TO_32(&LocalFADT.Pm2ControlBlock, &Tmp32);
+         LocalFADT.Pm2ControlLength = 1;
+ 
+         /* Setup one example X-64 GAS field */
+ 
+         LocalFADT.XPm1bEventBlock.SpaceId = ACPI_ADR_SPACE_SYSTEM_IO;
+-        LocalFADT.XPm1bEventBlock.Address = LocalFADT.Pm1bEventBlock;
++	ACPI_MOVE_32_TO_32(&Tmp32, &LocalFADT.Pm1bEventBlock);
++	Tmp64 = (UINT64)Tmp32;
++        ACPI_MOVE_64_TO_64(&LocalFADT.XPm1bEventBlock.Address, &Tmp64);
+         LocalFADT.XPm1bEventBlock.BitWidth = (UINT8)
+             ACPI_MUL_8 (LocalFADT.Pm1EventLength);
+     }
+@@ -425,13 +442,17 @@ AeBuildLocalTables (
+     memset (&LocalFACS, 0, sizeof (ACPI_TABLE_FACS));
+     ACPI_MOVE_NAME (LocalFACS.Signature, ACPI_SIG_FACS);
+ 
+-    LocalFACS.Length = sizeof (ACPI_TABLE_FACS);
+-    LocalFACS.GlobalLock = 0x11AA0011;
++    Tmp32 = sizeof (ACPI_TABLE_FACS);
++    ACPI_MOVE_32_TO_32(&LocalFACS.Length, &Tmp32);
++    Tmp32 = 0x11AA0011;
++    ACPI_MOVE_32_TO_32(&LocalFACS.GlobalLock, &Tmp32);
+ 
+     /* Build the optional local tables */
+ 
+     if (AcpiGbl_LoadTestTables)
+     {
++	UINT32 Tmp32;
++
+         /*
+          * Build a fake table [TEST] so that we make sure that the
+          * ACPICA core ignores it
+@@ -440,11 +461,12 @@ AeBuildLocalTables (
+         ACPI_MOVE_NAME (LocalTEST.Signature, "TEST");
+ 
+         LocalTEST.Revision = 1;
+-        LocalTEST.Length = sizeof (ACPI_TABLE_HEADER);
++        Tmp32 = sizeof (ACPI_TABLE_HEADER);
++        ACPI_MOVE_32_TO_32(&LocalTEST.Length, &Tmp32);
+ 
+         LocalTEST.Checksum = 0;
+         LocalTEST.Checksum = (UINT8) -AcpiTbChecksum (
+-            (void *) &LocalTEST, LocalTEST.Length);
++            (void *) &LocalTEST, Tmp32);
+ 
+         /*
+          * Build a fake table with a bad signature [BAD!] so that we make
+@@ -454,11 +476,12 @@ AeBuildLocalTables (
+         ACPI_MOVE_NAME (LocalBADTABLE.Signature, "BAD!");
+ 
+         LocalBADTABLE.Revision = 1;
+-        LocalBADTABLE.Length = sizeof (ACPI_TABLE_HEADER);
++        Tmp32 = sizeof (ACPI_TABLE_HEADER);
++        ACPI_MOVE_32_TO_32(&LocalBADTABLE.Length, &Tmp32);
+ 
+         LocalBADTABLE.Checksum = 0;
+         LocalBADTABLE.Checksum = (UINT8) -AcpiTbChecksum (
+-            (void *) &LocalBADTABLE, LocalBADTABLE.Length);
++            (void *) &LocalBADTABLE, Tmp32);
+     }
+ 
+     return (AE_OK);
+Index: acpica-unix2-20180629/source/common/dmswitch.c
+===================================================================
+--- acpica-unix2-20180629.orig/source/common/dmswitch.c
++++ acpica-unix2-20180629/source/common/dmswitch.c
+@@ -88,13 +88,15 @@ AcpiDmProcessSwitch (
+     ACPI_PARSE_OBJECT_LIST  *Current;
+     ACPI_PARSE_OBJECT_LIST  *Previous;
+     BOOLEAN                 FoundTemp = FALSE;
++    UINT32		    Tmp32;
+ 
+ 
+     switch (Op->Common.AmlOpcode)
+     {
+     case AML_NAME_OP:
+ 
+-        Temp = (char *) (&Op->Named.Name);
++	ACPI_MOVE_32_TO_32(&Tmp32, &Op->Named.Name);
++        Temp = (char *) (&Tmp32);
+ 
+         if (!strncmp(Temp, "_T_", 3))
+         {
+@@ -138,7 +140,10 @@ AcpiDmProcessSwitch (
+         {
+             /* Note, if we get here Temp is not NULL */
+ 
+-            if (!strncmp(Temp, (char *) (&Current->Op->Named.Name), 4))
++   	    ACPI_MOVE_32_TO_32(&Tmp32, &Current->Op->Named.Name);
++
++            /* if (!strncmp(Temp, (char *) (&Current->Op->Named.Name), 4)) */
++            if (!strncmp(Temp, (char *) &Tmp32, 4))
+             {
+                 /* Match found. Ignore disassembly */
+ 
diff --git a/SOURCES/converterSample.asl.result b/SOURCES/converterSample.asl.result
new file mode 100644
index 0000000..dcc98cb
--- /dev/null
+++ b/SOURCES/converterSample.asl.result
@@ -0,0 +1,21 @@
+converterSample.asl     37:     Method(MAIN) {
+Remark   2120 -                          ^ Control Method should be made Serialized (due to creation of named objects within)
+
+converterSample.asl     48:             Name(b,0);
+Remark   2089 -    Object is not referenced ^  (Name [B___] is within a method [MAIN])
+
+converterSample.asl     65:     Method(SCOP)
+Remark   2120 -                          ^ Control Method should be made Serialized (due to creation of named objects within)
+
+converterSample.asl     68:         Name (a1, 0x04)
+Remark   2089 -  Object is not referenced ^  (Name [A1__] is within a method [SCOP])
+
+
+Intel ACPI Component Architecture
+ASL+ Optimizing Compiler/Disassembler version VVVVVVVV
+Copyright (c) 2000 - 2018 Intel Corporation
+
+ASL Input:     converterSample.asl - 85 lines, 1968 bytes, 11 keywords
+AML Output:    converterSample.aml - 180 bytes, 9 named objects, 2 executable opcodes
+
+Compilation complete. 0 Errors, 0 Warnings, 4 Remarks, 11 Optimizations, 1 Constants Folded
diff --git a/SOURCES/cve-2017-13693.patch b/SOURCES/cve-2017-13693.patch
new file mode 100644
index 0000000..baded1a
--- /dev/null
+++ b/SOURCES/cve-2017-13693.patch
@@ -0,0 +1,99 @@
+From 987a3b5cf7175916e2a4b6ea5b8e70f830dfe732 Mon Sep 17 00:00:00 2001
+From: Seunghun Han <kkamagui@gmail.com>
+Date: Wed, 19 Jul 2017 16:47:53 +0900
+Subject: [PATCH] acpi: acpica: fix acpi operand cache leak in dswstate.c
+
+I found an ACPI cache leak in ACPI early termination and boot continuing case.
+
+When early termination occurs due to malicious ACPI table, Linux kernel
+terminates ACPI function and continues to boot process. While kernel terminates
+ACPI function, kmem_cache_destroy() reports Acpi-Operand cache leak.
+
+Boot log of ACPI operand cache leak is as follows:
+>[    0.585957] ACPI: Added _OSI(Module Device)
+>[    0.587218] ACPI: Added _OSI(Processor Device)
+>[    0.588530] ACPI: Added _OSI(3.0 _SCP Extensions)
+>[    0.589790] ACPI: Added _OSI(Processor Aggregator Device)
+>[    0.591534] ACPI Error: Illegal I/O port address/length above 64K: C806E00000004002/0x2 (20170303/hwvalid-155)
+>[    0.594351] ACPI Exception: AE_LIMIT, Unable to initialize fixed events (20170303/evevent-88)
+>[    0.597858] ACPI: Unable to start the ACPI Interpreter
+>[    0.599162] ACPI Error: Could not remove SCI handler (20170303/evmisc-281)
+>[    0.601836] kmem_cache_destroy Acpi-Operand: Slab cache still has objects
+>[    0.603556] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.12.0-rc5 #26
+>[    0.605159] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
+>[    0.609177] Call Trace:
+>[    0.610063]  ? dump_stack+0x5c/0x81
+>[    0.611118]  ? kmem_cache_destroy+0x1aa/0x1c0
+>[    0.612632]  ? acpi_sleep_proc_init+0x27/0x27
+>[    0.613906]  ? acpi_os_delete_cache+0xa/0x10
+>[    0.617986]  ? acpi_ut_delete_caches+0x3f/0x7b
+>[    0.619293]  ? acpi_terminate+0xa/0x14
+>[    0.620394]  ? acpi_init+0x2af/0x34f
+>[    0.621616]  ? __class_create+0x4c/0x80
+>[    0.623412]  ? video_setup+0x7f/0x7f
+>[    0.624585]  ? acpi_sleep_proc_init+0x27/0x27
+>[    0.625861]  ? do_one_initcall+0x4e/0x1a0
+>[    0.627513]  ? kernel_init_freeable+0x19e/0x21f
+>[    0.628972]  ? rest_init+0x80/0x80
+>[    0.630043]  ? kernel_init+0xa/0x100
+>[    0.631084]  ? ret_from_fork+0x25/0x30
+>[    0.633343] vgaarb: loaded
+>[    0.635036] EDAC MC: Ver: 3.0.0
+>[    0.638601] PCI: Probing PCI hardware
+>[    0.639833] PCI host bridge to bus 0000:00
+>[    0.641031] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
+> ... Continue to boot and log is omitted ...
+
+I analyzed this memory leak in detail and found acpi_ds_obj_stack_pop_and_
+delete() function miscalculated the top of the stack. acpi_ds_obj_stack_push()
+function uses walk_state->operand_index for start position of the top, but
+acpi_ds_obj_stack_pop_and_delete() function considers index 0 for it.
+Therefore, this causes acpi operand memory leak.
+
+This cache leak causes a security threat because an old kernel (<= 4.9) shows
+memory locations of kernel functions in stack dump. Some malicious users
+could use this information to neutralize kernel ASLR.
+
+I made a patch to fix ACPI operand cache leak.
+
+Signed-off-by: Seunghun Han <kkamagui@gmail.com>
+
+Github-Location: https://github.com/acpica/acpica/pull/295/commits/987a3b5cf7175916e2a4b6ea5b8e70f830dfe732
+---
+ source/components/dispatcher/dsutils.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+Index: acpica-unix2-20180209/source/components/dispatcher/dsutils.c
+===================================================================
+--- acpica-unix2-20180209.orig/source/components/dispatcher/dsutils.c
++++ acpica-unix2-20180209/source/components/dispatcher/dsutils.c
+@@ -761,6 +761,8 @@ AcpiDsCreateOperands (
+     ACPI_PARSE_OBJECT       *Arguments[ACPI_OBJ_NUM_OPERANDS];
+     UINT32                  ArgCount = 0;
+     UINT32                  Index = WalkState->NumOperands;
++    UINT32                  PrevNumOperands = WalkState->NumOperands;
++    UINT32                  NewNumOperands;
+     UINT32                  i;
+ 
+ 
+@@ -793,6 +795,7 @@ AcpiDsCreateOperands (
+ 
+     /* Create the interpreter arguments, in reverse order */
+ 
++    NewNumOperands = Index;
+     Index--;
+     for (i = 0; i < ArgCount; i++)
+     {
+@@ -820,7 +823,11 @@ Cleanup:
+      * pop everything off of the operand stack and delete those
+      * objects
+      */
+-    AcpiDsObjStackPopAndDelete (ArgCount, WalkState);
++    WalkState->NumOperands = i;
++    AcpiDsObjStackPopAndDelete (NewNumOperands, WalkState);
++
++    /* Restore operand count */
++    WalkState->NumOperands = PrevNumOperands;
+ 
+     ACPI_EXCEPTION ((AE_INFO, Status, "While creating Arg %u", Index));
+     return_ACPI_STATUS (Status);
diff --git a/SOURCES/cve-2017-13694.patch b/SOURCES/cve-2017-13694.patch
new file mode 100644
index 0000000..c753108
--- /dev/null
+++ b/SOURCES/cve-2017-13694.patch
@@ -0,0 +1,216 @@
+From 4a0243ecb4c94e2d73510d096c5ea4d0711fc6c0 Mon Sep 17 00:00:00 2001
+From: Seunghun Han <kkamagui@gmail.com>
+Date: Fri, 23 Jun 2017 14:19:48 +0900
+Subject: [PATCH] acpi: acpica: fix acpi parse and parseext cache leaks
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+I'm Seunghun Han, and I work for National Security Research Institute of
+South Korea.
+
+I have been doing a research on ACPI and found an ACPI cache leak in ACPI
+early abort cases.
+
+Boot log of ACPI cache leak is as follows:
+[    0.352414] ACPI: Added _OSI(Module Device)
+[    0.353182] ACPI: Added _OSI(Processor Device)
+[    0.353182] ACPI: Added _OSI(3.0 _SCP Extensions)
+[    0.353182] ACPI: Added _OSI(Processor Aggregator Device)
+[    0.356028] ACPI: Unable to start the ACPI Interpreter
+[    0.356799] ACPI Error: Could not remove SCI handler (20170303/evmisc-281)
+[    0.360215] kmem_cache_destroy Acpi-State: Slab cache still has objects
+[    0.360648] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G        W
+4.12.0-rc4-next-20170608+ #10
+[    0.361273] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS
+VirtualBox 12/01/2006
+[    0.361873] Call Trace:
+[    0.362243]  ? dump_stack+0x5c/0x81
+[    0.362591]  ? kmem_cache_destroy+0x1aa/0x1c0
+[    0.362944]  ? acpi_sleep_proc_init+0x27/0x27
+[    0.363296]  ? acpi_os_delete_cache+0xa/0x10
+[    0.363646]  ? acpi_ut_delete_caches+0x6d/0x7b
+[    0.364000]  ? acpi_terminate+0xa/0x14
+[    0.364000]  ? acpi_init+0x2af/0x34f
+[    0.364000]  ? __class_create+0x4c/0x80
+[    0.364000]  ? video_setup+0x7f/0x7f
+[    0.364000]  ? acpi_sleep_proc_init+0x27/0x27
+[    0.364000]  ? do_one_initcall+0x4e/0x1a0
+[    0.364000]  ? kernel_init_freeable+0x189/0x20a
+[    0.364000]  ? rest_init+0xc0/0xc0
+[    0.364000]  ? kernel_init+0xa/0x100
+[    0.364000]  ? ret_from_fork+0x25/0x30
+
+I analyzed this memory leak in detail. I found that “Acpi-State” cache and
+“Acpi-Parse” cache were merged because the size of cache objects was same
+slab cache size.
+
+I finally found “Acpi-Parse” cache and “Acpi-ParseExt” cache were leaked
+using SLAB_NEVER_MERGE flag in kmem_cache_create() function.
+
+Real ACPI cache leak point is as follows:
+[    0.360101] ACPI: Added _OSI(Module Device)
+[    0.360101] ACPI: Added _OSI(Processor Device)
+[    0.360101] ACPI: Added _OSI(3.0 _SCP Extensions)
+[    0.361043] ACPI: Added _OSI(Processor Aggregator Device)
+[    0.364016] ACPI: Unable to start the ACPI Interpreter
+[    0.365061] ACPI Error: Could not remove SCI handler (20170303/evmisc-281)
+[    0.368174] kmem_cache_destroy Acpi-Parse: Slab cache still has objects
+[    0.369332] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G        W
+4.12.0-rc4-next-20170608+ #8
+[    0.371256] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS
+VirtualBox 12/01/2006
+[    0.372000] Call Trace:
+[    0.372000]  ? dump_stack+0x5c/0x81
+[    0.372000]  ? kmem_cache_destroy+0x1aa/0x1c0
+[    0.372000]  ? acpi_sleep_proc_init+0x27/0x27
+[    0.372000]  ? acpi_os_delete_cache+0xa/0x10
+[    0.372000]  ? acpi_ut_delete_caches+0x56/0x7b
+[    0.372000]  ? acpi_terminate+0xa/0x14
+[    0.372000]  ? acpi_init+0x2af/0x34f
+[    0.372000]  ? __class_create+0x4c/0x80
+[    0.372000]  ? video_setup+0x7f/0x7f
+[    0.372000]  ? acpi_sleep_proc_init+0x27/0x27
+[    0.372000]  ? do_one_initcall+0x4e/0x1a0
+[    0.372000]  ? kernel_init_freeable+0x189/0x20a
+[    0.372000]  ? rest_init+0xc0/0xc0
+[    0.372000]  ? kernel_init+0xa/0x100
+[    0.372000]  ? ret_from_fork+0x25/0x30
+[    0.388039] kmem_cache_destroy Acpi-ParseExt: Slab cache still has objects
+[    0.389063] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G        W
+4.12.0-rc4-next-20170608+ #8
+[    0.390557] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS
+VirtualBox 12/01/2006
+[    0.392000] Call Trace:
+[    0.392000]  ? dump_stack+0x5c/0x81
+[    0.392000]  ? kmem_cache_destroy+0x1aa/0x1c0
+[    0.392000]  ? acpi_sleep_proc_init+0x27/0x27
+[    0.392000]  ? acpi_os_delete_cache+0xa/0x10
+[    0.392000]  ? acpi_ut_delete_caches+0x6d/0x7b
+[    0.392000]  ? acpi_terminate+0xa/0x14
+[    0.392000]  ? acpi_init+0x2af/0x34f
+[    0.392000]  ? __class_create+0x4c/0x80
+[    0.392000]  ? video_setup+0x7f/0x7f
+[    0.392000]  ? acpi_sleep_proc_init+0x27/0x27
+[    0.392000]  ? do_one_initcall+0x4e/0x1a0
+[    0.392000]  ? kernel_init_freeable+0x189/0x20a
+[    0.392000]  ? rest_init+0xc0/0xc0
+[    0.392000]  ? kernel_init+0xa/0x100
+[    0.392000]  ? ret_from_fork+0x25/0x30
+
+When early abort is occurred due to invalid ACPI information, Linux kernel
+terminates ACPI by calling acpi_terminate() function. The function calls
+acpi_ut_delete_caches() function to delete local caches (acpi_gbl_namespace_
+cache, state_cache, operand_cache, ps_node_cache, ps_node_ext_cache).
+
+But the deletion codes in acpi_ut_delete_caches() function only delete
+slab caches using kmem_cache_destroy() function, therefore the cache
+objects should be flushed before acpi_ut_delete_caches() function.
+
+“Acpi-Parse” cache and “Acpi-ParseExt” cache are used in an AML parse
+function, acpi_ps_parse_loop(). The function should have flush codes to
+handle an error state due to invalid AML codes.
+
+This cache leak has a security threat because an old kernel (<= 4.9) shows
+memory locations of kernel functions in stack dump. Some malicious users
+could use this information to neutralize kernel ASLR.
+
+To fix ACPI cache leak for enhancing security, I made a patch which has
+flush codes in acpi_ps_parse_loop() function.
+
+I hope that this patch improves the security of Linux kernel.
+
+Thank you.
+
+Signed-off-by: Seunghun Han <kkamagui@gmail.com>
+
+Github-Location: https://github.com/acpica/acpica/pull/278/commits/4a0243ecb4c94e2d73510d096c5ea4d0711fc6c0
+
+---
+ source/components/parser/psobject.c | 44 ++++++++++++++-----------------------
+ 1 file changed, 16 insertions(+), 28 deletions(-)
+
+Index: acpica-unix2-20180531/source/components/parser/psobject.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/components/parser/psobject.c
++++ acpica-unix2-20180531/source/components/parser/psobject.c
+@@ -709,7 +709,8 @@ AcpiPsCompleteFinalOp (
+     ACPI_PARSE_OBJECT       *Op,
+     ACPI_STATUS             Status)
+ {
+-    ACPI_STATUS             Status2;
++    ACPI_STATUS             ReturnStatus = AE_OK;
++    BOOLEAN                 Ascending = TRUE;
+ 
+ 
+     ACPI_FUNCTION_TRACE_PTR (PsCompleteFinalOp, WalkState);
+@@ -726,7 +727,7 @@ AcpiPsCompleteFinalOp (
+     {
+         if (Op)
+         {
+-            if (WalkState->AscendingCallback != NULL)
++            if (Ascending && WalkState->AscendingCallback != NULL)
+             {
+                 WalkState->Op = Op;
+                 WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
+@@ -745,41 +746,28 @@ AcpiPsCompleteFinalOp (
+ 
+                 if (Status == AE_CTRL_TERMINATE)
+                 {
+-                    Status = AE_OK;
+-
+-                    /* Clean up */
+-                    do
+-                    {
+-                        if (Op)
+-                        {
+-                            Status2 = AcpiPsCompleteThisOp (WalkState, Op);
+-                            if (ACPI_FAILURE (Status2))
+-                            {
+-                                return_ACPI_STATUS (Status2);
+-                            }
+-                        }
+-
+-                        AcpiPsPopScope (&(WalkState->ParserState), &Op,
+-                            &WalkState->ArgTypes, &WalkState->ArgCount);
+-
+-                    } while (Op);
+-
+-                    return_ACPI_STATUS (Status);
++                    Ascending = FALSE;
++                    ReturnStatus = AE_CTRL_TERMINATE;
+                 }
+ 
+                 else if (ACPI_FAILURE (Status))
+                 {
+                     /* First error is most important */
+ 
+-                    (void) AcpiPsCompleteThisOp (WalkState, Op);
+-                    return_ACPI_STATUS (Status);
++                    Ascending = FALSE;
++                    ReturnStatus = Status;
+                 }
+             }
+ 
+-            Status2 = AcpiPsCompleteThisOp (WalkState, Op);
+-            if (ACPI_FAILURE (Status2))
++            Status = AcpiPsCompleteThisOp (WalkState, Op);
++            if (ACPI_FAILURE (Status))
+             {
+-                return_ACPI_STATUS (Status2);
++                Ascending = FALSE;
++                if (ACPI_SUCCESS (ReturnStatus) ||
++                    ReturnStatus == AE_CTRL_TERMINATE)
++                {
++                    ReturnStatus = Status;
++                }
+             }
+         }
+ 
+@@ -788,5 +776,5 @@ AcpiPsCompleteFinalOp (
+ 
+     } while (Op);
+ 
+-    return_ACPI_STATUS (Status);
++    return_ACPI_STATUS (ReturnStatus);
+ }
diff --git a/SOURCES/cve-2017-13695.patch b/SOURCES/cve-2017-13695.patch
new file mode 100644
index 0000000..8604d1e
--- /dev/null
+++ b/SOURCES/cve-2017-13695.patch
@@ -0,0 +1,90 @@
+From 37f2c716f2c6ab14c3ba557a539c3ee3224931b5 Mon Sep 17 00:00:00 2001
+From: Seunghun Han <kkamagui@gmail.com>
+Date: Wed, 19 Jul 2017 17:04:44 +0900
+Subject: [PATCH] acpi: acpica: fix acpi operand cache leak in nseval.c
+
+I found an ACPI cache leak in ACPI early termination and boot continuing case.
+
+When early termination occurs due to malicious ACPI table, Linux kernel
+terminates ACPI function and continues to boot process. While kernel terminates
+ACPI function, kmem_cache_destroy() reports Acpi-Operand cache leak.
+
+Boot log of ACPI operand cache leak is as follows:
+>[    0.464168] ACPI: Added _OSI(Module Device)
+>[    0.467022] ACPI: Added _OSI(Processor Device)
+>[    0.469376] ACPI: Added _OSI(3.0 _SCP Extensions)
+>[    0.471647] ACPI: Added _OSI(Processor Aggregator Device)
+>[    0.477997] ACPI Error: Null stack entry at ffff880215c0aad8 (20170303/exresop-174)
+>[    0.482706] ACPI Exception: AE_AML_INTERNAL, While resolving operands for [OpcodeName unavailable] (20170303/dswexec-461)
+>[    0.487503] ACPI Error: Method parse/execution failed [\DBG] (Node ffff88021710ab40), AE_AML_INTERNAL (20170303/psparse-543)
+>[    0.492136] ACPI Error: Method parse/execution failed [\_SB._INI] (Node ffff88021710a618), AE_AML_INTERNAL (20170303/psparse-543)
+>[    0.497683] ACPI: Interpreter enabled
+>[    0.499385] ACPI: (supports S0)
+>[    0.501151] ACPI: Using IOAPIC for interrupt routing
+>[    0.503342] ACPI Error: Null stack entry at ffff880215c0aad8 (20170303/exresop-174)
+>[    0.506522] ACPI Exception: AE_AML_INTERNAL, While resolving operands for [OpcodeName unavailable] (20170303/dswexec-461)
+>[    0.510463] ACPI Error: Method parse/execution failed [\DBG] (Node ffff88021710ab40), AE_AML_INTERNAL (20170303/psparse-543)
+>[    0.514477] ACPI Error: Method parse/execution failed [\_PIC] (Node ffff88021710ab18), AE_AML_INTERNAL (20170303/psparse-543)
+>[    0.518867] ACPI Exception: AE_AML_INTERNAL, Evaluating _PIC (20170303/bus-991)
+>[    0.522384] kmem_cache_destroy Acpi-Operand: Slab cache still has objects
+>[    0.524597] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.12.0-rc5 #26
+>[    0.526795] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
+>[    0.529668] Call Trace:
+>[    0.530811]  ? dump_stack+0x5c/0x81
+>[    0.532240]  ? kmem_cache_destroy+0x1aa/0x1c0
+>[    0.533905]  ? acpi_os_delete_cache+0xa/0x10
+>[    0.535497]  ? acpi_ut_delete_caches+0x3f/0x7b
+>[    0.537237]  ? acpi_terminate+0xa/0x14
+>[    0.538701]  ? acpi_init+0x2af/0x34f
+>[    0.540008]  ? acpi_sleep_proc_init+0x27/0x27
+>[    0.541593]  ? do_one_initcall+0x4e/0x1a0
+>[    0.543008]  ? kernel_init_freeable+0x19e/0x21f
+>[    0.546202]  ? rest_init+0x80/0x80
+>[    0.547513]  ? kernel_init+0xa/0x100
+>[    0.548817]  ? ret_from_fork+0x25/0x30
+>[    0.550587] vgaarb: loaded
+>[    0.551716] EDAC MC: Ver: 3.0.0
+>[    0.553744] PCI: Probing PCI hardware
+>[    0.555038] PCI host bridge to bus 0000:00
+> ... Continue to boot and log is omitted ...
+
+I analyzed this memory leak in detail and found AcpiNsEvaluate() function
+only removes Info->ReturnObject in AE_CTRL_RETURN_VALUE case. But, when errors
+occur, the status value is not AE_CTRL_RETURN_VALUE, and Info->ReturnObject is
+also not null. Therefore, this causes acpi operand memory leak.
+
+This cache leak causes a security threat because an old kernel (<= 4.9) shows
+memory locations of kernel functions in stack dump. Some malicious users
+could use this information to neutralize kernel ASLR.
+
+I made a patch to fix ACPI operand cache leak.
+
+Signed-off-by: Seunghun Han <kkamagui@gmail.com>
+
+Github-Location: https://github.com/acpica/acpica/pull/296/commits/37f2c716f2c6ab14c3ba557a539c3ee3224931b5
+
+---
+ source/components/namespace/nseval.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+Index: acpica-unix2-20180313/source/components/namespace/nseval.c
+===================================================================
+--- acpica-unix2-20180313.orig/source/components/namespace/nseval.c
++++ acpica-unix2-20180313/source/components/namespace/nseval.c
+@@ -330,6 +330,16 @@ AcpiNsEvaluate (
+             Info->ReturnObject = NULL;
+         }
+     }
++    else if (ACPI_FAILURE(Status)) 
++    {
++        /* If ReturnObject exists, delete it */
++
++        if (Info->ReturnObject) 
++        {
++            AcpiUtRemoveReference (Info->ReturnObject);
++            Info->ReturnObject = NULL;
++        }
++    }
+ 
+     ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
+         "*** Completed evaluation of object %s ***\n",
diff --git a/SOURCES/f23-harden.patch b/SOURCES/f23-harden.patch
new file mode 100644
index 0000000..2891d9b
--- /dev/null
+++ b/SOURCES/f23-harden.patch
@@ -0,0 +1,61 @@
+Introduce build hardening flags for f23
+
+From: Al Stone <ahs3@redhat.com>
+
+
+---
+ generate/unix/Makefile.config |    2 ++
+ generate/unix/iasl/Makefile   |   13 +++++++------
+ 2 files changed, 9 insertions(+), 6 deletions(-)
+
+Index: acpica-unix2-20180209/generate/unix/Makefile.config
+===================================================================
+--- acpica-unix2-20180209.orig/generate/unix/Makefile.config
++++ acpica-unix2-20180209/generate/unix/Makefile.config
+@@ -182,6 +182,8 @@ ifneq ($(NOFORTIFY),TRUE)
+ OPT_CFLAGS += -D_FORTIFY_SOURCE=2
+ endif
+ 
++OPT_CFLAGS += -fPIC -pie
++
+ CFLAGS += \
+     -D$(HOST)\
+     -D_GNU_SOURCE\
+Index: acpica-unix2-20180209/generate/unix/iasl/Makefile
+===================================================================
+--- acpica-unix2-20180209.orig/generate/unix/iasl/Makefile
++++ acpica-unix2-20180209/generate/unix/iasl/Makefile
+@@ -344,26 +344,27 @@ $(OBJDIR)/prparserparse.c $(OBJDIR)/prpa
+ # Cannot use the common compile warning flags since the C files are created
+ # by the utilities above and they are not necessarily ANSI C, etc.
+ #
++HARDENING_FLAGS = -fPIC -pie
+ $(OBJDIR)/aslcompilerlex.o :   $(OBJDIR)/aslcompilerlex.c
+ 	@echo "- " "Intermediate" $<
+-	@$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
++	@$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
+ 
+ $(OBJDIR)/aslcompilerparse.o : $(OBJDIR)/aslcompilerparse.c
+ 	@echo "- " "Intermediate" $<
+-	@$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
++	@$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
+ 
+ $(OBJDIR)/dtparserlex.o :      $(OBJDIR)/dtparserlex.c
+ 	@echo "- " "Intermediate" $<
+-	@$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
++	@$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
+ 
+ $(OBJDIR)/dtparserparse.o :    $(OBJDIR)/dtparserparse.c
+ 	@echo "- " "Intermediate" $<
+-	@$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
++	@$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
+ 
+ $(OBJDIR)/prparserlex.o :      $(OBJDIR)/prparserlex.c
+ 	@echo "- " "Intermediate" $<
+-	@$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
++	@$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
+ 
+ $(OBJDIR)/prparserparse.o :    $(OBJDIR)/prparserparse.c
+ 	@echo "- " "Intermediate" $<
+-	@$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
++	@$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
diff --git a/SOURCES/free.patch b/SOURCES/free.patch
new file mode 100644
index 0000000..7859da4
--- /dev/null
+++ b/SOURCES/free.patch
@@ -0,0 +1,15 @@
+This prevents a segfault when an Include file does not exist.
+
+Index: acpica-unix2-20170929/source/compiler/aslfiles.c
+===================================================================
+--- acpica-unix2-20170929.orig/source/compiler/aslfiles.c
++++ acpica-unix2-20170929/source/compiler/aslfiles.c
+@@ -318,7 +318,7 @@ FlOpenIncludeWithPrefix (
+     if (!IncludeFile)
+     {
+         fprintf (stderr, "Could not open include file %s\n", Pathname);
+-        ACPI_FREE (Pathname);
++        /* ACPI_FREE (Pathname); <-- forces free() segfault */
+         return (NULL);
+     }
+ 
diff --git a/SOURCES/grammar.asl.result b/SOURCES/grammar.asl.result
new file mode 100644
index 0000000..4b0ef21
--- /dev/null
+++ b/SOURCES/grammar.asl.result
@@ -0,0 +1,374 @@
+grammar.asl    120:     Device (A1)
+Warning  3141 -                 ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl    135:     Device (A2)
+Warning  3141 -                 ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl    145:     Device (A3)
+Warning  3141 -                 ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl    155:     Device (A4)
+Warning  3141 -                 ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl    171:     Device (IRES)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl    199:     Name (_NPK, Package ()
+Warning  3133 -                 ^ Unknown reserved name (_NPK)
+
+grammar.asl    208:     Device (RES)
+Warning  3141 -                  ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl    399:             CreateByteField (PRT0, R000._ASZ, RSIZ)
+Remark   2089 -                            Object is not referenced ^  (Name [RSIZ] is within a method [_CRS])
+
+grammar.asl    513:         Name (_STR, Unicode ("test"))
+Remark   2089 -                     ^ Object is not referenced (Name [_STR] is within a method [TCOP])
+
+grammar.asl    515:         Store (MFLD, Local0)
+Warning  3144 -                              ^ Method Local is set but never used (Local0)
+
+grammar.asl    522:     NAME (ESC1, "abcdefg\x00hijklmn")
+Warning  3055 -                                ^ Invalid Hex/Octal Escape - Non-ASCII or NULL
+
+grammar.asl    523:     NAME (ESC2, "abcdefg\000hijklmn")
+Warning  3055 -                                ^ Invalid Hex/Octal Escape - Non-ASCII or NULL
+
+grammar.asl    620:         RCIV (Subtract (Arg0, 1))
+Remark   2098 -               ^ Recursive method call (RCIV)
+
+grammar.asl    668:     Method(SMWE, 4)
+Remark   2146 -                  ^ Method Argument is never used (Arg0)
+
+grammar.asl    668:     Method(SMWE, 4)
+Remark   2146 -                  ^ Method Argument is never used (Arg1)
+
+grammar.asl    668:     Method(SMWE, 4)
+Remark   2146 -                  ^ Method Argument is never used (Arg2)
+
+grammar.asl    668:     Method(SMWE, 4)
+Remark   2146 -                  ^ Method Argument is never used (Arg3)
+
+grammar.asl    673:     Method(SMRE, 4)
+Remark   2146 -                  ^ Method Argument is never used (Arg0)
+
+grammar.asl    673:     Method(SMRE, 4)
+Remark   2146 -                  ^ Method Argument is never used (Arg1)
+
+grammar.asl    673:     Method(SMRE, 4)
+Remark   2146 -                  ^ Method Argument is never used (Arg2)
+
+grammar.asl    673:     Method(SMRE, 4)
+Remark   2146 -                  ^ Method Argument is never used (Arg3)
+
+grammar.asl    701:             CreateField (\_SB_.SBUF, 148, 96, FLDV)
+Remark   2089 -                            Object is not referenced ^  (Name [FLDV] is within a method [_INI])
+
+grammar.asl    733:             Method(_SRS)
+Warning  3102 -                          ^ Reserved method has too few arguments (_SRS requires 1)
+
+grammar.asl    738:             Device(EIO)
+Warning  3141 -      Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl    822:                     If(LNot(SMRE(0x09,0x17,Local2,RefOf(Local3)))){
+Warning  3144 -                              Method Local is set but never used ^  (Local3)
+
+grammar.asl    913:     Device (DEV1)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl    963:         Divide (Local0, Local1, Local3)
+Warning  3144 -      Method Local is set but never used ^  (Local3)
+
+grammar.asl    988:     Method (R226, 2)
+Remark   2146 -                   ^ Method Argument is never used (Arg0)
+
+grammar.asl    988:     Method (R226, 2)
+Remark   2146 -                   ^ Method Argument is never used (Arg1)
+
+grammar.asl   1011:         Store (Local0, Local1)
+Warning  3144 -                                ^ Method Local is set but never used (Local1)
+
+grammar.asl   1296:     Method (OBJ1, 1, SERIALIZED)
+Remark   2146 -                   ^ Method Argument is never used (Arg0)
+
+grammar.asl   1300:         Name(BUFR, Buffer (Local0) {})
+Remark   2089 -                    ^ Object is not referenced (Name [BUFR] is within a method [OBJ1])
+
+grammar.asl   1307:         Alias (MTX1, MTX2)
+Remark   2089 -   Object is not referenced ^  (Name [MTX2] is within a method [OBJ1])
+
+grammar.asl   1329:         CreateField (BUF2, 148, 96, FLD3)
+Remark   2089 -                  Object is not referenced ^  (Name [FLD3] is within a method [FLDS])
+
+grammar.asl   1394:         Store (0x1234567887654321, QWD2)
+Warning  3038 -                                    ^ Truncating 64-bit constant found in 32-bit table
+
+grammar.asl   1396:         if (LNotEqual (Local0, 0x1234567887654321))
+Warning  3038 -   Truncating 64-bit constant found in 32-bit table ^ 
+
+grammar.asl   1476:         SizeOf (BUFO)
+Error    6114 -                       ^ Result is not used, operator has no effect
+
+grammar.asl   1496:         Alias (MTX2, MTXA)
+Remark   2089 -   Object is not referenced ^  (Name [MTXA] is within a method [OBJ2])
+
+grammar.asl   1502:         Acquire (MTX2, 1)
+Warning  3130 -                           ^ Result is not used, possible operator timeout will be missed
+
+grammar.asl   1650:         Add (Local0, Local1)
+Error    6114 -                      ^ Result is not used, operator has no effect
+
+grammar.asl   1661:         Add (Local0, Local1, Local2)
+Warning  3144 -   Method Local is set but never used ^  (Local2)
+
+grammar.asl   1777:         Store (LAnd (0xFFFFFFFF, 0x11111111), Local0)
+Warning  3144 -                    Method Local is set but never used ^  (Local0)
+
+grammar.asl   1780:         Store (LEqual (0xFFFFFFFF, 0x11111111), Local1)
+Warning  3144 -                      Method Local is set but never used ^  (Local1)
+
+grammar.asl   1783:         Store (LGreater (0xFFFFFFFF, 0x11111111), Local2)
+Warning  3144 -                        Method Local is set but never used ^  (Local2)
+
+grammar.asl   1786:         Store (LGreaterEqual (0xFFFFFFFF, 0x11111111), Local3)
+Warning  3144 -                             Method Local is set but never used ^  (Local3)
+
+grammar.asl   1789:         Store (LLess (0xFFFFFFFF, 0x11111111), Local4)
+Warning  3144 -                     Method Local is set but never used ^  (Local4)
+
+grammar.asl   1792:         Store (LLessEqual (0xFFFFFFFF, 0x11111111), Local5)
+Warning  3144 -                          Method Local is set but never used ^  (Local5)
+
+grammar.asl   1821:     Method (COND)
+Warning  3115 -                   ^ Not all control paths return a value (COND)
+
+grammar.asl   1930:         Store (RefOf (MAIN), Local5)
+Warning  3144 -   Method Local is set but never used ^  (Local5)
+
+grammar.asl   2005:     Device (IFEL)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2162:     Device (NOSV)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2583:     Device (IDXF)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2611:             Store (IFE0, Local0)
+Warning  3144 -                                  ^ Method Local is set but never used (Local0)
+
+grammar.asl   2612:             Store (IFE1, Local1)
+Warning  3144 -                                  ^ Method Local is set but never used (Local1)
+
+grammar.asl   2613:             Store (IFE2, Local2)
+Warning  3144 -                                  ^ Method Local is set but never used (Local2)
+
+grammar.asl   2630:         Device (NSTL)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2658:     Device (RTBF)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2756:     Device (GPE2)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2771:     Device (PRW2)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2819:     Device (PRW1)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2886:             Store (Arg0, Local0)
+Warning  3144 -                                  ^ Method Local is set but never used (Local0)
+
+grammar.asl   2889:         Device (RTLV)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2993:             Name (_CRS,0)
+Error    6105 -                           ^ Invalid object type for reserved name (_CRS: found Integer, Buffer required)
+
+grammar.asl   3017:         Device (RETP)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   3053:     Device (WHLR)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   3109:     Device (ANDO)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   3383:     Device (BRKP)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   3420:     Device (ADSU)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   3513:     Device (INDC)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   3611:     Device (LOPS)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   3956:     Device (FDSO)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   4120:     Device (MLDV)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   4253:     Device (NBIT)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   4489:     Device (SHFT)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   4685:     Device (XORD)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   5022:     Device (CRBF)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   5100:     Device (IDX4)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   5639:     Device (EVNT)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   5867:     Device (SZLV)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   5960:         Device (BYTF)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   5970:         Device (C005)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   5972:             Device (C013)
+Warning  3141 -        Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   6027:             Name (_HID, "*PNP0A06")
+Error    6061 -            Invalid leading asterisk ^  (*PNP0A06)
+
+grammar.asl   6166:         Name (C18C, Package (2)
+Remark   2063 -                                 ^ Initializer list shorter than declared package length
+
+grammar.asl   6190:         Device (C19B)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   6199:                 Divide (Local1, 10, Local0, Local2) //  Local0 = Local1 / 10
+Warning  3144 -          Method Local is set but never used ^  (Local0)
+
+grammar.asl   6244:     Device (DWDF)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   6276:     Method (MKW_, 2)
+Remark   2146 -                   ^ Method Argument is never used (Arg0)
+
+grammar.asl   6276:     Method (MKW_, 2)
+Remark   2146 -                   ^ Method Argument is never used (Arg1)
+
+grammar.asl   6285:     Device (DVAX)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   6328:     Device (IDX6)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   6352:         Device (TST_)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   6371:             Store (IFE0, Local0)
+Warning  3144 -                                  ^ Method Local is set but never used (Local0)
+
+grammar.asl   6372:             Store (IFE1, Local1)
+Warning  3144 -                                  ^ Method Local is set but never used (Local1)
+
+grammar.asl   6373:             Store (IFE2, Local2)
+Warning  3144 -                                  ^ Method Local is set but never used (Local2)
+
+grammar.asl   6376:             Store (\IDX6.IFE0, Local3)
+Warning  3144 -     Method Local is set but never used ^  (Local3)
+
+grammar.asl   6377:             Store (\IDX6.IFE1, Local4)
+Warning  3144 -     Method Local is set but never used ^  (Local4)
+
+grammar.asl   6379:             Store (\IDX6.TST_.IFE0, Local5)
+Warning  3144 -          Method Local is set but never used ^  (Local5)
+
+grammar.asl   6380:             Store (\IDX6.TST_.IFE1, Local6)
+Warning  3144 -          Method Local is set but never used ^  (Local6)
+
+grammar.asl   6393:     Device (IDX5)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   6478:             Name (_CRS, Buffer(26)  {"\_SB_.PCI2._CRS..........."})
+Warning  3046 -        Invalid or unknown escape sequence ^ 
+
+grammar.asl   6709:         Device (BITI)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   6817:                 And (Local0, 1, Local0) //  Local0 &= 1
+Error    6066 -                              ^ Method local variable is not initialized (Local0)
+
+grammar.asl   6903:             Name (_HID, "*PNP0C0A")     //  Control Method Battey ID
+Error    6061 -            Invalid leading asterisk ^  (*PNP0C0A)
+
+grammar.asl   6912:         Device (IDX3)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   7057:     Device(IDX7)
+Warning  3141 -                  ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   7736:     Device (MTCH)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   7757:             CreateDWordField (TMD0, 4, DMA0)
+Remark   2089 -                     Object is not referenced ^  (Name [DMA0] is within a method [TEST])
+
+grammar.asl   7758:             CreateDWordField (TMD0, 8, PIO1)
+Remark   2089 -                     Object is not referenced ^  (Name [PIO1] is within a method [TEST])
+
+grammar.asl   7759:             CreateDWordField (TMD0, 12, DMA1)
+Remark   2089 -                      Object is not referenced ^  (Name [DMA1] is within a method [TEST])
+
+grammar.asl   7760:             CreateDWordField (TMD0, 16, CHNF)
+Remark   2089 -                      Object is not referenced ^  (Name [CHNF] is within a method [TEST])
+
+grammar.asl   7934:     Device (WHLB)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   8295:         Device (IDX2)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   8678:     Device (SIZO)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   8720:             Name (PKG2, Package (4)
+Remark   2063 -                                     ^ Initializer list shorter than declared package length
+
+grammar.asl   9132:             Store (_OS, Local0)
+Warning  3144 -                                 ^ Method Local is set but never used (Local0)
+
+grammar.asl   9262:         Device (MBIT)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   9273:         Device (MWRD)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   9281:         Device (MBYT)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   9354:         Device (SMIS)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   9408:         Device(CNDT)
+Warning  3141 -   Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+
+Intel ACPI Component Architecture
+ASL+ Optimizing Compiler/Disassembler version VVVVVVVV
+Copyright (c) 2000 - 2018 Intel Corporation
+
+Ignoring all errors, forcing AML file generation
+
+ASL Input:     grammar.asl - 10284 lines, 323650 bytes, 4818 keywords
+AML Output:    grammar.aml - 43758 bytes, 670 named objects, 4148 executable opcodes
+
+Compilation complete. 6 Errors, 88 Warnings, 27 Remarks, 1106 Optimizations
diff --git a/SOURCES/iasl.1 b/SOURCES/iasl.1
new file mode 100644
index 0000000..1938c7b
--- /dev/null
+++ b/SOURCES/iasl.1
@@ -0,0 +1,231 @@
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH IASL 1 "January 23, 2013"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+iasl \- ACPI Source Language compiler/decompiler
+.SH SYNOPSIS
+.B iasl
+.RI [ <option> ... ]
+.RI <input-file>
+.B ...
+.SH DESCRIPTION
+This manual page briefly documents the
+.B iasl
+command. The option list is taken from the iasl interactive help.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
+.\" respectively.
+.B iasl
+is an ASL compiler and decompiler.  This command provides both the ability
+to translate one or more ASL source files to their corresponding AML binary
+files, and the ability to translate AML binary files back to readable
+ASL source.
+.PP
+Much more detailed documentation may be found at
+http://www.acpica.org/documentation/.
+
+.SH OPTIONS
+
+.PP
+.SS Global
+.TP
+.B \-@ <file>
+Specify command file
+.TP
+.B \-I <dir>
+Specify additional include directory
+.TP
+.B \-T <sig>|ALL|*
+Create table template file for ACPI <sig>
+.TP
+.B \-v
+Display compiler version
+
+.PP
+.SS Preprocessor
+.TP
+.B \-D <symbol>
+Define sybol for preprocessor use
+.TP
+.B \-li
+Create prepocessed output file (*.i)
+.TP
+.B \-P
+Preprocess only and create preprocessor output file (*.i)
+.TP
+.B \-Pn
+Disable preprocessor
+
+.PP
+.SS General Output
+.TP
+.B \-p <prefix>
+Specify path/filename prefix for all output files
+.TP
+.B \-va
+Disable all errors and warnings (summary only)
+.TP
+.B \-vi
+Less verbose errors and warnings for use with IDEs
+.TP
+.B \-vo
+Enable optimization comments
+.TP
+.B \-vr
+Disable remarks
+.TP
+.B \-vs
+Disable signon
+.TP
+.B \-w{1|2|3}
+Set warning reporting level
+.TP
+.B \-we
+Report warnings as errors
+
+.PP
+.SS AML and Data Output Files
+.TP
+.B \-s{a|c}
+Create assembler or C source file (*.asm or *.c)
+.TP
+.B \-i{a|c}
+Create assembler or C include file (*.inc or *.h)
+.TP
+.B \-t{a|c|s}
+Create assembler, C, or ASL hex table (*.hex)
+
+.PP
+.SS AML Code Generation
+.TP
+.B \-oa
+Disable all optimizations (compatibility mode)
+.TP
+.B \-of
+Disable constant folding
+.TP
+.B \-oi
+Disable integer optimization to Zero/One/Ones
+.TP
+.B \-on
+Disable named reference string optimization
+.TP
+.B \-cr
+Disable Resource Descriptor error checking
+.TP
+.B \-in
+Ignore NoOp operators
+.TP
+.B \-r <revision>
+Override table header Revision (1-255)
+
+.PP
+.SS ASL Listing Files
+.TP
+.B \-l
+Create mixed listing file (ASL source and AML) (*.lst)
+.TP
+.B \-ln
+Create namespace file (*.nsp)
+.TP
+.B \-ls
+Create combined source file (expanded includes) (*.src)
+
+.PP
+.SS ACPI Data Tables
+.TP
+.B \-G
+Compile custom table containing generic operators
+.TP
+.B \-vt
+Create verbose templates (full disassembly)
+
+.PP
+.SS AML Disassembler
+.TP
+.B \-d [<file>]
+Disassemble AML to ASL source code file (*.dsl)
+.TP
+.B \-da [<file1>,<file2>]
+Disassemble multiple tables from single namespace
+.TP
+.B \-db
+Do not translate Buffers to Resource Templates
+.TP
+.B \-dc [<file>]
+Disassemble AML and immediately compile it
+.br
+(Obtain DSDT from current system if no input file)
+.TP
+.B \-e [<file1>,<file2>]
+Include ACPI table(s) for external symbol resolution
+.TP
+.B \-g
+Get ACPI tables and write to files (*.dat)
+.TP
+.B \-in
+Ignore NoOp opcodes
+.TP
+.B \-vt
+Dump binary table date in hex format within output file
+
+.PP
+.SS Help
+.TP
+.B \-h
+Additional help and compiler debug options
+.TP
+.B \-hc
+Display operators allowed in constant expressions
+.TP
+.B \-hf
+Display help for output file name generation
+.TP
+.B \-hr
+Display ACPI reserved method names
+.TP
+.B \-ht
+Display currently supported ACPI table names
+
+.PP
+.SS Debug
+.TP
+.B \-b{f|t}
+Create debug file (full or parse tree only) (*.txt)
+.TP
+.B \-f
+Ignore errors, force creation of AML output file(s)
+.TP
+.B \-n
+Parse only, no output generation
+.TP
+.B \-ot
+Display compiles times and statistics
+.TP
+.B \-x <level>
+Set debug level for trace output
+.TP
+.B \-z
+Do not insert new compiler ID for DataTables
+
+.SH AUTHOR
+iasl was written by Robert Moore <robert.moore@intel.com>.
+.PP
+This manual page was written by Mattia Dongili <malattia@debian.org>,
+for the Debian project (but may be used by others).  It was updated for
+the Fedora project by Al Stone <ahs3@redhat.com> (and may also be used
+by others).
diff --git a/SOURCES/int-format.patch b/SOURCES/int-format.patch
new file mode 100644
index 0000000..fcdf86e
--- /dev/null
+++ b/SOURCES/int-format.patch
@@ -0,0 +1,334 @@
+Use proper integer formatting
+
+From: Al Stone <ahs3@redhat.com>
+
+
+---
+ source/compiler/aslcompile.c            |    2 +-
+ source/compiler/aslerror.c              |    4 ++--
+ source/compiler/aslopt.c                |    2 +-
+ source/compiler/aslpredef.c             |    2 +-
+ source/compiler/aslprepkg.c             |    2 +-
+ source/components/debugger/dbexec.c     |    2 +-
+ source/components/dispatcher/dsmthdat.c |    4 ++--
+ source/components/dispatcher/dsutils.c  |    2 +-
+ source/components/dispatcher/dswscope.c |    4 ++--
+ source/components/events/evgpe.c        |    4 ++--
+ source/components/executer/exdump.c     |    2 +-
+ source/components/executer/exfldio.c    |    4 ++--
+ source/components/executer/exnames.c    |    4 ++--
+ source/components/hardware/hwregs.c     |    2 +-
+ source/components/tables/tbfadt.c       |    6 +++---
+ source/components/tables/tbxfroot.c     |    6 +++---
+ source/components/utilities/utownerid.c |    2 +-
+ source/tools/acpiexec/aemain.c          |    2 +-
+ 18 files changed, 28 insertions(+), 28 deletions(-)
+
+Index: acpica-unix2-20180531/source/compiler/aslcompile.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/compiler/aslcompile.c
++++ acpica-unix2-20180531/source/compiler/aslcompile.c
+@@ -750,7 +750,7 @@ CmCleanupAndExit (
+ 
+     if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT)
+     {
+-        printf ("\nMaximum error count (%u) exceeded\n",
++        printf ("\nMaximum error count (%d) exceeded\n",
+             ASL_MAX_ERROR_COUNT);
+     }
+ 
+Index: acpica-unix2-20180531/source/compiler/aslerror.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/compiler/aslerror.c
++++ acpica-unix2-20180531/source/compiler/aslerror.c
+@@ -880,7 +880,7 @@ AslLogNewError (
+     Gbl_ExceptionCount[Level]++;
+     if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT)
+     {
+-        printf ("\nMaximum error count (%u) exceeded\n", ASL_MAX_ERROR_COUNT);
++        printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT);
+ 
+         Gbl_SourceLine = 0;
+         Gbl_NextError = Gbl_ErrorLog;
+@@ -1036,7 +1036,7 @@ AslDisableException (
+ 
+     if (Gbl_DisabledMessagesIndex >= ASL_MAX_DISABLED_MESSAGES)
+     {
+-        printf ("Too many messages have been disabled (max %u)\n",
++        printf ("Too many messages have been disabled (max %d)\n",
+             ASL_MAX_DISABLED_MESSAGES);
+         return (AE_LIMIT);
+     }
+Index: acpica-unix2-20180531/source/compiler/aslopt.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/compiler/aslopt.c
++++ acpica-unix2-20180531/source/compiler/aslopt.c
+@@ -584,7 +584,7 @@ OptOptimizeNamePath (
+     }
+ 
+     ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
+-        "PATH OPTIMIZE: Line %5d ParentOp [%12.12s] ThisOp [%12.12s] ",
++        "PATH OPTIMIZE: Line %5u ParentOp [%12.12s] ThisOp [%12.12s] ",
+         Op->Asl.LogicalLineNumber,
+         AcpiPsGetOpcodeName (Op->Common.Parent->Common.AmlOpcode),
+         AcpiPsGetOpcodeName (Op->Common.AmlOpcode)));
+Index: acpica-unix2-20180531/source/compiler/aslpredef.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/compiler/aslpredef.c
++++ acpica-unix2-20180531/source/compiler/aslpredef.c
+@@ -114,7 +114,7 @@ ApCheckForPredefinedMethod (
+ 
+         if (MethodInfo->NumArguments != 0)
+         {
+-            sprintf (MsgBuffer, "%s requires %u", Op->Asl.ExternalName, 0);
++            sprintf (MsgBuffer, "%s requires %d", Op->Asl.ExternalName, 0);
+ 
+             AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op,
+                 MsgBuffer);
+Index: acpica-unix2-20180531/source/compiler/aslprepkg.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/compiler/aslprepkg.c
++++ acpica-unix2-20180531/source/compiler/aslprepkg.c
+@@ -309,7 +309,7 @@ ApCheckPackage (
+ 
+         if (Count & 1)
+         {
+-            sprintf (MsgBuffer, "%4.4s: Package length, %d, must be even.",
++            sprintf (MsgBuffer, "%4.4s: Package length, %u, must be even.",
+                 Predefined->Info.Name, Count);
+ 
+             AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH,
+Index: acpica-unix2-20180531/source/components/debugger/dbexec.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/components/debugger/dbexec.c
++++ acpica-unix2-20180531/source/components/debugger/dbexec.c
+@@ -230,7 +230,7 @@ AcpiDbExecuteMethod (
+             ACPI_ERROR ((AE_INFO,
+                 "Possible overflow of internal debugger "
+                 "buffer (size 0x%X needed 0x%X)",
+-                ACPI_DEBUG_BUFFER_SIZE, (UINT32) ReturnObj->Length));
++                (UINT32) ACPI_DEBUG_BUFFER_SIZE, (UINT32) ReturnObj->Length));
+         }
+     }
+ 
+Index: acpica-unix2-20180531/source/components/dispatcher/dsmthdat.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/components/dispatcher/dsmthdat.c
++++ acpica-unix2-20180531/source/components/dispatcher/dsmthdat.c
+@@ -291,7 +291,7 @@ AcpiDsMethodDataGetNode (
+         if (Index > ACPI_METHOD_MAX_LOCAL)
+         {
+             ACPI_ERROR ((AE_INFO,
+-                "Local index %u is invalid (max %u)",
++                "Local index %u is invalid (max %d)",
+                 Index, ACPI_METHOD_MAX_LOCAL));
+             return_ACPI_STATUS (AE_AML_INVALID_INDEX);
+         }
+@@ -306,7 +306,7 @@ AcpiDsMethodDataGetNode (
+         if (Index > ACPI_METHOD_MAX_ARG)
+         {
+             ACPI_ERROR ((AE_INFO,
+-                "Arg index %u is invalid (max %u)",
++                "Arg index %u is invalid (max %d)",
+                 Index, ACPI_METHOD_MAX_ARG));
+             return_ACPI_STATUS (AE_AML_INVALID_INDEX);
+         }
+Index: acpica-unix2-20180531/source/components/dispatcher/dsutils.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/components/dispatcher/dsutils.c
++++ acpica-unix2-20180531/source/components/dispatcher/dsutils.c
+@@ -788,7 +788,7 @@ AcpiDsCreateOperands (
+     }
+ 
+     ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+-        "NumOperands %d, ArgCount %d, Index %d\n",
++        "NumOperands %d, ArgCount %u, Index %u\n",
+         WalkState->NumOperands, ArgCount, Index));
+ 
+     /* Create the interpreter arguments, in reverse order */
+Index: acpica-unix2-20180531/source/components/dispatcher/dswscope.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/components/dispatcher/dswscope.c
++++ acpica-unix2-20180531/source/components/dispatcher/dswscope.c
+@@ -149,7 +149,7 @@ AcpiDsScopeStackPush (
+     WalkState->ScopeDepth++;
+ 
+     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+-        "[%.2d] Pushed scope ", (UINT32) WalkState->ScopeDepth));
++        "[%.2d] Pushed scope ", WalkState->ScopeDepth));
+ 
+     OldScopeInfo = WalkState->ScopeInfo;
+     if (OldScopeInfo)
+@@ -211,7 +211,7 @@ AcpiDsScopeStackPop (
+     WalkState->ScopeDepth--;
+ 
+     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+-        "[%.2d] Popped scope [%4.4s] (%s), New scope -> ",
++        "[%.2u] Popped scope [%4.4s] (%s), New scope -> ",
+         (UINT32) WalkState->ScopeDepth,
+         AcpiUtGetNodeName (ScopeInfo->Scope.Node),
+         AcpiUtGetTypeName (ScopeInfo->Common.Value)));
+Index: acpica-unix2-20180531/source/components/events/evgpe.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/components/events/evgpe.c
++++ acpica-unix2-20180531/source/components/events/evgpe.c
+@@ -481,7 +481,7 @@ AcpiEvGpeDetect (
+                     "Ignore disabled registers for GPE %02X-%02X: "
+                     "RunEnable=%02X, WakeEnable=%02X\n",
+                     GpeRegisterInfo->BaseGpeNumber,
+-                    GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
++                    (unsigned int) (GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1)),
+                     GpeRegisterInfo->EnableForRun,
+                     GpeRegisterInfo->EnableForWake));
+                 continue;
+Index: acpica-unix2-20180531/source/components/executer/exdump.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/components/executer/exdump.c
++++ acpica-unix2-20180531/source/components/executer/exdump.c
+@@ -678,7 +678,7 @@ AcpiExDumpOperand (
+     if (Depth > 0)
+     {
+         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%*s[%u] %p Refs=%u ",
+-            Depth, " ", Depth, ObjDesc, ObjDesc->Common.ReferenceCount));
++            (int) Depth, " ", Depth, ObjDesc, ObjDesc->Common.ReferenceCount));
+     }
+     else
+     {
+Index: acpica-unix2-20180531/source/components/executer/exfldio.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/components/executer/exfldio.c
++++ acpica-unix2-20180531/source/components/executer/exfldio.c
+@@ -681,8 +681,8 @@ AcpiExWriteWithUpdateRule (
+ 
+             ACPI_ERROR ((AE_INFO,
+                 "Unknown UpdateRule value: 0x%X",
+-                (ObjDesc->CommonField.FieldFlags &
+-                    AML_FIELD_UPDATE_RULE_MASK)));
++                (unsigned int) (ObjDesc->CommonField.FieldFlags &
++                                   AML_FIELD_UPDATE_RULE_MASK)));
+             return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
+         }
+     }
+Index: acpica-unix2-20180531/source/components/executer/exnames.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/components/executer/exnames.c
++++ acpica-unix2-20180531/source/components/executer/exnames.c
+@@ -237,7 +237,7 @@ AcpiExNameSegment (
+          */
+         ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+             "Leading character is not alpha: %02Xh (not a name)\n",
+-            CharBuf[0]));
++            (unsigned int) CharBuf[0]));
+         Status = AE_CTRL_PENDING;
+     }
+     else
+@@ -249,7 +249,7 @@ AcpiExNameSegment (
+         Status = AE_AML_BAD_NAME;
+         ACPI_ERROR ((AE_INFO,
+             "Bad character 0x%02x in name, at %p",
+-            *AmlAddress, AmlAddress));
++            (unsigned int) (*AmlAddress), AmlAddress));
+     }
+ 
+     *InAmlAddress = ACPI_CAST_PTR (UINT8, AmlAddress);
+Index: acpica-unix2-20180531/source/components/hardware/hwregs.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/components/hardware/hwregs.c
++++ acpica-unix2-20180531/source/components/hardware/hwregs.c
+@@ -460,7 +460,7 @@ AcpiHwClearAcpiStatus (
+ 
+ 
+     ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %04X to %8.8X%8.8X\n",
+-        ACPI_BITMASK_ALL_FIXED_STATUS,
++        (UINT32) ACPI_BITMASK_ALL_FIXED_STATUS,
+         ACPI_FORMAT_UINT64 (AcpiGbl_XPm1aStatus.Address)));
+ 
+     LockFlags = AcpiOsAcquireLock (AcpiGbl_HardwareLock);
+Index: acpica-unix2-20180531/source/components/tables/tbfadt.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/components/tables/tbfadt.c
++++ acpica-unix2-20180531/source/components/tables/tbfadt.c
+@@ -233,7 +233,7 @@ AcpiTbInitGenericAddress (
+         if (!(Flags & ACPI_FADT_GPE_REGISTER))
+         {
+             ACPI_ERROR ((AE_INFO,
+-                "%s - 32-bit FADT register is too long (%u bytes, %u bits) "
++                "%s - 32-bit FADT register is too long (%u bytes, %d bits) "
+                 "to convert to GAS struct - 255 bits max, truncating",
+                 RegisterName, ByteWidth, (ByteWidth * 8)));
+         }
+@@ -304,7 +304,7 @@ AcpiTbSelectAddress (
+ 
+         ACPI_BIOS_WARNING ((AE_INFO,
+             "32/64X %s address mismatch in FADT: "
+-            "0x%8.8X/0x%8.8X%8.8X, using %u-bit address",
++            "0x%8.8X/0x%8.8X%8.8X, using %d-bit address",
+             RegisterName, Address32, ACPI_FORMAT_UINT64 (Address64),
+             AcpiGbl_Use32BitFadtAddresses ? 32 : 64));
+ 
+@@ -628,7 +628,7 @@ AcpiTbConvertFadt (
+ 
+                     ACPI_BIOS_WARNING ((AE_INFO,
+                         "32/64X address mismatch in FADT/%s: "
+-                        "0x%8.8X/0x%8.8X%8.8X, using %u-bit address",
++                        "0x%8.8X/0x%8.8X%8.8X, using %d-bit address",
+                         Name, Address32,
+                         ACPI_FORMAT_UINT64 (Address64->Address),
+                         AcpiGbl_Use32BitFadtAddresses ? 32 : 64));
+Index: acpica-unix2-20180531/source/components/tables/tbxfroot.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/components/tables/tbxfroot.c
++++ acpica-unix2-20180531/source/components/tables/tbxfroot.c
+@@ -177,7 +177,7 @@ AcpiFindRootPointer (
+     {
+         ACPI_ERROR ((AE_INFO,
+             "Could not map memory at 0x%8.8X for length %u",
+-            ACPI_EBDA_PTR_LOCATION, ACPI_EBDA_PTR_LENGTH));
++            (UINT32) ACPI_EBDA_PTR_LOCATION, (UINT32) ACPI_EBDA_PTR_LENGTH));
+ 
+         return_ACPI_STATUS (AE_NO_MEMORY);
+     }
+@@ -204,7 +204,7 @@ AcpiFindRootPointer (
+         {
+             ACPI_ERROR ((AE_INFO,
+                 "Could not map memory at 0x%8.8X for length %u",
+-                PhysicalAddress, ACPI_EBDA_WINDOW_SIZE));
++                PhysicalAddress, (UINT32) ACPI_EBDA_WINDOW_SIZE));
+ 
+             return_ACPI_STATUS (AE_NO_MEMORY);
+         }
+@@ -236,7 +236,7 @@ AcpiFindRootPointer (
+     {
+         ACPI_ERROR ((AE_INFO,
+             "Could not map memory at 0x%8.8X for length %u",
+-            ACPI_HI_RSDP_WINDOW_BASE, ACPI_HI_RSDP_WINDOW_SIZE));
++            (UINT32) ACPI_HI_RSDP_WINDOW_BASE, (UINT32) ACPI_HI_RSDP_WINDOW_SIZE));
+ 
+         return_ACPI_STATUS (AE_NO_MEMORY);
+     }
+Index: acpica-unix2-20180531/source/components/utilities/utownerid.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/components/utilities/utownerid.c
++++ acpica-unix2-20180531/source/components/utilities/utownerid.c
+@@ -237,7 +237,7 @@ AcpiUtReleaseOwnerId (
+     else
+     {
+         ACPI_ERROR ((AE_INFO,
+-            "Release of non-allocated OwnerId: 0x%2.2X", OwnerId + 1));
++            "Release of non-allocated OwnerId: 0x%2.2X", (UINT32) OwnerId + 1));
+     }
+ 
+     (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES);
+Index: acpica-unix2-20180531/source/tools/acpiexec/aemain.c
+===================================================================
+--- acpica-unix2-20180531.orig/source/tools/acpiexec/aemain.c
++++ acpica-unix2-20180531/source/tools/acpiexec/aemain.c
+@@ -209,7 +209,7 @@ AeDoOptions (
+ 
+         if (strlen (AcpiGbl_Optarg) > (AE_BUFFER_SIZE -1))
+         {
+-            printf ("**** The length of command line (%u) exceeded maximum (%u)\n",
++            printf ("**** The length of command line (%u) exceeded maximum (%d)\n",
+                 (UINT32) strlen (AcpiGbl_Optarg), (AE_BUFFER_SIZE -1));
+             return (-1);
+         }
diff --git a/SOURCES/mips-be-fix.patch b/SOURCES/mips-be-fix.patch
new file mode 100644
index 0000000..089dbb0
--- /dev/null
+++ b/SOURCES/mips-be-fix.patch
@@ -0,0 +1,37 @@
+Index: acpica-unix2-20180313/source/compiler/aslparseop.c
+===================================================================
+--- acpica-unix2-20180313.orig/source/compiler/aslparseop.c
++++ acpica-unix2-20180313/source/compiler/aslparseop.c
+@@ -283,7 +283,16 @@ TrCreateValuedLeafOp (
+ 
+ 
+     Op = TrAllocateOp (ParseOpcode);
+-    Op->Asl.Value.Integer = Value;
++    if (ParseOpcode == PARSEOP_NAMESTRING ||
++        ParseOpcode == PARSEOP_NAMESEG ||
++        ParseOpcode == PARSEOP_STRING_LITERAL)
++    {
++        Op->Asl.Value.String = (char *) Value;
++    }
++    else
++    {
++        Op->Asl.Value.Integer = Value;
++    }
+ 
+     DbgPrint (ASL_PARSE_OUTPUT,
+         "\nCreateValuedLeafOp  Ln/Col %u/%u NewOp %p  "
+Index: acpica-unix2-20180313/source/include/platform/aclinux.h
+===================================================================
+--- acpica-unix2-20180313.orig/source/include/platform/aclinux.h
++++ acpica-unix2-20180313/source/include/platform/aclinux.h
+@@ -227,10 +227,8 @@
+ #endif
+ 
+ #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+-#if defined(__PPC64__) || defined(__s390x__)
+ #define ACPI_BIG_ENDIAN
+ #endif
+-#endif
+ 
+ #endif /* __KERNEL__ */
+ 
diff --git a/SOURCES/ppc64le.patch b/SOURCES/ppc64le.patch
new file mode 100644
index 0000000..da956f0
--- /dev/null
+++ b/SOURCES/ppc64le.patch
@@ -0,0 +1,16 @@
+Index: acpica-unix2-20180313/source/include/platform/aclinux.h
+===================================================================
+--- acpica-unix2-20180313.orig/source/include/platform/aclinux.h
++++ acpica-unix2-20180313/source/include/platform/aclinux.h
+@@ -228,9 +228,11 @@
+ #define __cdecl
+ #endif
+ 
++#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ #if defined(__PPC64__) || defined(__s390x__)
+ #define ACPI_BIG_ENDIAN
+ #endif
++#endif
+ 
+ #endif /* __KERNEL__ */
+ 
diff --git a/SOURCES/ptr-cast.patch b/SOURCES/ptr-cast.patch
new file mode 100644
index 0000000..369d308
--- /dev/null
+++ b/SOURCES/ptr-cast.patch
@@ -0,0 +1,48 @@
+diff -Naur acpica-unix2-20180209.orig/source/components/tables/tbutils.c acpica-unix2-20180209/source/components/tables/tbutils.c
+--- acpica-unix2-20180209.orig/source/components/tables/tbutils.c	2018-03-15 16:47:21.831526264 -0600
++++ acpica-unix2-20180209/source/components/tables/tbutils.c	2018-03-15 16:58:20.030097284 -0600
+@@ -238,9 +238,11 @@
+          * 64-bit platform, XSDT: Move (unaligned) 64-bit to local,
+          *  return 64-bit
+          */
+-	Address64 = (UINT64) TableEntry;
+ 
+ #if ACPI_MACHINE_WIDTH == 32
++	UINT32 Tmp32 = (UINT32) TableEntry;
++
++	Address64 = (UINT64) Tmp32;
+         if (Address64 > ACPI_UINT32_MAX)
+         {
+             /* Will truncate 64-bit address to 32 bits, issue warning */
+@@ -250,9 +252,15 @@
+                 " truncating",
+                 ACPI_FORMAT_UINT64 (Address64)));
+         }
+-#endif
++
++        return ((ACPI_PHYSICAL_ADDRESS) (*ACPI_CAST_PTR (
++            UINT32, TableEntry)));
++#else
++	Address64 = (UINT64) TableEntry;
++
+         return ((ACPI_PHYSICAL_ADDRESS) (*ACPI_CAST_PTR (
+             UINT64, Address64)));
++#endif
+     }
+ }
+ 
+diff -Naur acpica-unix2-20180209.orig/source/compiler/aslparseop.c acpica-unix2-20180209/source/compiler/aslparseop.c
+--- acpica-unix2-20180209.orig/source/compiler/aslparseop.c	2018-03-15 17:20:09.844338074 -0600
++++ acpica-unix2-20180209/source/compiler/aslparseop.c	2018-03-15 17:28:19.570800797 -0600
+@@ -287,7 +287,11 @@
+         ParseOpcode == PARSEOP_NAMESEG ||
+         ParseOpcode == PARSEOP_STRING_LITERAL)
+     {
++#if ACPI_MACHINE_WIDTH == 32
++        Op->Asl.Value.String = (char *) (UINT32) Value;
++#else
+         Op->Asl.Value.String = (char *) Value;
++#endif
+     }
+     else
+     {
diff --git a/SOURCES/run-misc-tests.sh b/SOURCES/run-misc-tests.sh
new file mode 100644
index 0000000..e16babf
--- /dev/null
+++ b/SOURCES/run-misc-tests.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+#
+#       run the misc tests: we need to do this in a script since
+#       some of these are expected to fail which would normally cause
+#	the %check step to stop.  however, this is expected behavior.
+#	we are running iasl precisely because we expect it to stop when
+#	presented with faulty ASL.
+#
+#       this script assumes it is in the source 'tests' directory at
+#       start.
+#
+
+set -x
+
+BINDIR="$1"
+VERSION="$2"
+
+# create files to compare against
+$BINDIR/iasl -h
+
+sed -e "s/VVVVVVVV/$VERSION/" \
+    ../badcode.asl.result > misc/badcode.asl.expected
+sed -e "s/VVVVVVVV/$VERSION/" \
+    ../grammar.asl.result > misc/grammar.asl.expected
+sed -e "s/VVVVVVVV/$VERSION/" \
+    ../converterSample.asl.result > misc/converterSample.asl.expected
+
+cd misc
+
+# see if badcode.asl failed as expected
+# NB: the -f option is required so we can see all of the errors
+$BINDIR/iasl -f badcode.asl 2>&1 | tee badcode.asl.actual
+diff badcode.asl.actual badcode.asl.expected >/dev/null 2>&1
+[ $? -eq 0 ] || exit 1
+
+# see if grammar.asl failed as expected
+# NB: the -f option is required so we can see all of the errors
+$BINDIR/iasl -f -of grammar.asl 2>&1 | tee grammar.asl.actual
+diff grammar.asl.actual grammar.asl.expected >/dev/null 2>&1
+[ $? -eq 0 ] || exit 1
+
+# see if converterSample.asl succeeded as expected
+$BINDIR/iasl converterSample.asl 2>&1 | tee converterSample.asl.actual
+diff converterSample.asl.actual converterSample.asl.expected >/dev/null 2>&1
+[ $? -ne 0 ] && exit 1
+
+exit 0
diff --git a/SOURCES/simple-64bit.patch b/SOURCES/simple-64bit.patch
new file mode 100644
index 0000000..9350704
--- /dev/null
+++ b/SOURCES/simple-64bit.patch
@@ -0,0 +1,20 @@
+Description: Stop listing all 64bit architectures
+ Check __LP64__ instead of maintaining a list of all
+ 64bit architectures.
+Author: Adrian Bunk <bunk@debian.org>
+
+Index: acpica-unix2-20180313/source/include/platform/aclinux.h
+===================================================================
+--- acpica-unix2-20180313.orig/source/include/platform/aclinux.h
++++ acpica-unix2-20180313/source/include/platform/aclinux.h
+@@ -210,9 +210,7 @@
+ #define ACPI_FLUSH_CPU_CACHE()
+ #define ACPI_CAST_PTHREAD_T(Pthread) ((ACPI_THREAD_ID) (Pthread))
+ 
+-#if defined(__ia64__)    || (defined(__x86_64__) && !defined(__ILP32__)) ||\
+-    defined(__aarch64__) || defined(__PPC64__) ||\
+-    defined(__s390x__)
++#if defined(__LP64__)
+ #define ACPI_MACHINE_WIDTH          64
+ #define COMPILER_DEPENDENT_INT64    long
+ #define COMPILER_DEPENDENT_UINT64   unsigned long
diff --git a/SOURCES/str-trunc-warn.patch b/SOURCES/str-trunc-warn.patch
new file mode 100644
index 0000000..fe89c4c
--- /dev/null
+++ b/SOURCES/str-trunc-warn.patch
@@ -0,0 +1,112 @@
+Index: acpica-unix2-20180209/source/compiler/aslanalyze.c
+===================================================================
+--- acpica-unix2-20180209.orig/source/compiler/aslanalyze.c
++++ acpica-unix2-20180209/source/compiler/aslanalyze.c
+@@ -355,11 +355,16 @@ AnCheckMethodReturnValue (
+          */
+         if (ThisNodeBtype != 0)
+         {
+-            sprintf (MsgBuffer,
++	     int cnt;
++	     char *strp;
++
++            cnt = asprintf (&strp,
+                 "Method returns [%s], %s operator requires [%s]",
+                 StringBuffer, OpInfo->Name, StringBuffer2);
+ 
+-            AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, MsgBuffer);
++            AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, strp);
++	     if (cnt > 0)
++	         free(strp);
+         }
+     }
+ }
+Index: acpica-unix2-20180209/source/compiler/aslpredef.c
+===================================================================
+--- acpica-unix2-20180209.orig/source/compiler/aslpredef.c
++++ acpica-unix2-20180209/source/compiler/aslpredef.c
+@@ -159,14 +159,19 @@ ApCheckForPredefinedMethod (
+         if (MethodInfo->NumReturnNoValue &&
+             ThisName->Info.ExpectedBtypes)
+         {
++	     int cnt;
++	     char *strp;
++
+             AcpiUtGetExpectedReturnTypes (StringBuffer,
+                 ThisName->Info.ExpectedBtypes);
+ 
+-            sprintf (MsgBuffer, "%s required for %4.4s",
+-                StringBuffer, ThisName->Info.Name);
++            cnt = asprintf (&strp, "%s required for %4.4s",
++	        StringBuffer, ThisName->Info.Name);
+ 
+             AslError (ASL_WARNING, ASL_MSG_RESERVED_RETURN_VALUE, Op,
+-                MsgBuffer);
++                strp);
++	     if (cnt > 0)
++	        free(strp);
+         }
+         break;
+     }
+@@ -698,18 +703,26 @@ TypeErrorExit:
+ 
+     AcpiUtGetExpectedReturnTypes (StringBuffer, ExpectedBtypes);
+ 
+-    if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
+-    {
+-        sprintf (MsgBuffer, "%4.4s: found %s, %s required",
+-            PredefinedName, TypeName, StringBuffer);
+-    }
+-    else
+     {
+-        sprintf (MsgBuffer, "%4.4s: found %s at index %u, %s required",
+-            PredefinedName, TypeName, PackageIndex, StringBuffer);
++        int cnt;
++	char *strp;
++
++        if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
++        {
++            cnt = asprintf (&strp, "%4.4s: found %s, %s required",
++                PredefinedName, TypeName, StringBuffer);
++        }
++        else
++        {
++            cnt = asprintf (&strp, "%4.4s: found %s at index %u, %s required",
++                PredefinedName, TypeName, PackageIndex, StringBuffer);
++        }
++
++        AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op, strp);
++	if (cnt > 0)
++	    free(strp);
+     }
+ 
+-    AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op, MsgBuffer);
+     return (AE_TYPE);
+ }
+ 
+Index: acpica-unix2-20180209/source/compiler/aslwalks.c
+===================================================================
+--- acpica-unix2-20180209.orig/source/compiler/aslwalks.c
++++ acpica-unix2-20180209/source/compiler/aslwalks.c
+@@ -507,15 +507,19 @@ AnOperandTypecheckWalkEnd (
+             else if (!CommonBtypes)
+             {
+                 /* No match -- this is a type mismatch error */
++		int cnt;
++		char *strp;
+ 
+                 AnFormatBtype (StringBuffer, ThisNodeBtype);
+                 AnFormatBtype (StringBuffer2, RequiredBtypes);
+ 
+-                sprintf (MsgBuffer, "[%s] found, %s operator requires [%s]",
++                cnt = asprintf (&strp, "[%s] found, %s operator requires [%s]",
+                     StringBuffer, OpInfo->Name, StringBuffer2);
+ 
+                 AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE,
+-                    ArgOp, MsgBuffer);
++                    ArgOp, strp);
++		if (cnt > 0)
++		    free(strp);
+             }
+ 
+         NextArgument:
diff --git a/SOURCES/template.patch b/SOURCES/template.patch
new file mode 100644
index 0000000..e8b06f5
--- /dev/null
+++ b/SOURCES/template.patch
@@ -0,0 +1,22 @@
+Add in a needed parameter for a test file template
+
+From: Al Stone <ahs3@redhat.com>
+
+
+---
+ tests/templates/Makefile |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: acpica-unix2-20161222/tests/templates/Makefile
+===================================================================
+--- acpica-unix2-20161222.orig/tests/templates/Makefile
++++ acpica-unix2-20161222/tests/templates/Makefile
+@@ -2,7 +2,7 @@
+ PROG= templates
+ 
+ templates :
+-	sh templates.sh
++	sh templates.sh 1
+ 
+ clean :
+ 	rm -f *.asl *.aml *.dsl *.hex diff.log
diff --git a/SOURCES/unaligned.patch b/SOURCES/unaligned.patch
new file mode 100644
index 0000000..43e4bb6
--- /dev/null
+++ b/SOURCES/unaligned.patch
@@ -0,0 +1,105 @@
+Patch carried over from the prior iasl package and updated.  This allows
+for builds on systems requiring aligned memory access. Please see
+http://lists.acpica.org/pipermail/devel/2010-July/000159.html.  Resolves
+BZ#865013 and BZ#856856.
+--
+
+Add more platforms to the list of the ones requiring aligned memory access.
+Also fix callsites where wrong assumptions where made in terms of aligment.
+
+Signed-off-by: Mattia Dongili <malattia@linux.it>
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+---
+ source/components/executer/exoparg2.c |   12 +++++++++---
+ source/include/actypes.h              |   26 +++++++++++++-------------
+ 3 files changed, 32 insertions(+), 21 deletions(-)
+
+Index: acpica-unix2-20170728/source/components/executer/exoparg2.c
+===================================================================
+--- acpica-unix2-20170728.orig/source/components/executer/exoparg2.c
++++ acpica-unix2-20170728/source/components/executer/exoparg2.c
+@@ -172,6 +172,8 @@ AcpiExOpcode_2A_2T_1R (
+     ACPI_OPERAND_OBJECT     **Operand = &WalkState->Operands[0];
+     ACPI_OPERAND_OBJECT     *ReturnDesc1 = NULL;
+     ACPI_OPERAND_OBJECT     *ReturnDesc2 = NULL;
++    UINT64                  ReturnValue1 = 0;
++    UINT64                  ReturnValue2 = 0;
+     ACPI_STATUS             Status;
+ 
+ 
+@@ -206,8 +208,10 @@ AcpiExOpcode_2A_2T_1R (
+         Status = AcpiUtDivide (
+             Operand[0]->Integer.Value,
+             Operand[1]->Integer.Value,
+-            &ReturnDesc1->Integer.Value,
+-            &ReturnDesc2->Integer.Value);
++            &ReturnValue1, &ReturnValue2);
++        ReturnDesc1->Integer.Value = ReturnValue1;
++        ReturnDesc2->Integer.Value = ReturnValue2;
++
+         if (ACPI_FAILURE (Status))
+         {
+             goto Cleanup;
+@@ -282,6 +286,7 @@ AcpiExOpcode_2A_1T_1R (
+     ACPI_OPERAND_OBJECT     **Operand = &WalkState->Operands[0];
+     ACPI_OPERAND_OBJECT     *ReturnDesc = NULL;
+     UINT64                  Index;
++    UINT64                  ReturnValue = 0;
+     ACPI_STATUS             Status = AE_OK;
+     ACPI_SIZE               Length = 0;
+ 
+@@ -327,7 +332,8 @@ AcpiExOpcode_2A_1T_1R (
+             Operand[0]->Integer.Value,
+             Operand[1]->Integer.Value,
+             NULL,
+-            &ReturnDesc->Integer.Value);
++            &ReturnValue);
++        ReturnDesc->Integer.Value = ReturnValue;
+         break;
+ 
+     case AML_CONCATENATE_OP: /* Concatenate (Data1, Data2, Result) */
+Index: acpica-unix2-20170728/source/include/actypes.h
+===================================================================
+--- acpica-unix2-20170728.orig/source/include/actypes.h
++++ acpica-unix2-20170728/source/include/actypes.h
+@@ -143,6 +143,19 @@ typedef COMPILER_DEPENDENT_INT64
+  */
+ #define ACPI_THREAD_ID                  UINT64
+ 
++/*
++ * In the case of the Itanium Processor Family (IPF), the hardware does not
++ * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag
++ * to indicate that special precautions must be taken to avoid alignment faults.
++ * (IA64 or ia64 is currently used by existing compilers to indicate IPF.)
++ *
++ * Note: EM64T and other X86-64 processors support misaligned transfers,
++ * so there is no need to define this flag.
++ */
++#if defined (__IA64__) || defined (__ia64__) || defined(__alpha__) || defined(__sparc__) || defined(__hppa__) || defined(__arm__)
++#define ACPI_MISALIGNMENT_NOT_SUPPORTED
++#endif
++
+ 
+ /*******************************************************************************
+  *
+@@ -170,20 +183,6 @@ typedef UINT64
+ #define ACPI_USE_NATIVE_DIVIDE          /* Has native 64-bit integer support */
+ #define ACPI_USE_NATIVE_MATH64          /* Has native 64-bit integer support */
+ 
+-/*
+- * In the case of the Itanium Processor Family (IPF), the hardware does not
+- * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED
+- * flag to indicate that special precautions must be taken to avoid alignment
+- * faults. (IA64 or ia64 is currently used by existing compilers to indicate
+- * IPF.)
+- *
+- * Note: EM64T and other X86-64 processors support misaligned transfers,
+- * so there is no need to define this flag.
+- */
+-#if defined (__IA64__) || defined (__ia64__)
+-#define ACPI_MISALIGNMENT_NOT_SUPPORTED
+-#endif
+-
+ 
+ /*******************************************************************************
+  *
diff --git a/SPECS/acpica-tools.spec b/SPECS/acpica-tools.spec
new file mode 100644
index 0000000..6554190
--- /dev/null
+++ b/SPECS/acpica-tools.spec
@@ -0,0 +1,683 @@
+Name:           acpica-tools
+Version:        20180629
+Release:        3%{?dist}
+Summary:        ACPICA tools for the development and debug of ACPI tables
+
+Group:          Development/Languages
+License:        GPLv2
+URL:            https://www.acpica.org/
+
+Source0:        https://acpica.org/sites/acpica/files/acpica-unix2-%{version}.tar.gz
+Source1:        https://acpica.org/sites/acpica/files/acpitests-unix-%{version}.tar.gz
+Source2:        README.Fedora
+Source3:        iasl.1
+Source4:        acpibin.1
+Source5:        acpidump.1
+Source6:        acpiexec.1
+Source7:        acpihelp.1
+Source8:        acpinames.1
+Source9:        acpisrc.1
+Source10:       acpixtract.1
+Source11:       acpiexamples.1
+Source12:       badcode.asl.result
+Source13:       grammar.asl.result
+Source14:       converterSample.asl.result
+Source15:       run-misc-tests.sh
+Source16:       COPYING
+
+Patch0:         big-endian.patch
+Patch1:         unaligned.patch
+Patch2:         OPT_LDFLAGS.patch
+Patch3:         int-format.patch
+Patch4:         f23-harden.patch
+Patch5:         template.patch
+Patch6:         free.patch
+Patch7:         ppc64le.patch
+Patch8:         arm7hl.patch
+Patch9:         big-endian-v2.patch
+Patch10:        simple-64bit.patch
+Patch11:        be-tpm2.patch
+Patch12:        mips-be-fix.patch
+Patch13:        cve-2017-13693.patch
+Patch14:        cve-2017-13694.patch
+Patch15:        cve-2017-13695.patch
+Patch16:        str-trunc-warn.patch
+Patch17:	ptr-cast.patch
+Patch18:	aslcodegen.patch
+
+BuildRequires:  bison patchutils flex gcc
+
+# The previous iasl package contained only a very small subset of these tools
+# and it produced only the iasl package listed below; further, the pmtools
+# package -- which provides acpidump -- also provides a /usr/sbin/acpixtract
+# that we don't really want to collide with
+Provides:       acpixtract >= 20120913-7
+Provides:       iasl = %{version}-%{release}
+Obsoletes:      iasl < 20120913-8
+
+# The pmtools package provides an obsolete and deprecated version of the
+# acpidump command from lesswatts.org which has now been taken off-line.
+# ACPICA, however, is providing a new version and we again do not want to
+# conflict with the command name.
+Provides:       acpidump >= 20100513-5
+Provides:       pmtools = %{version}-%{release}
+Obsoletes:      pmtools < 20100513-6
+
+%description
+The ACPI Component Architecture (ACPICA) project provides an OS-independent
+reference implementation of the Advanced Configuration and Power Interface
+Specification (ACPI).  ACPICA code contains those portions of ACPI meant to
+be directly integrated into the host OS as a kernel-resident subsystem, and
+a small set of tools to assist in developing and debugging ACPI tables.
+
+This package contains only the user-space tools needed for ACPI table
+development, not the kernel implementation of ACPI.  The following commands
+are installed:
+   -- iasl: compiles ASL (ACPI Source Language) into AML (ACPI Machine
+      Language), suitable for inclusion as a DSDT in system firmware.
+      It also can disassemble AML, for debugging purposes.
+   -- acpibin: performs basic operations on binary AML files (e.g.,
+      comparison, data extraction)
+   -- acpidump: write out the current contents of ACPI tables
+   -- acpiexec: simulate AML execution in order to debug method definitions
+   -- acpihelp: display help messages describing ASL keywords and op-codes
+   -- acpinames: display complete ACPI name space from input AML
+   -- acpisrc: manipulate the ACPICA source tree and format source files
+      for specific environments
+   -- acpixtract: extract binary ACPI tables from acpidump output (see
+      also the pmtools package)
+
+This version of the tools is being released under GPLv2 license.
+
+%prep
+%setup -q -n acpica-unix2-%{version}
+gzip -dc %{SOURCE1} | tar -x --strip-components=1 -f -
+
+%patch0 -p1 -b .big-endian
+%patch1 -p1 -b .unaligned
+%patch2 -p1 -b .OPT_LDFLAGS
+%patch3 -p1 -b .int-format
+%patch4 -p1 -b .f23-harden
+%patch5 -p1 -b .template
+%patch6 -p1 -b .free
+%patch7 -p1 -b .ppc64le
+%patch8 -p1 -b .arm7hl
+%patch9 -p1 -b .big-endian-v2
+%patch10 -p1 -b .simple-64bit
+%patch11 -p1 -b .be-tpm2
+%patch12 -p1 -b .mips-be-fix
+%patch13 -p1 -b .cve-2017-13693
+%patch14 -p1 -b .cve-2017-13694
+%patch15 -p1 -b .cve-2017-13695
+%patch16 -p1 -b .str-trunc-warn
+%patch17 -p1 -b .ptr-cast
+%patch18 -p1 -b .aslcodegen
+
+cp -p %{SOURCE2} README.Fedora
+cp -p %{SOURCE3} iasl.1
+cp -p %{SOURCE4} acpibin.1
+cp -p %{SOURCE5} acpidump.1
+cp -p %{SOURCE6} acpiexec.1
+cp -p %{SOURCE7} acpihelp.1
+cp -p %{SOURCE8} acpinames.1
+cp -p %{SOURCE9} acpisrc.1
+cp -p %{SOURCE10} acpixtract.1
+cp -p %{SOURCE11} acpiexamples.1
+cp -p %{SOURCE12} badcode.asl.result
+cp -p %{SOURCE13} grammar.asl.result
+cp -p %{SOURCE14} converterSample.asl.result
+cp -p %{SOURCE15} tests/run-misc-tests.sh
+chmod a+x tests/run-misc-tests.sh
+cp -p %{SOURCE16} COPYING
+
+# spurious executable permissions on text files in upstream
+chmod a-x changes.txt
+chmod a-x source/compiler/new_table.txt
+
+
+%build
+CWARNINGFLAGS="\
+    -std=c99\
+    -Wall\
+    -Wbad-function-cast\
+    -Wdeclaration-after-statement\
+    -Werror\
+    -Wformat=2\
+    -Wmissing-declarations\
+    -Wmissing-prototypes\
+    -Wstrict-aliasing=0\
+    -Wstrict-prototypes\
+    -Wswitch-default\
+    -Wpointer-arith\
+    -Wundef\
+    -Waddress\
+    -Waggregate-return\
+    -Winit-self\
+    -Winline\
+    -Wmissing-declarations\
+    -Wmissing-field-initializers\
+    -Wnested-externs\
+    -Wold-style-definition\
+    -Wno-format-nonliteral\
+    -Wredundant-decls\
+    -Wempty-body\
+    -Woverride-init\
+    -Wlogical-op\
+    -Wmissing-parameter-type\
+    -Wold-style-declaration\
+    -Wtype-limits"
+
+OPT_CFLAGS="%{optflags} $CWARNINGFLAGS"
+OPT_LDFLAGS="%{__global_ldflags}"
+export OPT_CFLAGS
+export OPT_LDFLAGS
+
+make
+
+
+%install
+# Install the binaries
+mkdir -p %{buildroot}%{_bindir}
+install -pD generate/unix/bin*/* %{buildroot}%{_bindir}/
+
+# Install the man pages
+mkdir -p %{buildroot}%{_mandir}/man1
+install -pDm 0644 *.1 %{buildroot}%{_mandir}/man1/
+
+# Install the examples source code
+mkdir -p %{buildroot}%{_docdir}/acpica-tools/examples
+install -pDm 0644 source/tools/examples/* %{buildroot}%{_docdir}/acpica-tools/examples/
+
+%check
+cd tests
+
+# ASL tests
+./aslts.sh                         # relies on non-zero exit
+[ $? -eq 0 ] || exit 1
+
+# misc tests
+./run-misc-tests.sh %{buildroot}%{_bindir} %{version}
+
+# Template tests
+cd templates
+make
+if [ -f diff.log ]
+then
+    if [ -s diff.log ]
+    then
+        exit 1                  # implies errors occurred
+    fi
+fi
+cd ..
+
+%pre
+if [ -e %{_bindir}/acpixtract-acpica ]
+then
+    alternatives --remove acpixtract %{_bindir}/acpixtract-acpica
+fi
+if [ -e %{_bindir}/acpidump-acpica ]
+then
+    alternatives --remove acpidump %{_bindir}/acpidump-acpica
+fi
+
+%postun
+if [ -e %{_bindir}/acpixtract-acpica ]
+then
+    alternatives --remove acpixtract %{_bindir}/acpixtract-acpica
+fi
+if [ -e %{_bindir}/acpidump-acpica ]
+then
+    alternatives --remove acpidump %{_bindir}/acpidump-acpica
+fi
+
+
+%files
+%doc changes.txt source/compiler/new_table.txt
+%doc README.Fedora COPYING
+%{_bindir}/*
+%{_mandir}/*/*
+%{_docdir}/*/*
+
+
+%changelog
+* Wed Aug 8 2018 Al Stone <ahs3@redhat.com> - 20180629-3
+- Add in man page for acpiexamples.  So that the man page makes some sense,
+  also copy the source code used for acpiexamples to the doc directory for
+  this package.  Closes BZ#1611145.
+- Add in the converterSample.asl file from the misc tests.  Clean up the
+  run-misc-tests.sh script, too, to make it more robust by simplifying
+  the work done.
+
+* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 20180629-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
+
+* Sun Jul 8 2018 Al Stone <ahs3@redhat.com> - 20180629-1
+- Update to 20180629 source tree, including patch refeshes. Closes BZ#1584923
+- Includes upstream fix for #1592971 (iasl segfault).
+
+* Thu Jun 21 2018 Al Stone <ahs3@redhat.com> - 20180531-1
+- Update to 20180531 source tree, including patch refeshes. Closes BZ#1584923
+
+* Tue May 22 2018 Al Stone <ahs3@redhat.com> - 20180508-2
+- %%pre and %%post scriptlets fail -- stupid thinko where I inadvertently
+  tested for alternatives not existing, vs existing 
+
+* Tue May 15 2018 Al Stone <ahs3@redhat.com> - 20180508-1
+- Update to 20180508 source tree, including patch refeshes. Closes BZ#1544048
+- acpidump/acpixtract no longer have alternatives, so remove the scriptlets
+  that maintain them and just install them directly; we do leave the pre-
+  and post- scriptlets to remove the alternatives for now.  Closes BZ#1576970
+- Typo: OPT_LDFLAGS, not OPT_LDLAGS in the build section.  Closes BZ#1560542
+
+* Mon May 14 2018 Al Stone <ahs3@redhat.com> - 20180427-1
+- Update to 20180427 source tree, including patch refeshes. Closes BZ#1544048
+
+* Mon May 14 2018 Al Stone <ahs3@redhat.com> - 20180313-1
+- Update to 20180313 source tree, including patch refeshes. Closes BZ#1544048
+
+* Fri Mar 16 2018 Al Stone <ahs3@redhat.com> - 20180209-1
+- Update to 20180209 source tree, including patch refeshes. Closes BZ#1544048
+- CVE-2017-13693: operand cache leak in dsutils.c -- applied github patch to
+  fix the leak.  Resolves BZ#1485346.
+- CVE-2017-13694: acpi parse and parseext cache leaks in psobjects.c -- applied
+  github patch to fix the leaks.  Resolves BZ#1485348.
+- CVE-2017-13695: operand cache leak in nseval.c -- applied github patch to fix
+  the leak.  Resolves BZ#1485349.
+- Security fixes for the CVEs above applied.  Closes BZ#1485355.  NOTE: these
+  patches fix acpica-tools ONLY; the kernel needs to be patch separately.
+- Added gcc to BuildRequires
+- It turns out the %%build section was incorrectly passing in OPT_CFLAGS; it
+  made the wrong assumptions about what generate/unix/Makefile.config did with
+  that value.  Added to the spec file what should happen so that a full and
+  complete set of C flags get passed in, not just the small subset that was.
+- Clean up compiler warnings for truncated strings
+- Clean up compiler warnings for pointer casting on 32-bit architectures
+
+* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 20180105-3
+- Escape macros in %%changelog
+
+* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 20180105-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
+
+* Mon Jan 8 2018 Al Stone <ahs3@redhat.com> - 20180105-1
+- Update to 20180105 source tree, including patch refeshes. Closes BZ#1526651
+- Cleaned up changelog. Closes BZ#1525938
+- Pulled in a mips32/BE patch from Debian, for completeness sake
+
+* Mon Jan 8 2018 Al Stone <ahs3@redhat.com> - 20171215-1
+- Update to 20171215 source tree, including patch refeshes
+
+* Mon Nov 20 2017 Al Stone <ahs3@redhat.com> - 20171110-1
+- Update to 20171110 source tree, including patch refeshes
+- Add patch for mips64el build, should it ever be needed; it also cleans
+  up all 64-bit arches, so nice to have regardless
+- Add new patch for a TPM2 big-endian issue.
+
+* Fri Oct 6 2017 Al Stone <ahs3@redhat.com> - 20170929-1
+- Update to 20170929 source tree, including patch refeshes
+- Removed aslts-acpibin.patch to fix PATH problem in ASLTS; in upstream now
+
+* Wed Sep 27 2017 Al Stone <ahs3@redhat.com> - 20170831-1
+- Update to 20170831 source tree, including patch refeshes
+- Add aslts-acpibin.patch to fix PATH problem in ASLTS that prevents
+  some tests from being run
+
+* Fri Aug 18 2017 Al Stone <ahs3@redhat.com> - 20170728-3
+- Completed the big-endian fixes (I think)
+- Fix ppc64le.patch that inadvertently broke s390x
+- Minor patch refresh
+- Re-enable full %%check for s390x
+
+* Mon Aug 14 2017 Al Stone <ahs3@redhat.com> - 20170728-2
+- Start some long delayed clean-up
+- Temporarily disable one test section until all the big-endian issues
+  can be resolved; it provides what may be a false negative result
+- Consolidate the big-endian patches
+
+* Fri Aug 11 2017 Al Stone <ahs3@redhat.com> - 20170728-1
+- Update to 20170728 source tree, including patch refeshes
+
+* Fri Aug 11 2017 Al Stone <ahs3@redhat.com> - 20170629-1
+- Update to 20170629 source tree, including patch refeshes
+
+* Fri Aug 11 2017 Al Stone <ahs3@redhat.com> - 20170531-1
+- Update to 20170531 source tree, including patch refeshes
+
+* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20170303-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
+
+* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20170303-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
+
+* Fri May 5 2017 Al Stone <ahs3@redhat.com> - 20170303-3
+- Correct ppc64le.patch; it was not setting little-endian properly.
+
+* Tue May 2 2017 Al Stone <ahs3@redhat.com> - 20170303-2
+- Correct update-big-endian.patch; it introduced a bug due to logic being
+  replaced in the wrong order.
+
+* Fri Mar 31 2017 Al Stone <ahs3@redhat.com> - 20170303-1
+- Update to latest upstream.  Closes BZ#1381017.
+- Refresh patches.
+
+* Fri Mar 31 2017 Al Stone <ahs3@redhat.com> - 20170224-1
+- Update to latest upstream.  Closes BZ#1381017.
+- Refresh patches.
+
+* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20170119-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
+
+* Mon Jan 30 2017 Al Stone <ahs3@redhat.com> - 20170119-1
+- Update to latest upstream.  Closes BZ#1381017.
+- Refresh patches.
+- Add patch to fix ASLTS.
+- Add patch to fix ppc64le build.
+- Add patch to fix arm7hl build.
+
+* Mon Jan 9 2017 Al Stone <ahs3@redhat.com> - 20161222-1
+- Update to latest upstream.  Closes BZ#1381017.
+- Refresh patches.
+
+* Mon Jan 9 2017 Al Stone <ahs3@redhat.com> - 20160930-3
+- Restructure the repairs for big-endian support to simplify patching -- it is
+  all combined into update-big-endian.patch now.  (NB: this version may still
+  have issues on big-endian)
+
+* Fri Dec 9 2016 Al Stone <ahs3@redhat.com> - 20160930-2
+- Major repairs to compiler and disassembler code to make it endian-neutral
+  again (added patches big-endian-part1 and big-endian-part2).
+
+* Fri Oct 28 2016 Al Stone <ahs3@redhat.com> - 20160930-2
+- Update to latest upstream.  Closes BZ#1381017.
+- Refresh patches.
+- Major repairs to disassembler code to make it endian-neutral again.
+
+* Thu Sep 1 2016 Al Stone <ahs3@redhat.com> - 20160831-1
+- Update to latest upstream.  Closes BZ#1372107.
+- Refresh patches.
+- Closes BZ#1365193 -- s390x FTBFS due to int/ptr size mismatch: made sure
+  the tools built with 64-bit integers for s390x
+
+* Tue Aug 2 2016 Al Stone <ahs3@redhat.com> - 20160729-1
+- Update to latest upstream.  Closes BZ#1361737.
+- Refresh patches.
+
+* Thu Jun 9 2016 Al Stone <ahs3@redhat.com> - 20160527-1
+- Update to latest upstream.  Closes BZ#1340573.
+- Refresh patches.
+
+* Tue Apr 26 2016 Al Stone <ahs3@redhat.com> - 20160422-1
+- Update to latest upstream.  Closes BZ#1329774.
+- Refresh patches.
+
+* Sat Mar 19 2016 Al Stone <ahs3@redhat.com> - 20160318-1
+- Update to latest upstream.  Closes BZ#1319359.
+- Refresh patches.
+
+* Mon Feb 22 2016 Al Stone <ahs3@redhat.com> - 20160212-1
+- Update to latest upstream.  Closes BZ#1307192.
+- Refresh patches.
+
+* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 20160108-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
+
+* Mon Jan 11 2016 Al Stone <ahs3@redhat.com> - 20160108-1
+- Update to latest upstream.  Closes BZ#1297078.
+- Refresh patches.
+
+* Wed Jan 6 2016 Al Stone <ahs3@redhat.com> - 20151218-1
+- Update to latest upstream.  Closes BZ#1292987.
+- Refresh patches, and remove one no longer needed (acpinames).
+
+* Tue Dec 15 2015 Al Stone <ahs3@redhat.com> - 20151124-1
+- Update to latest upstream.  Closes BZ#1267772.
+- Refresh patches.
+- Add back in a patch to rename source/tools/acpinames/AcpiNames.h to remove
+  the camel case; this is a leftover in the conversion to Un*x files, and
+  crept back in with this version.
+
+* Wed Oct 14 2015 Al Stone <ahs3@redhat.com> - 20150930-1
+- Update to latest upstream.  Closes BZ#1267772.
+- Refresh patches, and remove one no longer needed.
+
+* Thu Sep 10 2015 Al Stone <ahs3@redhat.com> - 20150818-2
+- Remove extraneous patch files for AAPITS.
+- Correct an assumption that all names are stored in little-endian format.
+  Fix is in asllookup-ppc64.patch.  Closes BZ#1251972.
+
+* Wed Sep 9 2015 Al Stone <ahs3@redhat.com> - 20150818-1
+- Update to latest upstream.  Closes BZ#1256134.
+- Refresh patches
+- This version deprecates aapits (ACPICA API Test Suite) for now; this is
+  in accordance with upstream wishes, but in this maintainer's view, may
+  not be the correct long term solution as there is no other API specific
+  test suite.
+- Add a patch to rename source/tools/acpinames/AcpiNames.h to remove the
+  camel case; this is a leftover in the conversion to Un*x files.
+
+* Tue Aug 4 2015 Al Stone <ahs3@redhat.com> - 20150717-1
+- Update to latest upstream.  Closes BZ#1244449.
+- Refresh patches
+- Bodge back together the aapits makefile after source file relocations in
+  the primary ACPICA component files
+- Update the misc test results to incorporate iasl improvements
+
+* Tue Jun 30 2015 Al Stone <ahs3@redhat.com> - 20150619-2
+- Silly error: forgot to remove patches that are no longer needed
+
+* Mon Jun 29 2015 Al Stone <ahs3@redhat.com> - 20150619-1
+- Update to latest upstream.  Closes BZ#1232512.
+- Refresh patches
+
+* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20150515-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
+
+* Wed Jun 3 2015 Al Stone <ahs3@redhat.com> - 20150515-2
+- Replace dev-mem patch with nodevmem; this is a much more robust version of
+  the functionality needed, and set up properly for arm64 -- the patch makes
+  it so that acpidump does not use /dev/mem at all on arm64 since it might
+  not contain the right data.
+
+* Mon Jun 1 2015 Al Stone <ahs3@redhat.com> - 20150515-1
+- Update to latest upstream.  Closes BZ#122166
+- Refresh patches
+- Add patch from upstream for incorrect UUIDs for NFIT
+- Add patch from Linaro to remove use of /dev/mem (use /sys instead)
+- Add patch from upstream to correct ARM GIC entries in MADT
+- Add patch to fix segfaults reported.  Closes BZ#1219341.
+
+* Mon Apr 13 2015 Al Stone <ahs3@redhat.com> - 20150410-1
+- Update to latest upstream.  Closes BZ#1190383
+- Refresh patches
+
+* Fri Apr 10 2015 Al Stone <ahs3@redhat.com> - 20150408-1
+- Update to latest upstream.  Closes BZ#1190383
+- Refresh patches
+
+* Mon Mar 2 2015 Al Stone <ahs3@redhat.com> - 20150204-1
+- Update to latest upstream.  Closes BZ#1190383
+- Refresh patches
+
+* Mon Nov 17 2014 Al Stone <ahs3@redhat.com> - 20141107-1
+- Update to latest upstream.  Closes BZ#1147131.
+- Refresh patches
+- Patch to ensure ASLTS always reports when an error occurs, instead
+  of glossing over it has been incorporated upstream, so remove patch.
+
+* Wed Oct 1 2014 Al Stone <ahs3@redhat.com> - 20140926-1
+- Update to latest upstream.  Closes BZ#1147131.
+- Refresh patches
+- Add patch to ensure ASLTS always reports when an error occurs, instead
+  of glossing over it.
+- Add use of %%__global_ldflags.  Closes BZ#1126134.
+
+* Fri Aug 29 2014 Al Stone <ahs3@redhat.com> - 20140828-1
+- Update to latest upstream.  Closes BZ#1135352.
+- Refresh patches.
+
+* Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20140724-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
+
+* Mon Jul 28 2014 Al Stone <ahs3@redhat.com> - 20140724-1
+- Update to latest upstream.  Closes BZ#1114275.
+- This update adds support for the 5.1 version of the ACPI specification
+- Refresh patches so everything applies properly.
+
+* Fri Jun 6 2014 Dan Horák <dan[at]danny.cz> - 20140424-3
+- refresh the big endian patch so it applies correctly, fixes build on big endians
+
+* Thu May 22 2014 Al Stone <ahs3@redhat.com> - 20140424-2
+- Add ppc64le as a 64-bit arch in run-misc-tests.sh.  Closes BZ#1098614.
+- Re-enable big-endian support in iasl.
+
+* Wed May 7 2014 Al Stone <ahs3@redhat.com> - 20140424-1
+- Update to latest upstream.  Closes BZ#1091189.
+
+* Fri Apr 4 2014 Al Stone <ahs3@redhat.com> - 20140325-1
+- Update to latest upstream.  Closes BZ#1080791.
+- Incorporated patch to fix broken symlinks.  Closes BZ#1074256.
+- Add patch to fix missing .o files in aapits tests.
+
+* Wed Feb 26 2014 Al Stone <ahs3@redhat.com> - 20140214-1
+- Update to latest upstream.  Closes BZ#1053396.
+- Remove temporary patch so that AAPITS will build and run.
+- Add patch to print asllookup.c warning properly on big endian;
+  Closes BZ#1069178.
+
+* Tue Jan 21 2014 Al Stone <ahs3@redhat.com> - 20140114-1
+- Update to latest upstream.  Closes BZ#1053396.
+- Remove temporary patch to add Makefile missing from upstream tarball.
+- Add temporary patch so that AAPITS will build and run.
+
+* Tue Jan 7 2014 Al Stone <ahs3@redhat.com> - 20131218-1
+- Update to latest upstream.  Closes BZ#1044951.
+- Add temporary patch to add Makefile missing from upstream tarball.
+
+* Mon Nov 25 2013 Al Stone <ahs3@redhat.com> - 20131115-1
+- Update to latest upstream.  Closes BZ#1031255.
+- Add a little code to workaround build problems that can occur (the tests
+  will fail) when a build starts before midnight, but ends after midnight
+- Remove patch to include Makefile.config that was missing from tarball.
+
+* Wed Oct 09 2013 Al Stone <ahs3@redhat.com> - 20130927-1
+- Update to latest upstream.  Closes BZ#1013090.
+- Add temporary patch to include Makefile.config being missing from tarball.
+
+* Fri Sep 13 2013 Michael Schwendt <mschwendt@fedoraproject.org> - 20130823-5
+- correct iasl obs_ver
+
+* Tue Sep 10 2013 Dean Nelson <dnelson@redhat.com> - 20130823-4
+- Fix run-misc-tests.sh script to properly set the number of BITS to 64
+  when run on a s390x system.
+
+* Tue Sep 10 2013 Michael Schwendt <mschwendt@fedoraproject.org> - 20130823-3
+- correct pmtools obs_ver
+
+* Tue Aug 27 2013 Al Stone <ahs3@redhat.com> - 20130823-2
+- Add in a copy of the GPLv2 text in order to comply with the requirement
+  to always redistribute the terms of the license.
+
+* Mon Aug 26 2013 Al Stone <ahs3@redhat.com> - 20130823-1
+- Update to latest upstream source.
+
+* Tue Aug 20 2013 Al Stone <ahs3@redhat.com> - 20130725-2
+- Fix several rpmlint items (listed below)
+- Add versions to explicit provides for acpixtract, acpidump
+- Not all setup steps used -q
+- Setup executable test script (run-misc-tests.sh) differently
+- Removed unneeded commented out line with macros in it
+- Removed mixed use of spaces and tabs (all spaces now)
+- Corrected source URLs (upstream moved)
+
+* Sun Aug 18 2013 Al Stone <ahs3@redhat.com> - 20130725-1
+- Update to latest upstream source.
+
+* Wed Jul 24 2013 Al Stone <ahs3@redhat.com> - 20130626-1
+- Update to latest upstream source.
+- Move acpidump to acpidump-acpica so it be an alternative properly
+- Add basic man page for acpidump
+- Enable use of AAPITS tests during the check step
+
+* Sun Jun 02 2013 Al Stone <ahs3@redhat.com> - 20130517-2
+- Correct an oversight: we provide an acpidump in conflict with the
+  version in pmtools (which appears to be dead upstream) but had not
+  made it an alternative before
+
+* Tue May 28 2013 Al Stone <ahs3@redhat.com> - 20130517-1
+- Update to latest upstream source.
+- Remove acpica-tools-config.patch -- now in upstream
+- Remove iasl-signed-char.patch -- now in upstream
+- Updated debian-big_endian.patch
+- Updated debian-unaligned.patch
+
+* Mon May 13 2013 Al Stone <ahs3@redhat.com> - 20130328-1
+- Update to latest upstream source.
+
+* Wed Mar 20 2013 Al Stone <ahs3@redhat.com> - 20130214-2
+- Incorporate use of optflags macro in the build.
+- Remove extraneous rm -rf of buildroot.
+- Remove extraneous use of defattr in the files section.
+- Incorporate use of parallel make.
+- Remove extraneous use of the clean section.
+- Use simpler globbing in the files section.
+- Use simpler globbing in the install section.
+- Remove obsolete git notes from README.Fedora.
+- Remove ExcludeArch restrictions.
+
+* Mon Feb 18 2013 Al Stone <ahs3@redhat.com> - 20130214-1
+- New upstream.
+- Remove most of the config file patch; still need to remove -m{32,64}.
+- Clarify the licensing; this source is dual-licensed and is being released
+  under the GPLv2 as allowed by the original Intel license.
+- Redo the misc tests so they compare results properly.
+
+* Wed Feb 06 2013 Al Stone <ahs3@redhat.com> - 20130117-6
+- Added a zero-fill to a date used in comparing testing results so that the
+  comparison would be correct on days numbered < 10.
+
+* Thu Jan 31 2013 Al Stone <ahs3@redhat.com> - 20130117-5
+- Simplify versioning scheme and revert to the original scheme in use by
+  iasl, which is use the latest official tarball date (2013017) as the
+  version and 1%%{?dist} as the release, to be incremented for packaging
+  and bug fixes as needed.
+
+* Wed Jan 30 2013 Al Stone <ahs3@redhat.com> - 20130117-4
+- Do a little reset: go back to using just the original upstream tarball
+  instead of the latest git; the snapshot approach was more complicated
+  than needed.
+- Upstream tarballs split commands from test suites, so had to add the
+  test suite back in as another Source: file.
+- Change versioning scheme to include the APCI specification level (5.0),
+  the latest official tarball date (2013017) and a revision level  (the
+  .1 at the end) for packaging and bug fixes as needed.
+- Changed the License field to reflect the source tarball change; the release
+  tarball is dual-licensed, Intel ACPI or GPLv2.
+- Updated patches to apply cleanly as needed.
+- Corrected Obsoletes and Provides version numbers.
+
+* Mon Jan 28 2013 Al Stone <ahs3@redhat.com> - 20130117-3
+- Reconcile Fedora and Debian patches to be as alike as possible
+
+* Mon Jan 28 2013 Al Stone <ahs3@redhat.com> - 20130117-2
+- Verify ExcludeArch restrictions -- the architectures excluded can have
+  no use for these tools.  Hardware support for ACPI is simply not
+  implemented for them.
+- Corrected versioning to note this source came from a git pull.
+- Add License file as upstream has not yet provided one (and has not for
+  many years).
+- Insert properly versioned Provides and Obsoletes for iasl.
+- Corrected files to use man.1* (vs man.1.gz) to allow flexibility in the
+  compression being used.
+
+* Wed Jan 23 2013 Al Stone <ahs3@redhat.com> - 20130117-1
+- Clone from the current iasl package, with the intent of replacing it
+- Update source to latest upstream
+- NB: ACPICA documentation would normally be included in a source tarball.
+  But, since it is not clearly redistributable, it is not included in the
+  source RPM for this package.
+- Build all ACPICA tools, not just iasl (and hence the package replacement)
+- Add in brief man pages
+- Set up acpixtract from this package as an alternative to the same command
+  in the pmtools package
+- Run the check step once built
+