Al Stone b0fde5
Index: acpica-unix2-20170531/source/common/acfileio.c
Al Stone 5c5a61
===================================================================
Al Stone b0fde5
--- acpica-unix2-20170531.orig/source/common/acfileio.c
Al Stone b0fde5
+++ acpica-unix2-20170531/source/common/acfileio.c
Al Stone 5c5a61
@@ -250,6 +250,7 @@ AcGetOneTableFromFile (
Al Stone 3df7a9
     ACPI_TABLE_HEADER       *Table;
Al Stone 3df7a9
     INT32                   Count;
Al Stone 3df7a9
     long                    TableOffset;
Al Stone 3df7a9
+    UINT32		    TableLen;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     *ReturnTable = NULL;
Al Stone 5c5a61
@@ -289,7 +290,8 @@ AcGetOneTableFromFile (
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Allocate a buffer for the entire table */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Table = AcpiOsAllocate ((ACPI_SIZE) TableHeader.Length);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&TableLen, &TableHeader.Length);
Al Stone 3df7a9
+    Table = AcpiOsAllocate ((ACPI_SIZE) TableLen);
Al Stone 3df7a9
     if (!Table)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         return (AE_NO_MEMORY);
Al Stone 5c5a61
@@ -299,8 +301,8 @@ AcGetOneTableFromFile (
Al Stone 3df7a9
 
Al Stone 3df7a9
     fseek (File, TableOffset, SEEK_SET);
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Count = fread (Table, 1, TableHeader.Length, File);
Al Stone 3df7a9
-    if (Count != (INT32) TableHeader.Length)
Al Stone 3df7a9
+    Count = fread (Table, 1, TableLen, File);
Al Stone 3df7a9
+    if (Count != (INT32) TableLen)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         Status = AE_ERROR;
Al Stone 3df7a9
         goto ErrorExit;
Al Stone 5c5a61
@@ -308,7 +310,7 @@ AcGetOneTableFromFile (
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Validate the checksum (just issue a warning) */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Status = AcpiTbVerifyChecksum (Table, TableHeader.Length);
Al Stone 3df7a9
+    Status = AcpiTbVerifyChecksum (Table, TableLen);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 3df7a9
         Status = AcCheckTextModeCorruption (Table);
Al Stone 5c5a61
@@ -400,6 +402,7 @@ AcValidateTableHeader (
Al Stone 3df7a9
     ACPI_SIZE               Actual;
Al Stone 3df7a9
     long                    OriginalOffset;
Al Stone 3df7a9
     UINT32                  FileSize;
Al Stone 3df7a9
+    UINT32                  TableLength;
Al Stone 3df7a9
     UINT32                  i;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone b0fde5
@@ -429,11 +432,12 @@ AcValidateTableHeader (
Al Stone 3df7a9
     /* Validate table length against bytes remaining in the file */
Al Stone 3df7a9
 
Al Stone 3df7a9
     FileSize = CmGetFileSize (File);
Al Stone 3df7a9
-    if (TableHeader.Length > (UINT32) (FileSize - TableOffset))
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&TableLength, &TableHeader.Length);
Al Stone 3df7a9
+    if (TableLength > (UINT32) (FileSize - TableOffset))
Al Stone 3df7a9
     {
Al Stone 3df7a9
         fprintf (stderr, "Table [%4.4s] is too long for file - "
Al Stone 3df7a9
             "needs: 0x%.2X, remaining in file: 0x%.2X\n",
Al Stone 3df7a9
-            TableHeader.Signature, TableHeader.Length,
Al Stone 3df7a9
+            TableHeader.Signature, TableLength,
Al Stone 3df7a9
             (UINT32) (FileSize - TableOffset));
Al Stone 3df7a9
         return (AE_BAD_HEADER);
Al Stone 3df7a9
     }
Al Stone b0fde5
Index: acpica-unix2-20170531/source/common/dmtable.c
Al Stone 5c5a61
===================================================================
Al Stone b0fde5
--- acpica-unix2-20170531.orig/source/common/dmtable.c
Al Stone b0fde5
+++ acpica-unix2-20170531/source/common/dmtable.c
Al Stone b0fde5
@@ -523,7 +523,7 @@ AcpiDmDumpDataTable (
Al Stone 3df7a9
      */
Al Stone 3df7a9
     if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS))
Al Stone 3df7a9
     {
Al Stone 3df7a9
-        Length = Table->Length;
Al Stone 3df7a9
+        ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
         Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone b0fde5
@@ -537,13 +537,14 @@ AcpiDmDumpDataTable (
Al Stone 3df7a9
     else if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_S3PT))
Al Stone 3df7a9
     {
Al Stone 3df7a9
         Length = AcpiDmDumpS3pt (Table);
Al Stone 3df7a9
+        ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
     }
Al Stone 3df7a9
     else
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /*
Al Stone 3df7a9
          * All other tables must use the common ACPI table header, dump it now
Al Stone 3df7a9
          */
Al Stone 3df7a9
-        Length = Table->Length;
Al Stone 3df7a9
+        ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
         Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHeader);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone b0fde5
@@ -754,6 +755,7 @@ AcpiDmDumpTable (
Al Stone 3df7a9
     BOOLEAN                 LastOutputBlankLine = FALSE;
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     char                    RepairedName[8];
Al Stone 3df7a9
+    UINT16		    Val16;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     if (!Info)
Al Stone b0fde5
@@ -1148,8 +1150,9 @@ AcpiDmDumpTable (
Al Stone 3df7a9
             /* Checksum, display and validate */
Al Stone 3df7a9
 
Al Stone 3df7a9
             AcpiOsPrintf ("%2.2X", *Target);
Al Stone 3df7a9
-            Temp8 = AcpiDmGenerateChecksum (Table,
Al Stone 3df7a9
-                ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
Al Stone 3df7a9
+	    ACPI_MOVE_32_TO_32(&Temp32,
Al Stone 3df7a9
+			&ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length);
Al Stone 3df7a9
+            Temp8 = AcpiDmGenerateChecksum (Table, Temp32,
Al Stone 3df7a9
                 ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);
Al Stone 3df7a9
 
Al Stone 3df7a9
             if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum)
Al Stone b0fde5
@@ -1214,14 +1217,14 @@ AcpiDmDumpTable (
Al Stone 3df7a9
 
Al Stone 3df7a9
             /* DMAR subtable types */
Al Stone 3df7a9
 
Al Stone 3df7a9
-            Temp16 = ACPI_GET16 (Target);
Al Stone 3df7a9
+            Val16 = ACPI_GET16 (Target);
Al Stone 3df7a9
+	    ACPI_MOVE_16_TO_16(&Temp16, &Val16);
Al Stone 3df7a9
             if (Temp16 > ACPI_DMAR_TYPE_RESERVED)
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 Temp16 = ACPI_DMAR_TYPE_RESERVED;
Al Stone 3df7a9
             }
Al Stone 3df7a9
 
Al Stone 3df7a9
-            AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
Al Stone 3df7a9
-                AcpiDmDmarSubnames[Temp16]);
Al Stone 3df7a9
+            AcpiOsPrintf (UINT16_FORMAT, Temp16, AcpiDmDmarSubnames[Temp16]);
Al Stone 3df7a9
             break;
Al Stone 3df7a9
 
Al Stone 3df7a9
         case ACPI_DMT_DMAR_SCOPE:
Al Stone b0fde5
@@ -1312,14 +1315,14 @@ AcpiDmDumpTable (
Al Stone 3df7a9
 
Al Stone 3df7a9
             /* HEST subtable types */
Al Stone 3df7a9
 
Al Stone 3df7a9
-            Temp16 = ACPI_GET16 (Target);
Al Stone 3df7a9
+            Val16 = ACPI_GET16 (Target);
Al Stone 3df7a9
+	    ACPI_MOVE_16_TO_16(&Temp16, &Val16);
Al Stone 3df7a9
             if (Temp16 > ACPI_HEST_TYPE_RESERVED)
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 Temp16 = ACPI_HEST_TYPE_RESERVED;
Al Stone 3df7a9
             }
Al Stone 3df7a9
 
Al Stone 3df7a9
-            AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
Al Stone 3df7a9
-                AcpiDmHestSubnames[Temp16]);
Al Stone 3df7a9
+            AcpiOsPrintf (UINT16_FORMAT, Temp16, AcpiDmHestSubnames[Temp16]);
Al Stone 3df7a9
             break;
Al Stone 3df7a9
 
Al Stone 3df7a9
         case ACPI_DMT_HESTNTFY:
Al Stone b0fde5
@@ -1399,13 +1402,14 @@ AcpiDmDumpTable (
Al Stone 3df7a9
 
Al Stone 3df7a9
             /* NFIT subtable types */
Al Stone 3df7a9
 
Al Stone 3df7a9
-            Temp16 = ACPI_GET16 (Target);
Al Stone 3df7a9
+            Val16 = ACPI_GET16 (Target);
Al Stone 3df7a9
+            ACPI_MOVE_16_TO_16(&Temp16, &Val16);
Al Stone 3df7a9
             if (Temp16 > ACPI_NFIT_TYPE_RESERVED)
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 Temp16 = ACPI_NFIT_TYPE_RESERVED;
Al Stone 3df7a9
             }
Al Stone 3df7a9
 
Al Stone 3df7a9
-            AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
Al Stone 3df7a9
+            AcpiOsPrintf (UINT16_FORMAT, Temp16,
Al Stone 3df7a9
                 AcpiDmNfitSubnames[Temp16]);
Al Stone 3df7a9
             break;
Al Stone 3df7a9
 
Al Stone b0fde5
Index: acpica-unix2-20170531/source/common/dmtables.c
Al Stone 5c5a61
===================================================================
Al Stone b0fde5
--- acpica-unix2-20170531.orig/source/common/dmtables.c
Al Stone b0fde5
+++ acpica-unix2-20170531/source/common/dmtables.c
Al Stone 0a2fbe
@@ -142,7 +142,9 @@ AdCreateTableHeader (
Al Stone 3df7a9
     ACPI_TABLE_HEADER       *Table)
Al Stone 3df7a9
 {
Al Stone 3df7a9
     UINT8                   Checksum;
Al Stone 3df7a9
-
Al Stone 3df7a9
+    UINT32		    TableLen;
Al Stone 3df7a9
+    UINT32		    OemRev;
Al Stone 3df7a9
+    UINT32		    CompilerRev;
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Reset globals for External statements */
Al Stone 3df7a9
 
Al Stone 0a2fbe
@@ -154,9 +156,10 @@ AdCreateTableHeader (
Al Stone 3df7a9
      */
Al Stone 3df7a9
     AdDisassemblerHeader (Filename, ACPI_IS_AML_TABLE);
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&TableLen, &Table->Length);
Al Stone 3df7a9
     AcpiOsPrintf (" * Original Table Header:\n");
Al Stone 3df7a9
     AcpiOsPrintf (" *     Signature        \"%4.4s\"\n",    Table->Signature);
Al Stone 3df7a9
-    AcpiOsPrintf (" *     Length           0x%8.8X (%u)\n", Table->Length, Table->Length);
Al Stone 3df7a9
+    AcpiOsPrintf (" *     Length           0x%8.8X (%u)\n", TableLen, TableLen);
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Print and validate the revision */
Al Stone 3df7a9
 
Al Stone 0a2fbe
@@ -188,7 +191,7 @@ AdCreateTableHeader (
Al Stone 3df7a9
 
Al Stone 3df7a9
     AcpiOsPrintf ("\n *     Checksum         0x%2.2X",        Table->Checksum);
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), Table->Length);
Al Stone 3df7a9
+    Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), TableLen);
Al Stone 3df7a9
     if (Checksum)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         AcpiOsPrintf (" **** Incorrect checksum, should be 0x%2.2X",
Al Stone 0a2fbe
@@ -198,9 +201,11 @@ AdCreateTableHeader (
Al Stone 3df7a9
     AcpiOsPrintf ("\n");
Al Stone 3df7a9
     AcpiOsPrintf (" *     OEM ID           \"%.6s\"\n",     Table->OemId);
Al Stone 3df7a9
     AcpiOsPrintf (" *     OEM Table ID     \"%.8s\"\n",     Table->OemTableId);
Al Stone 3df7a9
-    AcpiOsPrintf (" *     OEM Revision     0x%8.8X (%u)\n", Table->OemRevision, Table->OemRevision);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&OemRev, &Table->OemRevision);
Al Stone 3df7a9
+    AcpiOsPrintf (" *     OEM Revision     0x%8.8X (%u)\n", OemRev, OemRev);
Al Stone 3df7a9
     AcpiOsPrintf (" *     Compiler ID      \"%.4s\"\n",     Table->AslCompilerId);
Al Stone 3df7a9
-    AcpiOsPrintf (" *     Compiler Version 0x%8.8X (%u)\n", Table->AslCompilerRevision, Table->AslCompilerRevision);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&CompilerRev, &Table->AslCompilerRevision);
Al Stone 3df7a9
+    AcpiOsPrintf (" *     Compiler Version 0x%8.8X (%u)\n", CompilerRev, CompilerRev);
Al Stone 3df7a9
     AcpiOsPrintf (" */\n");
Al Stone 3df7a9
 
Al Stone 3df7a9
     /*
Al Stone 0a2fbe
@@ -221,7 +226,7 @@ AdCreateTableHeader (
Al Stone 3df7a9
     AcpiOsPrintf (
Al Stone 3df7a9
         "DefinitionBlock (\"\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
Al Stone 3df7a9
         Table->Signature, Table->Revision,
Al Stone 3df7a9
-        Table->OemId, Table->OemTableId, Table->OemRevision);
Al Stone 3df7a9
+        Table->OemId, Table->OemTableId, OemRev);
Al Stone 3df7a9
 }
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 0a2fbe
@@ -396,7 +401,8 @@ AdParseTable (
Al Stone 3df7a9
 
Al Stone 3df7a9
     fprintf (stderr, "Pass 1 parse of [%4.4s]\n", (char *) Table->Signature);
Al Stone 3df7a9
 
Al Stone 3df7a9
-    AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&AmlLength, &Table->Length);
Al Stone 3df7a9
+    AmlLength -= sizeof (ACPI_TABLE_HEADER);
Al Stone 3df7a9
     AmlStart = ((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER));
Al Stone 0a2fbe
     ASL_CV_INIT_FILETREE(Table, AmlStart, AmlLength);
Al Stone 3df7a9
 
Al Stone b0fde5
Index: acpica-unix2-20170531/source/common/dmtbdump.c
Al Stone 5c5a61
===================================================================
Al Stone b0fde5
--- acpica-unix2-20170531.orig/source/common/dmtbdump.c
Al Stone b0fde5
+++ acpica-unix2-20170531/source/common/dmtbdump.c
Al Stone 5c5a61
@@ -277,6 +277,8 @@ AcpiDmDumpRsdt (
Al Stone 3df7a9
     UINT32                  Entries;
Al Stone 3df7a9
     UINT32                  Offset;
Al Stone 3df7a9
     UINT32                  i;
Al Stone 3df7a9
+    UINT32		    Length;
Al Stone 3df7a9
+    UINT32		    Address;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Point to start of table pointer array */
Al Stone 5c5a61
@@ -286,12 +288,14 @@ AcpiDmDumpRsdt (
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* RSDT uses 32-bit pointers */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT32);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
+    Entries = (Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT32);
Al Stone 3df7a9
 
Al Stone 3df7a9
     for (i = 0; i < Entries; i++)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         AcpiDmLineHeader2 (Offset, sizeof (UINT32), "ACPI Table Address", i);
Al Stone 3df7a9
-        AcpiOsPrintf ("%8.8X\n", Array[i]);
Al Stone 3df7a9
+	ACPI_MOVE_32_TO_32(&Address, &Array[i]);
Al Stone 3df7a9
+        AcpiOsPrintf ("%8.8X\n", Address);
Al Stone 3df7a9
         Offset += sizeof (UINT32);
Al Stone 3df7a9
     }
Al Stone 3df7a9
 }
Al Stone 5c5a61
@@ -317,6 +321,8 @@ AcpiDmDumpXsdt (
Al Stone 3df7a9
     UINT32                  Entries;
Al Stone 3df7a9
     UINT32                  Offset;
Al Stone 3df7a9
     UINT32                  i;
Al Stone 3df7a9
+    UINT32                  Length;
Al Stone 3df7a9
+    UINT64		    Address;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Point to start of table pointer array */
Al Stone 5c5a61
@@ -326,12 +332,14 @@ AcpiDmDumpXsdt (
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* XSDT uses 64-bit pointers */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT64);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
+    Entries = (Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT64);
Al Stone 3df7a9
 
Al Stone 3df7a9
     for (i = 0; i < Entries; i++)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         AcpiDmLineHeader2 (Offset, sizeof (UINT64), "ACPI Table Address", i);
Al Stone 3df7a9
-        AcpiOsPrintf ("%8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Array[i]));
Al Stone 3df7a9
+	ACPI_MOVE_64_TO_64(&Address, &Array[i]);
Al Stone 3df7a9
+        AcpiOsPrintf ("%8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Address));
Al Stone 3df7a9
         Offset += sizeof (UINT64);
Al Stone 3df7a9
     }
Al Stone 3df7a9
 }
Al Stone 5c5a61
@@ -524,17 +532,21 @@ AcpiDmDumpAsf (
Al Stone 3df7a9
     UINT32                  DataOffset = 0;
Al Stone 3df7a9
     UINT32                  i;
Al Stone 3df7a9
     UINT8                   Type;
Al Stone 3df7a9
+    UINT32		    Len;
Al Stone 3df7a9
+    UINT16		    SubLen;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* No main table, only subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Len, &Table->Length);
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Len)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* Common subtable header */
Al Stone 3df7a9
 
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
Al Stone 3df7a9
-            SubTable->Header.Length, AcpiDmTableInfoAsfHdr);
Al Stone 3df7a9
+	ACPI_MOVE_16_TO_16(&SubLen, &SubTable->Header.Length);
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Len, Offset, SubTable,
Al Stone 3df7a9
+            SubLen, AcpiDmTableInfoAsfHdr);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             return;
Al Stone 5c5a61
@@ -591,8 +603,7 @@ AcpiDmDumpAsf (
Al Stone 3df7a9
             return;
Al Stone 3df7a9
         }
Al Stone 3df7a9
 
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
Al Stone 3df7a9
-            SubTable->Header.Length, InfoTable);
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Len, Offset, SubTable, SubLen, InfoTable);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             return;
Al Stone 5c5a61
@@ -608,7 +619,7 @@ AcpiDmDumpAsf (
Al Stone 3df7a9
             for (i = 0; i < DataCount; i++)
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 AcpiOsPrintf ("\n");
Al Stone 3df7a9
-                Status = AcpiDmDumpTable (Table->Length, DataOffset,
Al Stone 3df7a9
+                Status = AcpiDmDumpTable (Len, DataOffset,
Al Stone 3df7a9
                     DataTable, DataLength, DataInfoTable);
Al Stone 3df7a9
                 if (ACPI_FAILURE (Status))
Al Stone 3df7a9
                 {
Al Stone 5c5a61
@@ -654,15 +665,14 @@ AcpiDmDumpAsf (
Al Stone 3df7a9
 
Al Stone 3df7a9
         /* Point to next subtable */
Al Stone 3df7a9
 
Al Stone 3df7a9
-        if (!SubTable->Header.Length)
Al Stone 3df7a9
+        if (!SubLen)
Al Stone 3df7a9
         {
Al Stone 3df7a9
             AcpiOsPrintf ("Invalid zero subtable header length\n");
Al Stone 3df7a9
             return;
Al Stone 3df7a9
         }
Al Stone 3df7a9
 
Al Stone 3df7a9
-        Offset += SubTable->Header.Length;
Al Stone 3df7a9
-        SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, SubTable,
Al Stone 3df7a9
-            SubTable->Header.Length);
Al Stone 3df7a9
+        Offset += SubLen;
Al Stone 3df7a9
+        SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, SubTable, SubLen);
Al Stone 3df7a9
     }
Al Stone 3df7a9
 }
Al Stone 3df7a9
 
Al Stone 5c5a61
@@ -686,12 +696,13 @@ AcpiDmDumpCpep (
Al Stone 3df7a9
 {
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     ACPI_CPEP_POLLING       *SubTable;
Al Stone 3df7a9
-    UINT32                  Length = Table->Length;
Al Stone 3df7a9
+    UINT32                  Length;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_CPEP);
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoCpep);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 5c5a61
@@ -701,7 +712,7 @@ AcpiDmDumpCpep (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 5c5a61
@@ -741,7 +752,10 @@ AcpiDmDumpCsrt (
Al Stone 3df7a9
     ACPI_CSRT_GROUP         *SubTable;
Al Stone 3df7a9
     ACPI_CSRT_SHARED_INFO   *SharedInfoTable;
Al Stone 3df7a9
     ACPI_CSRT_DESCRIPTOR    *SubSubTable;
Al Stone 3df7a9
-    UINT32                  Length = Table->Length;
Al Stone 3df7a9
+    UINT32                  Length;
Al Stone 3df7a9
+    UINT32                  SubLength;
Al Stone 3df7a9
+    UINT32                  SubSubLength;
Al Stone 3df7a9
+    UINT32                  SharedInfoLength;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_CSRT);
Al Stone 3df7a9
     UINT32                  SubOffset;
Al Stone 3df7a9
     UINT32                  SubSubOffset;
Al Stone 5c5a61
@@ -752,14 +766,16 @@ AcpiDmDumpCsrt (
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Subtables (Resource Groups) */
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* Resource group subtable */
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
+        ACPI_MOVE_32_TO_32(&SubLength, &SubTable->Length);
Al Stone 3df7a9
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
-            SubTable->Length, AcpiDmTableInfoCsrt0);
Al Stone 3df7a9
+            SubLength, AcpiDmTableInfoCsrt0);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             return;
Al Stone 5c5a61
@@ -779,19 +795,20 @@ AcpiDmDumpCsrt (
Al Stone 3df7a9
             return;
Al Stone 3df7a9
         }
Al Stone 3df7a9
 
Al Stone 3df7a9
-        SubOffset += SubTable->SharedInfoLength;
Al Stone 3df7a9
+	ACPI_MOVE_32_TO_32(&SharedInfoLength, &SubTable->SharedInfoLength);
Al Stone 3df7a9
+        SubOffset += SharedInfoLength;
Al Stone 3df7a9
 
Al Stone 3df7a9
         /* Sub-Subtables (Resource Descriptors) */
Al Stone 3df7a9
 
Al Stone 3df7a9
         SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table,
Al Stone 3df7a9
             Offset + SubOffset);
Al Stone 3df7a9
 
Al Stone 3df7a9
-        while ((SubOffset < SubTable->Length) &&
Al Stone 3df7a9
-              ((Offset + SubOffset) < Table->Length))
Al Stone 3df7a9
+        while ((SubOffset < SubLength) && ((Offset + SubOffset) < Length))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             AcpiOsPrintf ("\n");
Al Stone 3df7a9
+	    ACPI_MOVE_32_TO_32(&SubSubLength, &SubSubTable->Length);
Al Stone 3df7a9
             Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubTable,
Al Stone 3df7a9
-                SubSubTable->Length, AcpiDmTableInfoCsrt2);
Al Stone 3df7a9
+                SubSubLength, AcpiDmTableInfoCsrt2);
Al Stone 3df7a9
             if (ACPI_FAILURE (Status))
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 return;
Al Stone 5c5a61
@@ -801,7 +818,7 @@ AcpiDmDumpCsrt (
Al Stone 3df7a9
 
Al Stone 3df7a9
             /* Resource-specific info buffer */
Al Stone 3df7a9
 
Al Stone 3df7a9
-            InfoLength = SubSubTable->Length - SubSubOffset;
Al Stone 3df7a9
+            InfoLength = SubSubLength - SubSubOffset;
Al Stone 3df7a9
             if (InfoLength)
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 Status = AcpiDmDumpTable (Length,
Al Stone 5c5a61
@@ -816,16 +833,15 @@ AcpiDmDumpCsrt (
Al Stone 3df7a9
 
Al Stone 3df7a9
             /* Point to next sub-subtable */
Al Stone 3df7a9
 
Al Stone 3df7a9
-            SubOffset += SubSubTable->Length;
Al Stone 3df7a9
+            SubOffset += SubSubLength;
Al Stone 3df7a9
             SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubTable,
Al Stone 3df7a9
-                SubSubTable->Length);
Al Stone 3df7a9
+                SubSubLength);
Al Stone 3df7a9
         }
Al Stone 3df7a9
 
Al Stone 3df7a9
         /* Point to next subtable */
Al Stone 3df7a9
 
Al Stone 3df7a9
-        Offset += SubTable->Length;
Al Stone 3df7a9
-        SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable,
Al Stone 3df7a9
-            SubTable->Length);
Al Stone 3df7a9
+        Offset += SubLength;
Al Stone 3df7a9
+        SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable, SubLength);
Al Stone 3df7a9
     }
Al Stone 3df7a9
 }
Al Stone 3df7a9
 
Al Stone 5c5a61
@@ -849,16 +865,20 @@ AcpiDmDumpDbg2 (
Al Stone 3df7a9
 {
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     ACPI_DBG2_DEVICE        *SubTable;
Al Stone 3df7a9
-    UINT32                  Length = Table->Length;
Al Stone 3df7a9
+    UINT32                  Length;
Al Stone 3df7a9
+    UINT16                  SubLength;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_DBG2);
Al Stone 3df7a9
     UINT32                  i;
Al Stone 3df7a9
     UINT32                  ArrayOffset;
Al Stone 3df7a9
     UINT32                  AbsoluteOffset;
Al Stone 3df7a9
     UINT8                   *Array;
Al Stone 3df7a9
+    UINT16		    Tmp16;
Al Stone 3df7a9
+    UINT16		    AlsoTmp16;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDbg2);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 5c5a61
@@ -868,11 +888,12 @@ AcpiDmDumpDbg2 (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
+        ACPI_MOVE_16_TO_16(&SubLength, &SubTable->Length);
Al Stone 3df7a9
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
-            SubTable->Length, AcpiDmTableInfoDbg2Device);
Al Stone 3df7a9
+            SubLength, AcpiDmTableInfoDbg2Device);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             return;
Al Stone 5c5a61
@@ -882,13 +903,13 @@ AcpiDmDumpDbg2 (
Al Stone 3df7a9
 
Al Stone 3df7a9
         for (i = 0; i < SubTable->RegisterCount; i++)
Al Stone 3df7a9
         {
Al Stone 3df7a9
-            ArrayOffset = SubTable->BaseAddressOffset +
Al Stone 3df7a9
-                (sizeof (ACPI_GENERIC_ADDRESS) * i);
Al Stone 3df7a9
+	    ACPI_MOVE_16_TO_16(&Tmp16, &SubTable->BaseAddressOffset);
Al Stone 3df7a9
+            ArrayOffset = Tmp16 + (sizeof (ACPI_GENERIC_ADDRESS) * i);
Al Stone 3df7a9
             AbsoluteOffset = Offset + ArrayOffset;
Al Stone 3df7a9
             Array = (UINT8 *) SubTable + ArrayOffset;
Al Stone 3df7a9
 
Al Stone 3df7a9
             Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
Al Stone 3df7a9
-                SubTable->Length, AcpiDmTableInfoDbg2Addr);
Al Stone 3df7a9
+                SubLength, AcpiDmTableInfoDbg2Addr);
Al Stone 3df7a9
             if (ACPI_FAILURE (Status))
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 return;
Al Stone 5c5a61
@@ -899,13 +920,13 @@ AcpiDmDumpDbg2 (
Al Stone 3df7a9
 
Al Stone 3df7a9
         for (i = 0; i < SubTable->RegisterCount; i++)
Al Stone 3df7a9
         {
Al Stone 3df7a9
-            ArrayOffset = SubTable->AddressSizeOffset +
Al Stone 3df7a9
-                (sizeof (UINT32) * i);
Al Stone 3df7a9
+	    ACPI_MOVE_16_TO_16(&Tmp16, &SubTable->AddressSizeOffset);
Al Stone 3df7a9
+            ArrayOffset = Tmp16 + (sizeof (UINT32) * i);
Al Stone 3df7a9
             AbsoluteOffset = Offset + ArrayOffset;
Al Stone 3df7a9
             Array = (UINT8 *) SubTable + ArrayOffset;
Al Stone 3df7a9
 
Al Stone 3df7a9
             Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
Al Stone 3df7a9
-                SubTable->Length, AcpiDmTableInfoDbg2Size);
Al Stone 3df7a9
+                SubLength, AcpiDmTableInfoDbg2Size);
Al Stone 3df7a9
             if (ACPI_FAILURE (Status))
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 return;
Al Stone 5c5a61
@@ -915,12 +936,13 @@ AcpiDmDumpDbg2 (
Al Stone 3df7a9
         /* Dump the Namestring (required) */
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
-        ArrayOffset = SubTable->NamepathOffset;
Al Stone 3df7a9
+	ACPI_MOVE_16_TO_16(&Tmp16, &SubTable->NamepathOffset);
Al Stone 3df7a9
+        ArrayOffset = Tmp16;
Al Stone 3df7a9
         AbsoluteOffset = Offset + ArrayOffset;
Al Stone 3df7a9
         Array = (UINT8 *) SubTable + ArrayOffset;
Al Stone 3df7a9
 
Al Stone 3df7a9
         Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
Al Stone 3df7a9
-            SubTable->Length, AcpiDmTableInfoDbg2Name);
Al Stone 3df7a9
+            SubLength, AcpiDmTableInfoDbg2Name);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             return;
Al Stone 5c5a61
@@ -930,9 +952,10 @@ AcpiDmDumpDbg2 (
Al Stone 3df7a9
 
Al Stone 3df7a9
         if (SubTable->OemDataOffset)
Al Stone 3df7a9
         {
Al Stone 3df7a9
-            Status = AcpiDmDumpTable (Length, Offset + SubTable->OemDataOffset,
Al Stone 3df7a9
-                Table, SubTable->OemDataLength,
Al Stone 3df7a9
-                AcpiDmTableInfoDbg2OemData);
Al Stone 3df7a9
+	    ACPI_MOVE_16_TO_16(&Tmp16, &SubTable->OemDataOffset);
Al Stone 3df7a9
+	    ACPI_MOVE_16_TO_16(&AlsoTmp16, &SubTable->OemDataLength);
Al Stone 3df7a9
+            Status = AcpiDmDumpTable (Length, Offset + Tmp16,
Al Stone 3df7a9
+                Table, AlsoTmp16, AcpiDmTableInfoDbg2OemData);
Al Stone 3df7a9
             if (ACPI_FAILURE (Status))
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 return;
Al Stone 5c5a61
@@ -941,9 +964,9 @@ AcpiDmDumpDbg2 (
Al Stone 3df7a9
 
Al Stone 3df7a9
         /* Point to next subtable */
Al Stone 3df7a9
 
Al Stone 3df7a9
-        Offset += SubTable->Length;
Al Stone 3df7a9
+        Offset += SubLength;
Al Stone 3df7a9
         SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, SubTable,
Al Stone 3df7a9
-            SubTable->Length);
Al Stone 3df7a9
+            SubLength);
Al Stone 3df7a9
     }
Al Stone 3df7a9
 }
Al Stone 3df7a9
 
Al Stone 5c5a61
@@ -967,17 +990,20 @@ AcpiDmDumpDmar (
Al Stone 3df7a9
 {
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     ACPI_DMAR_HEADER        *SubTable;
Al Stone 3df7a9
-    UINT32                  Length = Table->Length;
Al Stone 3df7a9
+    UINT32                  Length;
Al Stone 3df7a9
+    UINT16                  SubLength;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_DMAR);
Al Stone 3df7a9
     ACPI_DMTABLE_INFO       *InfoTable;
Al Stone 3df7a9
     ACPI_DMAR_DEVICE_SCOPE  *ScopeTable;
Al Stone 3df7a9
     UINT32                  ScopeOffset;
Al Stone 3df7a9
     UINT8                   *PciPath;
Al Stone 3df7a9
     UINT32                  PathOffset;
Al Stone 3df7a9
+    UINT16		    SubType;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDmar);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 5c5a61
@@ -987,13 +1013,14 @@ AcpiDmDumpDmar (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* Common subtable header */
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
+	ACPI_MOVE_16_TO_16(&SubLength, &SubTable->Length);
Al Stone 3df7a9
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
-            SubTable->Length, AcpiDmTableInfoDmarHdr);
Al Stone 3df7a9
+            SubLength, AcpiDmTableInfoDmarHdr);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             return;
Al Stone 5c5a61
@@ -1001,7 +1028,8 @@ AcpiDmDumpDmar (
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
 
Al Stone 3df7a9
-        switch (SubTable->Type)
Al Stone 3df7a9
+	ACPI_MOVE_16_TO_16(&SubType, &SubTable->Type);
Al Stone 3df7a9
+        switch (SubType)
Al Stone 3df7a9
         {
Al Stone 3df7a9
         case ACPI_DMAR_TYPE_HARDWARE_UNIT:
Al Stone 3df7a9
 
Al Stone 5c5a61
@@ -1036,12 +1064,12 @@ AcpiDmDumpDmar (
Al Stone 3df7a9
         default:
Al Stone 3df7a9
 
Al Stone 3df7a9
             AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n",
Al Stone 3df7a9
-                SubTable->Type);
Al Stone 3df7a9
+                SubType);
Al Stone 3df7a9
             return;
Al Stone 3df7a9
         }
Al Stone 3df7a9
 
Al Stone 3df7a9
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
-            SubTable->Length, InfoTable);
Al Stone 3df7a9
+            SubLength, InfoTable);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             return;
Al Stone 5c5a61
@@ -1050,8 +1078,8 @@ AcpiDmDumpDmar (
Al Stone 3df7a9
         /*
Al Stone 3df7a9
          * Dump the optional device scope entries
Al Stone 3df7a9
          */
Al Stone 3df7a9
-        if ((SubTable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
Al Stone 3df7a9
-            (SubTable->Type == ACPI_DMAR_TYPE_NAMESPACE))
Al Stone 3df7a9
+        if ((SubType == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
Al Stone 3df7a9
+            (SubType == ACPI_DMAR_TYPE_NAMESPACE))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             /* These types do not support device scopes */
Al Stone 3df7a9
 
Al Stone 5c5a61
@@ -1059,7 +1087,7 @@ AcpiDmDumpDmar (
Al Stone 3df7a9
         }
Al Stone 3df7a9
 
Al Stone 3df7a9
         ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset);
Al Stone 3df7a9
-        while (ScopeOffset < SubTable->Length)
Al Stone 3df7a9
+        while (ScopeOffset < SubLength)
Al Stone 3df7a9
         {
Al Stone 3df7a9
             AcpiOsPrintf ("\n");
Al Stone 3df7a9
             Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
Al Stone 5c5a61
@@ -1100,9 +1128,8 @@ AcpiDmDumpDmar (
Al Stone 3df7a9
 NextSubtable:
Al Stone 3df7a9
         /* Point to next subtable */
Al Stone 3df7a9
 
Al Stone 3df7a9
-        Offset += SubTable->Length;
Al Stone 3df7a9
-        SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable,
Al Stone 3df7a9
-            SubTable->Length);
Al Stone 3df7a9
+        Offset += SubLength;
Al Stone 3df7a9
+        SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable, SubLength);
Al Stone 3df7a9
     }
Al Stone 3df7a9
 }
Al Stone 3df7a9
 
Al Stone 5c5a61
@@ -1129,12 +1156,15 @@ AcpiDmDumpDrtm (
Al Stone 3df7a9
     ACPI_DRTM_RESOURCE_LIST *DrtmRl;
Al Stone 3df7a9
     ACPI_DRTM_DPS_ID        *DrtmDps;
Al Stone 3df7a9
     UINT32                  Count;
Al Stone 3df7a9
+    UINT32                  ValidatedCount;
Al Stone 3df7a9
+    UINT32                  ResourceCount;
Al Stone 3df7a9
+    UINT32		    Length;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
Al Stone 3df7a9
-        AcpiDmTableInfoDrtm);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
+    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDrtm);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 3df7a9
         return;
Al Stone 5c5a61
@@ -1148,7 +1178,7 @@ AcpiDmDumpDrtm (
Al Stone 3df7a9
 
Al Stone 3df7a9
     DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset);
Al Stone 3df7a9
     AcpiOsPrintf ("\n");
Al Stone 3df7a9
-    Status = AcpiDmDumpTable (Table->Length, Offset,
Al Stone 3df7a9
+    Status = AcpiDmDumpTable (Length, Offset,
Al Stone 3df7a9
         DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables),
Al Stone 3df7a9
         AcpiDmTableInfoDrtm0);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 5c5a61
@@ -1161,10 +1191,11 @@ AcpiDmDumpDrtm (
Al Stone 3df7a9
     /* Dump Validated table addresses */
Al Stone 3df7a9
 
Al Stone 3df7a9
     Count = 0;
Al Stone 3df7a9
-    while ((Offset < Table->Length) &&
Al Stone 3df7a9
-            (DrtmVtl->ValidatedTableCount > Count))
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&ValidatedCount, &DrtmVtl->ValidatedTableCount);
Al Stone 3df7a9
+    while ((Offset < Length) &&
Al Stone 3df7a9
+            (ValidatedCount > Count))
Al Stone 3df7a9
     {
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset,
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Length, Offset,
Al Stone 3df7a9
             ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64),
Al Stone 3df7a9
             AcpiDmTableInfoDrtm0a);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 5c5a61
@@ -1180,7 +1211,7 @@ AcpiDmDumpDrtm (
Al Stone 3df7a9
 
Al Stone 3df7a9
     DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset);
Al Stone 3df7a9
     AcpiOsPrintf ("\n");
Al Stone 3df7a9
-    Status = AcpiDmDumpTable (Table->Length, Offset,
Al Stone 3df7a9
+    Status = AcpiDmDumpTable (Length, Offset,
Al Stone 3df7a9
         DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources),
Al Stone 3df7a9
         AcpiDmTableInfoDrtm1);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 5c5a61
@@ -1193,10 +1224,11 @@ AcpiDmDumpDrtm (
Al Stone 3df7a9
     /* Dump the Resource List */
Al Stone 3df7a9
 
Al Stone 3df7a9
     Count = 0;
Al Stone 3df7a9
-    while ((Offset < Table->Length) &&
Al Stone 3df7a9
-           (DrtmRl->ResourceCount > Count))
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&ResourceCount, &DrtmRl->ResourceCount);
Al Stone 3df7a9
+    while ((Offset < Length) &&
Al Stone 3df7a9
+           (ResourceCount > Count))
Al Stone 3df7a9
     {
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset,
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Length, Offset,
Al Stone 3df7a9
             ACPI_ADD_PTR (void, Table, Offset),
Al Stone 3df7a9
             sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 5c5a61
@@ -1212,7 +1244,7 @@ AcpiDmDumpDrtm (
Al Stone 3df7a9
 
Al Stone 3df7a9
     DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset);
Al Stone 3df7a9
     AcpiOsPrintf ("\n");
Al Stone 3df7a9
-    (void) AcpiDmDumpTable (Table->Length, Offset,
Al Stone 3df7a9
+    (void) AcpiDmDumpTable (Length, Offset,
Al Stone 3df7a9
         DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2);
Al Stone 3df7a9
 }
Al Stone 3df7a9
 
Al Stone 5c5a61
@@ -1236,12 +1268,13 @@ AcpiDmDumpEinj (
Al Stone 3df7a9
 {
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     ACPI_WHEA_HEADER        *SubTable;
Al Stone 3df7a9
-    UINT32                  Length = Table->Length;
Al Stone 3df7a9
+    UINT32                  Length;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_EINJ);
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoEinj);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 5c5a61
@@ -1251,7 +1284,7 @@ AcpiDmDumpEinj (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 5c5a61
@@ -1289,12 +1322,13 @@ AcpiDmDumpErst (
Al Stone 3df7a9
 {
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     ACPI_WHEA_HEADER        *SubTable;
Al Stone 3df7a9
-    UINT32                  Length = Table->Length;
Al Stone 3df7a9
+    UINT32                  Length;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_ERST);
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoErst);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 5c5a61
@@ -1304,7 +1338,7 @@ AcpiDmDumpErst (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 5c5a61
@@ -1342,17 +1376,19 @@ AcpiDmDumpFpdt (
Al Stone 3df7a9
 {
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     ACPI_FPDT_HEADER        *SubTable;
Al Stone 3df7a9
-    UINT32                  Length = Table->Length;
Al Stone 3df7a9
+    UINT32                  Length;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_FPDT);
Al Stone 3df7a9
     ACPI_DMTABLE_INFO       *InfoTable;
Al Stone 3df7a9
+    UINT16		    Type;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* There is no main table (other than the standard ACPI header) */
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* Common subtable header */
Al Stone 3df7a9
 
Al Stone 5c5a61
@@ -1364,7 +1400,8 @@ AcpiDmDumpFpdt (
Al Stone 3df7a9
             return;
Al Stone 3df7a9
         }
Al Stone 3df7a9
 
Al Stone 3df7a9
-        switch (SubTable->Type)
Al Stone 3df7a9
+	ACPI_MOVE_16_TO_16(&Type, &SubTable->Type);
Al Stone 3df7a9
+        switch (Type)
Al Stone 3df7a9
         {
Al Stone 3df7a9
         case ACPI_FPDT_TYPE_BOOT:
Al Stone 3df7a9
 
Al Stone 5c5a61
@@ -1378,8 +1415,7 @@ AcpiDmDumpFpdt (
Al Stone 3df7a9
 
Al Stone 3df7a9
         default:
Al Stone 3df7a9
 
Al Stone 3df7a9
-            AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n",
Al Stone 3df7a9
-                SubTable->Type);
Al Stone 3df7a9
+            AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", Type);
Al Stone 3df7a9
 
Al Stone 3df7a9
             /* Attempt to continue */
Al Stone 3df7a9
 
Al Stone 5c5a61
@@ -1427,16 +1463,19 @@ AcpiDmDumpGtdt (
Al Stone 3df7a9
 {
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     ACPI_GTDT_HEADER        *SubTable;
Al Stone 3df7a9
-    UINT32                  Length = Table->Length;
Al Stone 3df7a9
+    UINT32                  Length;
Al Stone 3df7a9
+    UINT16                  SubLength;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_GTDT);
Al Stone 3df7a9
     ACPI_DMTABLE_INFO       *InfoTable;
Al Stone 3df7a9
     UINT32                  SubTableLength;
Al Stone 3df7a9
     UINT32                  GtCount;
Al Stone 3df7a9
+    UINT32                  Tmp32;
Al Stone 3df7a9
     ACPI_GTDT_TIMER_ENTRY   *GtxTable;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoGtdt);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 5c5a61
@@ -1446,7 +1485,7 @@ AcpiDmDumpGtdt (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* Common subtable header */
Al Stone 3df7a9
 
Al Stone 5c5a61
@@ -1464,8 +1503,9 @@ AcpiDmDumpGtdt (
Al Stone 3df7a9
         case ACPI_GTDT_TYPE_TIMER_BLOCK:
Al Stone 3df7a9
 
Al Stone 3df7a9
             SubTableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
Al Stone 3df7a9
-            GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
Al Stone 3df7a9
+            Tmp32 = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
Al Stone 3df7a9
                 SubTable))->TimerCount;
Al Stone 3df7a9
+	    ACPI_MOVE_32_TO_32(&GtCount, &Tmp32);
Al Stone 3df7a9
 
Al Stone 3df7a9
             InfoTable = AcpiDmTableInfoGtdt0;
Al Stone 3df7a9
             break;
Al Stone 5c5a61
@@ -1486,8 +1526,9 @@ AcpiDmDumpGtdt (
Al Stone 3df7a9
             return;
Al Stone 3df7a9
         }
Al Stone 3df7a9
 
Al Stone 3df7a9
+	ACPI_MOVE_16_TO_16(&SubLength, &SubTable->Length);
Al Stone 3df7a9
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
-            SubTable->Length, InfoTable);
Al Stone 3df7a9
+            SubLength, InfoTable);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             return;
Al Stone 5c5a61
@@ -1546,16 +1587,18 @@ AcpiDmDumpHest (
Al Stone 3df7a9
 {
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     ACPI_HEST_HEADER        *SubTable;
Al Stone 3df7a9
-    UINT32                  Length = Table->Length;
Al Stone 3df7a9
+    UINT32                  Length;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_HEST);
Al Stone 3df7a9
     ACPI_DMTABLE_INFO       *InfoTable;
Al Stone 3df7a9
     UINT32                  SubTableLength;
Al Stone 3df7a9
     UINT32                  BankCount;
Al Stone 3df7a9
     ACPI_HEST_IA_ERROR_BANK *BankTable;
Al Stone 3df7a9
+    UINT16		    SubType;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHest);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 5c5a61
@@ -1565,10 +1608,11 @@ AcpiDmDumpHest (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         BankCount = 0;
Al Stone 3df7a9
-        switch (SubTable->Type)
Al Stone 3df7a9
+	ACPI_MOVE_16_TO_16(&SubType, &SubTable->Type);
Al Stone 3df7a9
+        switch (SubType)
Al Stone 3df7a9
         {
Al Stone 3df7a9
         case ACPI_HEST_TYPE_IA32_CHECK:
Al Stone 3df7a9
 
Al Stone b0fde5
@@ -1902,15 +1946,21 @@ AcpiDmDumpIort (
Al Stone 3df7a9
     ACPI_IORT_SMMU          *IortSmmu = NULL;
Al Stone 3df7a9
     UINT32                  Offset;
Al Stone 3df7a9
     UINT32                  NodeOffset;
Al Stone 3df7a9
+    UINT16		    NodeLength;
Al Stone 3df7a9
     UINT32                  Length;
Al Stone 3df7a9
     ACPI_DMTABLE_INFO       *InfoTable;
Al Stone 3df7a9
     char                    *String;
Al Stone 3df7a9
     UINT32                  i;
Al Stone 3df7a9
-
Al Stone 3df7a9
+    UINT32		    TableLen;
Al Stone 3df7a9
+    UINT32		    ItsCount;
Al Stone 3df7a9
+    UINT32		    MappingCount;
Al Stone 3df7a9
+    UINT32		    CtxIntCount;
Al Stone 3df7a9
+    UINT32		    PmuIntCount;
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIort);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&TableLen, &Table->Length);
Al Stone 3df7a9
+    Status = AcpiDmDumpTable (TableLen, 0, Table, 0, AcpiDmTableInfoIort);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 3df7a9
         return;
Al Stone b0fde5
@@ -1921,18 +1971,19 @@ AcpiDmDumpIort (
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Dump the OptionalPadding (optional) */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    if (Iort->NodeOffset > Offset)
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&NodeOffset, &Iort->NodeOffset);
Al Stone 3df7a9
+    if (NodeOffset > Offset)
Al Stone 3df7a9
     {
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, Table,
Al Stone 3df7a9
-            Iort->NodeOffset - Offset, AcpiDmTableInfoIortPad);
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (TableLen, Offset, Table,
Al Stone 3df7a9
+            NodeOffset - Offset, AcpiDmTableInfoIortPad);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             return;
Al Stone 3df7a9
         }
Al Stone 3df7a9
     }
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Offset = Iort->NodeOffset;
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Offset, &Iort->NodeOffset);
Al Stone 3df7a9
+    while (Offset < TableLen)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* Common subtable header */
Al Stone 3df7a9
 
Al Stone b0fde5
@@ -1968,7 +2019,8 @@ AcpiDmDumpIort (
Al Stone 3df7a9
         case ACPI_IORT_NODE_PCI_ROOT_COMPLEX:
Al Stone 3df7a9
 
Al Stone 3df7a9
             InfoTable = AcpiDmTableInfoIort2;
Al Stone 3df7a9
-            Length = IortNode->Length - NodeOffset;
Al Stone 3df7a9
+	    ACPI_MOVE_16_TO_16(&NodeLength, &IortNode->Length);
Al Stone 3df7a9
+            Length = NodeLength - NodeOffset;
Al Stone 3df7a9
             break;
Al Stone 3df7a9
 
Al Stone 3df7a9
         case ACPI_IORT_NODE_SMMU:
Al Stone b0fde5
@@ -1981,7 +2033,8 @@ AcpiDmDumpIort (
Al Stone 3df7a9
         case ACPI_IORT_NODE_SMMU_V3:
Al Stone 3df7a9
 
Al Stone 3df7a9
             InfoTable = AcpiDmTableInfoIort4;
Al Stone 3df7a9
-            Length = IortNode->Length - NodeOffset;
Al Stone 3df7a9
+	    ACPI_MOVE_16_TO_16(&NodeLength, &IortNode->Length);
Al Stone 3df7a9
+            Length = NodeLength - NodeOffset;
Al Stone 3df7a9
             break;
Al Stone 3df7a9
 
Al Stone 3df7a9
         default:
Al Stone b0fde5
@@ -1991,7 +2044,8 @@ AcpiDmDumpIort (
Al Stone 3df7a9
 
Al Stone 3df7a9
             /* Attempt to continue */
Al Stone 3df7a9
 
Al Stone 3df7a9
-            if (!IortNode->Length)
Al Stone 3df7a9
+	    ACPI_MOVE_16_TO_16(&NodeLength, &IortNode->Length);
Al Stone 3df7a9
+            if (!NodeLength)
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 AcpiOsPrintf ("Invalid zero length IORT node\n");
Al Stone 3df7a9
                 return;
Al Stone b0fde5
@@ -2002,7 +2056,7 @@ AcpiDmDumpIort (
Al Stone 3df7a9
         /* Dump the node subtable header */
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (TableLen, Offset + NodeOffset,
Al Stone 3df7a9
             ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
Al Stone 3df7a9
             Length, InfoTable);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone b0fde5
@@ -2022,9 +2076,10 @@ AcpiDmDumpIort (
Al Stone 3df7a9
 
Al Stone 3df7a9
             if (IortItsGroup)
Al Stone 3df7a9
             {
Al Stone 3df7a9
-                for (i = 0; i < IortItsGroup->ItsCount; i++)
Al Stone 3df7a9
+	        ACPI_MOVE_32_TO_32(&ItsCount, &IortItsGroup->ItsCount);
Al Stone 3df7a9
+                for (i = 0; i < ItsCount; i++)
Al Stone 3df7a9
                 {
Al Stone 3df7a9
-                    Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
Al Stone 3df7a9
+                    Status = AcpiDmDumpTable (TableLen, Offset + NodeOffset,
Al Stone 3df7a9
                         ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
Al Stone 3df7a9
                         4, AcpiDmTableInfoIort0a);
Al Stone 3df7a9
                     NodeOffset += 4;
Al Stone b0fde5
@@ -2036,11 +2091,11 @@ AcpiDmDumpIort (
Al Stone 3df7a9
 
Al Stone 3df7a9
             /* Dump the Padding (optional) */
Al Stone 3df7a9
 
Al Stone 3df7a9
-            if (IortNode->Length > NodeOffset)
Al Stone 3df7a9
+	    ACPI_MOVE_16_TO_16(&NodeLength, &IortNode->Length);
Al Stone 3df7a9
+            if (NodeLength > NodeOffset)
Al Stone 3df7a9
             {
Al Stone 3df7a9
-                Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
Al Stone 3df7a9
-                    Table, IortNode->Length - NodeOffset,
Al Stone 3df7a9
-                    AcpiDmTableInfoIort1a);
Al Stone 3df7a9
+                Status = AcpiDmDumpTable (TableLen, Offset + NodeOffset,
Al Stone 3df7a9
+                    Table, NodeLength - NodeOffset, AcpiDmTableInfoIort1a);
Al Stone 3df7a9
                 if (ACPI_FAILURE (Status))
Al Stone 3df7a9
                 {
Al Stone 3df7a9
                     return;
Al Stone b0fde5
@@ -2057,8 +2112,8 @@ AcpiDmDumpIort (
Al Stone 3df7a9
             if (IortSmmu)
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 Length = 2 * sizeof (UINT64);
Al Stone 3df7a9
-                NodeOffset = IortSmmu->GlobalInterruptOffset;
Al Stone 3df7a9
-                Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
Al Stone 3df7a9
+                ACPI_MOVE_32_TO_32(&NodeOffset, &IortSmmu->GlobalInterruptOffset);
Al Stone 3df7a9
+                Status = AcpiDmDumpTable (TableLen, Offset + NodeOffset,
Al Stone 3df7a9
                     ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
Al Stone 3df7a9
                     Length, AcpiDmTableInfoIort3a);
Al Stone 3df7a9
                 if (ACPI_FAILURE (Status))
Al Stone b0fde5
@@ -2066,10 +2121,11 @@ AcpiDmDumpIort (
Al Stone 3df7a9
                     return;
Al Stone 3df7a9
                 }
Al Stone 3df7a9
 
Al Stone 3df7a9
-                NodeOffset = IortSmmu->ContextInterruptOffset;
Al Stone 3df7a9
-                for (i = 0; i < IortSmmu->ContextInterruptCount; i++)
Al Stone 3df7a9
+                ACPI_MOVE_32_TO_32(&NodeOffset, &IortSmmu->ContextInterruptOffset);
Al Stone 3df7a9
+                ACPI_MOVE_32_TO_32(&CtxIntCount, &IortSmmu->ContextInterruptCount);
Al Stone 3df7a9
+                for (i = 0; i < CtxIntCount; i++)
Al Stone 3df7a9
                 {
Al Stone 3df7a9
-                    Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
Al Stone 3df7a9
+                    Status = AcpiDmDumpTable (TableLen, Offset + NodeOffset,
Al Stone 3df7a9
                         ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
Al Stone 3df7a9
                         8, AcpiDmTableInfoIort3b);
Al Stone 3df7a9
                     if (ACPI_FAILURE (Status))
Al Stone b0fde5
@@ -2080,10 +2136,11 @@ AcpiDmDumpIort (
Al Stone 3df7a9
                     NodeOffset += 8;
Al Stone 3df7a9
                 }
Al Stone 3df7a9
 
Al Stone 3df7a9
-                NodeOffset = IortSmmu->PmuInterruptOffset;
Al Stone 3df7a9
-                for (i = 0; i < IortSmmu->PmuInterruptCount; i++)
Al Stone 3df7a9
+                ACPI_MOVE_32_TO_32(&NodeOffset, &IortSmmu->PmuInterruptOffset);
Al Stone 3df7a9
+                ACPI_MOVE_32_TO_32(&PmuIntCount, &IortSmmu->PmuInterruptCount);
Al Stone 3df7a9
+                for (i = 0; i < PmuIntCount; i++)
Al Stone 3df7a9
                 {
Al Stone 3df7a9
-                    Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
Al Stone 3df7a9
+                    Status = AcpiDmDumpTable (TableLen, Offset + NodeOffset,
Al Stone 3df7a9
                         ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
Al Stone 3df7a9
                         8, AcpiDmTableInfoIort3c);
Al Stone 3df7a9
                     if (ACPI_FAILURE (Status))
Al Stone b0fde5
@@ -2103,12 +2160,13 @@ AcpiDmDumpIort (
Al Stone 3df7a9
 
Al Stone 3df7a9
         /* Dump the ID mappings */
Al Stone 3df7a9
 
Al Stone 3df7a9
-        NodeOffset = IortNode->MappingOffset;
Al Stone 3df7a9
-        for (i = 0; i < IortNode->MappingCount; i++)
Al Stone 3df7a9
+        ACPI_MOVE_32_TO_32(&NodeOffset, &IortNode->MappingOffset);
Al Stone 3df7a9
+        ACPI_MOVE_32_TO_32(&MappingCount, &IortNode->MappingCount);
Al Stone 3df7a9
+        for (i = 0; i < MappingCount; i++)
Al Stone 3df7a9
         {
Al Stone 3df7a9
             AcpiOsPrintf ("\n");
Al Stone 3df7a9
             Length = sizeof (ACPI_IORT_ID_MAPPING);
Al Stone 3df7a9
-            Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
Al Stone 3df7a9
+            Status = AcpiDmDumpTable (TableLen, Offset + NodeOffset,
Al Stone 3df7a9
                 ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
Al Stone 3df7a9
                 Length, AcpiDmTableInfoIortMap);
Al Stone 3df7a9
             if (ACPI_FAILURE (Status))
Al Stone b0fde5
@@ -2122,8 +2180,9 @@ AcpiDmDumpIort (
Al Stone 3df7a9
 NextSubTable:
Al Stone 3df7a9
         /* Point to next node subtable */
Al Stone 3df7a9
 
Al Stone 3df7a9
-        Offset += IortNode->Length;
Al Stone 3df7a9
-        IortNode = ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, IortNode->Length);
Al Stone 3df7a9
+	ACPI_MOVE_16_TO_16(&NodeLength, &IortNode->Length);
Al Stone 3df7a9
+        Offset += NodeLength;
Al Stone 3df7a9
+        IortNode = ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeLength);
Al Stone 3df7a9
     }
Al Stone 3df7a9
 }
Al Stone 3df7a9
 
Al Stone b0fde5
@@ -2154,11 +2213,14 @@ AcpiDmDumpIvrs (
Al Stone 3df7a9
     ACPI_IVRS_DE_HEADER     *DeviceEntry;
Al Stone 3df7a9
     ACPI_IVRS_HEADER        *SubTable;
Al Stone 3df7a9
     ACPI_DMTABLE_INFO       *InfoTable;
Al Stone 3df7a9
+    UINT32		    Length;
Al Stone 3df7a9
+    UINT16		    SubLength;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIvrs);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
+    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoIvrs);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 3df7a9
         return;
Al Stone b0fde5
@@ -2167,13 +2229,14 @@ AcpiDmDumpIvrs (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* Common subtable header */
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
Al Stone 3df7a9
-            SubTable->Length, AcpiDmTableInfoIvrsHdr);
Al Stone 3df7a9
+        ACPI_MOVE_16_TO_16(&SubLength, &SubTable->Length);
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
+            SubLength, AcpiDmTableInfoIvrsHdr);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             return;
Al Stone b0fde5
@@ -2200,7 +2263,7 @@ AcpiDmDumpIvrs (
Al Stone 3df7a9
 
Al Stone 3df7a9
             /* Attempt to continue */
Al Stone 3df7a9
 
Al Stone 3df7a9
-            if (!SubTable->Length)
Al Stone 3df7a9
+            if (!SubLength)
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 AcpiOsPrintf ("Invalid zero length subtable\n");
Al Stone 3df7a9
                 return;
Al Stone b0fde5
@@ -2211,8 +2274,8 @@ AcpiDmDumpIvrs (
Al Stone 3df7a9
         /* Dump the subtable */
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
Al Stone 3df7a9
-            SubTable->Length, InfoTable);
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
+            SubLength, InfoTable);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             return;
Al Stone b0fde5
@@ -2226,7 +2289,7 @@ AcpiDmDumpIvrs (
Al Stone 3df7a9
             DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, SubTable,
Al Stone 3df7a9
                 sizeof (ACPI_IVRS_HARDWARE));
Al Stone 3df7a9
 
Al Stone 3df7a9
-            while (EntryOffset < (Offset + SubTable->Length))
Al Stone 3df7a9
+            while (EntryOffset < (Offset + SubLength))
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 AcpiOsPrintf ("\n");
Al Stone 3df7a9
                 /*
Al Stone b0fde5
@@ -2288,7 +2351,7 @@ AcpiDmDumpIvrs (
Al Stone 3df7a9
 
Al Stone 3df7a9
                 /* Dump the Device Entry */
Al Stone 3df7a9
 
Al Stone 3df7a9
-                Status = AcpiDmDumpTable (Table->Length, EntryOffset,
Al Stone 3df7a9
+                Status = AcpiDmDumpTable (Length, EntryOffset,
Al Stone 3df7a9
                     DeviceEntry, EntryLength, InfoTable);
Al Stone 3df7a9
                 if (ACPI_FAILURE (Status))
Al Stone 3df7a9
                 {
Al Stone b0fde5
@@ -2304,8 +2367,8 @@ AcpiDmDumpIvrs (
Al Stone 3df7a9
 NextSubTable:
Al Stone 3df7a9
         /* Point to next subtable */
Al Stone 3df7a9
 
Al Stone 3df7a9
-        Offset += SubTable->Length;
Al Stone 3df7a9
-        SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, SubTable, SubTable->Length);
Al Stone 3df7a9
+        Offset += SubLength;
Al Stone 3df7a9
+        SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, SubTable, SubLength);
Al Stone 3df7a9
     }
Al Stone 3df7a9
 }
Al Stone 3df7a9
 
Al Stone b0fde5
@@ -2331,7 +2394,7 @@ AcpiDmDumpLpit (
Al Stone 3df7a9
 {
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     ACPI_LPIT_HEADER        *SubTable;
Al Stone 3df7a9
-    UINT32                  Length = Table->Length;
Al Stone 3df7a9
+    UINT32                  Length;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_LPIT);
Al Stone 3df7a9
     ACPI_DMTABLE_INFO       *InfoTable;
Al Stone 3df7a9
     UINT32                  SubTableLength;
Al Stone b0fde5
@@ -2339,8 +2402,9 @@ AcpiDmDumpLpit (
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* Common subtable header */
Al Stone 3df7a9
 
Al Stone b0fde5
@@ -2404,13 +2468,14 @@ AcpiDmDumpMadt (
Al Stone 3df7a9
 {
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     ACPI_SUBTABLE_HEADER    *SubTable;
Al Stone 3df7a9
-    UINT32                  Length = Table->Length;
Al Stone 3df7a9
+    UINT32                  Length;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_MADT);
Al Stone 3df7a9
     ACPI_DMTABLE_INFO       *InfoTable;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoMadt);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone b0fde5
@@ -2420,7 +2485,7 @@ AcpiDmDumpMadt (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* Common subtable header */
Al Stone 3df7a9
 
Al Stone b0fde5
@@ -2566,11 +2631,13 @@ AcpiDmDumpMcfg (
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_MCFG);
Al Stone 3df7a9
     ACPI_MCFG_ALLOCATION    *SubTable;
Al Stone 3df7a9
+    UINT32		    Len;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMcfg);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Len, &Table->Length);
Al Stone 3df7a9
+    Status = AcpiDmDumpTable (Len, 0, Table, 0, AcpiDmTableInfoMcfg);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 3df7a9
         return;
Al Stone b0fde5
@@ -2579,17 +2646,17 @@ AcpiDmDumpMcfg (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Len)
Al Stone 3df7a9
     {
Al Stone 3df7a9
-        if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length)
Al Stone 3df7a9
+        if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Len)
Al Stone 3df7a9
         {
Al Stone 3df7a9
             AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n",
Al Stone 3df7a9
-                sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length));
Al Stone 3df7a9
+                sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Len));
Al Stone 3df7a9
             return;
Al Stone 3df7a9
         }
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Len, Offset, SubTable,
Al Stone 3df7a9
             sizeof (ACPI_MCFG_ALLOCATION), AcpiDmTableInfoMcfg0);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone b0fde5
@@ -2623,6 +2690,7 @@ AcpiDmDumpMpst (
Al Stone 3df7a9
 {
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_MPST);
Al Stone 3df7a9
+    ACPI_TABLE_MPST	    *Mpst;
Al Stone 3df7a9
     ACPI_MPST_POWER_NODE    *SubTable0;
Al Stone 3df7a9
     ACPI_MPST_POWER_STATE   *SubTable0A;
Al Stone 3df7a9
     ACPI_MPST_COMPONENT     *SubTable0B;
Al Stone b0fde5
@@ -2631,11 +2699,13 @@ AcpiDmDumpMpst (
Al Stone 3df7a9
     UINT16                  SubtableCount;
Al Stone 3df7a9
     UINT32                  PowerStateCount;
Al Stone 3df7a9
     UINT32                  ComponentCount;
Al Stone 3df7a9
+    UINT32		    Length;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMpst);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
+    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoMpst);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 3df7a9
         return;
Al Stone b0fde5
@@ -2643,13 +2713,14 @@ AcpiDmDumpMpst (
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Subtable: Memory Power Node(s) */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    SubtableCount = (ACPI_CAST_PTR (ACPI_TABLE_MPST, Table))->PowerNodeCount;
Al Stone 3df7a9
+    Mpst = ACPI_CAST_PTR (ACPI_TABLE_MPST, Table);
Al Stone 3df7a9
+    ACPI_MOVE_16_TO_16(&SubtableCount, &Mpst->PowerNodeCount);
Al Stone 3df7a9
     SubTable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Table, Offset);
Al Stone 3df7a9
 
Al Stone 3df7a9
-    while ((Offset < Table->Length) && SubtableCount)
Al Stone 3df7a9
+    while ((Offset < Length) && SubtableCount)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0,
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Length, Offset, SubTable0,
Al Stone 3df7a9
             sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone b0fde5
@@ -2658,8 +2729,8 @@ AcpiDmDumpMpst (
Al Stone 3df7a9
 
Al Stone 3df7a9
         /* Extract the sub-subtable counts */
Al Stone 3df7a9
 
Al Stone 3df7a9
-        PowerStateCount = SubTable0->NumPowerStates;
Al Stone 3df7a9
-        ComponentCount = SubTable0->NumPhysicalComponents;
Al Stone 3df7a9
+        ACPI_MOVE_32_TO_32(&PowerStateCount, &SubTable0->NumPowerStates);
Al Stone 3df7a9
+        ACPI_MOVE_32_TO_32(&ComponentCount, &SubTable0->NumPhysicalComponents);
Al Stone 3df7a9
         Offset += sizeof (ACPI_MPST_POWER_NODE);
Al Stone 3df7a9
 
Al Stone 3df7a9
         /* Sub-subtables - Memory Power State Structure(s) */
Al Stone b0fde5
@@ -2670,7 +2741,7 @@ AcpiDmDumpMpst (
Al Stone 3df7a9
         while (PowerStateCount)
Al Stone 3df7a9
         {
Al Stone 3df7a9
             AcpiOsPrintf ("\n");
Al Stone 3df7a9
-            Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0A,
Al Stone 3df7a9
+            Status = AcpiDmDumpTable (Length, Offset, SubTable0A,
Al Stone 3df7a9
                 sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A);
Al Stone 3df7a9
             if (ACPI_FAILURE (Status))
Al Stone 3df7a9
             {
Al Stone b0fde5
@@ -2680,7 +2751,7 @@ AcpiDmDumpMpst (
Al Stone 3df7a9
             SubTable0A++;
Al Stone 3df7a9
             PowerStateCount--;
Al Stone 3df7a9
             Offset += sizeof (ACPI_MPST_POWER_STATE);
Al Stone 3df7a9
-       }
Al Stone 3df7a9
+        }
Al Stone 3df7a9
 
Al Stone 3df7a9
         /* Sub-subtables - Physical Component ID Structure(s) */
Al Stone 3df7a9
 
Al Stone b0fde5
@@ -2693,7 +2764,7 @@ AcpiDmDumpMpst (
Al Stone 3df7a9
 
Al Stone 3df7a9
         while (ComponentCount)
Al Stone 3df7a9
         {
Al Stone 3df7a9
-            Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0B,
Al Stone 3df7a9
+            Status = AcpiDmDumpTable (Length, Offset, SubTable0B,
Al Stone 3df7a9
                 sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B);
Al Stone 3df7a9
             if (ACPI_FAILURE (Status))
Al Stone 3df7a9
             {
Al Stone b0fde5
@@ -2708,17 +2779,19 @@ AcpiDmDumpMpst (
Al Stone 3df7a9
         /* Point to next Memory Power Node subtable */
Al Stone 3df7a9
 
Al Stone 3df7a9
         SubtableCount--;
Al Stone 3df7a9
+        ACPI_MOVE_32_TO_32(&PowerStateCount, &SubTable0->NumPowerStates);
Al Stone 3df7a9
+        ACPI_MOVE_32_TO_32(&ComponentCount, &SubTable0->NumPhysicalComponents);
Al Stone 3df7a9
         SubTable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, SubTable0,
Al Stone 3df7a9
             sizeof (ACPI_MPST_POWER_NODE) +
Al Stone 3df7a9
-            (sizeof (ACPI_MPST_POWER_STATE) * SubTable0->NumPowerStates) +
Al Stone 3df7a9
-            (sizeof (ACPI_MPST_COMPONENT) * SubTable0->NumPhysicalComponents));
Al Stone 3df7a9
+            (sizeof (ACPI_MPST_POWER_STATE) * PowerStateCount) +
Al Stone 3df7a9
+            (sizeof (ACPI_MPST_COMPONENT) * ComponentCount));
Al Stone 3df7a9
     }
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Subtable: Count of Memory Power State Characteristic structures */
Al Stone 3df7a9
 
Al Stone 3df7a9
     AcpiOsPrintf ("\n");
Al Stone 3df7a9
     SubTable1 = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, SubTable0);
Al Stone 3df7a9
-    Status = AcpiDmDumpTable (Table->Length, Offset, SubTable1,
Al Stone 3df7a9
+    Status = AcpiDmDumpTable (Length, Offset, SubTable1,
Al Stone 3df7a9
         sizeof (ACPI_MPST_DATA_HDR), AcpiDmTableInfoMpst1);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone b0fde5
@@ -2733,10 +2806,10 @@ AcpiDmDumpMpst (
Al Stone 3df7a9
     SubTable2 = ACPI_ADD_PTR (ACPI_MPST_POWER_DATA, SubTable1,
Al Stone 3df7a9
         sizeof (ACPI_MPST_DATA_HDR));
Al Stone 3df7a9
 
Al Stone 3df7a9
-    while ((Offset < Table->Length) && SubtableCount)
Al Stone 3df7a9
+    while ((Offset < Length) && SubtableCount)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable2,
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Length, Offset, SubTable2,
Al Stone 3df7a9
             sizeof (ACPI_MPST_POWER_DATA), AcpiDmTableInfoMpst2);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone b0fde5
@@ -2769,11 +2842,13 @@ AcpiDmDumpMsct (
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_MSCT);
Al Stone 3df7a9
     ACPI_MSCT_PROXIMITY     *SubTable;
Al Stone 3df7a9
+    UINT32		    Length;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMsct);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
+    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoMsct);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 3df7a9
         return;
Al Stone b0fde5
@@ -2782,12 +2857,12 @@ AcpiDmDumpMsct (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* Common subtable header */
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
             sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone b0fde5
@@ -2822,11 +2897,13 @@ AcpiDmDumpMtmr (
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_MTMR);
Al Stone 3df7a9
     ACPI_MTMR_ENTRY         *SubTable;
Al Stone 3df7a9
+    UINT32		    Length;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMtmr);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
+    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoMtmr);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 3df7a9
         return;
Al Stone b0fde5
@@ -2835,12 +2912,12 @@ AcpiDmDumpMtmr (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* Common subtable header */
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
             sizeof (ACPI_MTMR_ENTRY), AcpiDmTableInfoMtmr0);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone b0fde5
@@ -2882,11 +2959,17 @@ AcpiDmDumpNfit (
Al Stone 3df7a9
     ACPI_NFIT_SMBIOS        *SmbiosInfo = NULL;
Al Stone 3df7a9
     ACPI_NFIT_FLUSH_ADDRESS *Hint = NULL;
Al Stone 3df7a9
     UINT32                  i;
Al Stone 3df7a9
+    UINT32                  TableLength;
Al Stone 3df7a9
+    UINT16                  SubLength;
Al Stone 3df7a9
+    UINT16                  SubType;
Al Stone 3df7a9
+    UINT32                  Count;
Al Stone 3df7a9
+    UINT16                  Count16;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoNfit);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&TableLength, &Table->Length);
Al Stone 3df7a9
+    Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoNfit);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 3df7a9
         return;
Al Stone b0fde5
@@ -2895,19 +2978,21 @@ AcpiDmDumpNfit (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < TableLength)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* NFIT subtable header */
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
Al Stone 3df7a9
-            SubTable->Length, AcpiDmTableInfoNfitHdr);
Al Stone 3df7a9
+	ACPI_MOVE_16_TO_16(&SubLength, &SubTable->Length);
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (TableLength, Offset, SubTable,
Al Stone 3df7a9
+            SubLength, AcpiDmTableInfoNfitHdr);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             return;
Al Stone 3df7a9
         }
Al Stone 3df7a9
 
Al Stone 3df7a9
-        switch (SubTable->Type)
Al Stone 3df7a9
+	ACPI_MOVE_16_TO_16(&SubType, &SubTable->Type);
Al Stone 3df7a9
+        switch (SubType)
Al Stone 3df7a9
         {
Al Stone 3df7a9
         case ACPI_NFIT_TYPE_SYSTEM_ADDRESS:
Al Stone 3df7a9
 
Al Stone b0fde5
@@ -2959,7 +3044,7 @@ AcpiDmDumpNfit (
Al Stone 3df7a9
 
Al Stone 3df7a9
             /* Attempt to continue */
Al Stone 3df7a9
 
Al Stone 3df7a9
-            if (!SubTable->Length)
Al Stone 3df7a9
+            if (!SubLength)
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 AcpiOsPrintf ("Invalid zero length subtable\n");
Al Stone 3df7a9
                 return;
Al Stone b0fde5
@@ -2968,8 +3053,8 @@ AcpiDmDumpNfit (
Al Stone 3df7a9
         }
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
Al Stone 3df7a9
-            SubTable->Length, InfoTable);
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (TableLength, Offset, SubTable,
Al Stone 3df7a9
+            SubLength, InfoTable);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             return;
Al Stone b0fde5
@@ -2977,13 +3062,14 @@ AcpiDmDumpNfit (
Al Stone 3df7a9
 
Al Stone 3df7a9
         /* Per-subtable variable-length fields */
Al Stone 3df7a9
 
Al Stone 3df7a9
-        switch (SubTable->Type)
Al Stone 3df7a9
+        switch (SubType)
Al Stone 3df7a9
         {
Al Stone 3df7a9
         case ACPI_NFIT_TYPE_INTERLEAVE:
Al Stone 3df7a9
 
Al Stone 3df7a9
-            for (i = 0; i < Interleave->LineCount; i++)
Al Stone 3df7a9
+	    ACPI_MOVE_32_TO_32(&Count, &Interleave->LineCount);
Al Stone 3df7a9
+            for (i = 0; i < Count; i++)
Al Stone 3df7a9
             {
Al Stone 3df7a9
-                Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
Al Stone 3df7a9
+                Status = AcpiDmDumpTable (TableLength, Offset + FieldOffset,
Al Stone 3df7a9
                     &Interleave->LineOffset[i],
Al Stone 3df7a9
                     sizeof (UINT32), AcpiDmTableInfoNfit2a);
Al Stone 3df7a9
                 if (ACPI_FAILURE (Status))
Al Stone b0fde5
@@ -2997,12 +3083,11 @@ AcpiDmDumpNfit (
Al Stone 3df7a9
 
Al Stone 3df7a9
         case ACPI_NFIT_TYPE_SMBIOS:
Al Stone 3df7a9
 
Al Stone 3df7a9
-            Length = SubTable->Length -
Al Stone 3df7a9
-                sizeof (ACPI_NFIT_SMBIOS) + sizeof (UINT8);
Al Stone 3df7a9
+            Length = SubLength - sizeof (ACPI_NFIT_SMBIOS) + sizeof (UINT8);
Al Stone 3df7a9
 
Al Stone 3df7a9
             if (Length)
Al Stone 3df7a9
             {
Al Stone 3df7a9
-                Status = AcpiDmDumpTable (Table->Length,
Al Stone 3df7a9
+                Status = AcpiDmDumpTable (TableLength,
Al Stone 3df7a9
                     sizeof (ACPI_NFIT_SMBIOS) - sizeof (UINT8),
Al Stone 3df7a9
                     SmbiosInfo,
Al Stone 3df7a9
                     Length, AcpiDmTableInfoNfit3a);
Al Stone b0fde5
@@ -3016,9 +3101,10 @@ AcpiDmDumpNfit (
Al Stone 3df7a9
 
Al Stone 3df7a9
         case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
Al Stone 3df7a9
 
Al Stone 3df7a9
-            for (i = 0; i < Hint->HintCount; i++)
Al Stone 3df7a9
+	    ACPI_MOVE_16_TO_16(&Count16, &Hint->HintCount);
Al Stone 3df7a9
+            for (i = 0; i < Count16; i++)
Al Stone 3df7a9
             {
Al Stone 3df7a9
-                Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
Al Stone 3df7a9
+                Status = AcpiDmDumpTable (TableLength, Offset + FieldOffset,
Al Stone 3df7a9
                     &Hint->HintAddress[i],
Al Stone 3df7a9
                     sizeof (UINT64), AcpiDmTableInfoNfit6a);
Al Stone 3df7a9
                 if (ACPI_FAILURE (Status))
Al Stone b0fde5
@@ -3037,8 +3123,8 @@ AcpiDmDumpNfit (
Al Stone 3df7a9
 NextSubTable:
Al Stone 3df7a9
         /* Point to next subtable */
Al Stone 3df7a9
 
Al Stone 3df7a9
-        Offset += SubTable->Length;
Al Stone 3df7a9
-        SubTable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, SubTable, SubTable->Length);
Al Stone 3df7a9
+        Offset += SubLength;
Al Stone 3df7a9
+        SubTable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, SubTable, SubLength);
Al Stone 3df7a9
     }
Al Stone 3df7a9
 }
Al Stone 3df7a9
 
Al Stone b0fde5
@@ -3063,12 +3149,13 @@ AcpiDmDumpPcct (
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     ACPI_PCCT_SUBSPACE      *SubTable;
Al Stone 3df7a9
     ACPI_DMTABLE_INFO       *InfoTable;
Al Stone 3df7a9
-    UINT32                  Length = Table->Length;
Al Stone 3df7a9
+    UINT32                  Length;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_PCCT);
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPcct);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone b0fde5
@@ -3078,7 +3165,7 @@ AcpiDmDumpPcct (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* Common subtable header */
Al Stone 3df7a9
 
Al Stone b0fde5
@@ -3164,16 +3251,21 @@ AcpiDmDumpPmtt (
Al Stone 3df7a9
     ACPI_PMTT_HEADER        *MemSubTable;
Al Stone 3df7a9
     ACPI_PMTT_HEADER        *DimmSubTable;
Al Stone 3df7a9
     ACPI_PMTT_DOMAIN        *DomainArray;
Al Stone 3df7a9
-    UINT32                  Length = Table->Length;
Al Stone 3df7a9
+    UINT32                  Length;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_PMTT);
Al Stone 3df7a9
     UINT32                  MemOffset;
Al Stone 3df7a9
     UINT32                  DimmOffset;
Al Stone 3df7a9
     UINT32                  DomainOffset;
Al Stone 3df7a9
-    UINT32                  DomainCount;
Al Stone 3df7a9
+    UINT16                  DomainCount;
Al Stone 3df7a9
+    UINT16		    SubLength;
Al Stone 3df7a9
+    UINT16		    Tmp16;
Al Stone 3df7a9
+    UINT16		    MemLength;
Al Stone 3df7a9
+    UINT16		    DimmLength;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPmtt);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone b0fde5
@@ -3183,13 +3275,14 @@ AcpiDmDumpPmtt (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* Common subtable header */
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
+        ACPI_MOVE_16_TO_16(&SubLength, &SubTable->Length);
Al Stone 3df7a9
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
-            SubTable->Length, AcpiDmTableInfoPmttHdr);
Al Stone 3df7a9
+            SubLength, AcpiDmTableInfoPmttHdr);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             return;
Al Stone b0fde5
@@ -3208,7 +3301,7 @@ AcpiDmDumpPmtt (
Al Stone 3df7a9
         /* Dump the fixed-length portion of the subtable */
Al Stone 3df7a9
 
Al Stone 3df7a9
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
-            SubTable->Length, AcpiDmTableInfoPmtt0);
Al Stone 3df7a9
+            SubLength, AcpiDmTableInfoPmtt0);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             return;
Al Stone b0fde5
@@ -3220,15 +3313,16 @@ AcpiDmDumpPmtt (
Al Stone 3df7a9
         MemSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, SubTable,
Al Stone 3df7a9
             sizeof (ACPI_PMTT_SOCKET));
Al Stone 3df7a9
 
Al Stone 3df7a9
-        while (((Offset + MemOffset) < Table->Length) &&
Al Stone 3df7a9
-            (MemOffset < SubTable->Length))
Al Stone 3df7a9
+        while (((Offset + MemOffset) < Length) &&
Al Stone 3df7a9
+            (MemOffset < SubLength))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             /* Common subtable header */
Al Stone 3df7a9
 
Al Stone 3df7a9
             AcpiOsPrintf ("\n");
Al Stone 3df7a9
+	    ACPI_MOVE_16_TO_16(&MemLength, &MemSubTable->Length);
Al Stone 3df7a9
             Status = AcpiDmDumpTable (Length,
Al Stone 3df7a9
                 Offset + MemOffset, MemSubTable,
Al Stone 3df7a9
-                MemSubTable->Length, AcpiDmTableInfoPmttHdr);
Al Stone 3df7a9
+                MemLength, AcpiDmTableInfoPmttHdr);
Al Stone 3df7a9
             if (ACPI_FAILURE (Status))
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 return;
Al Stone b0fde5
@@ -3248,7 +3342,7 @@ AcpiDmDumpPmtt (
Al Stone 3df7a9
 
Al Stone 3df7a9
             Status = AcpiDmDumpTable (Length,
Al Stone 3df7a9
                 Offset + MemOffset, MemSubTable,
Al Stone 3df7a9
-                MemSubTable->Length, AcpiDmTableInfoPmtt1);
Al Stone 3df7a9
+                MemLength, AcpiDmTableInfoPmtt1);
Al Stone 3df7a9
             if (ACPI_FAILURE (Status))
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 return;
Al Stone b0fde5
@@ -3256,13 +3350,14 @@ AcpiDmDumpPmtt (
Al Stone 3df7a9
 
Al Stone 3df7a9
             /* Walk the variable count of proximity domains */
Al Stone 3df7a9
 
Al Stone 3df7a9
-            DomainCount = ((ACPI_PMTT_CONTROLLER *) MemSubTable)->DomainCount;
Al Stone 3df7a9
+	    Tmp16 = ((ACPI_PMTT_CONTROLLER *) MemSubTable)->DomainCount;
Al Stone 3df7a9
+            ACPI_MOVE_16_TO_16(&DomainCount, &Tmp16);
Al Stone 3df7a9
             DomainOffset = sizeof (ACPI_PMTT_CONTROLLER);
Al Stone 3df7a9
             DomainArray = ACPI_ADD_PTR (ACPI_PMTT_DOMAIN, MemSubTable,
Al Stone 3df7a9
                 sizeof (ACPI_PMTT_CONTROLLER));
Al Stone 3df7a9
 
Al Stone 3df7a9
-            while (((Offset + MemOffset + DomainOffset) < Table->Length) &&
Al Stone 3df7a9
-                ((MemOffset + DomainOffset) < SubTable->Length) &&
Al Stone 3df7a9
+            while (((Offset + MemOffset + DomainOffset) < Length) &&
Al Stone 3df7a9
+                ((MemOffset + DomainOffset) < SubLength) &&
Al Stone 3df7a9
                 DomainCount)
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 Status = AcpiDmDumpTable (Length,
Al Stone b0fde5
@@ -3290,15 +3385,16 @@ AcpiDmDumpPmtt (
Al Stone 3df7a9
             DimmSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, MemSubTable,
Al Stone 3df7a9
                 DomainOffset);
Al Stone 3df7a9
 
Al Stone 3df7a9
-            while (((Offset + MemOffset + DimmOffset) < Table->Length) &&
Al Stone 3df7a9
-                (DimmOffset < MemSubTable->Length))
Al Stone 3df7a9
+            while (((Offset + MemOffset + DimmOffset) < Length) &&
Al Stone 3df7a9
+                (DimmOffset < MemLength))
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 /* Common subtable header */
Al Stone 3df7a9
 
Al Stone 3df7a9
                 AcpiOsPrintf ("\n");
Al Stone 3df7a9
+		ACPI_MOVE_16_TO_16(&DimmLength, &DimmSubTable->Length);
Al Stone 3df7a9
                 Status = AcpiDmDumpTable (Length,
Al Stone 3df7a9
                     Offset + MemOffset + DimmOffset, DimmSubTable,
Al Stone 3df7a9
-                    DimmSubTable->Length, AcpiDmTableInfoPmttHdr);
Al Stone 3df7a9
+                    DimmLength, AcpiDmTableInfoPmttHdr);
Al Stone 3df7a9
                 if (ACPI_FAILURE (Status))
Al Stone 3df7a9
                 {
Al Stone 3df7a9
                     return;
Al Stone b0fde5
@@ -3318,7 +3414,7 @@ AcpiDmDumpPmtt (
Al Stone 3df7a9
 
Al Stone 3df7a9
                 Status = AcpiDmDumpTable (Length,
Al Stone 3df7a9
                     Offset + MemOffset + DimmOffset, DimmSubTable,
Al Stone 3df7a9
-                    DimmSubTable->Length, AcpiDmTableInfoPmtt2);
Al Stone 3df7a9
+                    DimmLength, AcpiDmTableInfoPmtt2);
Al Stone 3df7a9
                 if (ACPI_FAILURE (Status))
Al Stone 3df7a9
                 {
Al Stone 3df7a9
                     return;
Al Stone b0fde5
@@ -3326,23 +3422,22 @@ AcpiDmDumpPmtt (
Al Stone 3df7a9
 
Al Stone 3df7a9
                 /* Point to next DIMM subtable */
Al Stone 3df7a9
 
Al Stone 3df7a9
-                DimmOffset += DimmSubTable->Length;
Al Stone 3df7a9
+                DimmOffset += DimmLength;
Al Stone 3df7a9
                 DimmSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
Al Stone 3df7a9
-                    DimmSubTable, DimmSubTable->Length);
Al Stone 3df7a9
+                    DimmSubTable, DimmLength);
Al Stone 3df7a9
             }
Al Stone 3df7a9
 
Al Stone 3df7a9
             /* Point to next Controller subtable */
Al Stone 3df7a9
 
Al Stone 3df7a9
-            MemOffset += MemSubTable->Length;
Al Stone 3df7a9
+            MemOffset += MemLength;
Al Stone 3df7a9
             MemSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
Al Stone 3df7a9
-                MemSubTable, MemSubTable->Length);
Al Stone 3df7a9
+                MemSubTable, MemLength);
Al Stone 3df7a9
         }
Al Stone 3df7a9
 
Al Stone 3df7a9
         /* Point to next Socket subtable */
Al Stone 3df7a9
 
Al Stone 3df7a9
-        Offset += SubTable->Length;
Al Stone 3df7a9
-        SubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
Al Stone 3df7a9
-            SubTable, SubTable->Length);
Al Stone 3df7a9
+        Offset += SubLength;
Al Stone 3df7a9
+        SubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, SubTable, SubLength);
Al Stone 3df7a9
     }
Al Stone 3df7a9
 }
Al Stone 3df7a9
 
Al Stone b0fde5
@@ -3498,6 +3593,8 @@ AcpiDmDumpS3pt (
Al Stone 3df7a9
     ACPI_FPDT_HEADER        *SubTable;
Al Stone 3df7a9
     ACPI_DMTABLE_INFO       *InfoTable;
Al Stone 3df7a9
     ACPI_TABLE_S3PT         *S3ptTable = ACPI_CAST_PTR (ACPI_TABLE_S3PT, Tables);
Al Stone 3df7a9
+    UINT32		    Length;
Al Stone 3df7a9
+    UINT16                  SubType;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone b0fde5
@@ -3508,20 +3605,22 @@ AcpiDmDumpS3pt (
Al Stone 3df7a9
         return 0;
Al Stone 3df7a9
     }
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &S3ptTable->Length);
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, S3ptTable, Offset);
Al Stone 3df7a9
-    while (Offset < S3ptTable->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* Common subtable header */
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable,
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
             SubTable->Length, AcpiDmTableInfoS3ptHdr);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone 3df7a9
             return 0;
Al Stone 3df7a9
         }
Al Stone 3df7a9
 
Al Stone 3df7a9
-        switch (SubTable->Type)
Al Stone 3df7a9
+        ACPI_MOVE_16_TO_16(&SubType, &SubTable->Type);
Al Stone 3df7a9
+        switch (SubType)
Al Stone 3df7a9
         {
Al Stone 3df7a9
         case ACPI_S3PT_TYPE_RESUME:
Al Stone 3df7a9
 
Al Stone b0fde5
@@ -3536,7 +3635,7 @@ AcpiDmDumpS3pt (
Al Stone 3df7a9
         default:
Al Stone 3df7a9
 
Al Stone 3df7a9
             AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n",
Al Stone 3df7a9
-                SubTable->Type);
Al Stone 3df7a9
+                SubType);
Al Stone 3df7a9
 
Al Stone 3df7a9
             /* Attempt to continue */
Al Stone 3df7a9
 
Al Stone b0fde5
@@ -3549,7 +3648,7 @@ AcpiDmDumpS3pt (
Al Stone 3df7a9
         }
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable,
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
             SubTable->Length, InfoTable);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone b0fde5
@@ -3583,9 +3682,11 @@ void
Al Stone 3df7a9
 AcpiDmDumpSlic (
Al Stone 3df7a9
     ACPI_TABLE_HEADER       *Table)
Al Stone 3df7a9
 {
Al Stone 3df7a9
+    UINT32	Length;
Al Stone 3df7a9
 
Al Stone 3df7a9
-    (void) AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table,
Al Stone 3df7a9
-        Table->Length - sizeof (*Table), AcpiDmTableInfoSlic);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
+    (void) AcpiDmDumpTable (Length, sizeof (ACPI_TABLE_HEADER), Table,
Al Stone 3df7a9
+        Length - sizeof (*Table), AcpiDmTableInfoSlic);
Al Stone 3df7a9
 }
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone b0fde5
@@ -3608,14 +3709,17 @@ AcpiDmDumpSlit (
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     UINT32                  Offset;
Al Stone 3df7a9
     UINT8                   *Row;
Al Stone 3df7a9
-    UINT32                  Localities;
Al Stone 3df7a9
+    UINT64                  Localities;
Al Stone 3df7a9
     UINT32                  i;
Al Stone 3df7a9
     UINT32                  j;
Al Stone 3df7a9
+    UINT32		    Length;
Al Stone 3df7a9
+    UINT64                  Tmp64;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSlit);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
+    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoSlit);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 3df7a9
         return;
Al Stone b0fde5
@@ -3623,7 +3727,8 @@ AcpiDmDumpSlit (
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Display the Locality NxN Matrix */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Localities = (UINT32) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount;
Al Stone 3df7a9
+    Tmp64 = (UINT64) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount;
Al Stone 3df7a9
+    ACPI_MOVE_64_TO_64(&Localities, &Tmp64);
Al Stone 3df7a9
     Offset = ACPI_OFFSET (ACPI_TABLE_SLIT, Entry[0]);
Al Stone 3df7a9
     Row = (UINT8 *) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->Entry;
Al Stone 3df7a9
 
Al Stone b0fde5
@@ -3636,7 +3741,7 @@ AcpiDmDumpSlit (
Al Stone 3df7a9
         {
Al Stone 3df7a9
             /* Check for beyond EOT */
Al Stone 3df7a9
 
Al Stone 3df7a9
-            if (Offset >= Table->Length)
Al Stone 3df7a9
+            if (Offset >= Length)
Al Stone 3df7a9
             {
Al Stone 3df7a9
                 AcpiOsPrintf (
Al Stone 3df7a9
                     "\n**** Not enough room in table for all localities\n");
Al Stone b0fde5
@@ -3688,11 +3793,13 @@ AcpiDmDumpSrat (
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_SRAT);
Al Stone 3df7a9
     ACPI_SUBTABLE_HEADER    *SubTable;
Al Stone 3df7a9
     ACPI_DMTABLE_INFO       *InfoTable;
Al Stone 3df7a9
+    UINT32		    Length;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSrat);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
+    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoSrat);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 3df7a9
         return;
Al Stone b0fde5
@@ -3701,12 +3808,12 @@ AcpiDmDumpSrat (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* Common subtable header */
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
             SubTable->Length, AcpiDmTableInfoSratHdr);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone b0fde5
@@ -3755,7 +3862,7 @@ AcpiDmDumpSrat (
Al Stone 3df7a9
         }
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
             SubTable->Length, InfoTable);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone b0fde5
@@ -3792,13 +3899,14 @@ AcpiDmDumpStao (
Al Stone 3df7a9
 {
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     char                    *Namepath;
Al Stone 3df7a9
-    UINT32                  Length = Table->Length;
Al Stone 3df7a9
+    UINT32                  Length;
Al Stone 3df7a9
     UINT32                  StringLength;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_STAO);
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoStao);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone b0fde5
@@ -3807,7 +3915,7 @@ AcpiDmDumpStao (
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* The rest of the table consists of Namepath strings */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         Namepath = ACPI_ADD_PTR (char, Table, Offset);
Al Stone 3df7a9
         StringLength = strlen (Namepath) + 1;
Al Stone b0fde5
@@ -3849,11 +3957,14 @@ AcpiDmDumpTcpa (
Al Stone 3df7a9
     ACPI_TABLE_TCPA_HDR     *SubTable = ACPI_ADD_PTR (
Al Stone 3df7a9
                                 ACPI_TABLE_TCPA_HDR, Table, Offset);
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
+    UINT32		    Length;
Al Stone 3df7a9
+    UINT16		    PlatformClass;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Status = AcpiDmDumpTable (Table->Length, 0, Table,
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
+    Status = AcpiDmDumpTable (Length, 0, Table,
Al Stone 3df7a9
         0, AcpiDmTableInfoTcpaHdr);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone b0fde5
@@ -3864,18 +3975,19 @@ AcpiDmDumpTcpa (
Al Stone 3df7a9
      * Examine the PlatformClass field to determine the table type.
Al Stone 3df7a9
      * Either a client or server table. Only one.
Al Stone 3df7a9
      */
Al Stone 3df7a9
-    switch (CommonHeader->PlatformClass)
Al Stone 3df7a9
+    ACPI_MOVE_16_TO_16(&PlatformClass, &CommonHeader->PlatformClass);
Al Stone 3df7a9
+    switch (PlatformClass)
Al Stone 3df7a9
     {
Al Stone 3df7a9
     case ACPI_TCPA_CLIENT_TABLE:
Al Stone 3df7a9
 
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
Al Stone 3df7a9
-            Table->Length - Offset, AcpiDmTableInfoTcpaClient);
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
+            Length - Offset, AcpiDmTableInfoTcpaClient);
Al Stone 3df7a9
         break;
Al Stone 3df7a9
 
Al Stone 3df7a9
     case ACPI_TCPA_SERVER_TABLE:
Al Stone 3df7a9
 
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
Al Stone 3df7a9
-            Table->Length - Offset, AcpiDmTableInfoTcpaServer);
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
+            Length - Offset, AcpiDmTableInfoTcpaServer);
Al Stone 3df7a9
         break;
Al Stone 3df7a9
 
Al Stone 3df7a9
     default:
Al Stone b0fde5
@@ -3912,11 +4024,13 @@ AcpiDmDumpVrtc (
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_VRTC);
Al Stone 3df7a9
     ACPI_VRTC_ENTRY         *SubTable;
Al Stone 3df7a9
+    UINT32		    Length;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoVrtc);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
+    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoVrtc);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 3df7a9
         return;
Al Stone b0fde5
@@ -3925,12 +4039,12 @@ AcpiDmDumpVrtc (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* Common subtable header */
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
             sizeof (ACPI_VRTC_ENTRY), AcpiDmTableInfoVrtc0);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone b0fde5
@@ -3965,11 +4079,13 @@ AcpiDmDumpWdat (
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     UINT32                  Offset = sizeof (ACPI_TABLE_WDAT);
Al Stone 3df7a9
     ACPI_WDAT_ENTRY         *SubTable;
Al Stone 3df7a9
+    UINT32		    Length;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoWdat);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
+    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoWdat);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone 3df7a9
         return;
Al Stone b0fde5
@@ -3978,12 +4094,12 @@ AcpiDmDumpWdat (
Al Stone 3df7a9
     /* Subtables */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset);
Al Stone 3df7a9
-    while (Offset < Table->Length)
Al Stone 3df7a9
+    while (Offset < Length)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         /* Common subtable header */
Al Stone 3df7a9
 
Al Stone 3df7a9
         AcpiOsPrintf ("\n");
Al Stone 3df7a9
-        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
Al Stone 3df7a9
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
Al Stone 3df7a9
             sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0);
Al Stone 3df7a9
         if (ACPI_FAILURE (Status))
Al Stone 3df7a9
         {
Al Stone b0fde5
@@ -4018,12 +4134,13 @@ AcpiDmDumpWpbt (
Al Stone 3df7a9
 {
Al Stone 3df7a9
     ACPI_STATUS             Status;
Al Stone 3df7a9
     ACPI_TABLE_WPBT         *SubTable;
Al Stone 3df7a9
-    UINT32                  Length = Table->Length;
Al Stone 3df7a9
+    UINT32                  Length;
Al Stone 3df7a9
     UINT16                  ArgumentsLength;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Dump the main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Length, &Table->Length);
Al Stone 3df7a9
     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoWpbt);
Al Stone 3df7a9
     if (ACPI_FAILURE (Status))
Al Stone 3df7a9
     {
Al Stone b0fde5
@@ -4033,10 +4150,10 @@ AcpiDmDumpWpbt (
Al Stone 3df7a9
     /* Extract the arguments buffer length from the main table */
Al Stone 3df7a9
 
Al Stone 3df7a9
     SubTable = ACPI_CAST_PTR (ACPI_TABLE_WPBT, Table);
Al Stone 3df7a9
-    ArgumentsLength = SubTable->ArgumentsLength;
Al Stone 3df7a9
+    ACPI_MOVE_16_TO_16(&ArgumentsLength, &SubTable->ArgumentsLength);
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Dump the arguments buffer */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    (void) AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength,
Al Stone 3df7a9
+    (void) AcpiDmDumpTable (Length, 0, Table, ArgumentsLength,
Al Stone 3df7a9
         AcpiDmTableInfoWpbt0);
Al Stone 3df7a9
 }
Al Stone b0fde5
Index: acpica-unix2-20170531/source/compiler/aslrestype2.c
Al Stone 5c5a61
===================================================================
Al Stone b0fde5
--- acpica-unix2-20170531.orig/source/compiler/aslrestype2.c
Al Stone b0fde5
+++ acpica-unix2-20170531/source/compiler/aslrestype2.c
Al Stone 5c5a61
@@ -98,21 +98,33 @@ RsDoGeneralRegisterDescriptor (
Al Stone ec8dd1
         {
Al Stone ec8dd1
         case 0: /* Address space */
Al Stone ec8dd1
 
Al Stone ec8dd1
+	    /*
Al Stone ec8dd1
             Descriptor->GenericReg.AddressSpaceId = (UINT8) InitializerOp->Asl.Value.Integer;
Al Stone ec8dd1
+	    */
Al Stone ec8dd1
+            ACPI_MOVE_64_TO_8(&Descriptor->GenericReg.AddressSpaceId,
Al Stone ec8dd1
+			      &InitializerOp->Asl.Value.Integer);
Al Stone ec8dd1
             RsCreateByteField (InitializerOp, ACPI_RESTAG_ADDRESSSPACE,
Al Stone ec8dd1
                 CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.AddressSpaceId));
Al Stone ec8dd1
            break;
Al Stone ec8dd1
 
Al Stone ec8dd1
         case 1: /* Register Bit Width */
Al Stone ec8dd1
 
Al Stone ec8dd1
+	    /*
Al Stone ec8dd1
             Descriptor->GenericReg.BitWidth = (UINT8) InitializerOp->Asl.Value.Integer;
Al Stone ec8dd1
+	    */
Al Stone ec8dd1
+            ACPI_MOVE_64_TO_8(&Descriptor->GenericReg.BitWidth,
Al Stone ec8dd1
+			      &InitializerOp->Asl.Value.Integer);
Al Stone ec8dd1
             RsCreateByteField (InitializerOp, ACPI_RESTAG_REGISTERBITWIDTH,
Al Stone ec8dd1
                 CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.BitWidth));
Al Stone ec8dd1
             break;
Al Stone ec8dd1
 
Al Stone ec8dd1
         case 2: /* Register Bit Offset */
Al Stone ec8dd1
 
Al Stone ec8dd1
+	    /*
Al Stone ec8dd1
             Descriptor->GenericReg.BitOffset = (UINT8) InitializerOp->Asl.Value.Integer;
Al Stone ec8dd1
+	    */
Al Stone ec8dd1
+            ACPI_MOVE_64_TO_8(&Descriptor->GenericReg.BitOffset,
Al Stone ec8dd1
+			      &InitializerOp->Asl.Value.Integer);
Al Stone ec8dd1
             RsCreateByteField (InitializerOp, ACPI_RESTAG_REGISTERBITOFFSET,
Al Stone ec8dd1
                 CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.BitOffset));
Al Stone ec8dd1
             break;
Al Stone 5c5a61
@@ -127,7 +139,11 @@ RsDoGeneralRegisterDescriptor (
Al Stone ec8dd1
 
Al Stone ec8dd1
         case 4: /* Access Size (ACPI 3.0) */
Al Stone ec8dd1
 
Al Stone ec8dd1
+	    /*
Al Stone ec8dd1
             Descriptor->GenericReg.AccessSize = (UINT8) InitializerOp->Asl.Value.Integer;
Al Stone ec8dd1
+	    */
Al Stone ec8dd1
+	    ACPI_MOVE_64_TO_8(&Descriptor->GenericReg.AccessSize,
Al Stone ec8dd1
+			      &InitializerOp->Asl.Value.Integer);
Al Stone ec8dd1
             RsCreateByteField (InitializerOp, ACPI_RESTAG_ACCESSSIZE,
Al Stone ec8dd1
                 CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.AccessSize));
Al Stone ec8dd1
 
Al Stone b0fde5
Index: acpica-unix2-20170531/source/compiler/dtfield.c
Al Stone 5c5a61
===================================================================
Al Stone b0fde5
--- acpica-unix2-20170531.orig/source/compiler/dtfield.c
Al Stone b0fde5
+++ acpica-unix2-20170531/source/compiler/dtfield.c
Al Stone 5c5a61
@@ -360,7 +360,27 @@ DtCompileInteger (
Al Stone ec8dd1
         DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer);
Al Stone ec8dd1
     }
Al Stone ec8dd1
 
Al Stone ec8dd1
-    memcpy (Buffer, &Value, ByteLength);
Al Stone ec8dd1
+    switch (ByteLength) {
Al Stone ec8dd1
+    case 1:
Al Stone ec8dd1
+	ACPI_MOVE_64_TO_8(Buffer, &Value);
Al Stone ec8dd1
+	break;
Al Stone ec8dd1
+
Al Stone ec8dd1
+    case 2:
Al Stone ec8dd1
+	ACPI_MOVE_64_TO_16(Buffer, &Value);
Al Stone ec8dd1
+	break;
Al Stone ec8dd1
+
Al Stone ec8dd1
+    case 4:
Al Stone ec8dd1
+	ACPI_MOVE_64_TO_32(Buffer, &Value);
Al Stone ec8dd1
+	break;
Al Stone ec8dd1
+
Al Stone ec8dd1
+    case 8:
Al Stone ec8dd1
+	ACPI_MOVE_64_TO_64(Buffer, &Value);
Al Stone ec8dd1
+	break;
Al Stone ec8dd1
+
Al Stone ec8dd1
+    default:
Al Stone ec8dd1
+	memcpy (Buffer, &Value, ByteLength);
Al Stone ec8dd1
+	break;
Al Stone ec8dd1
+    }
Al Stone ec8dd1
     return;
Al Stone ec8dd1
 }
Al Stone ec8dd1
 
Al Stone b0fde5
Index: acpica-unix2-20170531/source/compiler/dtsubtable.c
Al Stone 5c5a61
===================================================================
Al Stone b0fde5
--- acpica-unix2-20170531.orig/source/compiler/dtsubtable.c
Al Stone b0fde5
+++ acpica-unix2-20170531/source/compiler/dtsubtable.c
Al Stone 5c5a61
@@ -379,6 +379,21 @@ DtSetSubtableLength (
Al Stone ec8dd1
         return;
Al Stone ec8dd1
     }
Al Stone ec8dd1
 
Al Stone ec8dd1
-    memcpy (Subtable->LengthField, &Subtable->TotalLength,
Al Stone ec8dd1
-        Subtable->SizeOfLengthField);
Al Stone ec8dd1
+    switch(Subtable->SizeOfLengthField) {
Al Stone ec8dd1
+    case 1:
Al Stone ec8dd1
+	ACPI_MOVE_32_TO_8(Subtable->LengthField, &Subtable->TotalLength);
Al Stone ec8dd1
+	break;
Al Stone ec8dd1
+
Al Stone ec8dd1
+    case 2:
Al Stone ec8dd1
+	ACPI_MOVE_32_TO_16(Subtable->LengthField, &Subtable->TotalLength);
Al Stone ec8dd1
+	break;
Al Stone ec8dd1
+
Al Stone ec8dd1
+    case 4:
Al Stone ec8dd1
+	ACPI_MOVE_32_TO_32(Subtable->LengthField, &Subtable->TotalLength);
Al Stone ec8dd1
+	break;
Al Stone ec8dd1
+
Al Stone ec8dd1
+    default:
Al Stone ec8dd1
+    	memcpy (Subtable->LengthField, &Subtable->TotalLength,
Al Stone ec8dd1
+        	Subtable->SizeOfLengthField);
Al Stone ec8dd1
+    }
Al Stone ec8dd1
 }
Al Stone b0fde5
Index: acpica-unix2-20170531/source/compiler/dttable1.c
Al Stone 5c5a61
===================================================================
Al Stone b0fde5
--- acpica-unix2-20170531.orig/source/compiler/dttable1.c
Al Stone b0fde5
+++ acpica-unix2-20170531/source/compiler/dttable1.c
Al Stone 5c5a61
@@ -282,6 +282,8 @@ DtCompileCsrt (
Al Stone ec8dd1
     DT_FIELD                **PFieldList = (DT_FIELD **) List;
Al Stone ec8dd1
     UINT32                  DescriptorCount;
Al Stone ec8dd1
     UINT32                  GroupLength;
Al Stone ec8dd1
+    ACPI_CSRT_GROUP	    *Pgrp;
Al Stone ec8dd1
+    UINT32		    Tmp32;
Al Stone ec8dd1
 
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Subtables (Resource Groups) */
Al Stone 5c5a61
@@ -300,12 +302,20 @@ DtCompileCsrt (
Al Stone ec8dd1
 
Al Stone ec8dd1
         /* Compute the number of resource descriptors */
Al Stone ec8dd1
 
Al Stone ec8dd1
+	/*
Al Stone ec8dd1
         GroupLength =
Al Stone ec8dd1
             (ACPI_CAST_PTR (ACPI_CSRT_GROUP,
Al Stone ec8dd1
                 Subtable->Buffer))->Length -
Al Stone ec8dd1
             (ACPI_CAST_PTR (ACPI_CSRT_GROUP,
Al Stone ec8dd1
                 Subtable->Buffer))->SharedInfoLength -
Al Stone ec8dd1
             sizeof (ACPI_CSRT_GROUP);
Al Stone ec8dd1
+	*/
Al Stone ec8dd1
+	Pgrp = ACPI_CAST_PTR(ACPI_CSRT_GROUP, Subtable->Buffer);
Al Stone ec8dd1
+	ACPI_MOVE_32_TO_32(&Tmp32, &Pgrp->Length);
Al Stone ec8dd1
+	GroupLength = Tmp32;
Al Stone ec8dd1
+	ACPI_MOVE_32_TO_32(&Tmp32, &Pgrp->SharedInfoLength);
Al Stone ec8dd1
+	GroupLength -= Tmp32;
Al Stone ec8dd1
+        GroupLength -= sizeof (ACPI_CSRT_GROUP);
Al Stone ec8dd1
 
Al Stone ec8dd1
         DescriptorCount = (GroupLength  /
Al Stone ec8dd1
             sizeof (ACPI_CSRT_DESCRIPTOR));
Al Stone 5c5a61
@@ -393,6 +403,8 @@ DtCompileDbg2 (
Al Stone ec8dd1
     ACPI_DBG2_DEVICE        *DeviceInfo;
Al Stone ec8dd1
     UINT16                  CurrentOffset;
Al Stone ec8dd1
     UINT32                  i;
Al Stone ec8dd1
+    UINT16                  Tmp16;
Al Stone ec8dd1
+    UINT32                  Tmp32;
Al Stone ec8dd1
 
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Main table */
Al Stone 5c5a61
@@ -409,10 +421,11 @@ DtCompileDbg2 (
Al Stone ec8dd1
     /* Main table fields */
Al Stone ec8dd1
 
Al Stone ec8dd1
     Dbg2Header = ACPI_CAST_PTR (ACPI_DBG2_HEADER, Subtable->Buffer);
Al Stone ec8dd1
-    Dbg2Header->InfoOffset = sizeof (ACPI_TABLE_HEADER) + ACPI_PTR_DIFF (
Al Stone ec8dd1
+    Tmp32 = sizeof (ACPI_TABLE_HEADER) + ACPI_PTR_DIFF (
Al Stone ec8dd1
         ACPI_ADD_PTR (UINT8, Dbg2Header, sizeof (ACPI_DBG2_HEADER)), Dbg2Header);
Al Stone ec8dd1
+    ACPI_MOVE_32_TO_32(&Dbg2Header->InfoOffset, &Tmp32);
Al Stone ec8dd1
 
Al Stone ec8dd1
-    SubtableCount = Dbg2Header->InfoCount;
Al Stone ec8dd1
+    ACPI_MOVE_32_TO_32(&SubtableCount, &Dbg2Header->InfoCount);
Al Stone ec8dd1
     DtPushSubtable (Subtable);
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Process all Device Information subtables (Count = InfoCount) */
Al Stone 5c5a61
@@ -439,7 +452,7 @@ DtCompileDbg2 (
Al Stone ec8dd1
 
Al Stone ec8dd1
         /* BaseAddressRegister GAS array (Required, size is RegisterCount) */
Al Stone ec8dd1
 
Al Stone ec8dd1
-        DeviceInfo->BaseAddressOffset = CurrentOffset;
Al Stone ec8dd1
+        ACPI_MOVE_16_TO_16(&DeviceInfo->BaseAddressOffset, &CurrentOffset);
Al Stone ec8dd1
         for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
Al Stone ec8dd1
         {
Al Stone ec8dd1
             Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Addr,
Al Stone 5c5a61
@@ -455,7 +468,7 @@ DtCompileDbg2 (
Al Stone ec8dd1
 
Al Stone ec8dd1
         /* AddressSize array (Required, size = RegisterCount) */
Al Stone ec8dd1
 
Al Stone ec8dd1
-        DeviceInfo->AddressSizeOffset = CurrentOffset;
Al Stone ec8dd1
+        ACPI_MOVE_16_TO_16(&DeviceInfo->AddressSizeOffset, &CurrentOffset);
Al Stone ec8dd1
         for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
Al Stone ec8dd1
         {
Al Stone ec8dd1
             Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Size,
Al Stone 5c5a61
@@ -471,7 +484,7 @@ DtCompileDbg2 (
Al Stone ec8dd1
 
Al Stone ec8dd1
         /* NamespaceString device identifier (Required, size = NamePathLength) */
Al Stone ec8dd1
 
Al Stone ec8dd1
-        DeviceInfo->NamepathOffset = CurrentOffset;
Al Stone ec8dd1
+        ACPI_MOVE_16_TO_16(&DeviceInfo->NamepathOffset, &CurrentOffset);
Al Stone ec8dd1
         Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Name,
Al Stone ec8dd1
             &Subtable, TRUE);
Al Stone ec8dd1
         if (ACPI_FAILURE (Status))
Al Stone 5c5a61
@@ -481,8 +494,9 @@ DtCompileDbg2 (
Al Stone ec8dd1
 
Al Stone ec8dd1
         /* Update the device info header */
Al Stone ec8dd1
 
Al Stone ec8dd1
-        DeviceInfo->NamepathLength = (UINT16) Subtable->Length;
Al Stone ec8dd1
-        CurrentOffset += (UINT16) DeviceInfo->NamepathLength;
Al Stone ec8dd1
+        ACPI_MOVE_32_TO_16(&DeviceInfo->NamepathLength, &Subtable->Length);
Al Stone ec8dd1
+        ACPI_MOVE_16_TO_16(&Tmp16, &DeviceInfo->NamepathLength);
Al Stone ec8dd1
+        CurrentOffset += Tmp16;
Al Stone ec8dd1
         DtInsertSubtable (ParentTable, Subtable);
Al Stone ec8dd1
 
Al Stone ec8dd1
         /* OemData - Variable-length data (Optional, size = OemDataLength) */
Al Stone 5c5a61
@@ -503,8 +517,8 @@ DtCompileDbg2 (
Al Stone ec8dd1
 
Al Stone ec8dd1
         if (Subtable && Subtable->Length)
Al Stone ec8dd1
         {
Al Stone ec8dd1
-            DeviceInfo->OemDataOffset = CurrentOffset;
Al Stone ec8dd1
-            DeviceInfo->OemDataLength = (UINT16) Subtable->Length;
Al Stone ec8dd1
+            ACPI_MOVE_16_TO_16(&DeviceInfo->OemDataOffset, &CurrentOffset);
Al Stone ec8dd1
+            ACPI_MOVE_32_TO_16(&DeviceInfo->OemDataLength, &Subtable->Length);
Al Stone ec8dd1
 
Al Stone ec8dd1
             DtInsertSubtable (ParentTable, Subtable);
Al Stone ec8dd1
         }
Al Stone 5c5a61
@@ -544,6 +558,8 @@ DtCompileDmar (
Al Stone ec8dd1
     ACPI_DMAR_DEVICE_SCOPE  *DmarDeviceScope;
Al Stone ec8dd1
     UINT32                  DeviceScopeLength;
Al Stone ec8dd1
     UINT32                  PciPathLength;
Al Stone ec8dd1
+    UINT16		    Tmp16;
Al Stone ec8dd1
+    UINT16		    HdrType;
Al Stone ec8dd1
 
Al Stone ec8dd1
 
Al Stone ec8dd1
     Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmar, &Subtable, TRUE);
Al Stone 5c5a61
@@ -573,8 +589,11 @@ DtCompileDmar (
Al Stone ec8dd1
         DtPushSubtable (Subtable);
Al Stone ec8dd1
 
Al Stone ec8dd1
         DmarHeader = ACPI_CAST_PTR (ACPI_DMAR_HEADER, Subtable->Buffer);
Al Stone ec8dd1
+	ACPI_MOVE_16_TO_16(&Tmp16, &DmarHeader->Length);
Al Stone ec8dd1
+	DmarHeader->Length = Tmp16;
Al Stone ec8dd1
 
Al Stone ec8dd1
-        switch (DmarHeader->Type)
Al Stone ec8dd1
+	ACPI_MOVE_16_TO_16(&HdrType, &DmarHeader->Type);
Al Stone ec8dd1
+        switch (HdrType)
Al Stone ec8dd1
         {
Al Stone ec8dd1
         case ACPI_DMAR_TYPE_HARDWARE_UNIT:
Al Stone ec8dd1
 
Al Stone 5c5a61
@@ -621,8 +640,8 @@ DtCompileDmar (
Al Stone ec8dd1
         /*
Al Stone ec8dd1
          * Optional Device Scope subtables
Al Stone ec8dd1
          */
Al Stone ec8dd1
-        if ((DmarHeader->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
Al Stone ec8dd1
-            (DmarHeader->Type == ACPI_DMAR_TYPE_NAMESPACE))
Al Stone ec8dd1
+        if ((HdrType == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
Al Stone ec8dd1
+            (HdrType == ACPI_DMAR_TYPE_NAMESPACE))
Al Stone ec8dd1
         {
Al Stone ec8dd1
             /* These types do not support device scopes */
Al Stone ec8dd1
 
Al Stone 5c5a61
@@ -631,8 +650,8 @@ DtCompileDmar (
Al Stone ec8dd1
         }
Al Stone ec8dd1
 
Al Stone ec8dd1
         DtPushSubtable (Subtable);
Al Stone ec8dd1
-        DeviceScopeLength = DmarHeader->Length - Subtable->Length -
Al Stone ec8dd1
-            ParentTable->Length;
Al Stone ec8dd1
+        DeviceScopeLength = DmarHeader->Length - Subtable->Length - 
Al Stone ec8dd1
+		ParentTable->Length;
Al Stone ec8dd1
         while (DeviceScopeLength)
Al Stone ec8dd1
         {
Al Stone ec8dd1
             Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarScope,
Al Stone 5c5a61
@@ -757,7 +776,7 @@ DtCompileDrtm (
Al Stone ec8dd1
         Count++;
Al Stone ec8dd1
     }
Al Stone ec8dd1
 
Al Stone ec8dd1
-    DrtmVtl->ValidatedTableCount = Count;
Al Stone ec8dd1
+    ACPI_MOVE_32_TO_32(&DrtmVtl->ValidatedTableCount, &Count);
Al Stone ec8dd1
     DtPopSubtable ();
Al Stone ec8dd1
     ParentTable = DtPeekSubtable ();
Al Stone ec8dd1
 
Al Stone 5c5a61
@@ -795,7 +814,7 @@ DtCompileDrtm (
Al Stone ec8dd1
         Count++;
Al Stone ec8dd1
     }
Al Stone ec8dd1
 
Al Stone ec8dd1
-    DrtmRl->ResourceCount = Count;
Al Stone ec8dd1
+    ACPI_MOVE_32_TO_32(&DrtmRl->ResourceCount, &Count);
Al Stone ec8dd1
     DtPopSubtable ();
Al Stone ec8dd1
     ParentTable = DtPeekSubtable ();
Al Stone ec8dd1
 
Al Stone 5c5a61
@@ -889,6 +908,7 @@ DtCompileGtdt (
Al Stone ec8dd1
     ACPI_SUBTABLE_HEADER    *GtdtHeader;
Al Stone ec8dd1
     ACPI_DMTABLE_INFO       *InfoTable;
Al Stone ec8dd1
     UINT32                  GtCount;
Al Stone ec8dd1
+    ACPI_GTDT_TIMER_BLOCK   *TimerBlock;
Al Stone ec8dd1
 
Al Stone ec8dd1
 
Al Stone ec8dd1
     Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt,
Al Stone 5c5a61
@@ -955,8 +975,9 @@ DtCompileGtdt (
Al Stone ec8dd1
             DtPushSubtable (Subtable);
Al Stone ec8dd1
             ParentTable = DtPeekSubtable ();
Al Stone ec8dd1
 
Al Stone ec8dd1
-            GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
Al Stone ec8dd1
-                Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
Al Stone ec8dd1
+	    TimerBlock = ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
Al Stone ec8dd1
+                Subtable->Buffer - sizeof(ACPI_GTDT_HEADER));
Al Stone ec8dd1
+	    ACPI_MOVE_32_TO_32(&GtCount, &TimerBlock->TimerCount);
Al Stone ec8dd1
 
Al Stone ec8dd1
             while (GtCount)
Al Stone ec8dd1
             {
Al Stone 5c5a61
@@ -1009,6 +1030,7 @@ DtCompileFpdt (
Al Stone ec8dd1
     ACPI_DMTABLE_INFO       *InfoTable;
Al Stone ec8dd1
     DT_FIELD                **PFieldList = (DT_FIELD **) List;
Al Stone ec8dd1
     DT_FIELD                *SubtableStart;
Al Stone ec8dd1
+    UINT16		    HdrType;
Al Stone ec8dd1
 
Al Stone ec8dd1
 
Al Stone ec8dd1
     while (*PFieldList)
Al Stone 5c5a61
@@ -1027,7 +1049,8 @@ DtCompileFpdt (
Al Stone ec8dd1
 
Al Stone ec8dd1
         FpdtHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
Al Stone ec8dd1
 
Al Stone ec8dd1
-        switch (FpdtHeader->Type)
Al Stone ec8dd1
+	ACPI_MOVE_16_TO_16(&HdrType, &FpdtHeader->Type);
Al Stone ec8dd1
+        switch (HdrType)
Al Stone ec8dd1
         {
Al Stone ec8dd1
         case ACPI_FPDT_TYPE_BOOT:
Al Stone ec8dd1
 
Al Stone 5c5a61
@@ -1085,6 +1108,7 @@ DtCompileHest (
Al Stone ec8dd1
     ACPI_DMTABLE_INFO       *InfoTable;
Al Stone ec8dd1
     UINT16                  Type;
Al Stone ec8dd1
     UINT32                  BankCount;
Al Stone ec8dd1
+    UINT16		    Tmp16;
Al Stone ec8dd1
 
Al Stone ec8dd1
 
Al Stone ec8dd1
     Status = DtCompileTable (PFieldList, AcpiDmTableInfoHest,
Al Stone 5c5a61
@@ -1102,8 +1126,9 @@ DtCompileHest (
Al Stone ec8dd1
         /* Get subtable type */
Al Stone ec8dd1
 
Al Stone ec8dd1
         SubtableStart = *PFieldList;
Al Stone ec8dd1
-        DtCompileInteger ((UINT8 *) &Type, *PFieldList, 2, 0);
Al Stone ec8dd1
+        DtCompileInteger ((UINT8 *) &Tmp16, *PFieldList, 2, 0);
Al Stone ec8dd1
 
Al Stone ec8dd1
+	ACPI_MOVE_16_TO_16(&Type, &Tmp16);
Al Stone ec8dd1
         switch (Type)
Al Stone ec8dd1
         {
Al Stone ec8dd1
         case ACPI_HEST_TYPE_IA32_CHECK:
Al Stone b0fde5
@@ -1453,11 +1478,13 @@ DtCompileIort (
Al Stone ec8dd1
     ACPI_IORT_SMMU          *IortSmmu;
Al Stone ec8dd1
     UINT32                  NodeNumber;
Al Stone ec8dd1
     UINT32                  NodeLength;
Al Stone ec8dd1
+    UINT32                  NodeOffset;
Al Stone ec8dd1
     UINT32                  IdMappingNumber;
Al Stone ec8dd1
     UINT32                  ItsNumber;
Al Stone ec8dd1
     UINT32                  ContextIrptNumber;
Al Stone ec8dd1
     UINT32                  PmuIrptNumber;
Al Stone ec8dd1
     UINT32                  PaddingLength;
Al Stone ec8dd1
+    UINT32                  MappingOffset;
Al Stone ec8dd1
 
Al Stone ec8dd1
 
Al Stone ec8dd1
     ParentTable = DtPeekSubtable ();
Al Stone b0fde5
@@ -1483,7 +1510,7 @@ DtCompileIort (
Al Stone ec8dd1
      * Optionally allows the generic data types to be used for filling
Al Stone ec8dd1
      * this field.
Al Stone ec8dd1
      */
Al Stone ec8dd1
-    Iort->NodeOffset = sizeof (ACPI_TABLE_IORT);
Al Stone ec8dd1
+    NodeOffset = sizeof (ACPI_TABLE_IORT);
Al Stone ec8dd1
     Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortPad,
Al Stone ec8dd1
         &Subtable, TRUE);
Al Stone ec8dd1
     if (ACPI_FAILURE (Status))
Al Stone b0fde5
@@ -1493,7 +1520,7 @@ DtCompileIort (
Al Stone ec8dd1
     if (Subtable)
Al Stone ec8dd1
     {
Al Stone ec8dd1
         DtInsertSubtable (ParentTable, Subtable);
Al Stone ec8dd1
-        Iort->NodeOffset += Subtable->Length;
Al Stone ec8dd1
+        NodeOffset += Subtable->Length;
Al Stone ec8dd1
     }
Al Stone ec8dd1
     else
Al Stone ec8dd1
     {
Al Stone b0fde5
@@ -1503,8 +1530,9 @@ DtCompileIort (
Al Stone ec8dd1
         {
Al Stone ec8dd1
             return (Status);
Al Stone ec8dd1
         }
Al Stone ec8dd1
-        Iort->NodeOffset += PaddingLength;
Al Stone ec8dd1
+        NodeOffset += PaddingLength;
Al Stone ec8dd1
     }
Al Stone ec8dd1
+    ACPI_MOVE_32_TO_32(&Iort->NodeOffset, &NodeOffset);
Al Stone ec8dd1
 
Al Stone ec8dd1
     NodeNumber = 0;
Al Stone ec8dd1
     while (*PFieldList)
Al Stone b0fde5
@@ -1558,7 +1586,7 @@ DtCompileIort (
Al Stone ec8dd1
                 ItsNumber++;
Al Stone ec8dd1
             }
Al Stone ec8dd1
 
Al Stone ec8dd1
-            IortItsGroup->ItsCount = ItsNumber;
Al Stone ec8dd1
+            ACPI_MOVE_32_TO_32(&IortItsGroup->ItsCount, &ItsNumber);
Al Stone ec8dd1
             break;
Al Stone ec8dd1
 
Al Stone ec8dd1
         case ACPI_IORT_NODE_NAMED_COMPONENT:
Al Stone b0fde5
@@ -1592,15 +1620,16 @@ DtCompileIort (
Al Stone ec8dd1
             }
Al Stone ec8dd1
             else
Al Stone ec8dd1
             {
Al Stone ec8dd1
-                if (NodeLength > IortNode->MappingOffset)
Al Stone ec8dd1
+		ACPI_MOVE_32_TO_32(&MappingOffset, &IortNode->MappingOffset);
Al Stone ec8dd1
+                if (NodeLength > MappingOffset)
Al Stone ec8dd1
                 {
Al Stone ec8dd1
                     return (AE_BAD_DATA);
Al Stone ec8dd1
                 }
Al Stone ec8dd1
 
Al Stone ec8dd1
-                if (NodeLength < IortNode->MappingOffset)
Al Stone ec8dd1
+                if (NodeLength < MappingOffset)
Al Stone ec8dd1
                 {
Al Stone ec8dd1
                     Status = DtCompilePadding (
Al Stone ec8dd1
-                        IortNode->MappingOffset - NodeLength,
Al Stone ec8dd1
+                        MappingOffset - NodeLength,
Al Stone ec8dd1
                         &Subtable);
Al Stone ec8dd1
                     if (ACPI_FAILURE (Status))
Al Stone ec8dd1
                     {
Al Stone b0fde5
@@ -1608,7 +1637,8 @@ DtCompileIort (
Al Stone ec8dd1
                     }
Al Stone ec8dd1
 
Al Stone ec8dd1
                     DtInsertSubtable (ParentTable, Subtable);
Al Stone ec8dd1
-                    NodeLength = IortNode->MappingOffset;
Al Stone ec8dd1
+		    ACPI_MOVE_32_TO_32(&MappingOffset, &IortNode->MappingOffset);
Al Stone ec8dd1
+                    NodeLength = MappingOffset;
Al Stone ec8dd1
                 }
Al Stone ec8dd1
             }
Al Stone ec8dd1
             break;
Al Stone b0fde5
@@ -1641,7 +1671,7 @@ DtCompileIort (
Al Stone ec8dd1
 
Al Stone ec8dd1
             /* Compile global interrupt array */
Al Stone ec8dd1
 
Al Stone ec8dd1
-            IortSmmu->GlobalInterruptOffset = NodeLength;
Al Stone ec8dd1
+            ACPI_MOVE_32_TO_32(&IortSmmu->GlobalInterruptOffset, &NodeLength);
Al Stone ec8dd1
             Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3a,
Al Stone ec8dd1
                 &Subtable, TRUE);
Al Stone ec8dd1
             if (ACPI_FAILURE (Status))
Al Stone b0fde5
@@ -1655,7 +1685,7 @@ DtCompileIort (
Al Stone ec8dd1
             /* Compile context interrupt array */
Al Stone ec8dd1
 
Al Stone ec8dd1
             ContextIrptNumber = 0;
Al Stone ec8dd1
-            IortSmmu->ContextInterruptOffset = NodeLength;
Al Stone ec8dd1
+            ACPI_MOVE_32_TO_32(&IortSmmu->ContextInterruptOffset, &NodeLength);
Al Stone ec8dd1
             while (*PFieldList)
Al Stone ec8dd1
             {
Al Stone ec8dd1
                 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3b,
Al Stone b0fde5
@@ -1675,12 +1705,12 @@ DtCompileIort (
Al Stone ec8dd1
                 ContextIrptNumber++;
Al Stone ec8dd1
             }
Al Stone ec8dd1
 
Al Stone ec8dd1
-            IortSmmu->ContextInterruptCount = ContextIrptNumber;
Al Stone ec8dd1
+            ACPI_MOVE_32_TO_32(&IortSmmu->ContextInterruptCount, &ContextIrptNumber);
Al Stone ec8dd1
 
Al Stone ec8dd1
             /* Compile PMU interrupt array */
Al Stone ec8dd1
 
Al Stone ec8dd1
             PmuIrptNumber = 0;
Al Stone ec8dd1
-            IortSmmu->PmuInterruptOffset = NodeLength;
Al Stone ec8dd1
+            ACPI_MOVE_32_TO_32(&IortSmmu->PmuInterruptOffset, &NodeLength);
Al Stone ec8dd1
             while (*PFieldList)
Al Stone ec8dd1
             {
Al Stone ec8dd1
                 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3c,
Al Stone b0fde5
@@ -1700,7 +1730,7 @@ DtCompileIort (
Al Stone ec8dd1
                 PmuIrptNumber++;
Al Stone ec8dd1
             }
Al Stone ec8dd1
 
Al Stone ec8dd1
-            IortSmmu->PmuInterruptCount = PmuIrptNumber;
Al Stone ec8dd1
+            ACPI_MOVE_32_TO_32(&IortSmmu->PmuInterruptCount, &PmuIrptNumber);
Al Stone ec8dd1
             break;
Al Stone ec8dd1
 
Al Stone ec8dd1
         case ACPI_IORT_NODE_SMMU_V3:
Al Stone b0fde5
@@ -1724,7 +1754,7 @@ DtCompileIort (
Al Stone ec8dd1
 
Al Stone ec8dd1
         /* Compile Array of ID mappings */
Al Stone ec8dd1
 
Al Stone ec8dd1
-        IortNode->MappingOffset = NodeLength;
Al Stone ec8dd1
+        ACPI_MOVE_32_TO_32(&IortNode->MappingOffset, &NodeLength);
Al Stone ec8dd1
         IdMappingNumber = 0;
Al Stone ec8dd1
         while (*PFieldList)
Al Stone ec8dd1
         {
Al Stone b0fde5
@@ -1745,7 +1775,7 @@ DtCompileIort (
Al Stone ec8dd1
             IdMappingNumber++;
Al Stone ec8dd1
         }
Al Stone ec8dd1
 
Al Stone ec8dd1
-        IortNode->MappingCount = IdMappingNumber;
Al Stone ec8dd1
+        ACPI_MOVE_32_TO_32(&IortNode->MappingCount, &IdMappingNumber);
Al Stone 0a2fbe
         if (!IdMappingNumber)
Al Stone 0a2fbe
         {
Al Stone 0a2fbe
             IortNode->MappingOffset = 0;
Al Stone b0fde5
@@ -1760,7 +1790,7 @@ DtCompileIort (
Al Stone ec8dd1
         NodeNumber++;
Al Stone ec8dd1
     }
Al Stone ec8dd1
 
Al Stone ec8dd1
-    Iort->NodeCount = NodeNumber;
Al Stone ec8dd1
+    ACPI_MOVE_32_TO_32(&Iort->NodeCount, &NodeNumber);
Al Stone ec8dd1
     return (AE_OK);
Al Stone ec8dd1
 }
Al Stone ec8dd1
 
Al Stone b0fde5
Index: acpica-unix2-20170531/source/compiler/dttable2.c
Al Stone 5c5a61
===================================================================
Al Stone b0fde5
--- acpica-unix2-20170531.orig/source/compiler/dttable2.c
Al Stone b0fde5
+++ acpica-unix2-20170531/source/compiler/dttable2.c
Al Stone 5c5a61
@@ -346,7 +346,7 @@ DtCompileMpst (
Al Stone ec8dd1
     DtPushSubtable (Subtable);
Al Stone ec8dd1
 
Al Stone ec8dd1
     MpstChannelInfo = ACPI_CAST_PTR (ACPI_MPST_CHANNEL, Subtable->Buffer);
Al Stone ec8dd1
-    SubtableCount = MpstChannelInfo->PowerNodeCount;
Al Stone ec8dd1
+    ACPI_MOVE_16_TO_16(&SubtableCount, &MpstChannelInfo->PowerNodeCount);
Al Stone ec8dd1
 
Al Stone ec8dd1
     while (*PFieldList && SubtableCount)
Al Stone ec8dd1
     {
Al Stone 5c5a61
@@ -364,8 +364,8 @@ DtCompileMpst (
Al Stone ec8dd1
         DtPushSubtable (Subtable);
Al Stone ec8dd1
 
Al Stone ec8dd1
         MpstPowerNode = ACPI_CAST_PTR (ACPI_MPST_POWER_NODE, Subtable->Buffer);
Al Stone ec8dd1
-        PowerStateCount = MpstPowerNode->NumPowerStates;
Al Stone ec8dd1
-        ComponentCount = MpstPowerNode->NumPhysicalComponents;
Al Stone ec8dd1
+        ACPI_MOVE_32_TO_32(&PowerStateCount, &MpstPowerNode->NumPowerStates);
Al Stone ec8dd1
+        ACPI_MOVE_32_TO_32(&ComponentCount, &MpstPowerNode->NumPhysicalComponents);
Al Stone ec8dd1
 
Al Stone ec8dd1
         ParentTable = DtPeekSubtable ();
Al Stone ec8dd1
 
Al Stone 5c5a61
@@ -518,6 +518,7 @@ DtCompileNfit (
Al Stone ec8dd1
     UINT32                  Count;
Al Stone ec8dd1
     ACPI_NFIT_INTERLEAVE    *Interleave = NULL;
Al Stone ec8dd1
     ACPI_NFIT_FLUSH_ADDRESS *Hint = NULL;
Al Stone ec8dd1
+    UINT16		    SubType;
Al Stone ec8dd1
 
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Main table */
Al Stone 5c5a61
@@ -551,7 +552,8 @@ DtCompileNfit (
Al Stone ec8dd1
 
Al Stone ec8dd1
         NfitHeader = ACPI_CAST_PTR (ACPI_NFIT_HEADER, Subtable->Buffer);
Al Stone ec8dd1
 
Al Stone ec8dd1
-        switch (NfitHeader->Type)
Al Stone ec8dd1
+	ACPI_MOVE_16_TO_16(&SubType, &NfitHeader->Type);
Al Stone ec8dd1
+        switch (SubType)
Al Stone ec8dd1
         {
Al Stone ec8dd1
         case ACPI_NFIT_TYPE_SYSTEM_ADDRESS:
Al Stone ec8dd1
 
Al Stone 5c5a61
@@ -606,7 +608,7 @@ DtCompileNfit (
Al Stone ec8dd1
         DtInsertSubtable (ParentTable, Subtable);
Al Stone ec8dd1
         DtPopSubtable ();
Al Stone ec8dd1
 
Al Stone ec8dd1
-        switch (NfitHeader->Type)
Al Stone ec8dd1
+        switch (SubType)
Al Stone ec8dd1
         {
Al Stone ec8dd1
         case ACPI_NFIT_TYPE_INTERLEAVE:
Al Stone ec8dd1
 
Al Stone 5c5a61
@@ -632,7 +634,7 @@ DtCompileNfit (
Al Stone ec8dd1
                 Count++;
Al Stone ec8dd1
             }
Al Stone ec8dd1
 
Al Stone ec8dd1
-            Interleave->LineCount = Count;
Al Stone ec8dd1
+            ACPI_MOVE_32_TO_32(&Interleave->LineCount, &Count);
Al Stone ec8dd1
             DtPopSubtable ();
Al Stone ec8dd1
             break;
Al Stone ec8dd1
 
Al Stone 5c5a61
@@ -678,7 +680,7 @@ DtCompileNfit (
Al Stone ec8dd1
                 Count++;
Al Stone ec8dd1
             }
Al Stone ec8dd1
 
Al Stone ec8dd1
-            Hint->HintCount = (UINT16) Count;
Al Stone ec8dd1
+            ACPI_MOVE_32_TO_16(&Hint->HintCount, &Count);
Al Stone ec8dd1
             DtPopSubtable ();
Al Stone ec8dd1
             break;
Al Stone ec8dd1
 
Al Stone b0fde5
@@ -895,7 +897,7 @@ DtCompilePmtt (
Al Stone ec8dd1
 
Al Stone ec8dd1
             PmttController = ACPI_CAST_PTR (ACPI_PMTT_CONTROLLER,
Al Stone ec8dd1
                 (Subtable->Buffer - sizeof (ACPI_PMTT_HEADER)));
Al Stone ec8dd1
-            DomainCount = PmttController->DomainCount;
Al Stone ec8dd1
+            ACPI_MOVE_16_TO_16(&DomainCount, &PmttController->DomainCount);
Al Stone ec8dd1
 
Al Stone ec8dd1
             while (DomainCount)
Al Stone ec8dd1
             {
Al Stone b0fde5
@@ -1115,6 +1117,7 @@ DtCompileS3pt (
Al Stone ec8dd1
     DT_SUBTABLE             *ParentTable;
Al Stone ec8dd1
     ACPI_DMTABLE_INFO       *InfoTable;
Al Stone ec8dd1
     DT_FIELD                *SubtableStart;
Al Stone ec8dd1
+    UINT16		    HdrType;
Al Stone ec8dd1
 
Al Stone ec8dd1
 
Al Stone ec8dd1
     Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3pt,
Al Stone b0fde5
@@ -1142,7 +1145,8 @@ DtCompileS3pt (
Al Stone ec8dd1
 
Al Stone ec8dd1
         S3ptHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
Al Stone ec8dd1
 
Al Stone ec8dd1
-        switch (S3ptHeader->Type)
Al Stone ec8dd1
+	ACPI_MOVE_16_TO_16(&HdrType, &S3ptHeader->Type);
Al Stone ec8dd1
+        switch (HdrType)
Al Stone ec8dd1
         {
Al Stone ec8dd1
         case ACPI_S3PT_TYPE_RESUME:
Al Stone ec8dd1
 
Al Stone b0fde5
@@ -1239,6 +1243,7 @@ DtCompileSlit (
Al Stone ec8dd1
     DT_FIELD                *FieldList;
Al Stone ec8dd1
     UINT32                  Localities;
Al Stone ec8dd1
     UINT8                   *LocalityBuffer;
Al Stone ec8dd1
+    UINT32		    Tmp;
Al Stone ec8dd1
 
Al Stone ec8dd1
 
Al Stone ec8dd1
     Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlit,
Al Stone b0fde5
@@ -1251,7 +1256,8 @@ DtCompileSlit (
Al Stone ec8dd1
     ParentTable = DtPeekSubtable ();
Al Stone ec8dd1
     DtInsertSubtable (ParentTable, Subtable);
Al Stone ec8dd1
 
Al Stone ec8dd1
-    Localities = *ACPI_CAST_PTR (UINT32, Subtable->Buffer);
Al Stone ec8dd1
+    Tmp = *ACPI_CAST_PTR (UINT32, Subtable->Buffer);
Al Stone ec8dd1
+    ACPI_MOVE_32_TO_32(&Localities, &Tmp);
Al Stone ec8dd1
     LocalityBuffer = UtLocalCalloc (Localities);
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Compile each locality buffer */
Al Stone b0fde5
@@ -1445,6 +1451,7 @@ DtCompileTcpa (
Al Stone ec8dd1
     ACPI_TABLE_TCPA_HDR     *TcpaHeader;
Al Stone ec8dd1
     DT_SUBTABLE             *ParentTable;
Al Stone ec8dd1
     ACPI_STATUS             Status;
Al Stone ec8dd1
+    UINT16		    PlatClass;
Al Stone ec8dd1
 
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Compile the main table */
Al Stone b0fde5
@@ -1465,7 +1472,8 @@ DtCompileTcpa (
Al Stone ec8dd1
      */
Al Stone ec8dd1
     TcpaHeader = ACPI_CAST_PTR (ACPI_TABLE_TCPA_HDR, ParentTable->Buffer);
Al Stone ec8dd1
 
Al Stone ec8dd1
-    switch (TcpaHeader->PlatformClass)
Al Stone ec8dd1
+    ACPI_MOVE_16_TO_16(&PlatClass, &TcpaHeader->PlatformClass);
Al Stone ec8dd1
+    switch (PlatClass)
Al Stone ec8dd1
     {
Al Stone ec8dd1
     case ACPI_TCPA_CLIENT_TABLE:
Al Stone ec8dd1
 
Al Stone b0fde5
@@ -1661,6 +1669,9 @@ DtCompileWpbt (
Al Stone ec8dd1
     ACPI_TABLE_WPBT         *Table;
Al Stone ec8dd1
     ACPI_STATUS             Status;
Al Stone ec8dd1
     UINT16                  Length;
Al Stone ec8dd1
+    UINT16                  Tmp16;
Al Stone ec8dd1
+    UINT16		    *Ptr16;
Al Stone ec8dd1
+    UINT32		    ii;
Al Stone ec8dd1
 
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Compile the main table */
Al Stone b0fde5
@@ -1688,7 +1699,16 @@ DtCompileWpbt (
Al Stone ec8dd1
 
Al Stone ec8dd1
     Length = (UINT16) Subtable->TotalLength;
Al Stone ec8dd1
     Table = ACPI_CAST_PTR (ACPI_TABLE_WPBT, ParentTable->Buffer);
Al Stone ec8dd1
-    Table->ArgumentsLength = Length;
Al Stone ec8dd1
+    ACPI_MOVE_16_TO_16(&Table->ArgumentsLength, &Length);
Al Stone ec8dd1
+
Al Stone ec8dd1
+    /* The arguments are in Unicode, so make sure the byte order is correct */
Al Stone ec8dd1
+    Ptr16 = (UINT16 *)Subtable->Buffer;
Al Stone ec8dd1
+    for (ii = 0; ii < Length; ii++)
Al Stone ec8dd1
+    {
Al Stone ec8dd1
+	ACPI_MOVE_16_TO_16(&Tmp16, Ptr16);
Al Stone ec8dd1
+	*Ptr16 = Tmp16;
Al Stone ec8dd1
+        Ptr16++;
Al Stone ec8dd1
+    }
Al Stone ec8dd1
 
Al Stone ec8dd1
     ParentTable = DtPeekSubtable ();
Al Stone ec8dd1
     DtInsertSubtable (ParentTable, Subtable);
Al Stone b0fde5
Index: acpica-unix2-20170531/source/components/disassembler/dmbuffer.c
Al Stone 5c5a61
===================================================================
Al Stone b0fde5
--- acpica-unix2-20170531.orig/source/components/disassembler/dmbuffer.c
Al Stone b0fde5
+++ acpica-unix2-20170531/source/components/disassembler/dmbuffer.c
Al Stone 5c5a61
@@ -204,7 +204,7 @@ AcpiDmByteList (
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     ByteData = Op->Named.Data;
Al Stone 3df7a9
-    ByteCount = (UINT32) Op->Common.Value.Integer;
Al Stone 3df7a9
+    ByteCount = (UINT32) Op->Common.Value.Size;
Al Stone 3df7a9
 
Al Stone 3df7a9
     /*
Al Stone 3df7a9
      * The byte list belongs to a buffer, and can be produced by either
Al Stone 5c5a61
@@ -304,7 +304,8 @@ AcpiDmIsUuidBuffer (
Al Stone 3df7a9
     /* Extract the byte list info */
Al Stone 3df7a9
 
Al Stone 3df7a9
     ByteData = NextOp->Named.Data;
Al Stone 3df7a9
-    ByteCount = (UINT32) NextOp->Common.Value.Integer;
Al Stone 3df7a9
+    /* ByteCount = (UINT32) NextOp->Common.Value.Integer; */
Al Stone 3df7a9
+    ByteCount = (UINT32) NextOp->Common.Value.Size;
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Byte count must be exactly 16 */
Al Stone 3df7a9
 
Al Stone 5c5a61
@@ -424,7 +425,8 @@ AcpiDmIsUnicodeBuffer (
Al Stone ec8dd1
     /* Extract the byte list info */
Al Stone ec8dd1
 
Al Stone ec8dd1
     ByteData = NextOp->Named.Data;
Al Stone ec8dd1
-    ByteCount = (UINT32) NextOp->Common.Value.Integer;
Al Stone ec8dd1
+    /* ByteCount = (UINT32) NextOp->Common.Value.Integer; */
Al Stone ec8dd1
+    ByteCount = (UINT32) NextOp->Common.Value.Size;
Al Stone ec8dd1
     WordCount = ACPI_DIV_2 (ByteCount);
Al Stone ec8dd1
 
Al Stone ec8dd1
     /*
Al Stone 5c5a61
@@ -852,19 +854,22 @@ AcpiDmUnicode (
Al Stone ec8dd1
     UINT32                  WordCount;
Al Stone ec8dd1
     UINT32                  i;
Al Stone ec8dd1
     int                     OutputValue;
Al Stone ec8dd1
+    UINT16		    Tmp16;
Al Stone ec8dd1
 
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Extract the buffer info as a WORD buffer */
Al Stone ec8dd1
 
Al Stone ec8dd1
     WordData = ACPI_CAST_PTR (UINT16, Op->Named.Data);
Al Stone ec8dd1
-    WordCount = ACPI_DIV_2 (((UINT32) Op->Common.Value.Integer));
Al Stone ec8dd1
+    WordCount = ACPI_DIV_2 (((UINT32) Op->Common.Value.Size));
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Write every other byte as an ASCII character */
Al Stone ec8dd1
 
Al Stone ec8dd1
     AcpiOsPrintf ("\"");
Al Stone ec8dd1
     for (i = 0; i < (WordCount - 1); i++)
Al Stone ec8dd1
     {
Al Stone ec8dd1
-        OutputValue = (int) WordData[i];
Al Stone ec8dd1
+        /* OutputValue = (int) WordData[i]; */
Al Stone ec8dd1
+	ACPI_MOVE_16_TO_16(&Tmp16, &WordData[i]);
Al Stone ec8dd1
+	OutputValue = (int) Tmp16;
Al Stone ec8dd1
 
Al Stone ec8dd1
         /* Handle values that must be escaped */
Al Stone ec8dd1
 
Al Stone 5c5a61
@@ -973,16 +978,18 @@ AcpiDmCheckForHardwareId (
Al Stone 3df7a9
     ACPI_PARSE_OBJECT       *Op)
Al Stone 3df7a9
 {
Al Stone 3df7a9
     UINT32                  Name;
Al Stone 3df7a9
+    UINT32                  TmpName;
Al Stone 3df7a9
     ACPI_PARSE_OBJECT       *NextOp;
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Get the NameSegment */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    Name = AcpiPsGetName (Op);
Al Stone 3df7a9
-    if (!Name)
Al Stone 3df7a9
+    TmpName = AcpiPsGetName (Op);
Al Stone 3df7a9
+    if (!TmpName)
Al Stone 3df7a9
     {
Al Stone 3df7a9
         return;
Al Stone 3df7a9
     }
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Name, &TmpName);
Al Stone 3df7a9
 
Al Stone 3df7a9
     NextOp = AcpiPsGetDepthNext (NULL, Op);
Al Stone 3df7a9
     if (!NextOp)
Al Stone b0fde5
Index: acpica-unix2-20170531/source/components/disassembler/dmopcode.c
Al Stone 5c5a61
===================================================================
Al Stone b0fde5
--- acpica-unix2-20170531.orig/source/components/disassembler/dmopcode.c
Al Stone b0fde5
+++ acpica-unix2-20170531/source/components/disassembler/dmopcode.c
Al Stone b0fde5
@@ -244,6 +244,7 @@ AcpiDmPredefinedDescription (
Al Stone 3df7a9
     char                        *NameString;
Al Stone 3df7a9
     int                         LastCharIsDigit;
Al Stone 3df7a9
     int                         LastCharsAreHex;
Al Stone 3df7a9
+    char			TmpName[ACPI_NAME_SIZE + 1];
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 3df7a9
     if (!Op)
Al Stone b0fde5
@@ -261,7 +262,9 @@ AcpiDmPredefinedDescription (
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Predefined name must start with an underscore */
Al Stone 3df7a9
 
Al Stone 3df7a9
-    NameString = ACPI_CAST_PTR (char, &Op->Named.Name);
Al Stone 3df7a9
+    memset(TmpName, 0, ACPI_NAME_SIZE + 1);
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(TmpName, &Op->Named.Name);
Al Stone 3df7a9
+    NameString = TmpName;
Al Stone 3df7a9
     if (NameString[0] != '_')
Al Stone 3df7a9
     {
Al Stone 3df7a9
         return;
Al Stone b0fde5
@@ -875,25 +878,29 @@ AcpiDmDisassembleOneOp (
Al Stone 3df7a9
         AcpiDmNamestring (Op->Common.Value.Name);
Al Stone 3df7a9
         break;
Al Stone 3df7a9
 
Al Stone 3df7a9
-    case AML_INT_NAMEDFIELD_OP:
Al Stone 3df7a9
+    case AML_INT_NAMEDFIELD_OP: {
Al Stone 3df7a9
 
Al Stone 3df7a9
-        Length = AcpiDmDumpName (Op->Named.Name);
Al Stone 3df7a9
+	UINT32 TmpName;
Al Stone b0bee4
+
Al Stone b0bee4
+	ACPI_MOVE_32_TO_32(&TmpName, &Op->Named.Name);
Al Stone b0bee4
+        Length = AcpiDmDumpName (TmpName);
Al Stone 0a2fbe
 
Al Stone 0a2fbe
         AcpiOsPrintf (",");
Al Stone 0a2fbe
         ASL_CV_PRINT_ONE_COMMENT (Op, AML_NAMECOMMENT, NULL, 0);
Al Stone 0a2fbe
         AcpiOsPrintf ("%*.s  %u", (unsigned) (5 - Length), " ",
Al Stone 3df7a9
-            (UINT32) Op->Common.Value.Integer);
Al Stone 3df7a9
+            (UINT32) Op->Common.Value.Size);
Al Stone 0a2fbe
 
Al Stone 3df7a9
         AcpiDmCommaIfFieldMember (Op);
Al Stone 3df7a9
 
Al Stone 3df7a9
-        Info->BitOffset += (UINT32) Op->Common.Value.Integer;
Al Stone 3df7a9
+        Info->BitOffset += (UINT32) Op->Common.Value.Size;
Al Stone 3df7a9
         break;
Al Stone 544060
+    }
Al Stone 3df7a9
 
Al Stone 3df7a9
     case AML_INT_RESERVEDFIELD_OP:
Al Stone 3df7a9
 
Al Stone 3df7a9
         /* Offset() -- Must account for previous offsets */
Al Stone 3df7a9
 
Al Stone 3df7a9
-        Offset = (UINT32) Op->Common.Value.Integer;
Al Stone 3df7a9
+        Offset = Op->Common.Value.Size;
Al Stone 3df7a9
         Info->BitOffset += Offset;
Al Stone 3df7a9
 
Al Stone 3df7a9
         if (Info->BitOffset % 8 == 0)
Al Stone b0fde5
Index: acpica-unix2-20170531/source/components/disassembler/dmresrcl2.c
Al Stone 5c5a61
===================================================================
Al Stone b0fde5
--- acpica-unix2-20170531.orig/source/components/disassembler/dmresrcl2.c
Al Stone b0fde5
+++ acpica-unix2-20170531/source/components/disassembler/dmresrcl2.c
Al Stone 5c5a61
@@ -191,22 +191,24 @@ AcpiDmGpioCommon (
Al Stone ec8dd1
     char                    *DeviceName = NULL;
Al Stone ec8dd1
     UINT32                  PinCount;
Al Stone ec8dd1
     UINT32                  i;
Al Stone ec8dd1
+    UINT16		    Tmp16;
Al Stone ec8dd1
 
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* ResourceSource, ResourceSourceIndex, ResourceType */
Al Stone ec8dd1
 
Al Stone ec8dd1
     AcpiDmIndent (Level + 1);
Al Stone ec8dd1
-    if (Resource->Gpio.ResSourceOffset)
Al Stone ec8dd1
+    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.ResSourceOffset);
Al Stone ec8dd1
+    if (Tmp16)
Al Stone ec8dd1
     {
Al Stone ec8dd1
-        DeviceName = ACPI_ADD_PTR (char,
Al Stone ec8dd1
-            Resource, Resource->Gpio.ResSourceOffset),
Al Stone ec8dd1
+        DeviceName = ACPI_ADD_PTR (char, Resource, Tmp16),
Al Stone ec8dd1
         AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
Al Stone ec8dd1
     }
Al Stone ec8dd1
 
Al Stone ec8dd1
     AcpiOsPrintf (", ");
Al Stone ec8dd1
     AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.ResSourceIndex);
Al Stone ec8dd1
+    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.Flags);
Al Stone ec8dd1
     AcpiOsPrintf ("%s, ",
Al Stone ec8dd1
-        AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.Flags)]);
Al Stone ec8dd1
+        AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Tmp16)]);
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Insert a descriptor name */
Al Stone ec8dd1
 
Al Stone 5c5a61
@@ -215,15 +217,16 @@ AcpiDmGpioCommon (
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Dump the vendor data */
Al Stone ec8dd1
 
Al Stone ec8dd1
-    if (Resource->Gpio.VendorOffset)
Al Stone ec8dd1
+    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.VendorOffset);
Al Stone ec8dd1
+    if (Tmp16)
Al Stone ec8dd1
     {
Al Stone ec8dd1
         AcpiOsPrintf ("\n");
Al Stone ec8dd1
         AcpiDmIndent (Level + 1);
Al Stone ec8dd1
-        VendorData = ACPI_ADD_PTR (UINT8, Resource,
Al Stone ec8dd1
-            Resource->Gpio.VendorOffset);
Al Stone ec8dd1
+	ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.VendorOffset);
Al Stone ec8dd1
+        VendorData = ACPI_ADD_PTR (UINT8, Resource, Tmp16);
Al Stone ec8dd1
 
Al Stone ec8dd1
-        AcpiDmDumpRawDataBuffer (VendorData,
Al Stone ec8dd1
-            Resource->Gpio.VendorLength, Level);
Al Stone ec8dd1
+	ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.VendorLength);
Al Stone ec8dd1
+        AcpiDmDumpRawDataBuffer (VendorData, Tmp16, Level);
Al Stone ec8dd1
     }
Al Stone ec8dd1
 
Al Stone ec8dd1
     AcpiOsPrintf (")\n");
Al Stone 5c5a61
@@ -233,17 +236,25 @@ AcpiDmGpioCommon (
Al Stone ec8dd1
     AcpiDmIndent (Level + 1);
Al Stone ec8dd1
     AcpiOsPrintf ("{   // Pin list\n");
Al Stone ec8dd1
 
Al Stone ec8dd1
+    /*
Al Stone ec8dd1
     PinCount = ((UINT32) (Resource->Gpio.ResSourceOffset -
Al Stone ec8dd1
         Resource->Gpio.PinTableOffset)) /
Al Stone ec8dd1
         sizeof (UINT16);
Al Stone ec8dd1
+    */
Al Stone ec8dd1
+    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.ResSourceOffset);
Al Stone ec8dd1
+    PinCount = (UINT32) Tmp16;
Al Stone ec8dd1
+    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.PinTableOffset);
Al Stone ec8dd1
+    PinCount -= (UINT32) Tmp16;
Al Stone ec8dd1
+    PinCount /= sizeof (UINT16);
Al Stone ec8dd1
 
Al Stone ec8dd1
-    PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
Al Stone ec8dd1
-        Resource->Gpio.PinTableOffset);
Al Stone ec8dd1
+    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.PinTableOffset);
Al Stone ec8dd1
+    PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource, Tmp16);
Al Stone ec8dd1
 
Al Stone ec8dd1
     for (i = 0; i < PinCount; i++)
Al Stone ec8dd1
     {
Al Stone ec8dd1
         AcpiDmIndent (Level + 2);
Al Stone ec8dd1
-        AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
Al Stone ec8dd1
+	ACPI_MOVE_16_TO_16(&Tmp16, &PinList[i]);
Al Stone ec8dd1
+        AcpiOsPrintf ("0x%4.4X%s\n", Tmp16,
Al Stone ec8dd1
             ((i + 1) < PinCount) ? "," : "");
Al Stone ec8dd1
     }
Al Stone ec8dd1
 
Al Stone 5c5a61
@@ -277,16 +288,18 @@ AcpiDmGpioIntDescriptor (
Al Stone ec8dd1
     UINT32                  Length,
Al Stone ec8dd1
     UINT32                  Level)
Al Stone ec8dd1
 {
Al Stone ec8dd1
+    UINT16		    Tmp16;
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Dump the GpioInt-specific portion of the descriptor */
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* EdgeLevel, ActiveLevel, Shared */
Al Stone ec8dd1
 
Al Stone ec8dd1
     AcpiDmIndent (Level);
Al Stone ec8dd1
+    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.IntFlags);
Al Stone ec8dd1
     AcpiOsPrintf ("GpioInt (%s, %s, %s, ",
Al Stone ec8dd1
-        AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.IntFlags)],
Al Stone ec8dd1
-        AcpiGbl_LlDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 1)],
Al Stone ec8dd1
-        AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
Al Stone ec8dd1
+        AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Tmp16)],
Al Stone ec8dd1
+        AcpiGbl_LlDecode [ACPI_EXTRACT_2BIT_FLAG (Tmp16, 1)],
Al Stone ec8dd1
+        AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Tmp16, 3)]);
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* PinConfig, DebounceTimeout */
Al Stone ec8dd1
 
Al Stone 5c5a61
@@ -299,7 +312,8 @@ AcpiDmGpioIntDescriptor (
Al Stone ec8dd1
     {
Al Stone ec8dd1
         AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig);
Al Stone ec8dd1
     }
Al Stone ec8dd1
-    AcpiOsPrintf ("0x%4.4X,\n", Resource->Gpio.DebounceTimeout);
Al Stone ec8dd1
+    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.DebounceTimeout);
Al Stone ec8dd1
+    AcpiOsPrintf ("0x%4.4X,\n", Tmp16);
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Dump the GpioInt/GpioIo common portion of the descriptor */
Al Stone ec8dd1
 
Al Stone 5c5a61
@@ -329,14 +343,16 @@ AcpiDmGpioIoDescriptor (
Al Stone ec8dd1
     UINT32                  Length,
Al Stone ec8dd1
     UINT32                  Level)
Al Stone ec8dd1
 {
Al Stone ec8dd1
+    UINT16		    Tmp16;
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Dump the GpioIo-specific portion of the descriptor */
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Shared, PinConfig */
Al Stone ec8dd1
 
Al Stone ec8dd1
     AcpiDmIndent (Level);
Al Stone ec8dd1
+    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.IntFlags);
Al Stone ec8dd1
     AcpiOsPrintf ("GpioIo (%s, ",
Al Stone ec8dd1
-        AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
Al Stone ec8dd1
+        AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Tmp16, 3)]);
Al Stone ec8dd1
 
Al Stone ec8dd1
     if (Resource->Gpio.PinConfig <= 3)
Al Stone ec8dd1
     {
Al Stone 5c5a61
@@ -350,10 +366,13 @@ AcpiDmGpioIoDescriptor (
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* DebounceTimeout, DriveStrength, IoRestriction */
Al Stone ec8dd1
 
Al Stone ec8dd1
-    AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DebounceTimeout);
Al Stone ec8dd1
-    AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DriveStrength);
Al Stone ec8dd1
+    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.DebounceTimeout);
Al Stone ec8dd1
+    AcpiOsPrintf ("0x%4.4X, ", Tmp16);
Al Stone ec8dd1
+    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.DriveStrength);
Al Stone ec8dd1
+    AcpiOsPrintf ("0x%4.4X, ", Tmp16);
Al Stone ec8dd1
+    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Gpio.IntFlags);
Al Stone ec8dd1
     AcpiOsPrintf ("%s,\n",
Al Stone ec8dd1
-        AcpiGbl_IorDecode [ACPI_GET_2BIT_FLAG (Resource->Gpio.IntFlags)]);
Al Stone ec8dd1
+        AcpiGbl_IorDecode [ACPI_GET_2BIT_FLAG (Tmp16)]);
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Dump the GpioInt/GpioIo common portion of the descriptor */
Al Stone ec8dd1
 
Al Stone b0fde5
@@ -533,6 +552,7 @@ AcpiDmDumpSerialBusVendorData (
Al Stone ec8dd1
 {
Al Stone ec8dd1
     UINT8                   *VendorData;
Al Stone ec8dd1
     UINT32                  VendorLength;
Al Stone ec8dd1
+    UINT16                  Tmp16;
Al Stone ec8dd1
 
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Get the (optional) vendor data and length */
Al Stone b0fde5
@@ -541,8 +561,8 @@ AcpiDmDumpSerialBusVendorData (
Al Stone ec8dd1
     {
Al Stone ec8dd1
     case AML_RESOURCE_I2C_SERIALBUSTYPE:
Al Stone ec8dd1
 
Al Stone ec8dd1
-        VendorLength = Resource->CommonSerialBus.TypeDataLength -
Al Stone ec8dd1
-            AML_RESOURCE_I2C_MIN_DATA_LEN;
Al Stone ec8dd1
+	ACPI_MOVE_16_TO_16(&Tmp16, &Resource->CommonSerialBus.TypeDataLength);
Al Stone ec8dd1
+        VendorLength = Tmp16 - AML_RESOURCE_I2C_MIN_DATA_LEN;
Al Stone ec8dd1
 
Al Stone ec8dd1
         VendorData = ACPI_ADD_PTR (UINT8, Resource,
Al Stone ec8dd1
             sizeof (AML_RESOURCE_I2C_SERIALBUS));
Al Stone b0fde5
@@ -550,8 +570,8 @@ AcpiDmDumpSerialBusVendorData (
Al Stone ec8dd1
 
Al Stone ec8dd1
     case AML_RESOURCE_SPI_SERIALBUSTYPE:
Al Stone ec8dd1
 
Al Stone ec8dd1
-        VendorLength = Resource->CommonSerialBus.TypeDataLength -
Al Stone ec8dd1
-            AML_RESOURCE_SPI_MIN_DATA_LEN;
Al Stone ec8dd1
+	ACPI_MOVE_16_TO_16(&Tmp16, &Resource->CommonSerialBus.TypeDataLength);
Al Stone ec8dd1
+        VendorLength = Tmp16 - AML_RESOURCE_SPI_MIN_DATA_LEN;
Al Stone ec8dd1
 
Al Stone ec8dd1
         VendorData = ACPI_ADD_PTR (UINT8, Resource,
Al Stone ec8dd1
             sizeof (AML_RESOURCE_SPI_SERIALBUS));
Al Stone b0fde5
@@ -559,8 +579,8 @@ AcpiDmDumpSerialBusVendorData (
Al Stone ec8dd1
 
Al Stone ec8dd1
     case AML_RESOURCE_UART_SERIALBUSTYPE:
Al Stone ec8dd1
 
Al Stone ec8dd1
-        VendorLength = Resource->CommonSerialBus.TypeDataLength -
Al Stone ec8dd1
-            AML_RESOURCE_UART_MIN_DATA_LEN;
Al Stone ec8dd1
+	ACPI_MOVE_16_TO_16(&Tmp16, &Resource->CommonSerialBus.TypeDataLength);
Al Stone ec8dd1
+        VendorLength = Tmp16 - AML_RESOURCE_UART_MIN_DATA_LEN;
Al Stone ec8dd1
 
Al Stone ec8dd1
         VendorData = ACPI_ADD_PTR (UINT8, Resource,
Al Stone ec8dd1
             sizeof (AML_RESOURCE_UART_SERIALBUS));
Al Stone b0fde5
@@ -601,15 +621,19 @@ AcpiDmI2cSerialBusDescriptor (
Al Stone ec8dd1
 {
Al Stone ec8dd1
     UINT32                  ResourceSourceOffset;
Al Stone ec8dd1
     char                    *DeviceName;
Al Stone ec8dd1
+    UINT16		    Tmp16;
Al Stone ec8dd1
+    UINT32		    Tmp32;
Al Stone ec8dd1
 
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* SlaveAddress, SlaveMode, ConnectionSpeed, AddressingMode */
Al Stone ec8dd1
 
Al Stone ec8dd1
+    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->I2cSerialBus.SlaveAddress);
Al Stone ec8dd1
+    ACPI_MOVE_32_TO_32(&Tmp32, &Resource->I2cSerialBus.ConnectionSpeed);
Al Stone ec8dd1
     AcpiDmIndent (Level);
Al Stone ec8dd1
     AcpiOsPrintf ("I2cSerialBusV2 (0x%4.4X, %s, 0x%8.8X,\n",
Al Stone ec8dd1
-        Resource->I2cSerialBus.SlaveAddress,
Al Stone ec8dd1
+        Tmp16,
Al Stone ec8dd1
         AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.Flags)],
Al Stone ec8dd1
-        Resource->I2cSerialBus.ConnectionSpeed);
Al Stone ec8dd1
+        Tmp32);
Al Stone ec8dd1
 
Al Stone ec8dd1
     AcpiDmIndent (Level + 1);
Al Stone ec8dd1
     AcpiOsPrintf ("%s, ",
Al Stone b0fde5
@@ -617,8 +641,8 @@ AcpiDmI2cSerialBusDescriptor (
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* ResourceSource is a required field */
Al Stone ec8dd1
 
Al Stone ec8dd1
-    ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
Al Stone ec8dd1
-        Resource->CommonSerialBus.TypeDataLength;
Al Stone ec8dd1
+    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->CommonSerialBus.TypeDataLength);
Al Stone ec8dd1
+    ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) + Tmp16;
Al Stone ec8dd1
 
Al Stone ec8dd1
     DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
Al Stone ec8dd1
     AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
Al Stone b0fde5
Index: acpica-unix2-20170531/source/components/disassembler/dmresrcl.c
Al Stone 5c5a61
===================================================================
Al Stone b0fde5
--- acpica-unix2-20170531.orig/source/components/disassembler/dmresrcl.c
Al Stone b0fde5
+++ acpica-unix2-20170531/source/components/disassembler/dmresrcl.c
Al Stone 5c5a61
@@ -141,7 +141,8 @@ AcpiDmMemoryFields (
Al Stone 3df7a9
     UINT32                  Level)
Al Stone 3df7a9
 {
Al Stone 3df7a9
     UINT32                  i;
Al Stone 3df7a9
-
Al Stone 3df7a9
+    UINT16		    Tmp16;
Al Stone 3df7a9
+    UINT32		    Tmp32;
Al Stone 3df7a9
 
Al Stone 3df7a9
     for (i = 0; i < 4; i++)
Al Stone 3df7a9
     {
Al Stone 5c5a61
@@ -151,14 +152,14 @@ AcpiDmMemoryFields (
Al Stone 3df7a9
         {
Al Stone 3df7a9
         case 16:
Al Stone 3df7a9
 
Al Stone 3df7a9
-            AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i],
Al Stone 3df7a9
-                AcpiDmMemoryNames[i]);
Al Stone 3df7a9
+	    ACPI_MOVE_16_TO_16(&Tmp16, &(ACPI_CAST_PTR (UINT16, Source)[i]));
Al Stone 3df7a9
+            AcpiDmDumpInteger16 (Tmp16, AcpiDmMemoryNames[i]);
Al Stone 3df7a9
             break;
Al Stone 3df7a9
 
Al Stone 3df7a9
         case 32:
Al Stone 3df7a9
 
Al Stone 3df7a9
-            AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i],
Al Stone 3df7a9
-                AcpiDmMemoryNames[i]);
Al Stone 3df7a9
+	    ACPI_MOVE_32_TO_32(&Tmp32, &(ACPI_CAST_PTR (UINT32, Source)[i]));
Al Stone 3df7a9
+            AcpiDmDumpInteger32 (Tmp32, AcpiDmMemoryNames[i]);
Al Stone 3df7a9
             break;
Al Stone 3df7a9
 
Al Stone 3df7a9
         default:
Al Stone 5c5a61
@@ -190,7 +191,9 @@ AcpiDmAddressFields (
Al Stone 3df7a9
     UINT32                  Level)
Al Stone 3df7a9
 {
Al Stone 3df7a9
     UINT32                  i;
Al Stone 3df7a9
-
Al Stone 3df7a9
+    UINT16		    Tmp16;
Al Stone 3df7a9
+    UINT32		    Tmp32;
Al Stone 3df7a9
+    UINT64		    Tmp64;
Al Stone 3df7a9
 
Al Stone 3df7a9
     AcpiOsPrintf ("\n");
Al Stone 3df7a9
 
Al Stone 5c5a61
@@ -202,20 +205,20 @@ AcpiDmAddressFields (
Al Stone 3df7a9
         {
Al Stone 3df7a9
         case 16:
Al Stone 3df7a9
 
Al Stone 3df7a9
-            AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i],
Al Stone 3df7a9
-                AcpiDmAddressNames[i]);
Al Stone 3df7a9
+	    ACPI_MOVE_16_TO_16(&Tmp16, &(ACPI_CAST_PTR (UINT16, Source)[i]));
Al Stone 3df7a9
+            AcpiDmDumpInteger16 (Tmp16, AcpiDmAddressNames[i]);
Al Stone 3df7a9
             break;
Al Stone 3df7a9
 
Al Stone 3df7a9
         case 32:
Al Stone 3df7a9
 
Al Stone 3df7a9
-            AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i],
Al Stone 3df7a9
-                AcpiDmAddressNames[i]);
Al Stone 3df7a9
+	    ACPI_MOVE_32_TO_32(&Tmp32, &(ACPI_CAST_PTR (UINT32, Source)[i]));
Al Stone 3df7a9
+            AcpiDmDumpInteger32 (Tmp32, AcpiDmAddressNames[i]);
Al Stone 3df7a9
             break;
Al Stone 3df7a9
 
Al Stone 3df7a9
         case 64:
Al Stone 3df7a9
 
Al Stone 3df7a9
-            AcpiDmDumpInteger64 (ACPI_CAST_PTR (UINT64, Source)[i],
Al Stone 3df7a9
-                AcpiDmAddressNames[i]);
Al Stone 3df7a9
+	    ACPI_MOVE_64_TO_64(&Tmp64, &(ACPI_CAST_PTR (UINT64, Source)[i]));
Al Stone 3df7a9
+            AcpiDmDumpInteger64 (Tmp64, AcpiDmAddressNames[i]);
Al Stone 3df7a9
             break;
Al Stone 3df7a9
 
Al Stone 3df7a9
         default:
Al Stone 5c5a61
@@ -868,6 +871,7 @@ AcpiDmFixedMemory32Descriptor (
Al Stone 3df7a9
     UINT32                  Length,
Al Stone 3df7a9
     UINT32                  Level)
Al Stone 3df7a9
 {
Al Stone 3df7a9
+    UINT32 Tmp;
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Dump name and read/write flag */
Al Stone 3df7a9
 
Al Stone 5c5a61
@@ -876,12 +880,12 @@ AcpiDmFixedMemory32Descriptor (
Al Stone 3df7a9
         AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->FixedMemory32.Flags)]);
Al Stone 3df7a9
 
Al Stone 3df7a9
     AcpiDmIndent (Level + 1);
Al Stone 3df7a9
-    AcpiDmDumpInteger32 (Resource->FixedMemory32.Address,
Al Stone 3df7a9
-        "Address Base");
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Tmp, &Resource->FixedMemory32.Address);
Al Stone 3df7a9
+    AcpiDmDumpInteger32 (Tmp, "Address Base");
Al Stone 3df7a9
 
Al Stone 3df7a9
     AcpiDmIndent (Level + 1);
Al Stone 3df7a9
-    AcpiDmDumpInteger32 (Resource->FixedMemory32.AddressLength,
Al Stone 3df7a9
-        "Address Length");
Al Stone 3df7a9
+    ACPI_MOVE_32_TO_32(&Tmp, &Resource->FixedMemory32.AddressLength);
Al Stone 3df7a9
+    AcpiDmDumpInteger32 (Tmp, "Address Length");
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Insert a descriptor name */
Al Stone 3df7a9
 
Al Stone 5c5a61
@@ -913,6 +917,7 @@ AcpiDmGenericRegisterDescriptor (
Al Stone ec8dd1
     UINT32                  Length,
Al Stone ec8dd1
     UINT32                  Level)
Al Stone ec8dd1
 {
Al Stone ec8dd1
+    UINT64		    Tmp64;
Al Stone ec8dd1
 
Al Stone ec8dd1
     AcpiDmIndent (Level);
Al Stone ec8dd1
     AcpiOsPrintf ("Register (");
Al Stone 5c5a61
@@ -926,7 +931,9 @@ AcpiDmGenericRegisterDescriptor (
Al Stone ec8dd1
     AcpiDmDumpInteger8 (Resource->GenericReg.BitOffset, "Bit Offset");
Al Stone ec8dd1
 
Al Stone ec8dd1
     AcpiDmIndent (Level + 1);
Al Stone ec8dd1
-    AcpiDmDumpInteger64 (Resource->GenericReg.Address, "Address");
Al Stone ec8dd1
+    /* AcpiDmDumpInteger64 (Resource->GenericReg.Address, "Address"); */
Al Stone ec8dd1
+    ACPI_MOVE_64_TO_64(&Tmp64, &Resource->GenericReg.Address);
Al Stone ec8dd1
+    AcpiDmDumpInteger64 (Tmp64, "Address");
Al Stone ec8dd1
 
Al Stone ec8dd1
     /* Optional field for ACPI 3.0 */
Al Stone ec8dd1
 
Al Stone 5c5a61
@@ -972,7 +979,7 @@ AcpiDmInterruptDescriptor (
Al Stone 3df7a9
     UINT32                  Level)
Al Stone 3df7a9
 {
Al Stone 3df7a9
     UINT32                  i;
Al Stone 3df7a9
-
Al Stone 3df7a9
+    UINT16		    Tmp16;
Al Stone 3df7a9
 
Al Stone 3df7a9
     AcpiDmIndent (Level);
Al Stone 3df7a9
     AcpiOsPrintf ("Interrupt (%s, %s, %s, %s, ",
Al Stone 5c5a61
@@ -986,10 +993,11 @@ AcpiDmInterruptDescriptor (
Al Stone 3df7a9
      * list. Must compute length based on length of the list. First xrupt
Al Stone 3df7a9
      * is included in the struct (reason for -1 below)
Al Stone 3df7a9
      */
Al Stone 3df7a9
+    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->ExtendedIrq.ResourceLength);
Al Stone 3df7a9
     AcpiDmResourceSource (Resource,
Al Stone 3df7a9
         sizeof (AML_RESOURCE_EXTENDED_IRQ) +
Al Stone 3df7a9
             ((UINT32) Resource->ExtendedIrq.InterruptCount - 1) * sizeof (UINT32),
Al Stone 3df7a9
-        Resource->ExtendedIrq.ResourceLength);
Al Stone 3df7a9
+        Tmp16);
Al Stone 3df7a9
 
Al Stone 3df7a9
     /* Insert a descriptor name */
Al Stone 3df7a9
 
Al Stone 5c5a61
@@ -1002,9 +1010,12 @@ AcpiDmInterruptDescriptor (
Al Stone 3df7a9
     AcpiOsPrintf ("{\n");
Al Stone 3df7a9
     for (i = 0; i < Resource->ExtendedIrq.InterruptCount; i++)
Al Stone 3df7a9
     {
Al Stone 3df7a9
+	UINT32 Tmp32, Val32;
Al Stone 3df7a9
+
Al Stone 3df7a9
         AcpiDmIndent (Level + 1);
Al Stone 3df7a9
-        AcpiOsPrintf ("0x%8.8X,\n",
Al Stone 3df7a9
-            (UINT32) Resource->ExtendedIrq.Interrupts[i]);
Al Stone 3df7a9
+	Val32 = (UINT32) Resource->ExtendedIrq.Interrupts[i];
Al Stone 3df7a9
+	ACPI_MOVE_32_TO_32(&Tmp32, &Val32);
Al Stone 3df7a9
+        AcpiOsPrintf ("0x%8.8X,\n", Tmp32);
Al Stone 3df7a9
     }
Al Stone 3df7a9
 
Al Stone 3df7a9
     AcpiDmIndent (Level);
Al Stone b0fde5
Index: acpica-unix2-20170531/source/components/disassembler/dmresrcs.c
Al Stone 5c5a61
===================================================================
Al Stone b0fde5
--- acpica-unix2-20170531.orig/source/components/disassembler/dmresrcs.c
Al Stone b0fde5
+++ acpica-unix2-20170531/source/components/disassembler/dmresrcs.c
Al Stone 5c5a61
@@ -72,6 +72,7 @@ AcpiDmIrqDescriptor (
Al Stone 3df7a9
     UINT32                  Length,
Al Stone 3df7a9
     UINT32                  Level)
Al Stone 3df7a9
 {
Al Stone 3df7a9
+    UINT16 Tmp;
Al Stone 3df7a9
 
Al Stone 3df7a9
     AcpiDmIndent (Level);
Al Stone 3df7a9
     AcpiOsPrintf ("%s (",
Al Stone 5c5a61
@@ -93,7 +94,8 @@ AcpiDmIrqDescriptor (
Al Stone 3df7a9
     AcpiOsPrintf (")\n");
Al Stone 3df7a9
 
Al Stone 3df7a9
     AcpiDmIndent (Level + 1);
Al Stone 3df7a9
-    AcpiDmBitList (Resource->Irq.IrqMask);
Al Stone 3df7a9
+    ACPI_MOVE_16_TO_16(&Tmp, &Resource->Irq.IrqMask);
Al Stone 3df7a9
+    AcpiDmBitList (Tmp);
Al Stone 3df7a9
 }
Al Stone 3df7a9
 
Al Stone 3df7a9
 
Al Stone 5c5a61
@@ -204,16 +206,19 @@ AcpiDmIoDescriptor (
Al Stone 3df7a9
     UINT32                  Length,
Al Stone 3df7a9
     UINT32                  Level)
Al Stone 3df7a9
 {
Al Stone 3df7a9
+    UINT16 Tmp16;
Al Stone 3df7a9
 
Al Stone 3df7a9
     AcpiDmIndent (Level);
Al Stone 3df7a9
     AcpiOsPrintf ("IO (%s,\n",
Al Stone 3df7a9
         AcpiGbl_IoDecode [ACPI_GET_1BIT_FLAG (Resource->Io.Flags)]);
Al Stone 3df7a9
 
Al Stone 3df7a9
     AcpiDmIndent (Level + 1);
Al Stone 3df7a9
-    AcpiDmDumpInteger16 (Resource->Io.Minimum, "Range Minimum");
Al Stone 3df7a9
+    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Io.Minimum);
Al Stone 3df7a9
+    AcpiDmDumpInteger16 (Tmp16, "Range Minimum");
Al Stone 3df7a9
 
Al Stone 3df7a9
     AcpiDmIndent (Level + 1);
Al Stone 3df7a9
-    AcpiDmDumpInteger16 (Resource->Io.Maximum, "Range Maximum");
Al Stone 3df7a9
+    ACPI_MOVE_16_TO_16(&Tmp16, &Resource->Io.Maximum);
Al Stone 3df7a9
+    AcpiDmDumpInteger16 (Tmp16, "Range Maximum");
Al Stone 3df7a9
 
Al Stone 3df7a9
     AcpiDmIndent (Level + 1);
Al Stone 3df7a9
     AcpiDmDumpInteger8 (Resource->Io.Alignment, "Alignment");
Al Stone 5c5a61
@@ -251,12 +256,14 @@ AcpiDmFixedIoDescriptor (
Al Stone ec8dd1
     UINT32                  Length,
Al Stone ec8dd1
     UINT32                  Level)
Al Stone ec8dd1
 {
Al Stone ec8dd1
+    UINT16                  Tmp16;
Al Stone ec8dd1
 
Al Stone ec8dd1
     AcpiDmIndent (Level);
Al Stone ec8dd1
     AcpiOsPrintf ("FixedIO (\n");
Al Stone