diff --git a/.acpica-tools.metadata b/.acpica-tools.metadata
new file mode 100644
index 0000000..1c43e51
--- /dev/null
+++ b/.acpica-tools.metadata
@@ -0,0 +1,2 @@
+52495ced43532748f1955dcf6c1aa343a03cd67b SOURCES/acpica-unix2-20160527.tar.gz
+3fc040effedc62cefed9e09f358d55e398f0375a SOURCES/acpitests-unix-20160527.tar.gz
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..19b0924
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+SOURCES/acpica-unix2-20160527.tar.gz
+SOURCES/acpitests-unix-20160527.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/DSDT-too-long.patch b/SOURCES/DSDT-too-long.patch
new file mode 100644
index 0000000..8d0ef9b
--- /dev/null
+++ b/SOURCES/DSDT-too-long.patch
@@ -0,0 +1,33 @@
+ASL Test Suite encounters the following type of error...
+
+  Table [DSDT] is too long for file - needs: 0xCE4C0000, remaining in file: 0x4CCE
+
+when tests/aslts.sh was run on a big-endian system.
+
+diff --git a/source/common/acfileio.c b/source/common/acfileio.c
+index 589eaea..83e59e2 100644
+--- a/source/common/acfileio.c
++++ b/source/common/acfileio.c
+@@ -391,6 +391,7 @@ AcValidateTableHeader (
+     size_t                  Actual;
+     long                    OriginalOffset;
+     UINT32                  FileSize;
++    UINT32                  Length;
+     UINT32                  i;
+ 
+ 
+@@ -422,11 +423,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(&Length, &TableHeader.Length);
++    if (Length > (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, Length,
+             (UINT32) (FileSize - TableOffset));
+         return (AE_BAD_HEADER);
+     }
diff --git a/SOURCES/README b/SOURCES/README
new file mode 100644
index 0000000..d05ed5c
--- /dev/null
+++ b/SOURCES/README
@@ -0,0 +1,25 @@
+Packaging Notes for RHEL
+========================
+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..1228f4d
--- /dev/null
+++ b/SOURCES/acpidump.1
@@ -0,0 +1,129 @@
+.\" 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 \-r <address>
+Dump tables from specified RSDP.
+
+.PP
+.TP
+.B \-s
+Print table summaries only.
+
+.PP
+.TP
+.B \-v
+Print the version of this utility.
+
+.PP
+.TP
+.B \-z
+Verbose mode.
+
+.SH TABLE OPTIONS
+.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 \-c <on|off>
+Turn on/off customized table dumping. If turned on, tables are dumped
+from /sys/firmware/acpi/tables. If turned off, tables are dumped
+from /dev/mem. The default is on.
+
+.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).
+
+.PP
+.TP
+.B \-x
+Do not use but dump XSDT.
+
+.PP
+.TP
+.B \-x \-x
+Do not use or dump XSDT.
+
+.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/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/add-nfit-subtable7.patch b/SOURCES/add-nfit-subtable7.patch
new file mode 100644
index 0000000..c4a89e4
--- /dev/null
+++ b/SOURCES/add-nfit-subtable7.patch
@@ -0,0 +1,264 @@
+Upstream commit a42a086b8d682ab8dfbc4666cf6b9c8a5ee23a77
+Author: Robert Moore <Robert.Moore@intel.com>
+Date: Mon, 16 Oct 2017 10:42:49 -0700
+Subject: [PATCH] ACPI 6.0A: Changes to the NFIT ACPI table
+
+Adds a new subtable.
+---
+ source/common/dmtable.c        |  1 +
+ source/common/dmtbdump.c       |  5 +++
+ source/common/dmtbinfo.c       | 14 +++++++
+ source/compiler/dttable2.c     |  7 +++-
+ source/compiler/dttemplate.h   | 10 +++--
+ source/include/acdisasm.h      |  1 +
+ source/include/actbl1.h        | 72 +++++++++++++++++++++++++++++++++-
+ source/tools/acpisrc/astable.c |  2 +
+ 8 files changed, 105 insertions(+), 7 deletions(-)
+
+diff --git a/source/common/dmtable.c b/source/common/dmtable.c
+index 07d27faf7..60951732b 100644
+--- a/source/common/dmtable.c
++++ b/source/common/dmtable.c
+@@ -239,6 +239,7 @@ static const char           *AcpiDmNfitSubnames[] =
+     "NVDIMM Control Region",            /* ACPI_NFIT_TYPE_CONTROL_REGION */
+     "NVDIMM Block Data Window Region",  /* ACPI_NFIT_TYPE_DATA_REGION */
+     "Flush Hint Address",               /* ACPI_NFIT_TYPE_FLUSH_ADDRESS */
++    "Platform Capabilities",            /* ACPI_NFIT_TYPE_CAPABILITIES */
+     "Unknown Subtable Type"             /* Reserved */
+ };
+ 
+diff --git a/source/common/dmtbdump.c b/source/common/dmtbdump.c
+index 0f0697e3d..1ef91c2df 100644
+--- a/source/common/dmtbdump.c
++++ b/source/common/dmtbdump.c
+@@ -2748,6 +2748,11 @@ AcpiDmDumpNfit (
+             FieldOffset = sizeof (ACPI_NFIT_FLUSH_ADDRESS) - sizeof (UINT64);
+             break;
+ 
++        case ACPI_NFIT_TYPE_CAPABILITIES:    /* ACPI 6.0A */
++
++            InfoTable = AcpiDmTableInfoNfit7;
++            break;
++
+         default:
+             AcpiOsPrintf ("\n**** Unknown NFIT subtable type 0x%X\n",
+                 SubTable->Type);
+diff --git a/source/common/dmtbinfo.c b/source/common/dmtbinfo.c
+index 97de36067..bccb986fb 100644
+--- a/source/common/dmtbinfo.c
++++ b/source/common/dmtbinfo.c
+@@ -216,6 +216,7 @@
+ #define ACPI_NFIT4_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_NFIT_CONTROL_REGION,f)
+ #define ACPI_NFIT5_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_NFIT_DATA_REGION,f)
+ #define ACPI_NFIT6_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_NFIT_FLUSH_ADDRESS,f)
++#define ACPI_NFIT7_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_NFIT_CAPABILITIES,f)
+ #define ACPI_PCCT0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f)
+ #define ACPI_PCCT1_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED,f)
+ #define ACPI_PCCT2_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED_TYPE2,f)
+@@ -278,6 +279,7 @@
+ #define ACPI_NFIT0_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_NFIT_SYSTEM_ADDRESS,f,o)
+ #define ACPI_NFIT1_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_NFIT_MEMORY_MAP,f,o)
+ #define ACPI_NFIT4_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_NFIT_CONTROL_REGION,f,o)
++#define ACPI_NFIT7_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_NFIT_CAPABILITIES,f,o)
+ #define ACPI_PCCT_FLAG_OFFSET(f,o)      ACPI_FLAG_OFFSET (ACPI_TABLE_PCCT,f,o)
+ #define ACPI_PCCT1_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED,f,o)
+ #define ACPI_PCCT2_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED_TYPE2,f,o)
+@@ -2281,6 +2283,18 @@ ACPI_DMTABLE_INFO           AcpiDmTableInfoNfit6a[] =
+     ACPI_DMT_TERMINATOR
+ };
+ 
++ACPI_DMTABLE_INFO           AcpiDmTableInfoNfit7[] =
++{
++    {ACPI_DMT_UINT8,    ACPI_NFIT7_OFFSET (HighestCapability),      "Highest Capability", 0},
++    {ACPI_DMT_UINT24,   ACPI_NFIT7_OFFSET (Reserved[0]),            "Reserved", 0},
++    {ACPI_DMT_UINT32,   ACPI_NFIT7_OFFSET (Capabilities),           "Capabilities (decoded below)", DT_FLAG},
++    {ACPI_DMT_FLAG0,    ACPI_NFIT7_FLAG_OFFSET (Capabilities,0),    "Cache Flush to NVDIMM", 0},
++    {ACPI_DMT_FLAG1,    ACPI_NFIT7_FLAG_OFFSET (Capabilities,0),    "Memory Flush to MVDIMM", 0},
++    {ACPI_DMT_FLAG2,    ACPI_NFIT7_FLAG_OFFSET (Capabilities,0),    "Memory Mirroring", 0},
++    {ACPI_DMT_UINT32,   ACPI_NFIT7_OFFSET (Reserved2),              "Reserved", 0},
++    ACPI_DMT_TERMINATOR
++};
++
+ 
+ /*******************************************************************************
+  *
+diff --git a/source/compiler/dttable2.c b/source/compiler/dttable2.c
+index 172354cde..db79bac7a 100644
+--- a/source/compiler/dttable2.c
++++ b/source/compiler/dttable2.c
+@@ -590,6 +590,11 @@ DtCompileNfit (
+             InfoTable = AcpiDmTableInfoNfit6;
+             break;
+ 
++        case ACPI_NFIT_TYPE_CAPABILITIES:
++
++            InfoTable = AcpiDmTableInfoNfit7;
++            break;
++
+         default:
+ 
+             DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "NFIT");
+@@ -633,7 +638,6 @@ DtCompileNfit (
+             }
+ 
+             Interleave->LineCount = Count;
+-            DtPopSubtable ();
+             break;
+ 
+         case ACPI_NFIT_TYPE_SMBIOS:
+@@ -679,7 +684,6 @@ DtCompileNfit (
+             }
+ 
+             Hint->HintCount = (UINT16) Count;
+-            DtPopSubtable ();
+             break;
+ 
+         default:
+diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h
+index d541154bb..4c77afc16 100644
+--- a/source/compiler/dttemplate.h
++++ b/source/compiler/dttemplate.h
+@@ -780,11 +780,11 @@ const unsigned char TemplateMsct[] =
+ 
+ const unsigned char TemplateNfit[] =
+ {
+-    0x4E,0x46,0x49,0x54,0x70,0x01,0x00,0x00,  /* 00000000    "NFITp..." */
+-    0x01,0x53,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    ".SINTEL " */
++    0x4E,0x46,0x49,0x54,0x80,0x01,0x00,0x00,  /* 00000000    "NFIT...." */
++    0x01,0x07,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
+     0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65,  /* 00000010    "Template" */
+     0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
+-    0x10,0x04,0x15,0x20,0x00,0x00,0x00,0x00,  /* 00000020    "... ...." */
++    0x29,0x09,0x17,0x20,0x00,0x00,0x00,0x00,  /* 00000020    ").. ...." */
+     0x00,0x00,0x38,0x00,0x01,0x00,0x00,0x00,  /* 00000028    "..8....." */
+     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000030    "........" */
+     0x30,0x05,0xAF,0x91,0x86,0x5D,0x0E,0x47,  /* 00000038    "0....].G" */
+@@ -825,7 +825,9 @@ const unsigned char TemplateNfit[] =
+     0x06,0x00,0x20,0x00,0x01,0x00,0x00,0x00,  /* 00000150    ".. ....." */
+     0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000158    "........" */
+     0x00,0x00,0x00,0x18,0x04,0x00,0x00,0x00,  /* 00000160    "........" */
+-    0x00,0x00,0x00,0x18,0x06,0x00,0x00,0x00   /* 00000168    "........" */
++    0x00,0x00,0x00,0x18,0x06,0x00,0x00,0x00,  /* 00000168    "........" */
++    0x07,0x00,0x10,0x00,0x00,0x00,0x00,0x00,  /* 00000170    "........" */
++    0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00   /* 00000178    "........" */
+ };
+ 
+ const unsigned char TemplateMtmr[] =
+diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h
+index 0c465602d..d8ed7168d 100644
+--- a/source/include/acdisasm.h
++++ b/source/include/acdisasm.h
+@@ -375,6 +375,7 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoNfit4[];
+ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoNfit5[];
+ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoNfit6[];
+ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoNfit6a[];
++extern ACPI_DMTABLE_INFO        AcpiDmTableInfoNfit7[];
+ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPmtt[];
+ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPmtt0[];
+ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPmtt1[];
+diff --git a/source/include/actbl1.h b/source/include/actbl1.h
+index db409bb79..0ca869909 100644
+--- a/source/include/actbl1.h
++++ b/source/include/actbl1.h
+@@ -1185,7 +1185,8 @@ enum AcpiNfitType
+     ACPI_NFIT_TYPE_CONTROL_REGION       = 4,
+     ACPI_NFIT_TYPE_DATA_REGION          = 5,
+     ACPI_NFIT_TYPE_FLUSH_ADDRESS        = 6,
+-    ACPI_NFIT_TYPE_RESERVED             = 7     /* 7 and greater are reserved */
++    ACPI_NFIT_TYPE_CAPABILITIES         = 7,
++    ACPI_NFIT_TYPE_RESERVED             = 8     /* 8 and greater are reserved */
+ };
+ 
+ /*
+@@ -1338,6 +1339,75 @@ typedef struct acpi_nfit_flush_address
+ } ACPI_NFIT_FLUSH_ADDRESS;
+ 
+ 
++/* 7: Platform Capabilities Structure */
++
++typedef struct acpi_nfit_capabilities
++{
++    ACPI_NFIT_HEADER        Header;
++    UINT8                   HighestCapability;
++    UINT8                   Reserved[3];       /* Reserved, must be zero */
++    UINT32                  Capabilities;
++    UINT32                  Reserved2;
++
++} ACPI_NFIT_CAPABILITIES;
++
++/* Capabilities Flags */
++
++#define ACPI_NFIT_CAPABILITY_CACHE_FLUSH       (1)     /* 00: Cache Flush to NVDIMM capable */
++#define ACPI_NFIT_CAPABILITY_MEM_FLUSH         (1<<1)  /* 01: Memory Flush to NVDIMM capable */
++#define ACPI_NFIT_CAPABILITY_MEM_MIRRORING     (1<<2)  /* 02: Memory Mirroring capable */
++
++
++/*
++ * NFIT/DVDIMM device handle support - used as the _ADR for each NVDIMM
++ */
++typedef struct nfit_device_handle
++{
++    UINT32                  Handle;
++
++} NFIT_DEVICE_HANDLE;
++
++/* Device handle construction and extraction macros */
++
++#define ACPI_NFIT_DIMM_NUMBER_MASK              0x0000000F
++#define ACPI_NFIT_CHANNEL_NUMBER_MASK           0x000000F0
++#define ACPI_NFIT_MEMORY_ID_MASK                0x00000F00
++#define ACPI_NFIT_SOCKET_ID_MASK                0x0000F000
++#define ACPI_NFIT_NODE_ID_MASK                  0x0FFF0000
++
++#define ACPI_NFIT_DIMM_NUMBER_OFFSET            0
++#define ACPI_NFIT_CHANNEL_NUMBER_OFFSET         4
++#define ACPI_NFIT_MEMORY_ID_OFFSET              8
++#define ACPI_NFIT_SOCKET_ID_OFFSET              12
++#define ACPI_NFIT_NODE_ID_OFFSET                16
++
++/* Macro to construct a NFIT/NVDIMM device handle */
++
++#define ACPI_NFIT_BUILD_DEVICE_HANDLE(dimm, channel, memory, socket, node) \
++    ((dimm)                                         | \
++    ((channel) << ACPI_NFIT_CHANNEL_NUMBER_OFFSET)  | \
++    ((memory)  << ACPI_NFIT_MEMORY_ID_OFFSET)       | \
++    ((socket)  << ACPI_NFIT_SOCKET_ID_OFFSET)       | \
++    ((node)    << ACPI_NFIT_NODE_ID_OFFSET))
++
++/* Macros to extract individual fields from a NFIT/NVDIMM device handle */
++
++#define ACPI_NFIT_GET_DIMM_NUMBER(handle) \
++    ((handle) & ACPI_NFIT_DIMM_NUMBER_MASK)
++
++#define ACPI_NFIT_GET_CHANNEL_NUMBER(handle) \
++    (((handle) & ACPI_NFIT_CHANNEL_NUMBER_MASK) >> ACPI_NFIT_CHANNEL_NUMBER_OFFSET)
++
++#define ACPI_NFIT_GET_MEMORY_ID(handle) \
++    (((handle) & ACPI_NFIT_MEMORY_ID_MASK)      >> ACPI_NFIT_MEMORY_ID_OFFSET)
++
++#define ACPI_NFIT_GET_SOCKET_ID(handle) \
++    (((handle) & ACPI_NFIT_SOCKET_ID_MASK)      >> ACPI_NFIT_SOCKET_ID_OFFSET)
++
++#define ACPI_NFIT_GET_NODE_ID(handle) \
++    (((handle) & ACPI_NFIT_NODE_ID_MASK)        >> ACPI_NFIT_NODE_ID_OFFSET)
++
++
+ /*******************************************************************************
+  *
+  * SBST - Smart Battery Specification Table
+diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c
+index c4b023d81..51840dd90 100644
+--- a/source/tools/acpisrc/astable.c
++++ b/source/tools/acpisrc/astable.c
+@@ -658,6 +658,8 @@ ACPI_TYPED_IDENTIFIER_TABLE           AcpiIdentifiers[] = {
+     {"ACPI_MPST_POWER_STATE",               SRC_TYPE_STRUCT},
+     {"ACPI_MCFG_ALLOCATION",                SRC_TYPE_STRUCT},
+     {"ACPI_MSCT_PROXIMITY",                 SRC_TYPE_STRUCT},
++    {"ACPI_NFIT_CAPABILITIES",              SRC_TYPE_STRUCT},
++    {"ACPI_NFIT_DEVICE_HANDLE",             SRC_TYPE_STRUCT},
+     {"ACPI_NFIT_HEADER",                    SRC_TYPE_STRUCT},
+     {"ACPI_NFIT_SYSTEM_ADDRESS",            SRC_TYPE_STRUCT},
+     {"ACPI_NFIT_MEMORY_MAP",                SRC_TYPE_STRUCT},
+-- 
+2.17.1
+
diff --git a/SOURCES/asllookup-miscompare.patch b/SOURCES/asllookup-miscompare.patch
new file mode 100644
index 0000000..d6e135b
--- /dev/null
+++ b/SOURCES/asllookup-miscompare.patch
@@ -0,0 +1,35 @@
+diff --git a/source/compiler/asllookup.c b/source/compiler/asllookup.c
+index fed35fd..cda5976 100644
+--- a/source/compiler/asllookup.c
++++ b/source/compiler/asllookup.c
+@@ -122,6 +122,8 @@ LkIsObjectUsed (
+     ASL_METHOD_LOCAL        *MethodLocals;
+     ASL_METHOD_LOCAL        *MethodArgs;
+     UINT32                  i;
++    ACPI_NAME_UNION         NodeName;
++    ACPI_NAME_UNION         NextName;
+ 
+ 
+     if (Node->Type == ACPI_TYPE_METHOD)
+@@ -175,7 +177,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(&NodeName.Ascii, Node->Name.Ascii);
++                if ((NodeName.Ascii[0] != '_') &&
+                     (!(MethodArgs[i].Flags & ASL_ARG_REFERENCED)))
+                 {
+                     sprintf (MsgBuffer, "Arg%u", i);
+@@ -228,8 +231,10 @@ LkIsObjectUsed (
+              * Issue a remark even if it is a reserved name (starts
+              * with an underscore).
+              */
++            ACPI_MOVE_32_TO_32(&NodeName.Ascii, Node->Name.Ascii);
++            ACPI_MOVE_32_TO_32(&NextName.Ascii, Next->Name.Ascii);
+             sprintf (MsgBuffer, "Name [%4.4s] is within a method [%4.4s]",
+-                Node->Name.Ascii, Next->Name.Ascii);
++                NodeName.Ascii, NextName.Ascii);
+             AslError (ASL_REMARK, ASL_MSG_NOT_REFERENCED,
+                 LkGetNameOp (Node->Op), MsgBuffer);
+             return (AE_OK);
diff --git a/SOURCES/badcode.asl.result b/SOURCES/badcode.asl.result
new file mode 100644
index 0000000..23bef67
--- /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 -                                    ^ 64-bit integer in 32-bit table, truncating (DSDT or SSDT version < 2)
+
+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 version VVVVVVVV-YYYY
+Copyright (c) 2000 - 2016 Intel Corporation
+
+Ignoring all errors, forcing AML file generation
+
+ASL Input:     badcode.asl - 409 lines, 11588 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/debian-big_endian.patch b/SOURCES/debian-big_endian.patch
new file mode 100644
index 0000000..48235e2
--- /dev/null
+++ b/SOURCES/debian-big_endian.patch
@@ -0,0 +1,2466 @@
+diff --git a/source/compiler/aslcodegen.c b/source/compiler/aslcodegen.c
+index 30e7984..89433b9 100644
+--- a/source/compiler/aslcodegen.c
++++ b/source/compiler/aslcodegen.c
+@@ -243,16 +243,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 */
+ 
+@@ -276,51 +272,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;
+     }
+ 
+@@ -331,8 +328,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)
+         {
+@@ -342,7 +339,7 @@ CgWriteAmlOpcode (
+              */
+             PkgLenFirstByte = (UINT8)
+                 (((UINT32) (Op->Asl.AmlPkgLenBytes - 1) << 6) |
+-                (PkgLen.LenBytes[0] & 0x0F));
++                (PkgLen & 0x0F));
+ 
+             CgLocalWriteAmlData (Op, &PkgLenFirstByte, 1);
+ 
+@@ -350,39 +347,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:
+@@ -416,6 +421,7 @@ CgWriteTableHeader (
+     ACPI_PARSE_OBJECT       *Op)
+ {
+     ACPI_PARSE_OBJECT       *Child;
++    UINT32 DWord;
+ 
+ 
+     /* AML filename */
+@@ -452,7 +458,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 */
+ 
+@@ -460,12 +466,14 @@ 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) +
++    DWord = sizeof (ACPI_TABLE_HEADER) +
+         Op->Asl.AmlSubtreeLength;
++    ACPI_MOVE_32_TO_32(&TableHeader.Length, &DWord);
+     TableHeader.Checksum = 0;
+ 
+     Op->Asl.FinalAmlOffset = ftell (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
+@@ -578,7 +586,10 @@ CgWriteNode (
+     ACPI_PARSE_OBJECT       *Op)
+ {
+     ASL_RESOURCE_NODE       *Rnode;
+-
++    UINT8                   Byte;
++    UINT16                  Word;
++    UINT32                  DWord;
++    UINT64                  QWord;
+ 
+     /* Always check for DEFAULT_ARG and other "Noop" nodes */
+     /* TBD: this may not be the best place for this check */
+@@ -601,13 +612,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:
+ 
+diff --git a/source/compiler/aslopcodes.c b/source/compiler/aslopcodes.c
+index de9ffe1..81f4ad3 100644
+--- a/source/compiler/aslopcodes.c
++++ b/source/compiler/aslopcodes.c
+@@ -481,6 +481,7 @@ OpcDoUnicode (
+     UINT32                  i;
+     UINT8                   *AsciiString;
+     UINT16                  *UnicodeString;
++    UINT16                  UChar;
+     ACPI_PARSE_OBJECT       *BufferLengthOp;
+ 
+ 
+@@ -507,7 +508,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);
+     }
+ 
+     /*
+diff --git a/source/compiler/aslrestype1.c b/source/compiler/aslrestype1.c
+index 4bd9059..e61fa85 100644
+--- a/source/compiler/aslrestype1.c
++++ b/source/compiler/aslrestype1.c
+@@ -141,6 +141,11 @@ RsDoMemory24Descriptor (
+     ACPI_PARSE_OBJECT       *MaxOp = NULL;
+     ACPI_PARSE_OBJECT       *LengthOp = NULL;
+     ASL_RESOURCE_NODE       *Rnode;
++    UINT16                  Minimum = 0;
++    UINT16                  Maximum = 0;
++    UINT16                  AddressLength = 0;
++    UINT16                  Alignment = 0;
++    UINT16                  ResourceLength;
+     UINT32                  CurrentByteOffset;
+     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);
+ }
+ 
+@@ -247,6 +258,11 @@ RsDoMemory32Descriptor (
+     ACPI_PARSE_OBJECT       *LengthOp = NULL;
+     ACPI_PARSE_OBJECT       *AlignOp = NULL;
+     ASL_RESOURCE_NODE       *Rnode;
++    UINT32                  Minimum = 0;
++    UINT32                  Maximum = 0;
++    UINT32                  AddressLength = 0;
++    UINT32                  Alignment = 0;
++    UINT16                  ResourceLength;
+     UINT32                  CurrentByteOffset;
+     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);
+ }
+ 
+@@ -350,6 +372,7 @@ RsDoMemory32FixedDescriptor (
+     AML_RESOURCE            *Descriptor;
+     ACPI_PARSE_OBJECT       *InitializerOp;
+     ASL_RESOURCE_NODE       *Rnode;
++    UINT16                  ResourceLength;
+     UINT32                  CurrentByteOffset;
+     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;
+diff --git a/source/compiler/aslrestype1i.c b/source/compiler/aslrestype1i.c
+index 0f38e40..26fa7ea 100644
+--- a/source/compiler/aslrestype1i.c
++++ b/source/compiler/aslrestype1i.c
+@@ -197,6 +197,8 @@ RsDoFixedDmaDescriptor (
+     AML_RESOURCE            *Descriptor;
+     ACPI_PARSE_OBJECT       *InitializerOp;
+     ASL_RESOURCE_NODE       *Rnode;
++    UINT16                  RequestLines = 0;
++    UINT16                  Channels = 0;
+     UINT32                  CurrentByteOffset;
+     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);
+ }
+ 
+@@ -273,6 +278,7 @@ RsDoFixedIoDescriptor (
+     ACPI_PARSE_OBJECT       *InitializerOp;
+     ACPI_PARSE_OBJECT       *AddressOp = NULL;
+     ASL_RESOURCE_NODE       *Rnode;
++    UINT16                  Address = 0;
+     UINT32                  CurrentByteOffset;
+     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);
+ }
+ 
+@@ -356,6 +363,8 @@ RsDoIoDescriptor (
+     ACPI_PARSE_OBJECT       *LengthOp = NULL;
+     ACPI_PARSE_OBJECT       *AlignOp = NULL;
+     ASL_RESOURCE_NODE       *Rnode;
++    UINT16                  Minimum = 0;
++    UINT16                  Maximum = 0;
+     UINT32                  CurrentByteOffset;
+     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);
+ }
+diff --git a/source/compiler/aslrestype2.c b/source/compiler/aslrestype2.c
+index b75c118..37dd91b 100644
+--- a/source/compiler/aslrestype2.c
++++ b/source/compiler/aslrestype2.c
+@@ -75,6 +75,7 @@ RsDoGeneralRegisterDescriptor (
+     AML_RESOURCE            *Descriptor;
+     ACPI_PARSE_OBJECT       *InitializerOp;
+     ASL_RESOURCE_NODE       *Rnode;
++    UINT16                  ResourceLength;
+     UINT32                  CurrentByteOffset;
+     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 */
+ 
+@@ -116,7 +119,8 @@ RsDoGeneralRegisterDescriptor (
+ 
+         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;
+@@ -172,6 +176,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;
+@@ -220,7 +225,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,
+@@ -328,10 +333,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 */
+ 
+@@ -367,7 +373,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 */
+@@ -379,14 +385,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);
+ }
+ 
+@@ -434,7 +441,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 */
+ 
+diff --git a/source/compiler/aslrestype2d.c b/source/compiler/aslrestype2d.c
+index c7841b0..9a782c5 100644
+--- a/source/compiler/aslrestype2d.c
++++ b/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);
+diff --git a/source/compiler/aslrestype2e.c b/source/compiler/aslrestype2e.c
+index aa17a75..61abdd3 100644
+--- a/source/compiler/aslrestype2e.c
++++ b/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);
+@@ -251,6 +266,13 @@ RsDoExtendedMemoryDescriptor (
+     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;
+ 
+@@ -267,9 +289,10 @@ RsDoExtendedMemoryDescriptor (
+     Descriptor->ExtAddress64.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_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 */
+ 
+@@ -319,7 +342,7 @@ RsDoExtendedMemoryDescriptor (
+ 
+         case 6: /* 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;
+@@ -327,7 +350,7 @@ RsDoExtendedMemoryDescriptor (
+ 
+         case 7: /* Min Address */
+ 
+-            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;
+@@ -335,7 +358,7 @@ RsDoExtendedMemoryDescriptor (
+ 
+         case 8: /* Max Address */
+ 
+-            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;
+@@ -343,14 +366,14 @@ RsDoExtendedMemoryDescriptor (
+ 
+         case 9: /* 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 10: /* 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;
+@@ -358,7 +381,7 @@ RsDoExtendedMemoryDescriptor (
+ 
+         case 11: /* 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;
+@@ -395,13 +418,20 @@ RsDoExtendedMemoryDescriptor (
+     /* 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);
+@@ -432,6 +462,13 @@ RsDoExtendedSpaceDescriptor (
+     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;
+ 
+@@ -447,9 +484,10 @@ RsDoExtendedSpaceDescriptor (
+     Descriptor->ExtAddress64.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64;
+     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 */
+ 
+@@ -497,7 +535,7 @@ RsDoExtendedSpaceDescriptor (
+ 
+         case 6: /* 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;
+@@ -505,7 +543,7 @@ RsDoExtendedSpaceDescriptor (
+ 
+         case 7: /* Min Address */
+ 
+-            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;
+@@ -513,7 +551,7 @@ RsDoExtendedSpaceDescriptor (
+ 
+         case 8: /* Max Address */
+ 
+-            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;
+@@ -521,14 +559,14 @@ RsDoExtendedSpaceDescriptor (
+ 
+         case 9: /* 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 10: /* 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;
+@@ -536,7 +574,7 @@ RsDoExtendedSpaceDescriptor (
+ 
+         case 11: /* 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;
+@@ -558,13 +596,20 @@ RsDoExtendedSpaceDescriptor (
+     /* 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);
+diff --git a/source/compiler/aslrestype2q.c b/source/compiler/aslrestype2q.c
+index c8d8cab..d738ca4 100644
+--- a/source/compiler/aslrestype2q.c
++++ b/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);
+diff --git a/source/compiler/aslrestype2s.c b/source/compiler/aslrestype2s.c
+index fcd8e23..b7394b7 100644
+--- a/source/compiler/aslrestype2s.c
++++ b/source/compiler/aslrestype2s.c
+@@ -290,6 +290,9 @@ RsDoGpioIntDescriptor (
+     UINT16                  VendorLength;
+     UINT16                  InterruptLength;
+     UINT16                  DescriptorSize;
++    UINT16                  IntFlags = 0;
++    UINT16                  DebounceTimeout = 0;
++    UINT16                  Flags = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  PinCount = 0;
+     UINT32                  i;
+@@ -346,21 +349,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;
+@@ -374,7 +377,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;
+@@ -401,7 +404,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,6 +469,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);
+@@ -499,6 +506,10 @@ 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;
+@@ -555,7 +566,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;
+@@ -569,21 +580,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;
+@@ -609,7 +620,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,6 +684,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);
+@@ -703,6 +719,9 @@ RsDoI2cSerialBusDescriptor (
+     UINT16                  ResSourceLength;
+     UINT16                  VendorLength;
+     UINT16                  DescriptorSize;
++    UINT16                  SlaveAddress = 0;
++    UINT32                  ConnectionSpeed = 0;
++    UINT16                  TypeSpecificFlags = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  i;
+ 
+@@ -752,7 +771,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;
+@@ -766,14 +785,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;
+@@ -833,6 +852,10 @@ 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);
+ }
+@@ -862,6 +885,9 @@ RsDoSpiSerialBusDescriptor (
+     UINT16                  ResSourceLength;
+     UINT16                  VendorLength;
+     UINT16                  DescriptorSize;
++    UINT16                  DeviceSelection = 0;
++    UINT32                  ConnectionSpeed = 0;
++    UINT16                  TypeSpecificFlags = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  i;
+ 
+@@ -912,21 +938,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;
+@@ -947,7 +973,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;
+@@ -1021,6 +1047,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);
+ }
+@@ -1050,6 +1080,10 @@ RsDoUartSerialBusDescriptor (
+     UINT16                  ResSourceLength;
+     UINT16                  VendorLength;
+     UINT16                  DescriptorSize;
++    UINT32                  DefaultBaudRate = 0;
++    UINT16                  TypeSpecificFlags = 0;
++    UINT16                  RxFifoSize = 0;
++    UINT16                  TxFifoSize = 0;
+     UINT32                  CurrentByteOffset;
+     UINT32                  i;
+ 
+@@ -1099,21 +1133,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;
+@@ -1127,7 +1161,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;
+@@ -1141,21 +1175,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;
+@@ -1225,6 +1259,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);
+ }
+diff --git a/source/compiler/aslrestype2w.c b/source/compiler/aslrestype2w.c
+index 0b88c70..a971d5a 100644
+--- a/source/compiler/aslrestype2w.c
++++ b/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);
+diff --git a/source/include/acmacros.h b/source/include/acmacros.h
+index 21256cb..3649ff0 100644
+--- a/source/include/acmacros.h
++++ b/source/include/acmacros.h
+@@ -100,7 +100,8 @@
+ 
+ /* 32-bit source, 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_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];\
+@@ -115,9 +116,13 @@
+ 
+ /* 64-bit source, 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_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)        ACPI_MOVE_32_TO_32(d, s)    /* Truncate to 32 */
++#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];\
+@@ -144,7 +149,9 @@
+ 
+ /* 32-bit source, 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_16(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];\
++                                         ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[1];}
++
+ #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)
+ 
+diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h
+index bd45cdb..3eeb572 100644
+--- a/source/include/platform/aclinux.h
++++ b/source/include/platform/aclinux.h
+@@ -178,6 +178,7 @@
+ #include <stdlib.h>
+ #include <ctype.h>
+ #include <unistd.h>
++#include <endian.h>
+ 
+ /* Define/disable kernel-specific declarators */
+ 
+@@ -190,8 +191,7 @@
+ #define ACPI_FLUSH_CPU_CACHE()
+ #define ACPI_CAST_PTHREAD_T(Pthread) ((ACPI_THREAD_ID) (Pthread))
+ 
+-#if defined(__ia64__)    || defined(__x86_64__) ||\
+-    defined(__aarch64__) || defined(__PPC64__)
++#if __SIZEOF_LONG__ == 8
+ #define ACPI_MACHINE_WIDTH          64
+ #define COMPILER_DEPENDENT_INT64    long
+ #define COMPILER_DEPENDENT_UINT64   unsigned long
+@@ -202,6 +202,10 @@
+ #define ACPI_USE_NATIVE_DIVIDE
+ #endif
+ 
++#if __BYTE_ORDER == __BIG_ENDIAN
++#define ACPI_BIG_ENDIAN
++#endif
++
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
diff --git a/SOURCES/debian-unaligned.patch b/SOURCES/debian-unaligned.patch
new file mode 100644
index 0000000..adb3c6d
--- /dev/null
+++ b/SOURCES/debian-unaligned.patch
@@ -0,0 +1,161 @@
+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/compiler/asltree.c             | 15 ++++++++++-----
+ source/components/executer/exoparg2.c | 12 +++++++++---
+ source/include/actypes.h              | 26 +++++++++++++-------------
+ 3 file modificati, 32 inserzioni(+), 21 rimozioni(-)
+
+diff --git a/source/compiler/asltree.c b/source/compiler/asltree.c
+index af67467..b7118b3 100644
+--- a/source/compiler/asltree.c
++++ b/source/compiler/asltree.c
+@@ -913,28 +913,31 @@ TrCreateValuedLeafNode (
+         "Op %s  Value %8.8X%8.8X  ",
+         Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode),
+         ACPI_FORMAT_UINT64 (Value));
+-    Op->Asl.Value.Integer = Value;
+ 
+     switch (ParseOpcode)
+     {
+     case PARSEOP_STRING_LITERAL:
+ 
+-        DbgPrint (ASL_PARSE_OUTPUT, "STRING->%s", Value);
++        Op->Asl.Value.String = (ACPI_STRING) (ACPI_SIZE) Value;
++        DbgPrint (ASL_PARSE_OUTPUT, "STRING->%s", Op->Asl.Value.String);
+         break;
+ 
+     case PARSEOP_NAMESEG:
+ 
+-        DbgPrint (ASL_PARSE_OUTPUT, "NAMESEG->%s", Value);
++        Op->Asl.Value.String = (ACPI_STRING) (ACPI_SIZE) Value;
++        DbgPrint (ASL_PARSE_OUTPUT, "NAMESEG->%s", Op->Asl.Value.String);
+         break;
+ 
+     case PARSEOP_NAMESTRING:
+ 
+-        DbgPrint (ASL_PARSE_OUTPUT, "NAMESTRING->%s", Value);
++        Op->Asl.Value.String = (ACPI_STRING) (ACPI_SIZE) Value;
++        DbgPrint (ASL_PARSE_OUTPUT, "NAMESTRING->%s", Op->Asl.Value.String);
+         break;
+ 
+     case PARSEOP_EISAID:
+ 
+-        DbgPrint (ASL_PARSE_OUTPUT, "EISAID->%s", Value);
++        Op->Asl.Value.String = (ACPI_STRING) (ACPI_SIZE) Value;
++        DbgPrint (ASL_PARSE_OUTPUT, "EISAID->%s", Op->Asl.Value.String);
+         break;
+ 
+     case PARSEOP_METHOD:
+@@ -944,12 +947,14 @@ TrCreateValuedLeafNode (
+ 
+     case PARSEOP_INTEGER:
+ 
++        Op->Asl.Value.Integer = Value;
+         DbgPrint (ASL_PARSE_OUTPUT, "INTEGER->%8.8X%8.8X",
+             ACPI_FORMAT_UINT64 (Value));
+         break;
+ 
+     default:
+ 
++        Op->Asl.Value.Integer = Value;
+         break;
+     }
+ 
+diff --git a/source/components/executer/exoparg2.c b/source/components/executer/exoparg2.c
+index 7fe91a8..5c6af04 100644
+--- a/source/components/executer/exoparg2.c
++++ b/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_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */
+diff --git a/source/include/actypes.h b/source/include/actypes.h
+index 395b915..137d93f 100644
+--- a/source/include/actypes.h
++++ b/source/include/actypes.h
+@@ -143,6 +143,19 @@ typedef COMPILER_DEPENDENT_INT64        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
++
+ 
+ /*******************************************************************************
+  *
+@@ -169,19 +182,6 @@ typedef UINT64                          ACPI_PHYSICAL_ADDRESS;
+ #define ACPI_SIZE_MAX                   ACPI_UINT64_MAX
+ #define ACPI_USE_NATIVE_DIVIDE          /* 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/SOURCES/grammar.asl.result b/SOURCES/grammar.asl.result
new file mode 100644
index 0000000..ca72c7a
--- /dev/null
+++ b/SOURCES/grammar.asl.result
@@ -0,0 +1,380 @@
+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    823:                         Store(Local1,Arg2)
+Remark   2146 -              Method Argument is never used ^  (Arg2)
+
+grammar.asl    913:     Device (DEV1)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl    949:     Method (_ERR, 2)
+Warning  3102 -                   ^ Reserved method has too few arguments (_ERR requires 3)
+
+grammar.asl    963:         Divide (Local0, Local1, Local3)
+Warning  3144 -      Method Local is set but never used ^  (Local3)
+
+grammar.asl    987:     Method (R226, 2)
+Remark   2146 -                   ^ Method Argument is never used (Arg0)
+
+grammar.asl    987:     Method (R226, 2)
+Remark   2146 -                   ^ Method Argument is never used (Arg1)
+
+grammar.asl   1010:         Store (Local0, Local1)
+Warning  3144 -                                ^ Method Local is set but never used (Local1)
+
+grammar.asl   1295:     Method (OBJ1, 1, SERIALIZED)
+Remark   2146 -                   ^ Method Argument is never used (Arg0)
+
+grammar.asl   1299:         Name(BUFR, Buffer (Local0) {})
+Remark   2089 -                    ^ Object is not referenced (Name [BUFR] is within a method [OBJ1])
+
+grammar.asl   1306:         Alias (MTX1, MTX2)
+Remark   2089 -   Object is not referenced ^  (Name [MTX2] is within a method [OBJ1])
+
+grammar.asl   1328:         CreateField (BUF2, 148, 96, FLD3)
+Remark   2089 -                  Object is not referenced ^  (Name [FLD3] is within a method [FLDS])
+
+grammar.asl   1393:         Store (0x1234567887654321, QWD2)
+Warning  3038 -                                    ^ 64-bit integer in 32-bit table, truncating (DSDT or SSDT version < 2)
+
+grammar.asl   1395:         if (LNotEqual (Local0, 0x1234567887654321))
+Warning  3038 -                                                    ^ 64-bit integer in 32-bit table, truncating (DSDT or SSDT version < 2)
+
+grammar.asl   1475:         SizeOf (BUFO)
+Error    6114 -                       ^ Result is not used, operator has no effect
+
+grammar.asl   1495:         Alias (MTX2, MTXA)
+Remark   2089 -   Object is not referenced ^  (Name [MTXA] is within a method [OBJ2])
+
+grammar.asl   1501:         Acquire (MTX2, 1)
+Warning  3130 -                           ^ Result is not used, possible operator timeout will be missed
+
+grammar.asl   1649:         Add (Local0, Local1)
+Error    6114 -                      ^ Result is not used, operator has no effect
+
+grammar.asl   1660:         Add (Local0, Local1, Local2)
+Warning  3144 -   Method Local is set but never used ^  (Local2)
+
+grammar.asl   1776:         Store (LAnd (0xFFFFFFFF, 0x11111111), Local0)
+Warning  3144 -                    Method Local is set but never used ^  (Local0)
+
+grammar.asl   1779:         Store (LEqual (0xFFFFFFFF, 0x11111111), Local1)
+Warning  3144 -                      Method Local is set but never used ^  (Local1)
+
+grammar.asl   1782:         Store (LGreater (0xFFFFFFFF, 0x11111111), Local2)
+Warning  3144 -                        Method Local is set but never used ^  (Local2)
+
+grammar.asl   1785:         Store (LGreaterEqual (0xFFFFFFFF, 0x11111111), Local3)
+Warning  3144 -                             Method Local is set but never used ^  (Local3)
+
+grammar.asl   1788:         Store (LLess (0xFFFFFFFF, 0x11111111), Local4)
+Warning  3144 -                     Method Local is set but never used ^  (Local4)
+
+grammar.asl   1791:         Store (LLessEqual (0xFFFFFFFF, 0x11111111), Local5)
+Warning  3144 -                          Method Local is set but never used ^  (Local5)
+
+grammar.asl   1820:     Method (COND)
+Warning  3115 -                   ^ Not all control paths return a value (COND)
+
+grammar.asl   1929:         Store (RefOf (MAIN), Local5)
+Warning  3144 -   Method Local is set but never used ^  (Local5)
+
+grammar.asl   2004:     Device (IFEL)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2161:     Device (NOSV)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2582:     Device (IDXF)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2610:             Store (IFE0, Local0)
+Warning  3144 -                                  ^ Method Local is set but never used (Local0)
+
+grammar.asl   2611:             Store (IFE1, Local1)
+Warning  3144 -                                  ^ Method Local is set but never used (Local1)
+
+grammar.asl   2612:             Store (IFE2, Local2)
+Warning  3144 -                                  ^ Method Local is set but never used (Local2)
+
+grammar.asl   2629:         Device (NSTL)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2657:     Device (RTBF)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2755:     Device (GPE2)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2770:     Device (PRW2)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2818:     Device (PRW1)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2885:             Store (Arg0, Local0)
+Warning  3144 -                                  ^ Method Local is set but never used (Local0)
+
+grammar.asl   2888:         Device (RTLV)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   2992:             Name (_CRS,0)
+Error    6105 -                           ^ Invalid object type for reserved name (_CRS: found Integer, Buffer required)
+
+grammar.asl   3016:         Device (RETP)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   3052:     Device (WHLR)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   3108:     Device (ANDO)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   3382:     Device (BRKP)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   3419:     Device (ADSU)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   3512:     Device (INDC)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   3610:     Device (LOPS)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   3955:     Device (FDSO)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   4119:     Device (MLDV)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   4252:     Device (NBIT)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   4488:     Device (SHFT)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   4684:     Device (XORD)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   5021:     Device (CRBF)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   5099:     Device (IDX4)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   5638:     Device (EVNT)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   5866:     Device (SZLV)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   5959:         Device (BYTF)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   5969:         Device (C005)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   5971:             Device (C013)
+Warning  3141 -        Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   6026:             Name (_HID, "*PNP0A06")
+Error    6061 -            Invalid leading asterisk ^  (*PNP0A06)
+
+grammar.asl   6165:         Name (C18C, Package (2)
+Remark   2063 -                                 ^ Initializer list shorter than declared package length
+
+grammar.asl   6189:         Device (C19B)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   6198:                 Divide (Local1, 10, Local0, Local2) //  Local0 = Local1 / 10
+Warning  3144 -          Method Local is set but never used ^  (Local0)
+
+grammar.asl   6243:     Device (DWDF)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   6275:     Method (MKW_, 2)
+Remark   2146 -                   ^ Method Argument is never used (Arg0)
+
+grammar.asl   6275:     Method (MKW_, 2)
+Remark   2146 -                   ^ Method Argument is never used (Arg1)
+
+grammar.asl   6284:     Device (DVAX)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   6327:     Device (IDX6)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   6351:         Device (TST_)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   6370:             Store (IFE0, Local0)
+Warning  3144 -                                  ^ Method Local is set but never used (Local0)
+
+grammar.asl   6371:             Store (IFE1, Local1)
+Warning  3144 -                                  ^ Method Local is set but never used (Local1)
+
+grammar.asl   6372:             Store (IFE2, Local2)
+Warning  3144 -                                  ^ Method Local is set but never used (Local2)
+
+grammar.asl   6375:             Store (\IDX6.IFE0, Local3)
+Warning  3144 -     Method Local is set but never used ^  (Local3)
+
+grammar.asl   6376:             Store (\IDX6.IFE1, Local4)
+Warning  3144 -     Method Local is set but never used ^  (Local4)
+
+grammar.asl   6378:             Store (\IDX6.TST_.IFE0, Local5)
+Warning  3144 -          Method Local is set but never used ^  (Local5)
+
+grammar.asl   6379:             Store (\IDX6.TST_.IFE1, Local6)
+Warning  3144 -          Method Local is set but never used ^  (Local6)
+
+grammar.asl   6392:     Device (IDX5)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   6477:             Name (_CRS, Buffer(26)  {"\_SB_.PCI2._CRS..........."})
+Warning  3046 -        Invalid or unknown escape sequence ^ 
+
+grammar.asl   6708:         Device (BITI)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   6816:                 And (Local0, 1, Local0) //  Local0 &= 1
+Error    6066 -                              ^ Method local variable is not initialized (Local0)
+
+grammar.asl   6902:             Name (_HID, "*PNP0C0A")     //  Control Method Battey ID
+Error    6061 -            Invalid leading asterisk ^  (*PNP0C0A)
+
+grammar.asl   6911:         Device (IDX3)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   7056:     Device(IDX7)
+Warning  3141 -                  ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   7735:     Device (MTCH)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   7756:             CreateDWordField (TMD0, 4, DMA0)
+Remark   2089 -                     Object is not referenced ^  (Name [DMA0] is within a method [TEST])
+
+grammar.asl   7757:             CreateDWordField (TMD0, 8, PIO1)
+Remark   2089 -                     Object is not referenced ^  (Name [PIO1] is within a method [TEST])
+
+grammar.asl   7758:             CreateDWordField (TMD0, 12, DMA1)
+Remark   2089 -                      Object is not referenced ^  (Name [DMA1] is within a method [TEST])
+
+grammar.asl   7759:             CreateDWordField (TMD0, 16, CHNF)
+Remark   2089 -                      Object is not referenced ^  (Name [CHNF] is within a method [TEST])
+
+grammar.asl   7933:     Device (WHLB)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   8294:         Device (IDX2)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   8677:     Device (SIZO)
+Warning  3141 -                   ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   8719:             Name (PKG2, Package (4)
+Remark   2063 -                                     ^ Initializer list shorter than declared package length
+
+grammar.asl   9131:             Store (_OS, Local0)
+Warning  3144 -                                 ^ Method Local is set but never used (Local0)
+
+grammar.asl   9261:         Device (MBIT)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   9272:         Device (MWRD)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   9280:         Device (MBYT)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   9353:         Device (SMIS)
+Warning  3141 -    Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+grammar.asl   9407:         Device(CNDT)
+Warning  3141 -   Missing dependency ^  (Device object requires a _HID or _ADR in same scope)
+
+
+Intel ACPI Component Architecture
+ASL+ Optimizing Compiler version VVVVVVVV-YYYY
+Copyright (c) 2000 - 2016 Intel Corporation
+
+Ignoring all errors, forcing AML file generation
+
+ASL Input:     grammar.asl - 10284 lines, 322888 bytes, 4819 keywords
+AML Output:    grammar.aml - 43490 bytes, 670 named objects, 4149 executable opcodes
+
+Compilation complete. 6 Errors, 89 Warnings, 28 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/name-miscompare.patch b/SOURCES/name-miscompare.patch
new file mode 100644
index 0000000..d64fa91
--- /dev/null
+++ b/SOURCES/name-miscompare.patch
@@ -0,0 +1,28 @@
+On big-endian machines, a test case looking for the methods _L1D and _E1D
+in the same scope would fail (see tests/misc/badcode.asl:184).  The names
+to be compared were being treated as 32-bit ints, and not strings.  Hence,
+the characters were re-ordered incorrectly, mismatching the assumptions
+made in the remainder of the function.
+
+diff --git a/source/compiler/aslanalyze.c b/source/compiler/aslanalyze.c
+index bf5b37c..11eef08 100644
+--- a/source/compiler/aslanalyze.c
++++ b/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") */
+ 
diff --git a/SOURCES/re-enable-big-endian.patch b/SOURCES/re-enable-big-endian.patch
new file mode 100644
index 0000000..2bbeba6
--- /dev/null
+++ b/SOURCES/re-enable-big-endian.patch
@@ -0,0 +1,27 @@
+Re-enable use of these tools on big-endian machines.
+
+Al Stone <ahs3@redhat.com>
+
+diff --git a/source/compiler/aslmain.c b/source/compiler/aslmain.c
+index 064e790..c4cd451 100644
+--- a/source/compiler/aslmain.c
++++ b/source/compiler/aslmain.c
+@@ -318,18 +318,6 @@ main (
+     int                     ReturnStatus = 0;
+ 
+ 
+-    /*
+-     * 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 */
+ 
diff --git a/SOURCES/run-misc-tests.sh b/SOURCES/run-misc-tests.sh
new file mode 100644
index 0000000..568970a
--- /dev/null
+++ b/SOURCES/run-misc-tests.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+#       run the misc tests: we need to do this in a script since
+#       these are expected to fail which would normally cause %check
+#       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
+
+m=`uname -m`
+case $m in
+    s390x | \
+    *64le | \
+    *64) BITS=64
+         ;;
+    *)   BITS=32
+         ;;
+esac
+
+# if a build starts before midnight, but ends after midnight, this
+# test can get confused.  grab the date from the iasl file we just
+# built so they match regardless.
+FDATE=`stat --format="%Y" $BINDIR/iasl | cut -d" " -f1`
+WHEN=`date --date="@$FDATE" +"%b %_d %Y"`
+
+sed -e "s/XXXXXXXXXXX/$WHEN/" \
+    -e "s/YYYY/$BITS/" \
+    -e "s/VVVVVVVV/$VERSION/" \
+    ../badcode.asl.result > misc/badcode.asl.result
+sed -e "s/XXXXXXXXXXX/$WHEN/" \
+    -e "s/YYYY/$BITS/" \
+    -e "s/VVVVVVVV/$VERSION/" \
+    ../grammar.asl.result > misc/grammar.asl.result
+
+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
+diff badcode badcode.asl.result >/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
+diff grammar grammar.asl.result >/dev/null 2>&1
+[ $? -eq 0 ] || exit 1
+
+exit 0
diff --git a/SPECS/acpica-tools.spec b/SPECS/acpica-tools.spec
new file mode 100644
index 0000000..ed1acc1
--- /dev/null
+++ b/SPECS/acpica-tools.spec
@@ -0,0 +1,342 @@
+Name:           acpica-tools
+Version:        20160527
+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
+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:       badcode.asl.result
+Source12:       grammar.asl.result
+Source13:       run-misc-tests.sh
+Source14:       COPYING
+
+Patch0:         debian-big_endian.patch
+Patch1:         debian-unaligned.patch
+Patch2:         name-miscompare.patch
+Patch3:         asllookup-miscompare.patch
+Patch4:         re-enable-big-endian.patch
+Patch5:         DSDT-too-long.patch
+Patch6:		add-nfit-subtable7.patch
+
+BuildRequires:  bison patchutils flex
+
+# 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-7
+
+# 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-5
+
+%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 .debian-big_endian
+%patch1 -p1 -b .debian-unaligned
+%patch2 -p1 -b .name-miscompare
+%patch3 -p1 -b .asllookup-miscompare
+%patch4 -p1 -b .re-enable-big-endian
+%patch5 -p1 -b .DSDT-too-long
+%patch6 -p1 -b .add-nfit-subtable7
+
+cp -p %{SOURCE2} README
+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} badcode.asl.result
+cp -p %{SOURCE12} grammar.asl.result
+cp -p %{SOURCE13} tests/run-misc-tests.sh
+chmod a+x tests/run-misc-tests.sh
+cp -p %{SOURCE14} COPYING
+
+# remove spurious group write permissions from all files in tests directory
+chmod -R g-w tests/
+
+
+%build
+make OPT_CFLAGS="%{optflags} -fno-strict-aliasing"
+
+
+%install
+# Install the binaries
+mkdir -p %{buildroot}%{_bindir}
+install -pD generate/unix/bin*/* %{buildroot}%{_bindir}/
+mv %{buildroot}%{_bindir}/acpidump %{buildroot}%{_bindir}/acpidump-acpica
+mv %{buildroot}%{_bindir}/acpixtract %{buildroot}%{_bindir}/acpixtract-acpica
+
+# Install the man pages
+mkdir -p %{buildroot}%{_mandir}/man1
+install -pDm 0644 -p -D *.1 %{buildroot}%{_mandir}/man1/
+mv %{buildroot}%{_mandir}/man1/acpixtract.1 \
+   %{buildroot}%{_mandir}/man1/acpixtract-acpica.1
+mv %{buildroot}%{_mandir}/man1/acpidump.1 \
+   %{buildroot}%{_mandir}/man1/acpidump-acpica.1
+
+%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 ..
+
+
+%post
+alternatives --install %{_bindir}/acpixtract acpixtract \
+                       %{_bindir}/acpixtract-acpica 120 \
+               --slave %{_mandir}/man1/acpixtract.1.gz acpixtract.1.gz \
+                       %{_mandir}/man1/acpixtract-acpica.1.gz
+
+alternatives --install %{_bindir}/acpidump acpidump \
+                       %{_bindir}/acpidump-acpica 120 \
+               --slave %{_mandir}/man1/acpidump.1.gz acpidump.1.gz \
+                       %{_mandir}/man1/acpidump-acpica.1.gz
+
+
+%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 COPYING
+%{_bindir}/*
+%{_mandir}/*/*
+
+
+%changelog
+* Tue Jul 24 2018 Al Stone <ahs3@redhat.com> - 20160527-3
+- Added in support for NFIT subtable type 7 with an additional patch.
+  Resolves: #1600053.
+
+* Thu Jul 12 2018 Al Stone <ahs3@redhat.com> - 20160527-2
+- Corrected the use of percent signs in the change log and made sure
+  they are all properly escaped.  Resolves: #1425899.
+
+* Tue Jun 14 2016 Dean Nelson <dnelson@redhat.com> - 20160527-1
+- Update to the latest upstream version of acpica as requested by RHBZ 1278038.
+- Refresh existing patches and add/delete ones to enable a clean build.
+
+* Wed Jul 15 2015 Dean Nelson <dnelson@redhat.com> - 20150619-3
+- Remove acpitests-unix-%%{version} directory from the build because it was a
+  mistake that it was present and it complicated the fixing of the file
+  permissions done related to RHBZ 1211328's requested rebase.
+
+* Wed Jul 01 2015 Dean Nelson <dnelson@redhat.com> - 20150619-2
+- Fix the file permissions issue reported by rpmdiff related to RHBZ 1211328's
+  requested rebase.
+
+* Mon Jun 22 2015 Dean Nelson <dnelson@redhat.com> - 20150619-1
+- Update to the latest upstream version of acpica as requested by RHBZ 1211328.
+- Refresh existing patches and add/delete ones to enable a clean build.
+- Add missing return status checks after a few calls to AcpiDmDumpTable() and
+  one to fopen().
+
+* Mon Sep 29 2014 Dean Nelson <dnelson@redhat.com> - 20140926-1
+- Update to the latest upstream version of acpica as requested by RHBZ 967963.
+- Refresh existing patches and add new ones to enable a clean build.
+- Fix build failures that start before and finish after midnight.
+
+* Wed Aug 06 2014 Dean Nelson <dnelson@redhat.com> - 20130823-8
+- Fix run-misc-tests.sh script to properly set the number of BITS to 64 when run
+  on a ppc64le system as requested by RHBZ 1125471.
+
+* Wed Aug 06 2014 Dean Nelson <dnelson@redhat.com> - 20130823-7
+- Fix the dangling symlink issue for acpidump(1) and acpixtract(1) man pages
+  that was reported in RHBZ 1074681.
+
+* Tue Jan 28 2014 Daniel Mach <dmach@redhat.com> - 20130823-6
+- Mass rebuild 2014-01-24
+
+* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 20130823-5
+- Mass rebuild 2013-12-27
+
+* Mon Oct 21 2013 Dean Nelson <dnelson@redhat.com> - 20130823-4
+- Fix the four issues identified by RPMdiff that were reported in RHBZ 1017311.
+
+* Wed Sep 04 2013 Dean Nelson <dnelson@redhat.com> - 20130823-3
+- Fix run-misc-tests.sh script to properly set the number of BITS to 64 when run
+  on a s390x system.
+
+* 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
+