Blame SOURCES/debian-big_endian.patch

fa2344
diff --git a/source/compiler/aslcodegen.c b/source/compiler/aslcodegen.c
fa2344
index 30e7984..89433b9 100644
fa2344
--- a/source/compiler/aslcodegen.c
fa2344
+++ b/source/compiler/aslcodegen.c
fa2344
@@ -243,16 +243,12 @@ CgWriteAmlOpcode (
fa2344
     ACPI_PARSE_OBJECT       *Op)
fa2344
 {
fa2344
     UINT8                   PkgLenFirstByte;
fa2344
-    UINT32                  i;
fa2344
-    union {
fa2344
-        UINT16                  Opcode;
fa2344
-        UINT8                   OpcodeBytes[2];
fa2344
-    } Aml;
fa2344
-    union {
fa2344
-        UINT32                  Len;
fa2344
-        UINT8                   LenBytes[4];
fa2344
-    } PkgLen;
fa2344
-
fa2344
+    UINT8                   Byte;
fa2344
+    UINT16                  Word;
fa2344
+    UINT32                  DWord;
fa2344
+    UINT64                  QWord;
fa2344
+    UINT16                  AmlOpcode;
fa2344
+    UINT32                  PkgLen;
fa2344
 
fa2344
     /* We expect some DEFAULT_ARGs, just ignore them */
fa2344
 
fa2344
@@ -276,51 +272,52 @@ CgWriteAmlOpcode (
fa2344
 
fa2344
         /* Special opcodes for within a field definition */
fa2344
 
fa2344
-        Aml.Opcode = AML_FIELD_OFFSET_OP;
fa2344
+        AmlOpcode = AML_FIELD_OFFSET_OP;
fa2344
         break;
fa2344
 
fa2344
     case AML_INT_ACCESSFIELD_OP:
fa2344
 
fa2344
-        Aml.Opcode = AML_FIELD_ACCESS_OP;
fa2344
+        AmlOpcode = AML_FIELD_ACCESS_OP;
fa2344
         break;
fa2344
 
fa2344
     case AML_INT_CONNECTION_OP:
fa2344
 
fa2344
-        Aml.Opcode = AML_FIELD_CONNECTION_OP;
fa2344
+        AmlOpcode = AML_FIELD_CONNECTION_OP;
fa2344
         break;
fa2344
 
fa2344
     default:
fa2344
 
fa2344
-        Aml.Opcode = Op->Asl.AmlOpcode;
fa2344
+        AmlOpcode = Op->Asl.AmlOpcode;
fa2344
         break;
fa2344
     }
fa2344
 
fa2344
 
fa2344
-    switch (Aml.Opcode)
fa2344
+    switch (AmlOpcode)
fa2344
     {
fa2344
     case AML_PACKAGE_LENGTH:
fa2344
 
fa2344
         /* Value is the length to be encoded (Used in field definitions) */
fa2344
 
fa2344
-        PkgLen.Len = (UINT32) Op->Asl.Value.Integer;
fa2344
+        PkgLen = (UINT32) Op->Asl.Value.Integer;
fa2344
         break;
fa2344
 
fa2344
     default:
fa2344
 
fa2344
         /* Check for two-byte opcode */
fa2344
 
fa2344
-        if (Aml.Opcode > 0x00FF)
fa2344
+        if (AmlOpcode > 0x00FF)
fa2344
         {
fa2344
             /* Write the high byte first */
fa2344
-
fa2344
-            CgLocalWriteAmlData (Op, &Aml.OpcodeBytes[1], 1);
fa2344
+	    Byte = ACPI_HIBYTE(AmlOpcode);
fa2344
+	    CgLocalWriteAmlData (Op, &Byte, 1);
fa2344
         }
fa2344
 
fa2344
-        CgLocalWriteAmlData (Op, &Aml.OpcodeBytes[0], 1);
fa2344
+	Byte = ACPI_LOBYTE(AmlOpcode);
fa2344
+        CgLocalWriteAmlData (Op, &Byte, 1);
fa2344
 
fa2344
         /* Subtreelength doesn't include length of package length bytes */
fa2344
 
fa2344
-        PkgLen.Len = Op->Asl.AmlSubtreeLength + Op->Asl.AmlPkgLenBytes;
fa2344
+        PkgLen = Op->Asl.AmlSubtreeLength + Op->Asl.AmlPkgLenBytes;
fa2344
         break;
fa2344
     }
fa2344
 
fa2344
@@ -331,8 +328,8 @@ CgWriteAmlOpcode (
fa2344
         if (Op->Asl.AmlPkgLenBytes == 1)
fa2344
         {
fa2344
             /* Simplest case -- no bytes to follow, just write the count */
fa2344
-
fa2344
-            CgLocalWriteAmlData (Op, &PkgLen.LenBytes[0], 1);
fa2344
+            Byte = ACPI_LOBYTE(PkgLen);
fa2344
+            CgLocalWriteAmlData (Op, &Byte, 1);
fa2344
         }
fa2344
         else if (Op->Asl.AmlPkgLenBytes != 0)
fa2344
         {
fa2344
@@ -342,7 +339,7 @@ CgWriteAmlOpcode (
fa2344
              */
fa2344
             PkgLenFirstByte = (UINT8)
fa2344
                 (((UINT32) (Op->Asl.AmlPkgLenBytes - 1) << 6) |
fa2344
-                (PkgLen.LenBytes[0] & 0x0F));
fa2344
+                (PkgLen & 0x0F));
fa2344
 
fa2344
             CgLocalWriteAmlData (Op, &PkgLenFirstByte, 1);
fa2344
 
fa2344
@@ -350,39 +347,47 @@ CgWriteAmlOpcode (
fa2344
              * Shift the length over by the 4 bits we just stuffed
fa2344
              * in the first byte
fa2344
              */
fa2344
-            PkgLen.Len >>= 4;
fa2344
+            PkgLen >>= 4;
fa2344
 
fa2344
             /*
fa2344
              * Now we can write the remaining bytes -
fa2344
              * either 1, 2, or 3 bytes
fa2344
              */
fa2344
-            for (i = 0; i < (UINT32) (Op->Asl.AmlPkgLenBytes - 1); i++)
fa2344
+            Byte = ACPI_LOBYTE(PkgLen);
fa2344
+            CgLocalWriteAmlData (Op, &Byte, 1);
fa2344
+            if (Op->Asl.AmlPkgLenBytes >= 3)
fa2344
+            {
fa2344
+                Byte = ACPI_HIBYTE(PkgLen);
fa2344
+                CgLocalWriteAmlData (Op, &Byte, 1);
fa2344
+            }
fa2344
+            if (Op->Asl.AmlPkgLenBytes >= 4)
fa2344
             {
fa2344
-                CgLocalWriteAmlData (Op, &PkgLen.LenBytes[i], 1);
fa2344
+                Byte = ACPI_LOBYTE(ACPI_HIWORD(PkgLen));
fa2344
+                CgLocalWriteAmlData (Op, &Byte, 1);
fa2344
             }
fa2344
         }
fa2344
     }
fa2344
 
fa2344
-    switch (Aml.Opcode)
fa2344
+    switch (AmlOpcode)
fa2344
     {
fa2344
     case AML_BYTE_OP:
fa2344
-
fa2344
-        CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 1);
fa2344
+        Byte = (UINT8) Op->Asl.Value.Integer;
fa2344
+        CgLocalWriteAmlData (Op, &Byte, 1);
fa2344
         break;
fa2344
 
fa2344
     case AML_WORD_OP:
fa2344
-
fa2344
-        CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 2);
fa2344
+        ACPI_MOVE_64_TO_16(&Word, &Op->Asl.Value.Integer);
fa2344
+        CgLocalWriteAmlData (Op, &Word, 2);
fa2344
        break;
fa2344
 
fa2344
     case AML_DWORD_OP:
fa2344
-
fa2344
-        CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 4);
fa2344
+        ACPI_MOVE_64_TO_32(&DWord, &Op->Asl.Value.Integer);
fa2344
+        CgLocalWriteAmlData (Op, &DWord, 4);
fa2344
         break;
fa2344
 
fa2344
     case AML_QWORD_OP:
fa2344
-
fa2344
-        CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 8);
fa2344
+        ACPI_MOVE_64_TO_64(&QWord, &Op->Asl.Value.Integer);
fa2344
+        CgLocalWriteAmlData (Op, &QWord, 8);
fa2344
         break;
fa2344
 
fa2344
     case AML_STRING_OP:
fa2344
@@ -416,6 +421,7 @@ CgWriteTableHeader (
fa2344
     ACPI_PARSE_OBJECT       *Op)
fa2344
 {
fa2344
     ACPI_PARSE_OBJECT       *Child;
fa2344
+    UINT32 DWord;
fa2344
 
fa2344
 
fa2344
     /* AML filename */
fa2344
@@ -452,7 +458,7 @@ CgWriteTableHeader (
fa2344
     /* OEM Revision */
fa2344
 
fa2344
     Child = Child->Asl.Next;
fa2344
-    TableHeader.OemRevision = (UINT32) Child->Asl.Value.Integer;
fa2344
+    ACPI_MOVE_64_TO_32(&TableHeader.OemRevision, &Child->Asl.Value.Integer);
fa2344
 
fa2344
     /* Compiler ID */
fa2344
 
fa2344
@@ -460,12 +466,14 @@ CgWriteTableHeader (
fa2344
 
fa2344
     /* Compiler version */
fa2344
 
fa2344
-    TableHeader.AslCompilerRevision = ACPI_CA_VERSION;
fa2344
+    DWord = ACPI_CA_VERSION;
fa2344
+    ACPI_MOVE_32_TO_32(&TableHeader.AslCompilerRevision, &DWord);
fa2344
 
fa2344
     /* Table length. Checksum zero for now, will rewrite later */
fa2344
 
fa2344
-    TableHeader.Length = sizeof (ACPI_TABLE_HEADER) +
fa2344
+    DWord = sizeof (ACPI_TABLE_HEADER) +
fa2344
         Op->Asl.AmlSubtreeLength;
fa2344
+    ACPI_MOVE_32_TO_32(&TableHeader.Length, &DWord);
fa2344
     TableHeader.Checksum = 0;
fa2344
 
fa2344
     Op->Asl.FinalAmlOffset = ftell (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
fa2344
@@ -578,7 +586,10 @@ CgWriteNode (
fa2344
     ACPI_PARSE_OBJECT       *Op)
fa2344
 {
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
-
fa2344
+    UINT8                   Byte;
fa2344
+    UINT16                  Word;
fa2344
+    UINT32                  DWord;
fa2344
+    UINT64                  QWord;
fa2344
 
fa2344
     /* Always check for DEFAULT_ARG and other "Noop" nodes */
fa2344
     /* TBD: this may not be the best place for this check */
fa2344
@@ -601,13 +612,24 @@ CgWriteNode (
fa2344
     switch (Op->Asl.AmlOpcode)
fa2344
     {
fa2344
     case AML_RAW_DATA_BYTE:
fa2344
+        Byte = (UINT8) Op->Asl.Value.Integer;
fa2344
+        CgLocalWriteAmlData (Op, &Byte, 1);
fa2344
+        return;
fa2344
+
fa2344
     case AML_RAW_DATA_WORD:
fa2344
-    case AML_RAW_DATA_DWORD:
fa2344
-    case AML_RAW_DATA_QWORD:
fa2344
+        ACPI_MOVE_64_TO_16(&Word, &Op->Asl.Value.Integer);
fa2344
+        CgLocalWriteAmlData (Op, &Word, 2);
fa2344
+        return;
fa2344
 
fa2344
-        CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, Op->Asl.AmlLength);
fa2344
+    case AML_RAW_DATA_DWORD:
fa2344
+        ACPI_MOVE_64_TO_32(&DWord, &Op->Asl.Value.Integer);
fa2344
+        CgLocalWriteAmlData (Op, &DWord, 4);
fa2344
         return;
fa2344
 
fa2344
+    case AML_RAW_DATA_QWORD:
fa2344
+        ACPI_MOVE_64_TO_64(&QWord, &Op->Asl.Value.Integer);
fa2344
+        CgLocalWriteAmlData (Op, &QWord, 8);
fa2344
+        return;
fa2344
 
fa2344
     case AML_RAW_DATA_BUFFER:
fa2344
 
fa2344
diff --git a/source/compiler/aslopcodes.c b/source/compiler/aslopcodes.c
fa2344
index de9ffe1..81f4ad3 100644
fa2344
--- a/source/compiler/aslopcodes.c
fa2344
+++ b/source/compiler/aslopcodes.c
fa2344
@@ -481,6 +481,7 @@ OpcDoUnicode (
fa2344
     UINT32                  i;
fa2344
     UINT8                   *AsciiString;
fa2344
     UINT16                  *UnicodeString;
fa2344
+    UINT16                  UChar;
fa2344
     ACPI_PARSE_OBJECT       *BufferLengthOp;
fa2344
 
fa2344
 
fa2344
@@ -507,7 +508,8 @@ OpcDoUnicode (
fa2344
 
fa2344
     for (i = 0; i < Count; i++)
fa2344
     {
fa2344
-        UnicodeString[i] = (UINT16) AsciiString[i];
fa2344
+        UChar = (UINT16) AsciiString[i];
fa2344
+        ACPI_MOVE_16_TO_16(&UnicodeString[i], &UChar);
fa2344
     }
fa2344
 
fa2344
     /*
fa2344
diff --git a/source/compiler/aslrestype1.c b/source/compiler/aslrestype1.c
fa2344
index 4bd9059..e61fa85 100644
fa2344
--- a/source/compiler/aslrestype1.c
fa2344
+++ b/source/compiler/aslrestype1.c
fa2344
@@ -141,6 +141,11 @@ RsDoMemory24Descriptor (
fa2344
     ACPI_PARSE_OBJECT       *MaxOp = NULL;
fa2344
     ACPI_PARSE_OBJECT       *LengthOp = NULL;
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
+    UINT16                  Minimum = 0;
fa2344
+    UINT16                  Maximum = 0;
fa2344
+    UINT16                  AddressLength = 0;
fa2344
+    UINT16                  Alignment = 0;
fa2344
+    UINT16                  ResourceLength;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
 
fa2344
@@ -151,7 +156,8 @@ RsDoMemory24Descriptor (
fa2344
 
fa2344
     Descriptor = Rnode->Buffer;
fa2344
     Descriptor->Memory24.DescriptorType = ACPI_RESOURCE_NAME_MEMORY24;
fa2344
-    Descriptor->Memory24.ResourceLength = 9;
fa2344
+    ResourceLength = 9;
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Memory24.ResourceLength, &ResourceLength);
fa2344
 
fa2344
     /* Process all child initialization nodes */
fa2344
 
fa2344
@@ -168,7 +174,7 @@ RsDoMemory24Descriptor (
fa2344
 
fa2344
         case 1: /* Min Address */
fa2344
 
fa2344
-            Descriptor->Memory24.Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Minimum));
fa2344
             MinOp = InitializerOp;
fa2344
@@ -176,7 +182,7 @@ RsDoMemory24Descriptor (
fa2344
 
fa2344
         case 2: /* Max Address */
fa2344
 
fa2344
-            Descriptor->Memory24.Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Maximum));
fa2344
             MaxOp = InitializerOp;
fa2344
@@ -184,14 +190,14 @@ RsDoMemory24Descriptor (
fa2344
 
fa2344
         case 3: /* Alignment */
fa2344
 
fa2344
-            Descriptor->Memory24.Alignment = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            Alignment = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_ALIGNMENT,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Alignment));
fa2344
             break;
fa2344
 
fa2344
         case 4: /* Length */
fa2344
 
fa2344
-            Descriptor->Memory24.AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.AddressLength));
fa2344
             LengthOp = InitializerOp;
fa2344
@@ -214,12 +220,17 @@ RsDoMemory24Descriptor (
fa2344
     /* Validate the Min/Max/Len/Align values (Alignment==0 means 64K) */
fa2344
 
fa2344
     RsSmallAddressCheck (ACPI_RESOURCE_NAME_MEMORY24,
fa2344
-        Descriptor->Memory24.Minimum,
fa2344
-        Descriptor->Memory24.Maximum,
fa2344
-        Descriptor->Memory24.AddressLength,
fa2344
-        Descriptor->Memory24.Alignment,
fa2344
+        Minimum,
fa2344
+        Maximum,
fa2344
+        AddressLength,
fa2344
+        Alignment,
fa2344
         MinOp, MaxOp, LengthOp, NULL, Info->DescriptorTypeOp);
fa2344
 
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Memory24.Minimum, &Minimum);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Memory24.Maximum, &Maximum);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Memory24.AddressLength, &AddressLength);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Memory24.Alignment, &Alignment);
fa2344
+
fa2344
     return (Rnode);
fa2344
 }
fa2344
 
fa2344
@@ -247,6 +258,11 @@ RsDoMemory32Descriptor (
fa2344
     ACPI_PARSE_OBJECT       *LengthOp = NULL;
fa2344
     ACPI_PARSE_OBJECT       *AlignOp = NULL;
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
+    UINT32                  Minimum = 0;
fa2344
+    UINT32                  Maximum = 0;
fa2344
+    UINT32                  AddressLength = 0;
fa2344
+    UINT32                  Alignment = 0;
fa2344
+    UINT16                  ResourceLength;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
 
fa2344
@@ -257,7 +273,8 @@ RsDoMemory32Descriptor (
fa2344
 
fa2344
     Descriptor = Rnode->Buffer;
fa2344
     Descriptor->Memory32.DescriptorType = ACPI_RESOURCE_NAME_MEMORY32;
fa2344
-    Descriptor->Memory32.ResourceLength = 17;
fa2344
+    ResourceLength = 17;
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Memory32.ResourceLength, &ResourceLength);
fa2344
 
fa2344
     /* Process all child initialization nodes */
fa2344
 
fa2344
@@ -274,7 +291,7 @@ RsDoMemory32Descriptor (
fa2344
 
fa2344
         case 1:  /* Min Address */
fa2344
 
fa2344
-            Descriptor->Memory32.Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Minimum));
fa2344
             MinOp = InitializerOp;
fa2344
@@ -282,7 +299,7 @@ RsDoMemory32Descriptor (
fa2344
 
fa2344
         case 2: /* Max Address */
fa2344
 
fa2344
-            Descriptor->Memory32.Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Maximum));
fa2344
             MaxOp = InitializerOp;
fa2344
@@ -290,7 +307,7 @@ RsDoMemory32Descriptor (
fa2344
 
fa2344
         case 3: /* Alignment */
fa2344
 
fa2344
-            Descriptor->Memory32.Alignment = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            Alignment = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_ALIGNMENT,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Alignment));
fa2344
             AlignOp = InitializerOp;
fa2344
@@ -298,7 +315,7 @@ RsDoMemory32Descriptor (
fa2344
 
fa2344
         case 4: /* Length */
fa2344
 
fa2344
-            Descriptor->Memory32.AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.AddressLength));
fa2344
             LengthOp = InitializerOp;
fa2344
@@ -321,12 +338,17 @@ RsDoMemory32Descriptor (
fa2344
     /* Validate the Min/Max/Len/Align values */
fa2344
 
fa2344
     RsSmallAddressCheck (ACPI_RESOURCE_NAME_MEMORY32,
fa2344
-        Descriptor->Memory32.Minimum,
fa2344
-        Descriptor->Memory32.Maximum,
fa2344
-        Descriptor->Memory32.AddressLength,
fa2344
-        Descriptor->Memory32.Alignment,
fa2344
+        Minimum,
fa2344
+        Maximum,
fa2344
+        AddressLength,
fa2344
+        Alignment,
fa2344
         MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
fa2344
 
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Memory32.Minimum, &Minimum);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Memory32.Maximum, &Maximum);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Memory32.AddressLength, &AddressLength);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Memory32.Alignment, &Alignment);
fa2344
+
fa2344
     return (Rnode);
fa2344
 }
fa2344
 
fa2344
@@ -350,6 +372,7 @@ RsDoMemory32FixedDescriptor (
fa2344
     AML_RESOURCE            *Descriptor;
fa2344
     ACPI_PARSE_OBJECT       *InitializerOp;
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
+    UINT16                  ResourceLength;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
 
fa2344
@@ -360,7 +383,8 @@ RsDoMemory32FixedDescriptor (
fa2344
 
fa2344
     Descriptor = Rnode->Buffer;
fa2344
     Descriptor->FixedMemory32.DescriptorType = ACPI_RESOURCE_NAME_FIXED_MEMORY32;
fa2344
-    Descriptor->FixedMemory32.ResourceLength = 9;
fa2344
+    ResourceLength = 9;
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->FixedMemory32.ResourceLength, &ResourceLength);
fa2344
 
fa2344
     /* Process all child initialization nodes */
fa2344
 
fa2344
@@ -377,14 +401,16 @@ RsDoMemory32FixedDescriptor (
fa2344
 
fa2344
         case 1: /* Address */
fa2344
 
fa2344
-            Descriptor->FixedMemory32.Address = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            ACPI_MOVE_64_TO_32(&Descriptor->FixedMemory32.Address,
fa2344
+                &InitializerOp->Asl.Value.Integer);
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_BASEADDRESS,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedMemory32.Address));
fa2344
             break;
fa2344
 
fa2344
         case 2: /* Length */
fa2344
 
fa2344
-            Descriptor->FixedMemory32.AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            ACPI_MOVE_64_TO_32(&Descriptor->FixedMemory32.AddressLength,
fa2344
+                &InitializerOp->Asl.Value.Integer);
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedMemory32.AddressLength));
fa2344
             break;
fa2344
diff --git a/source/compiler/aslrestype1i.c b/source/compiler/aslrestype1i.c
fa2344
index 0f38e40..26fa7ea 100644
fa2344
--- a/source/compiler/aslrestype1i.c
fa2344
+++ b/source/compiler/aslrestype1i.c
fa2344
@@ -197,6 +197,8 @@ RsDoFixedDmaDescriptor (
fa2344
     AML_RESOURCE            *Descriptor;
fa2344
     ACPI_PARSE_OBJECT       *InitializerOp;
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
+    UINT16                  RequestLines = 0;
fa2344
+    UINT16                  Channels = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
 
fa2344
@@ -217,14 +219,14 @@ RsDoFixedDmaDescriptor (
fa2344
         {
fa2344
         case 0: /* DMA Request Lines [WORD] (_DMA) */
fa2344
 
fa2344
-            Descriptor->FixedDma.RequestLines = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            RequestLines = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_DMA,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedDma.RequestLines));
fa2344
             break;
fa2344
 
fa2344
         case 1: /* DMA Channel [WORD] (_TYP) */
fa2344
 
fa2344
-            Descriptor->FixedDma.Channels = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            Channels = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_DMATYPE,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedDma.Channels));
fa2344
             break;
fa2344
@@ -249,6 +251,9 @@ RsDoFixedDmaDescriptor (
fa2344
         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
fa2344
     }
fa2344
 
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->FixedDma.RequestLines, &RequestLines);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->FixedDma.Channels, &Channels);
fa2344
+
fa2344
     return (Rnode);
fa2344
 }
fa2344
 
fa2344
@@ -273,6 +278,7 @@ RsDoFixedIoDescriptor (
fa2344
     ACPI_PARSE_OBJECT       *InitializerOp;
fa2344
     ACPI_PARSE_OBJECT       *AddressOp = NULL;
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
+    UINT16                  Address = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
 
fa2344
@@ -293,8 +299,7 @@ RsDoFixedIoDescriptor (
fa2344
         {
fa2344
         case 0: /* Base Address */
fa2344
 
fa2344
-            Descriptor->FixedIo.Address =
fa2344
-                (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            Address = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_BASEADDRESS,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedIo.Address));
fa2344
             AddressOp = InitializerOp;
fa2344
@@ -324,11 +329,13 @@ RsDoFixedIoDescriptor (
fa2344
 
fa2344
     /* Error checks */
fa2344
 
fa2344
-    if (Descriptor->FixedIo.Address > 0x03FF)
fa2344
+    if (Address > 0x03FF)
fa2344
     {
fa2344
         AslError (ASL_WARNING, ASL_MSG_ISA_ADDRESS, AddressOp, NULL);
fa2344
     }
fa2344
 
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->FixedIo.Address, &Address);
fa2344
+
fa2344
     return (Rnode);
fa2344
 }
fa2344
 
fa2344
@@ -356,6 +363,8 @@ RsDoIoDescriptor (
fa2344
     ACPI_PARSE_OBJECT       *LengthOp = NULL;
fa2344
     ACPI_PARSE_OBJECT       *AlignOp = NULL;
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
+    UINT16                  Minimum = 0;
fa2344
+    UINT16                  Maximum = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
 
fa2344
@@ -383,8 +392,7 @@ RsDoIoDescriptor (
fa2344
 
fa2344
         case 1:  /* Min Address */
fa2344
 
fa2344
-            Descriptor->Io.Minimum =
fa2344
-                (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Io.Minimum));
fa2344
             MinOp = InitializerOp;
fa2344
@@ -392,8 +400,7 @@ RsDoIoDescriptor (
fa2344
 
fa2344
         case 2: /* Max Address */
fa2344
 
fa2344
-            Descriptor->Io.Maximum =
fa2344
-                (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Io.Maximum));
fa2344
             MaxOp = InitializerOp;
fa2344
@@ -434,12 +441,15 @@ RsDoIoDescriptor (
fa2344
     /* Validate the Min/Max/Len/Align values */
fa2344
 
fa2344
     RsSmallAddressCheck (ACPI_RESOURCE_NAME_IO,
fa2344
-        Descriptor->Io.Minimum,
fa2344
-        Descriptor->Io.Maximum,
fa2344
+        Minimum,
fa2344
+        Maximum,
fa2344
         Descriptor->Io.AddressLength,
fa2344
         Descriptor->Io.Alignment,
fa2344
         MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
fa2344
 
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Io.Minimum, &Minimum);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Io.Maximum, &Maximum);
fa2344
+
fa2344
     return (Rnode);
fa2344
 }
fa2344
 
fa2344
@@ -559,9 +569,9 @@ RsDoIrqDescriptor (
fa2344
         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
fa2344
     }
fa2344
 
fa2344
-    /* Now we can set the channel mask */
fa2344
+    /* Now we can set the interrupt mask */
fa2344
 
fa2344
-    Descriptor->Irq.IrqMask = IrqMask;
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Irq.IrqMask, &IrqMask);
fa2344
     return (Rnode);
fa2344
 }
fa2344
 
fa2344
@@ -660,6 +670,6 @@ RsDoIrqNoFlagsDescriptor (
fa2344
 
fa2344
     /* Now we can set the interrupt mask */
fa2344
 
fa2344
-    Descriptor->Irq.IrqMask = IrqMask;
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Irq.IrqMask, &IrqMask);
fa2344
     return (Rnode);
fa2344
 }
fa2344
diff --git a/source/compiler/aslrestype2.c b/source/compiler/aslrestype2.c
fa2344
index b75c118..37dd91b 100644
fa2344
--- a/source/compiler/aslrestype2.c
fa2344
+++ b/source/compiler/aslrestype2.c
fa2344
@@ -75,6 +75,7 @@ RsDoGeneralRegisterDescriptor (
fa2344
     AML_RESOURCE            *Descriptor;
fa2344
     ACPI_PARSE_OBJECT       *InitializerOp;
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
+    UINT16                  ResourceLength;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
 
fa2344
@@ -85,7 +86,9 @@ RsDoGeneralRegisterDescriptor (
fa2344
 
fa2344
     Descriptor = Rnode->Buffer;
fa2344
     Descriptor->GenericReg.DescriptorType = ACPI_RESOURCE_NAME_GENERIC_REGISTER;
fa2344
-    Descriptor->GenericReg.ResourceLength = 12;
fa2344
+    ResourceLength = 12;
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->GenericReg.ResourceLength,
fa2344
+		    &ResourceLength);
fa2344
 
fa2344
     /* Process all child initialization nodes */
fa2344
 
fa2344
@@ -116,7 +119,8 @@ RsDoGeneralRegisterDescriptor (
fa2344
 
fa2344
         case 3: /* Register Address */
fa2344
 
fa2344
-            Descriptor->GenericReg.Address = InitializerOp->Asl.Value.Integer;
fa2344
+	    ACPI_MOVE_64_TO_64(&Descriptor->GenericReg.Address,
fa2344
+			    &InitializerOp->Asl.Value.Integer);
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_ADDRESS,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.Address));
fa2344
             break;
fa2344
@@ -172,6 +176,7 @@ RsDoInterruptDescriptor (
fa2344
     AML_RESOURCE            *Rover = NULL;
fa2344
     ACPI_PARSE_OBJECT       *InitializerOp;
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
+    UINT16                  ResourceLength = 0;
fa2344
     UINT16                  StringLength = 0;
fa2344
     UINT32                  OptionIndex = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
@@ -220,7 +225,7 @@ RsDoInterruptDescriptor (
fa2344
      * Initial descriptor length -- may be enlarged if there are
fa2344
      * optional fields present
fa2344
      */
fa2344
-    Descriptor->ExtendedIrq.ResourceLength  = 2;  /* Flags and table length byte */
fa2344
+    ResourceLength  = 2;  /* Flags and table length byte */
fa2344
     Descriptor->ExtendedIrq.InterruptCount  = 0;
fa2344
 
fa2344
     Rover = ACPI_CAST_PTR (AML_RESOURCE,
fa2344
@@ -328,10 +333,11 @@ RsDoInterruptDescriptor (
fa2344
 
fa2344
             /* Save the integer and move pointer to the next one */
fa2344
 
fa2344
-            Rover->DwordItem = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            ACPI_MOVE_64_TO_32(&Rover->DwordItem,
fa2344
+                &InitializerOp->Asl.Value.Integer);
fa2344
             Rover = ACPI_ADD_PTR (AML_RESOURCE, &(Rover->DwordItem), 4);
fa2344
             Descriptor->ExtendedIrq.InterruptCount++;
fa2344
-            Descriptor->ExtendedIrq.ResourceLength += 4;
fa2344
+            ResourceLength += 4;
fa2344
 
fa2344
             /* Case 7: First interrupt number in list */
fa2344
 
fa2344
@@ -367,7 +373,7 @@ RsDoInterruptDescriptor (
fa2344
     {
fa2344
         Rover->ByteItem = ResSourceIndex;
fa2344
         Rover = ACPI_ADD_PTR (AML_RESOURCE, &(Rover->ByteItem), 1);
fa2344
-        Descriptor->ExtendedIrq.ResourceLength += 1;
fa2344
+        ResourceLength += 1;
fa2344
     }
fa2344
 
fa2344
     /* Add optional ResSource string if present */
fa2344
@@ -379,14 +385,15 @@ RsDoInterruptDescriptor (
fa2344
         Rover = ACPI_ADD_PTR (
fa2344
                     AML_RESOURCE, &(Rover->ByteItem), StringLength);
fa2344
 
fa2344
-        Descriptor->ExtendedIrq.ResourceLength = (UINT16)
fa2344
-            (Descriptor->ExtendedIrq.ResourceLength + StringLength);
fa2344
+        ResourceLength = (UINT16) (ResourceLength + StringLength);
fa2344
     }
fa2344
 
fa2344
     Rnode->BufferLength =
fa2344
         (ASL_RESDESC_OFFSET (ExtendedIrq.Interrupts[0]) -
fa2344
         ASL_RESDESC_OFFSET (ExtendedIrq.DescriptorType))
fa2344
         + OptionIndex + StringLength;
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->ExtendedIrq.ResourceLength,
fa2344
+		    &ResourceLength);
fa2344
     return (Rnode);
fa2344
 }
fa2344
 
fa2344
@@ -434,7 +441,7 @@ RsDoVendorLargeDescriptor (
fa2344
 
fa2344
     Descriptor = Rnode->Buffer;
fa2344
     Descriptor->VendorLarge.DescriptorType = ACPI_RESOURCE_NAME_VENDOR_LARGE;
fa2344
-    Descriptor->VendorLarge.ResourceLength = (UINT16) i;
fa2344
+    ACPI_MOVE_32_TO_16(&Descriptor->VendorLarge.ResourceLength, &i);
fa2344
 
fa2344
     /* Point to end-of-descriptor for vendor data */
fa2344
 
fa2344
diff --git a/source/compiler/aslrestype2d.c b/source/compiler/aslrestype2d.c
fa2344
index c7841b0..9a782c5 100644
fa2344
--- a/source/compiler/aslrestype2d.c
fa2344
+++ b/source/compiler/aslrestype2d.c
fa2344
@@ -79,7 +79,13 @@ RsDoDwordIoDescriptor (
fa2344
     ACPI_PARSE_OBJECT       *GranOp = NULL;
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
     UINT16                  StringLength = 0;
fa2344
+    UINT16                  ResourceLength = 0;
fa2344
     UINT32                  OptionIndex = 0;
fa2344
+    UINT32                  Minimum = 0;
fa2344
+    UINT32                  Maximum = 0;
fa2344
+    UINT32                  AddressLength = 0;
fa2344
+    UINT32                  Granularity = 0;
fa2344
+    UINT32                  TranslationOffset = 0;
fa2344
     UINT8                   *OptionalFields;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
@@ -102,8 +108,7 @@ RsDoDwordIoDescriptor (
fa2344
      * optional fields present
fa2344
      */
fa2344
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32);
fa2344
-    Descriptor->Address32.ResourceLength = (UINT16)
fa2344
-        (sizeof (AML_RESOURCE_ADDRESS32) -
fa2344
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS32) -
fa2344
          sizeof (AML_RESOURCE_LARGE_HEADER));
fa2344
 
fa2344
     /* Process all child initialization nodes */
fa2344
@@ -147,8 +152,7 @@ RsDoDwordIoDescriptor (
fa2344
 
fa2344
         case 5: /* Address Granularity */
fa2344
 
fa2344
-            Descriptor->Address32.Granularity =
fa2344
-                (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            Granularity = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
fa2344
             GranOp = InitializerOp;
fa2344
@@ -156,8 +160,7 @@ RsDoDwordIoDescriptor (
fa2344
 
fa2344
         case 6: /* Address Min */
fa2344
 
fa2344
-            Descriptor->Address32.Minimum =
fa2344
-                (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
fa2344
             MinOp = InitializerOp;
fa2344
@@ -165,8 +168,7 @@ RsDoDwordIoDescriptor (
fa2344
 
fa2344
         case 7: /* Address Max */
fa2344
 
fa2344
-            Descriptor->Address32.Maximum =
fa2344
-                (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
fa2344
             MaxOp = InitializerOp;
fa2344
@@ -174,16 +176,14 @@ RsDoDwordIoDescriptor (
fa2344
 
fa2344
         case 8: /* Translation Offset */
fa2344
 
fa2344
-            Descriptor->Address32.TranslationOffset =
fa2344
-                (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            TranslationOffset = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
fa2344
             break;
fa2344
 
fa2344
         case 9: /* Address Length */
fa2344
 
fa2344
-            Descriptor->Address32.AddressLength =
fa2344
-                (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
fa2344
             LengthOp = InitializerOp;
fa2344
@@ -197,7 +197,7 @@ RsDoDwordIoDescriptor (
fa2344
 
fa2344
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
fa2344
                 OptionIndex++;
fa2344
-                Descriptor->Address32.ResourceLength++;
fa2344
+                ResourceLength++;
fa2344
                 ResSourceIndex = TRUE;
fa2344
             }
fa2344
             break;
fa2344
@@ -211,8 +211,7 @@ RsDoDwordIoDescriptor (
fa2344
                 {
fa2344
                     /* Found a valid ResourceSource */
fa2344
 
fa2344
-                    Descriptor->Address32.ResourceLength = (UINT16)
fa2344
-                        (Descriptor->Address32.ResourceLength + StringLength);
fa2344
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
fa2344
 
fa2344
                     strcpy ((char *)
fa2344
                         &OptionalFields[OptionIndex],
fa2344
@@ -272,13 +271,20 @@ RsDoDwordIoDescriptor (
fa2344
     /* Validate the Min/Max/Len/Gran values */
fa2344
 
fa2344
     RsLargeAddressCheck (
fa2344
-        (UINT64) Descriptor->Address32.Minimum,
fa2344
-        (UINT64) Descriptor->Address32.Maximum,
fa2344
-        (UINT64) Descriptor->Address32.AddressLength,
fa2344
-        (UINT64) Descriptor->Address32.Granularity,
fa2344
+        Minimum,
fa2344
+        Maximum,
fa2344
+        AddressLength,
fa2344
+        Granularity,
fa2344
         Descriptor->Address32.Flags,
fa2344
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
fa2344
 
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address32.ResourceLength, &ResourceLength);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Minimum, &Minimum);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Maximum, &Maximum);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.AddressLength, &AddressLength);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Granularity, &Granularity);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.TranslationOffset, &TranslationOffset);
fa2344
+
fa2344
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
fa2344
         OptionIndex + StringLength;
fa2344
     return (Rnode);
fa2344
@@ -310,7 +316,13 @@ RsDoDwordMemoryDescriptor (
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
     UINT8                   *OptionalFields;
fa2344
     UINT16                  StringLength = 0;
fa2344
+    UINT16                  ResourceLength = 0;
fa2344
     UINT32                  OptionIndex = 0;
fa2344
+    UINT32                  Minimum = 0;
fa2344
+    UINT32                  Maximum = 0;
fa2344
+    UINT32                  AddressLength = 0;
fa2344
+    UINT32                  Granularity = 0;
fa2344
+    UINT32                  TranslationOffset = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
     BOOLEAN                 ResSourceIndex = FALSE;
fa2344
@@ -332,11 +344,9 @@ RsDoDwordMemoryDescriptor (
fa2344
      * optional fields present
fa2344
      */
fa2344
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32);
fa2344
-    Descriptor->Address32.ResourceLength = (UINT16)
fa2344
-        (sizeof (AML_RESOURCE_ADDRESS32) -
fa2344
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS32) -
fa2344
          sizeof (AML_RESOURCE_LARGE_HEADER));
fa2344
 
fa2344
-
fa2344
     /* Process all child initialization nodes */
fa2344
 
fa2344
     for (i = 0; InitializerOp; i++)
fa2344
@@ -385,8 +395,7 @@ RsDoDwordMemoryDescriptor (
fa2344
 
fa2344
         case 6: /* Address Granularity */
fa2344
 
fa2344
-            Descriptor->Address32.Granularity =
fa2344
-                (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            Granularity = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
fa2344
             GranOp = InitializerOp;
fa2344
@@ -394,8 +403,7 @@ RsDoDwordMemoryDescriptor (
fa2344
 
fa2344
         case 7: /* Min Address */
fa2344
 
fa2344
-            Descriptor->Address32.Minimum =
fa2344
-                (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
fa2344
             MinOp = InitializerOp;
fa2344
@@ -403,8 +411,7 @@ RsDoDwordMemoryDescriptor (
fa2344
 
fa2344
         case 8: /* Max Address */
fa2344
 
fa2344
-            Descriptor->Address32.Maximum =
fa2344
-                (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
fa2344
             MaxOp = InitializerOp;
fa2344
@@ -412,16 +419,14 @@ RsDoDwordMemoryDescriptor (
fa2344
 
fa2344
         case 9: /* Translation Offset */
fa2344
 
fa2344
-            Descriptor->Address32.TranslationOffset =
fa2344
-                (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            TranslationOffset = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
fa2344
             break;
fa2344
 
fa2344
         case 10: /* Address Length */
fa2344
 
fa2344
-            Descriptor->Address32.AddressLength =
fa2344
-                (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
fa2344
             LengthOp = InitializerOp;
fa2344
@@ -433,7 +438,7 @@ RsDoDwordMemoryDescriptor (
fa2344
             {
fa2344
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
fa2344
                 OptionIndex++;
fa2344
-                Descriptor->Address32.ResourceLength++;
fa2344
+                ResourceLength++;
fa2344
                 ResSourceIndex = TRUE;
fa2344
             }
fa2344
             break;
fa2344
@@ -445,8 +450,8 @@ RsDoDwordMemoryDescriptor (
fa2344
             {
fa2344
                 if (StringLength)
fa2344
                 {
fa2344
-                    Descriptor->Address32.ResourceLength = (UINT16)
fa2344
-                        (Descriptor->Address32.ResourceLength + StringLength);
fa2344
+
fa2344
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
fa2344
 
fa2344
                     strcpy ((char *)
fa2344
                         &OptionalFields[OptionIndex],
fa2344
@@ -507,13 +512,20 @@ RsDoDwordMemoryDescriptor (
fa2344
     /* Validate the Min/Max/Len/Gran values */
fa2344
 
fa2344
     RsLargeAddressCheck (
fa2344
-        (UINT64) Descriptor->Address32.Minimum,
fa2344
-        (UINT64) Descriptor->Address32.Maximum,
fa2344
-        (UINT64) Descriptor->Address32.AddressLength,
fa2344
-        (UINT64) Descriptor->Address32.Granularity,
fa2344
+        Minimum,
fa2344
+        Maximum,
fa2344
+        AddressLength,
fa2344
+        Granularity,
fa2344
         Descriptor->Address32.Flags,
fa2344
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
fa2344
 
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address32.ResourceLength, &ResourceLength);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Minimum, &Minimum);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Maximum, &Maximum);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.AddressLength, &AddressLength);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Granularity, &Granularity);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.TranslationOffset, &TranslationOffset);
fa2344
+
fa2344
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
fa2344
         OptionIndex + StringLength;
fa2344
     return (Rnode);
fa2344
@@ -545,7 +557,13 @@ RsDoDwordSpaceDescriptor (
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
     UINT8                   *OptionalFields;
fa2344
     UINT16                  StringLength = 0;
fa2344
+    UINT16                  ResourceLength = 0;
fa2344
     UINT32                  OptionIndex = 0;
fa2344
+    UINT32                  Minimum = 0;
fa2344
+    UINT32                  Maximum = 0;
fa2344
+    UINT32                  AddressLength = 0;
fa2344
+    UINT32                  Granularity = 0;
fa2344
+    UINT32                  TranslationOffset = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
     BOOLEAN                 ResSourceIndex = FALSE;
fa2344
@@ -566,8 +584,7 @@ RsDoDwordSpaceDescriptor (
fa2344
      * optional fields present
fa2344
      */
fa2344
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32);
fa2344
-    Descriptor->Address32.ResourceLength = (UINT16)
fa2344
-        (sizeof (AML_RESOURCE_ADDRESS32) -
fa2344
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS32) -
fa2344
          sizeof (AML_RESOURCE_LARGE_HEADER));
fa2344
 
fa2344
     /* Process all child initialization nodes */
fa2344
@@ -616,8 +633,7 @@ RsDoDwordSpaceDescriptor (
fa2344
 
fa2344
         case 6: /* Address Granularity */
fa2344
 
fa2344
-            Descriptor->Address32.Granularity =
fa2344
-                (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            Granularity = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
fa2344
             GranOp = InitializerOp;
fa2344
@@ -625,8 +641,7 @@ RsDoDwordSpaceDescriptor (
fa2344
 
fa2344
         case 7: /* Min Address */
fa2344
 
fa2344
-            Descriptor->Address32.Minimum =
fa2344
-                (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
fa2344
             MinOp = InitializerOp;
fa2344
@@ -634,8 +649,7 @@ RsDoDwordSpaceDescriptor (
fa2344
 
fa2344
         case 8: /* Max Address */
fa2344
 
fa2344
-            Descriptor->Address32.Maximum =
fa2344
-                (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
fa2344
             MaxOp = InitializerOp;
fa2344
@@ -643,16 +657,14 @@ RsDoDwordSpaceDescriptor (
fa2344
 
fa2344
         case 9: /* Translation Offset */
fa2344
 
fa2344
-            Descriptor->Address32.TranslationOffset =
fa2344
-                (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            TranslationOffset = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
fa2344
             break;
fa2344
 
fa2344
         case 10: /* Address Length */
fa2344
 
fa2344
-            Descriptor->Address32.AddressLength =
fa2344
-                (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
fa2344
             LengthOp = InitializerOp;
fa2344
@@ -664,7 +676,7 @@ RsDoDwordSpaceDescriptor (
fa2344
             {
fa2344
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
fa2344
                 OptionIndex++;
fa2344
-                Descriptor->Address32.ResourceLength++;
fa2344
+                ResourceLength++;
fa2344
                 ResSourceIndex = TRUE;
fa2344
             }
fa2344
             break;
fa2344
@@ -676,8 +688,7 @@ RsDoDwordSpaceDescriptor (
fa2344
             {
fa2344
                 if (StringLength)
fa2344
                 {
fa2344
-                    Descriptor->Address32.ResourceLength = (UINT16)
fa2344
-                        (Descriptor->Address32.ResourceLength + StringLength);
fa2344
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
fa2344
 
fa2344
                     strcpy ((char *)
fa2344
                         &OptionalFields[OptionIndex],
fa2344
@@ -724,13 +735,20 @@ RsDoDwordSpaceDescriptor (
fa2344
     /* Validate the Min/Max/Len/Gran values */
fa2344
 
fa2344
     RsLargeAddressCheck (
fa2344
-        (UINT64) Descriptor->Address32.Minimum,
fa2344
-        (UINT64) Descriptor->Address32.Maximum,
fa2344
-        (UINT64) Descriptor->Address32.AddressLength,
fa2344
-        (UINT64) Descriptor->Address32.Granularity,
fa2344
+        Minimum,
fa2344
+        Maximum,
fa2344
+        AddressLength,
fa2344
+        Granularity,
fa2344
         Descriptor->Address32.Flags,
fa2344
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
fa2344
 
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address32.ResourceLength, &ResourceLength);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Minimum, &Minimum);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Maximum, &Maximum);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.AddressLength, &AddressLength);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Granularity, &Granularity);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.TranslationOffset, &TranslationOffset);
fa2344
+
fa2344
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
fa2344
         OptionIndex + StringLength;
fa2344
     return (Rnode);
fa2344
diff --git a/source/compiler/aslrestype2e.c b/source/compiler/aslrestype2e.c
fa2344
index aa17a75..61abdd3 100644
fa2344
--- a/source/compiler/aslrestype2e.c
fa2344
+++ b/source/compiler/aslrestype2e.c
fa2344
@@ -78,6 +78,13 @@ RsDoExtendedIoDescriptor (
fa2344
     ACPI_PARSE_OBJECT       *GranOp = NULL;
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
     UINT16                  StringLength = 0;
fa2344
+    UINT16                  ResourceLength = 0;
fa2344
+    UINT64                  Minimum = 0;
fa2344
+    UINT64                  Maximum = 0;
fa2344
+    UINT64                  AddressLength = 0;
fa2344
+    UINT64                  Granularity = 0;
fa2344
+    UINT64                  TranslationOffset = 0;
fa2344
+    UINT64                  TypeSpecific = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
 
fa2344
@@ -94,9 +101,10 @@ RsDoExtendedIoDescriptor (
fa2344
     Descriptor->ExtAddress64.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE;
fa2344
     Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
fa2344
 
fa2344
-    Descriptor->ExtAddress64.ResourceLength = (UINT16)
fa2344
-        (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
fa2344
+    ResourceLength  = (UINT16) (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
fa2344
          sizeof (AML_RESOURCE_LARGE_HEADER));
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->ExtAddress64.ResourceLength,
fa2344
+        &ResourceLength);
fa2344
 
fa2344
     /* Process all child initialization nodes */
fa2344
 
fa2344
@@ -139,7 +147,7 @@ RsDoExtendedIoDescriptor (
fa2344
 
fa2344
         case 5: /* Address Granularity */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer;
fa2344
+            Granularity = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity));
fa2344
             GranOp = InitializerOp;
fa2344
@@ -147,7 +155,7 @@ RsDoExtendedIoDescriptor (
fa2344
 
fa2344
         case 6: /* Address Min */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer;
fa2344
+            Minimum = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum));
fa2344
             MinOp = InitializerOp;
fa2344
@@ -155,7 +163,7 @@ RsDoExtendedIoDescriptor (
fa2344
 
fa2344
         case 7: /* Address Max */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer;
fa2344
+            Maximum = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum));
fa2344
             MaxOp = InitializerOp;
fa2344
@@ -163,14 +171,14 @@ RsDoExtendedIoDescriptor (
fa2344
 
fa2344
         case 8: /* Translation Offset */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer;
fa2344
+            TranslationOffset = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset));
fa2344
             break;
fa2344
 
fa2344
         case 9: /* Address Length */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer;
fa2344
+            AddressLength = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength));
fa2344
             LengthOp = InitializerOp;
fa2344
@@ -178,7 +186,7 @@ RsDoExtendedIoDescriptor (
fa2344
 
fa2344
         case 10: /* Type-Specific Attributes */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer;
fa2344
+            TypeSpecific = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific));
fa2344
             break;
fa2344
@@ -214,13 +222,20 @@ RsDoExtendedIoDescriptor (
fa2344
     /* Validate the Min/Max/Len/Gran values */
fa2344
 
fa2344
     RsLargeAddressCheck (
fa2344
-        Descriptor->ExtAddress64.Minimum,
fa2344
-        Descriptor->ExtAddress64.Maximum,
fa2344
-        Descriptor->ExtAddress64.AddressLength,
fa2344
-        Descriptor->ExtAddress64.Granularity,
fa2344
+        Minimum,
fa2344
+        Maximum,
fa2344
+        AddressLength,
fa2344
+        Granularity,
fa2344
         Descriptor->ExtAddress64.Flags,
fa2344
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
fa2344
 
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Minimum, &Minimum);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Maximum, &Maximum);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.AddressLength, &AddressLength);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Granularity, &Granularity);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.TranslationOffset, &TranslationOffset);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.TypeSpecific, &TypeSpecific);
fa2344
+
fa2344
     Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) +
fa2344
         StringLength;
fa2344
     return (Rnode);
fa2344
@@ -251,6 +266,13 @@ RsDoExtendedMemoryDescriptor (
fa2344
     ACPI_PARSE_OBJECT       *GranOp = NULL;
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
     UINT16                  StringLength = 0;
fa2344
+    UINT16                  ResourceLength = 0;
fa2344
+    UINT64                  Minimum = 0;
fa2344
+    UINT64                  Maximum = 0;
fa2344
+    UINT64                  AddressLength = 0;
fa2344
+    UINT64                  Granularity = 0;
fa2344
+    UINT64                  TranslationOffset = 0;
fa2344
+    UINT64                  TypeSpecific = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
 
fa2344
@@ -267,9 +289,10 @@ RsDoExtendedMemoryDescriptor (
fa2344
     Descriptor->ExtAddress64.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE;
fa2344
     Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
fa2344
 
fa2344
-    Descriptor->ExtAddress64.ResourceLength = (UINT16)
fa2344
-        (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
fa2344
+    ResourceLength  = (UINT16) (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
fa2344
          sizeof (AML_RESOURCE_LARGE_HEADER));
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->ExtAddress64.ResourceLength,
fa2344
+        &ResourceLength);
fa2344
 
fa2344
     /* Process all child initialization nodes */
fa2344
 
fa2344
@@ -319,7 +342,7 @@ RsDoExtendedMemoryDescriptor (
fa2344
 
fa2344
         case 6: /* Address Granularity */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer;
fa2344
+            Granularity = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity));
fa2344
             GranOp = InitializerOp;
fa2344
@@ -327,7 +350,7 @@ RsDoExtendedMemoryDescriptor (
fa2344
 
fa2344
         case 7: /* Min Address */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer;
fa2344
+            Minimum = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum));
fa2344
             MinOp = InitializerOp;
fa2344
@@ -335,7 +358,7 @@ RsDoExtendedMemoryDescriptor (
fa2344
 
fa2344
         case 8: /* Max Address */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer;
fa2344
+            Maximum = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum));
fa2344
             MaxOp = InitializerOp;
fa2344
@@ -343,14 +366,14 @@ RsDoExtendedMemoryDescriptor (
fa2344
 
fa2344
         case 9: /* Translation Offset */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer;
fa2344
+            TranslationOffset = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset));
fa2344
             break;
fa2344
 
fa2344
         case 10: /* Address Length */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer;
fa2344
+            AddressLength = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength));
fa2344
             LengthOp = InitializerOp;
fa2344
@@ -358,7 +381,7 @@ RsDoExtendedMemoryDescriptor (
fa2344
 
fa2344
         case 11: /* Type-Specific Attributes */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer;
fa2344
+            TypeSpecific = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific));
fa2344
             break;
fa2344
@@ -395,13 +418,20 @@ RsDoExtendedMemoryDescriptor (
fa2344
     /* Validate the Min/Max/Len/Gran values */
fa2344
 
fa2344
     RsLargeAddressCheck (
fa2344
-        Descriptor->ExtAddress64.Minimum,
fa2344
-        Descriptor->ExtAddress64.Maximum,
fa2344
-        Descriptor->ExtAddress64.AddressLength,
fa2344
-        Descriptor->ExtAddress64.Granularity,
fa2344
+        Minimum,
fa2344
+        Maximum,
fa2344
+        AddressLength,
fa2344
+        Granularity,
fa2344
         Descriptor->ExtAddress64.Flags,
fa2344
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
fa2344
 
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Minimum, &Minimum);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Maximum, &Maximum);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.AddressLength, &AddressLength);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Granularity, &Granularity);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.TranslationOffset, &TranslationOffset);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.TypeSpecific, &TypeSpecific);
fa2344
+
fa2344
     Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) +
fa2344
         StringLength;
fa2344
     return (Rnode);
fa2344
@@ -432,6 +462,13 @@ RsDoExtendedSpaceDescriptor (
fa2344
     ACPI_PARSE_OBJECT       *GranOp = NULL;
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
     UINT16                  StringLength = 0;
fa2344
+    UINT16                  ResourceLength = 0;
fa2344
+    UINT64                  Minimum = 0;
fa2344
+    UINT64                  Maximum = 0;
fa2344
+    UINT64                  AddressLength = 0;
fa2344
+    UINT64                  Granularity = 0;
fa2344
+    UINT64                  TranslationOffset = 0;
fa2344
+    UINT64                  TypeSpecific = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
 
fa2344
@@ -447,9 +484,10 @@ RsDoExtendedSpaceDescriptor (
fa2344
     Descriptor->ExtAddress64.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64;
fa2344
     Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
fa2344
 
fa2344
-    Descriptor->ExtAddress64.ResourceLength = (UINT16)
fa2344
-        (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
fa2344
+    ResourceLength  = (UINT16) (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
fa2344
          sizeof (AML_RESOURCE_LARGE_HEADER));
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->ExtAddress64.ResourceLength,
fa2344
+        &ResourceLength);
fa2344
 
fa2344
     /* Process all child initialization nodes */
fa2344
 
fa2344
@@ -497,7 +535,7 @@ RsDoExtendedSpaceDescriptor (
fa2344
 
fa2344
         case 6: /* Address Granularity */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer;
fa2344
+            Granularity = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity));
fa2344
             GranOp = InitializerOp;
fa2344
@@ -505,7 +543,7 @@ RsDoExtendedSpaceDescriptor (
fa2344
 
fa2344
         case 7: /* Min Address */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer;
fa2344
+            Minimum = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum));
fa2344
             MinOp = InitializerOp;
fa2344
@@ -513,7 +551,7 @@ RsDoExtendedSpaceDescriptor (
fa2344
 
fa2344
         case 8: /* Max Address */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer;
fa2344
+            Maximum = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum));
fa2344
             MaxOp = InitializerOp;
fa2344
@@ -521,14 +559,14 @@ RsDoExtendedSpaceDescriptor (
fa2344
 
fa2344
         case 9: /* Translation Offset */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer;
fa2344
+            TranslationOffset = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset));
fa2344
             break;
fa2344
 
fa2344
         case 10: /* Address Length */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer;
fa2344
+            AddressLength = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength));
fa2344
             LengthOp = InitializerOp;
fa2344
@@ -536,7 +574,7 @@ RsDoExtendedSpaceDescriptor (
fa2344
 
fa2344
         case 11: /* Type-Specific Attributes */
fa2344
 
fa2344
-            Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer;
fa2344
+            TypeSpecific = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific));
fa2344
             break;
fa2344
@@ -558,13 +596,20 @@ RsDoExtendedSpaceDescriptor (
fa2344
     /* Validate the Min/Max/Len/Gran values */
fa2344
 
fa2344
     RsLargeAddressCheck (
fa2344
-        Descriptor->ExtAddress64.Minimum,
fa2344
-        Descriptor->ExtAddress64.Maximum,
fa2344
-        Descriptor->ExtAddress64.AddressLength,
fa2344
-        Descriptor->ExtAddress64.Granularity,
fa2344
+        Minimum,
fa2344
+        Maximum,
fa2344
+        AddressLength,
fa2344
+        Granularity,
fa2344
         Descriptor->ExtAddress64.Flags,
fa2344
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
fa2344
 
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Minimum, &Minimum);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Maximum, &Maximum);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.AddressLength, &AddressLength);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Granularity, &Granularity);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.TranslationOffset, &TranslationOffset);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.TypeSpecific, &TypeSpecific);
fa2344
+
fa2344
     Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) +
fa2344
         StringLength;
fa2344
     return (Rnode);
fa2344
diff --git a/source/compiler/aslrestype2q.c b/source/compiler/aslrestype2q.c
fa2344
index c8d8cab..d738ca4 100644
fa2344
--- a/source/compiler/aslrestype2q.c
fa2344
+++ b/source/compiler/aslrestype2q.c
fa2344
@@ -80,7 +80,13 @@ RsDoQwordIoDescriptor (
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
     UINT8                   *OptionalFields;
fa2344
     UINT16                  StringLength = 0;
fa2344
+    UINT16                  ResourceLength = 0;
fa2344
     UINT32                  OptionIndex = 0;
fa2344
+    UINT64                  Minimum = 0;
fa2344
+    UINT64                  Maximum = 0;
fa2344
+    UINT64                  AddressLength = 0;
fa2344
+    UINT64                  Granularity = 0;
fa2344
+    UINT64                  TranslationOffset = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
     BOOLEAN                 ResSourceIndex = FALSE;
fa2344
@@ -102,8 +108,7 @@ RsDoQwordIoDescriptor (
fa2344
      * optional fields present
fa2344
      */
fa2344
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64);
fa2344
-    Descriptor->Address64.ResourceLength = (UINT16)
fa2344
-        (sizeof (AML_RESOURCE_ADDRESS64) -
fa2344
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS64) -
fa2344
          sizeof (AML_RESOURCE_LARGE_HEADER));
fa2344
 
fa2344
     /* Process all child initialization nodes */
fa2344
@@ -147,7 +152,7 @@ RsDoQwordIoDescriptor (
fa2344
 
fa2344
         case 5: /* Address Granularity */
fa2344
 
fa2344
-            Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
fa2344
+            Granularity = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
fa2344
             GranOp = InitializerOp;
fa2344
@@ -155,7 +160,7 @@ RsDoQwordIoDescriptor (
fa2344
 
fa2344
         case 6: /* Address Min */
fa2344
 
fa2344
-            Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
fa2344
+            Minimum = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
fa2344
             MinOp = InitializerOp;
fa2344
@@ -163,7 +168,7 @@ RsDoQwordIoDescriptor (
fa2344
 
fa2344
         case 7: /* Address Max */
fa2344
 
fa2344
-            Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
fa2344
+            Maximum = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
fa2344
             MaxOp = InitializerOp;
fa2344
@@ -171,14 +176,14 @@ RsDoQwordIoDescriptor (
fa2344
 
fa2344
         case 8: /* Translation Offset */
fa2344
 
fa2344
-            Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
fa2344
+            TranslationOffset = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
fa2344
             break;
fa2344
 
fa2344
         case 9: /* Address Length */
fa2344
 
fa2344
-            Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
fa2344
+            AddressLength = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
fa2344
             LengthOp = InitializerOp;
fa2344
@@ -190,7 +195,7 @@ RsDoQwordIoDescriptor (
fa2344
             {
fa2344
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
fa2344
                 OptionIndex++;
fa2344
-                Descriptor->Address64.ResourceLength++;
fa2344
+                ResourceLength++;
fa2344
                 ResSourceIndex = TRUE;
fa2344
             }
fa2344
             break;
fa2344
@@ -202,8 +207,7 @@ RsDoQwordIoDescriptor (
fa2344
             {
fa2344
                 if (StringLength)
fa2344
                 {
fa2344
-                    Descriptor->Address64.ResourceLength = (UINT16)
fa2344
-                        (Descriptor->Address64.ResourceLength + StringLength);
fa2344
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
fa2344
 
fa2344
                     strcpy ((char *)
fa2344
                         &OptionalFields[OptionIndex],
fa2344
@@ -263,13 +267,20 @@ RsDoQwordIoDescriptor (
fa2344
     /* Validate the Min/Max/Len/Gran values */
fa2344
 
fa2344
     RsLargeAddressCheck (
fa2344
-        Descriptor->Address64.Minimum,
fa2344
-        Descriptor->Address64.Maximum,
fa2344
-        Descriptor->Address64.AddressLength,
fa2344
-        Descriptor->Address64.Granularity,
fa2344
+        Minimum,
fa2344
+        Maximum,
fa2344
+        AddressLength,
fa2344
+        Granularity,
fa2344
         Descriptor->Address64.Flags,
fa2344
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
fa2344
 
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address64.ResourceLength, &ResourceLength);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Minimum, &Minimum);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Maximum, &Maximum);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.AddressLength, &AddressLength);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Granularity, &Granularity);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.TranslationOffset, &TranslationOffset);
fa2344
+
fa2344
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
fa2344
         OptionIndex + StringLength;
fa2344
     return (Rnode);
fa2344
@@ -301,7 +312,13 @@ RsDoQwordMemoryDescriptor (
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
     UINT8                   *OptionalFields;
fa2344
     UINT16                  StringLength = 0;
fa2344
+    UINT16                  ResourceLength = 0;
fa2344
     UINT32                  OptionIndex = 0;
fa2344
+    UINT64                  Minimum = 0;
fa2344
+    UINT64                  Maximum = 0;
fa2344
+    UINT64                  AddressLength = 0;
fa2344
+    UINT64                  Granularity = 0;
fa2344
+    UINT64                  TranslationOffset = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
     BOOLEAN                 ResSourceIndex = FALSE;
fa2344
@@ -323,8 +340,7 @@ RsDoQwordMemoryDescriptor (
fa2344
      * optional fields present
fa2344
      */
fa2344
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64);
fa2344
-    Descriptor->Address64.ResourceLength = (UINT16)
fa2344
-        (sizeof (AML_RESOURCE_ADDRESS64) -
fa2344
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS64) -
fa2344
          sizeof (AML_RESOURCE_LARGE_HEADER));
fa2344
 
fa2344
     /* Process all child initialization nodes */
fa2344
@@ -375,7 +391,7 @@ RsDoQwordMemoryDescriptor (
fa2344
 
fa2344
         case 6: /* Address Granularity */
fa2344
 
fa2344
-            Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
fa2344
+            Granularity = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
fa2344
             GranOp = InitializerOp;
fa2344
@@ -383,7 +399,7 @@ RsDoQwordMemoryDescriptor (
fa2344
 
fa2344
         case 7: /* Min Address */
fa2344
 
fa2344
-            Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
fa2344
+            Minimum = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
fa2344
             MinOp = InitializerOp;
fa2344
@@ -391,7 +407,7 @@ RsDoQwordMemoryDescriptor (
fa2344
 
fa2344
         case 8: /* Max Address */
fa2344
 
fa2344
-            Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
fa2344
+            Maximum = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
fa2344
             MaxOp = InitializerOp;
fa2344
@@ -399,14 +415,14 @@ RsDoQwordMemoryDescriptor (
fa2344
 
fa2344
         case 9: /* Translation Offset */
fa2344
 
fa2344
-            Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
fa2344
+            TranslationOffset = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
fa2344
             break;
fa2344
 
fa2344
         case 10: /* Address Length */
fa2344
 
fa2344
-            Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
fa2344
+            AddressLength = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
fa2344
             LengthOp = InitializerOp;
fa2344
@@ -418,7 +434,7 @@ RsDoQwordMemoryDescriptor (
fa2344
             {
fa2344
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
fa2344
                 OptionIndex++;
fa2344
-                Descriptor->Address64.ResourceLength++;
fa2344
+                ResourceLength++;
fa2344
                 ResSourceIndex = TRUE;
fa2344
             }
fa2344
             break;
fa2344
@@ -430,8 +446,7 @@ RsDoQwordMemoryDescriptor (
fa2344
             {
fa2344
                 if (StringLength)
fa2344
                 {
fa2344
-                    Descriptor->Address64.ResourceLength = (UINT16)
fa2344
-                        (Descriptor->Address64.ResourceLength + StringLength);
fa2344
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
fa2344
 
fa2344
                     strcpy ((char *)
fa2344
                         &OptionalFields[OptionIndex],
fa2344
@@ -492,13 +507,20 @@ RsDoQwordMemoryDescriptor (
fa2344
     /* Validate the Min/Max/Len/Gran values */
fa2344
 
fa2344
     RsLargeAddressCheck (
fa2344
-        Descriptor->Address64.Minimum,
fa2344
-        Descriptor->Address64.Maximum,
fa2344
-        Descriptor->Address64.AddressLength,
fa2344
-        Descriptor->Address64.Granularity,
fa2344
+        Minimum,
fa2344
+        Maximum,
fa2344
+        AddressLength,
fa2344
+        Granularity,
fa2344
         Descriptor->Address64.Flags,
fa2344
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
fa2344
 
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address64.ResourceLength, &ResourceLength);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Minimum, &Minimum);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Maximum, &Maximum);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.AddressLength, &AddressLength);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Granularity, &Granularity);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.TranslationOffset, &TranslationOffset);
fa2344
+
fa2344
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
fa2344
         OptionIndex + StringLength;
fa2344
     return (Rnode);
fa2344
@@ -530,9 +552,15 @@ RsDoQwordSpaceDescriptor (
fa2344
     ASL_RESOURCE_NODE       *Rnode;
fa2344
     UINT8                   *OptionalFields;
fa2344
     UINT16                  StringLength = 0;
fa2344
+    UINT16                  ResourceLength = 0;
fa2344
     UINT32                  OptionIndex = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
+    UINT64                  Minimum = 0;
fa2344
+    UINT64                  Maximum = 0;
fa2344
+    UINT64                  AddressLength = 0;
fa2344
+    UINT64                  Granularity = 0;
fa2344
+    UINT64                  TranslationOffset = 0;
fa2344
     BOOLEAN                 ResSourceIndex = FALSE;
fa2344
 
fa2344
 
fa2344
@@ -551,8 +579,7 @@ RsDoQwordSpaceDescriptor (
fa2344
      * optional fields present
fa2344
      */
fa2344
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64);
fa2344
-    Descriptor->Address64.ResourceLength = (UINT16)
fa2344
-        (sizeof (AML_RESOURCE_ADDRESS64) -
fa2344
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS64) -
fa2344
          sizeof (AML_RESOURCE_LARGE_HEADER));
fa2344
 
fa2344
     /* Process all child initialization nodes */
fa2344
@@ -601,7 +628,7 @@ RsDoQwordSpaceDescriptor (
fa2344
 
fa2344
         case 6: /* Address Granularity */
fa2344
 
fa2344
-            Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
fa2344
+            Granularity = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
fa2344
             GranOp = InitializerOp;
fa2344
@@ -609,7 +636,7 @@ RsDoQwordSpaceDescriptor (
fa2344
 
fa2344
         case 7: /* Min Address */
fa2344
 
fa2344
-            Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
fa2344
+            Minimum = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
fa2344
             MinOp = InitializerOp;
fa2344
@@ -617,7 +644,7 @@ RsDoQwordSpaceDescriptor (
fa2344
 
fa2344
         case 8: /* Max Address */
fa2344
 
fa2344
-            Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
fa2344
+            Maximum = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
fa2344
             MaxOp = InitializerOp;
fa2344
@@ -625,14 +652,14 @@ RsDoQwordSpaceDescriptor (
fa2344
 
fa2344
         case 9: /* Translation Offset */
fa2344
 
fa2344
-            Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
fa2344
+            TranslationOffset = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
fa2344
             break;
fa2344
 
fa2344
         case 10: /* Address Length */
fa2344
 
fa2344
-            Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
fa2344
+            AddressLength = InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
fa2344
             LengthOp = InitializerOp;
fa2344
@@ -644,7 +671,7 @@ RsDoQwordSpaceDescriptor (
fa2344
             {
fa2344
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
fa2344
                 OptionIndex++;
fa2344
-                Descriptor->Address64.ResourceLength++;
fa2344
+                ResourceLength++;
fa2344
                 ResSourceIndex = TRUE;
fa2344
             }
fa2344
             break;
fa2344
@@ -656,8 +683,7 @@ RsDoQwordSpaceDescriptor (
fa2344
             {
fa2344
                 if (StringLength)
fa2344
                 {
fa2344
-                    Descriptor->Address64.ResourceLength = (UINT16)
fa2344
-                        (Descriptor->Address64.ResourceLength + StringLength);
fa2344
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
fa2344
 
fa2344
                     strcpy ((char *)
fa2344
                         &OptionalFields[OptionIndex],
fa2344
@@ -703,13 +729,20 @@ RsDoQwordSpaceDescriptor (
fa2344
     /* Validate the Min/Max/Len/Gran values */
fa2344
 
fa2344
     RsLargeAddressCheck (
fa2344
-        Descriptor->Address64.Minimum,
fa2344
-        Descriptor->Address64.Maximum,
fa2344
-        Descriptor->Address64.AddressLength,
fa2344
-        Descriptor->Address64.Granularity,
fa2344
+        Minimum,
fa2344
+        Maximum,
fa2344
+        AddressLength,
fa2344
+        Granularity,
fa2344
         Descriptor->Address64.Flags,
fa2344
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
fa2344
 
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address64.ResourceLength, &ResourceLength);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Minimum, &Minimum);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Maximum, &Maximum);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.AddressLength, &AddressLength);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Granularity, &Granularity);
fa2344
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.TranslationOffset, &TranslationOffset);
fa2344
+
fa2344
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
fa2344
         OptionIndex + StringLength;
fa2344
     return (Rnode);
fa2344
diff --git a/source/compiler/aslrestype2s.c b/source/compiler/aslrestype2s.c
fa2344
index fcd8e23..b7394b7 100644
fa2344
--- a/source/compiler/aslrestype2s.c
fa2344
+++ b/source/compiler/aslrestype2s.c
fa2344
@@ -290,6 +290,9 @@ RsDoGpioIntDescriptor (
fa2344
     UINT16                  VendorLength;
fa2344
     UINT16                  InterruptLength;
fa2344
     UINT16                  DescriptorSize;
fa2344
+    UINT16                  IntFlags = 0;
fa2344
+    UINT16                  DebounceTimeout = 0;
fa2344
+    UINT16                  Flags = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  PinCount = 0;
fa2344
     UINT32                  i;
fa2344
@@ -346,21 +349,21 @@ RsDoGpioIntDescriptor (
fa2344
         {
fa2344
         case 0: /* Interrupt Mode - edge/level [Flag] (_MOD) */
fa2344
 
fa2344
-            RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 0, 0);
fa2344
+            RsSetFlagBits16 (&IntFlags, InitializerOp, 0, 0);
fa2344
             RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 0);
fa2344
             break;
fa2344
 
fa2344
         case 1: /* Interrupt Polarity - Active high/low [Flags] (_POL) */
fa2344
 
fa2344
-            RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 1, 0);
fa2344
+            RsSetFlagBits16 (&IntFlags, InitializerOp, 1, 0);
fa2344
             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_POLARITY,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 1, 2);
fa2344
             break;
fa2344
 
fa2344
         case 2: /* Share Type - Default: exclusive (0) [Flags] (_SHR) */
fa2344
 
fa2344
-            RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 3, 0);
fa2344
+            RsSetFlagBits16 (&IntFlags, InitializerOp, 3, 0);
fa2344
             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 3, 2);
fa2344
             break;
fa2344
@@ -374,7 +377,7 @@ RsDoGpioIntDescriptor (
fa2344
 
fa2344
         case 4: /* Debounce Timeout [WORD] (_DBT) */
fa2344
 
fa2344
-            Descriptor->Gpio.DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_DEBOUNCETIME,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.DebounceTimeout));
fa2344
             break;
fa2344
@@ -401,7 +404,7 @@ RsDoGpioIntDescriptor (
fa2344
 
fa2344
         case 7: /* Resource Usage (consumer/producer) */
fa2344
 
fa2344
-            RsSetFlagBits16 (&Descriptor->Gpio.Flags, InitializerOp, 0, 1);
fa2344
+            RsSetFlagBits16 (&Flags, InitializerOp, 0, 1);
fa2344
             break;
fa2344
 
fa2344
         case 8: /* Resource Tag (Descriptor Name) */
fa2344
@@ -466,6 +469,10 @@ RsDoGpioIntDescriptor (
fa2344
         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
fa2344
     }
fa2344
 
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.IntFlags, &IntFlags);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.DebounceTimeout, &DebounceTimeout);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.Flags, &Flags);
fa2344
+
fa2344
     MpSaveGpioInfo (Info->MappingOp, Descriptor,
fa2344
         PinCount, PinList, ResourceSource);
fa2344
     return (Rnode);
fa2344
@@ -499,6 +506,10 @@ RsDoGpioIoDescriptor (
fa2344
     UINT16                  VendorLength;
fa2344
     UINT16                  InterruptLength;
fa2344
     UINT16                  DescriptorSize;
fa2344
+    UINT16                  IntFlags = 0;
fa2344
+    UINT16                  DebounceTimeout = 0;
fa2344
+    UINT16                  DriveStrength = 0;
fa2344
+    UINT16                  Flags = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  PinCount = 0;
fa2344
     UINT32                  i;
fa2344
@@ -555,7 +566,7 @@ RsDoGpioIoDescriptor (
fa2344
         {
fa2344
         case 0: /* Share Type [Flags] (_SHR) */
fa2344
 
fa2344
-            RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 3, 0);
fa2344
+            RsSetFlagBits16 (&IntFlags, InitializerOp, 3, 0);
fa2344
             RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 3);
fa2344
             break;
fa2344
@@ -569,21 +580,21 @@ RsDoGpioIoDescriptor (
fa2344
 
fa2344
         case 2: /* Debounce Timeout [WORD] (_DBT) */
fa2344
 
fa2344
-            Descriptor->Gpio.DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_DEBOUNCETIME,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.DebounceTimeout));
fa2344
             break;
fa2344
 
fa2344
         case 3: /* Drive Strength [WORD] (_DRS) */
fa2344
 
fa2344
-            Descriptor->Gpio.DriveStrength = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            DriveStrength = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_DRIVESTRENGTH,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.DriveStrength));
fa2344
             break;
fa2344
 
fa2344
         case 4: /* I/O Restriction [Flag] (_IOR) */
fa2344
 
fa2344
-            RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 0, 0);
fa2344
+            RsSetFlagBits16 (&IntFlags, InitializerOp, 0, 0);
fa2344
             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_IORESTRICTION,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 0, 2);
fa2344
             break;
fa2344
@@ -609,7 +620,7 @@ RsDoGpioIoDescriptor (
fa2344
 
fa2344
         case 7: /* Resource Usage (consumer/producer) */
fa2344
 
fa2344
-            RsSetFlagBits16 (&Descriptor->Gpio.Flags, InitializerOp, 0, 1);
fa2344
+            RsSetFlagBits16 (&Flags, InitializerOp, 0, 1);
fa2344
             break;
fa2344
 
fa2344
         case 8: /* Resource Tag (Descriptor Name) */
fa2344
@@ -673,6 +684,11 @@ RsDoGpioIoDescriptor (
fa2344
         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
fa2344
     }
fa2344
 
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.IntFlags, &IntFlags);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.DebounceTimeout, &DebounceTimeout);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.DriveStrength, &DriveStrength);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.Flags, &Flags);
fa2344
+
fa2344
     MpSaveGpioInfo (Info->MappingOp, Descriptor,
fa2344
         PinCount, PinList, ResourceSource);
fa2344
     return (Rnode);
fa2344
@@ -703,6 +719,9 @@ RsDoI2cSerialBusDescriptor (
fa2344
     UINT16                  ResSourceLength;
fa2344
     UINT16                  VendorLength;
fa2344
     UINT16                  DescriptorSize;
fa2344
+    UINT16                  SlaveAddress = 0;
fa2344
+    UINT32                  ConnectionSpeed = 0;
fa2344
+    UINT16                  TypeSpecificFlags = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
 
fa2344
@@ -752,7 +771,7 @@ RsDoI2cSerialBusDescriptor (
fa2344
         {
fa2344
         case 0: /* Slave Address [WORD] (_ADR) */
fa2344
 
fa2344
-            Descriptor->I2cSerialBus.SlaveAddress = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            SlaveAddress = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_ADDRESS,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.SlaveAddress));
fa2344
             break;
fa2344
@@ -766,14 +785,14 @@ RsDoI2cSerialBusDescriptor (
fa2344
 
fa2344
         case 2: /* Connection Speed [DWORD] (_SPE) */
fa2344
 
fa2344
-            Descriptor->I2cSerialBus.ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.ConnectionSpeed));
fa2344
             break;
fa2344
 
fa2344
         case 3: /* Addressing Mode [Flag] (_MOD) */
fa2344
 
fa2344
-            RsSetFlagBits16 (&Descriptor->I2cSerialBus.TypeSpecificFlags, InitializerOp, 0, 0);
fa2344
+            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 0, 0);
fa2344
             RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.TypeSpecificFlags), 0);
fa2344
             break;
fa2344
@@ -833,6 +852,10 @@ RsDoI2cSerialBusDescriptor (
fa2344
         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
fa2344
     }
fa2344
 
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->I2cSerialBus.SlaveAddress, &SlaveAddress);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->I2cSerialBus.ConnectionSpeed, &ConnectionSpeed);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->I2cSerialBus.TypeSpecificFlags, &TypeSpecificFlags);
fa2344
+
fa2344
     MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
fa2344
     return (Rnode);
fa2344
 }
fa2344
@@ -862,6 +885,9 @@ RsDoSpiSerialBusDescriptor (
fa2344
     UINT16                  ResSourceLength;
fa2344
     UINT16                  VendorLength;
fa2344
     UINT16                  DescriptorSize;
fa2344
+    UINT16                  DeviceSelection = 0;
fa2344
+    UINT32                  ConnectionSpeed = 0;
fa2344
+    UINT16                  TypeSpecificFlags = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
 
fa2344
@@ -912,21 +938,21 @@ RsDoSpiSerialBusDescriptor (
fa2344
         {
fa2344
         case 0: /* Device Selection [WORD] (_ADR) */
fa2344
 
fa2344
-            Descriptor->SpiSerialBus.DeviceSelection = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            DeviceSelection = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_ADDRESS,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.DeviceSelection));
fa2344
             break;
fa2344
 
fa2344
         case 1: /* Device Polarity [Flag] (_DPL) */
fa2344
 
fa2344
-            RsSetFlagBits16 (&Descriptor->SpiSerialBus.TypeSpecificFlags, InitializerOp, 1, 0);
fa2344
+            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 1, 0);
fa2344
             RsCreateBitField (InitializerOp, ACPI_RESTAG_DEVICEPOLARITY,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.TypeSpecificFlags), 1);
fa2344
             break;
fa2344
 
fa2344
         case 2: /* Wire Mode [Flag] (_MOD) */
fa2344
 
fa2344
-            RsSetFlagBits16 (&Descriptor->SpiSerialBus.TypeSpecificFlags, InitializerOp, 0, 0);
fa2344
+            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 0, 0);
fa2344
             RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.TypeSpecificFlags), 0);
fa2344
             break;
fa2344
@@ -947,7 +973,7 @@ RsDoSpiSerialBusDescriptor (
fa2344
 
fa2344
         case 5: /* Connection Speed [DWORD] (_SPE) */
fa2344
 
fa2344
-            Descriptor->SpiSerialBus.ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.ConnectionSpeed));
fa2344
             break;
fa2344
@@ -1021,6 +1047,10 @@ RsDoSpiSerialBusDescriptor (
fa2344
         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
fa2344
     }
fa2344
 
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->SpiSerialBus.DeviceSelection, &DeviceSelection);
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->SpiSerialBus.ConnectionSpeed, &ConnectionSpeed);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->SpiSerialBus.TypeSpecificFlags, &TypeSpecificFlags);
fa2344
+
fa2344
     MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
fa2344
     return (Rnode);
fa2344
 }
fa2344
@@ -1050,6 +1080,10 @@ RsDoUartSerialBusDescriptor (
fa2344
     UINT16                  ResSourceLength;
fa2344
     UINT16                  VendorLength;
fa2344
     UINT16                  DescriptorSize;
fa2344
+    UINT32                  DefaultBaudRate = 0;
fa2344
+    UINT16                  TypeSpecificFlags = 0;
fa2344
+    UINT16                  RxFifoSize = 0;
fa2344
+    UINT16                  TxFifoSize = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
 
fa2344
@@ -1099,21 +1133,21 @@ RsDoUartSerialBusDescriptor (
fa2344
         {
fa2344
         case 0: /* Connection Speed (Baud Rate) [DWORD] (_SPE) */
fa2344
 
fa2344
-            Descriptor->UartSerialBus.DefaultBaudRate = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
+            DefaultBaudRate = (UINT32) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.DefaultBaudRate));
fa2344
             break;
fa2344
 
fa2344
         case 1: /* Bits Per Byte [Flags] (_LEN) */
fa2344
 
fa2344
-            RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 4, 3);
fa2344
+            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 4, 3);
fa2344
             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_LENGTH,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 4, 3);
fa2344
             break;
fa2344
 
fa2344
         case 2: /* Stop Bits [Flags] (_STB) */
fa2344
 
fa2344
-            RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 2, 1);
fa2344
+            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 2, 1);
fa2344
             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_STOPBITS,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 2, 2);
fa2344
             break;
fa2344
@@ -1127,7 +1161,7 @@ RsDoUartSerialBusDescriptor (
fa2344
 
fa2344
         case 4: /* Endianness [Flag] (_END) */
fa2344
 
fa2344
-            RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 7, 0);
fa2344
+            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 7, 0);
fa2344
             RsCreateBitField (InitializerOp, ACPI_RESTAG_ENDIANNESS,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 7);
fa2344
             break;
fa2344
@@ -1141,21 +1175,21 @@ RsDoUartSerialBusDescriptor (
fa2344
 
fa2344
         case 6: /* Flow Control [Flags] (_FLC) */
fa2344
 
fa2344
-            RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 0, 0);
fa2344
+            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 0, 0);
fa2344
             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_FLOWCONTROL,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 0, 2);
fa2344
             break;
fa2344
 
fa2344
         case 7: /* Rx Buffer Size [WORD] (_RXL) */
fa2344
 
fa2344
-            Descriptor->UartSerialBus.RxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            RxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH_RX,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.RxFifoSize));
fa2344
             break;
fa2344
 
fa2344
         case 8: /* Tx Buffer Size [WORD] (_TXL) */
fa2344
 
fa2344
-            Descriptor->UartSerialBus.TxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            TxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH_TX,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TxFifoSize));
fa2344
             break;
fa2344
@@ -1225,6 +1259,11 @@ RsDoUartSerialBusDescriptor (
fa2344
         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
fa2344
     }
fa2344
 
fa2344
+    ACPI_MOVE_32_TO_32(&Descriptor->UartSerialBus.DefaultBaudRate, &DefaultBaudRate);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->UartSerialBus.TypeSpecificFlags, &TypeSpecificFlags);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->UartSerialBus.RxFifoSize, &RxFifoSize);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->UartSerialBus.TxFifoSize, &TxFifoSize);
fa2344
+
fa2344
     MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
fa2344
     return (Rnode);
fa2344
 }
fa2344
diff --git a/source/compiler/aslrestype2w.c b/source/compiler/aslrestype2w.c
fa2344
index 0b88c70..a971d5a 100644
fa2344
--- a/source/compiler/aslrestype2w.c
fa2344
+++ b/source/compiler/aslrestype2w.c
fa2344
@@ -81,6 +81,12 @@ RsDoWordIoDescriptor (
fa2344
     UINT8                   *OptionalFields;
fa2344
     UINT16                  StringLength = 0;
fa2344
     UINT32                  OptionIndex = 0;
fa2344
+    UINT16                  ResourceLength = 0;
fa2344
+    UINT16                  Minimum = 0;
fa2344
+    UINT16                  Maximum = 0;
fa2344
+    UINT16                  AddressLength = 0;
fa2344
+    UINT16                  Granularity = 0;
fa2344
+    UINT16                  TranslationOffset = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
     BOOLEAN                 ResSourceIndex = FALSE;
fa2344
@@ -102,8 +108,7 @@ RsDoWordIoDescriptor (
fa2344
      * optional fields present
fa2344
      */
fa2344
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS16);
fa2344
-    Descriptor->Address16.ResourceLength = (UINT16)
fa2344
-        (sizeof (AML_RESOURCE_ADDRESS16) -
fa2344
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS16) -
fa2344
          sizeof (AML_RESOURCE_LARGE_HEADER));
fa2344
 
fa2344
     /* Process all child initialization nodes */
fa2344
@@ -147,7 +152,7 @@ RsDoWordIoDescriptor (
fa2344
 
fa2344
         case 5: /* Address Granularity */
fa2344
 
fa2344
-            Descriptor->Address16.Granularity = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            Granularity = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
fa2344
             GranOp = InitializerOp;
fa2344
@@ -155,7 +160,7 @@ RsDoWordIoDescriptor (
fa2344
 
fa2344
         case 6: /* Address Min */
fa2344
 
fa2344
-            Descriptor->Address16.Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
fa2344
             MinOp = InitializerOp;
fa2344
@@ -163,7 +168,7 @@ RsDoWordIoDescriptor (
fa2344
 
fa2344
         case 7: /* Address Max */
fa2344
 
fa2344
-            Descriptor->Address16.Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
fa2344
             MaxOp = InitializerOp;
fa2344
@@ -171,14 +176,14 @@ RsDoWordIoDescriptor (
fa2344
 
fa2344
         case 8: /* Translation Offset */
fa2344
 
fa2344
-            Descriptor->Address16.TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
fa2344
             break;
fa2344
 
fa2344
         case 9: /* Address Length */
fa2344
 
fa2344
-            Descriptor->Address16.AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
fa2344
                  CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength));
fa2344
             LengthOp = InitializerOp;
fa2344
@@ -190,7 +195,7 @@ RsDoWordIoDescriptor (
fa2344
             {
fa2344
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
fa2344
                 OptionIndex++;
fa2344
-                Descriptor->Address16.ResourceLength++;
fa2344
+                ResourceLength++;
fa2344
                 ResSourceIndex = TRUE;
fa2344
             }
fa2344
             break;
fa2344
@@ -202,8 +207,7 @@ RsDoWordIoDescriptor (
fa2344
             {
fa2344
                 if (StringLength)
fa2344
                 {
fa2344
-                    Descriptor->Address16.ResourceLength = (UINT16)
fa2344
-                        (Descriptor->Address16.ResourceLength + StringLength);
fa2344
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
fa2344
 
fa2344
                     strcpy ((char *)
fa2344
                         &OptionalFields[OptionIndex],
fa2344
@@ -263,13 +267,20 @@ RsDoWordIoDescriptor (
fa2344
     /* Validate the Min/Max/Len/Gran values */
fa2344
 
fa2344
     RsLargeAddressCheck (
fa2344
-        (UINT64) Descriptor->Address16.Minimum,
fa2344
-        (UINT64) Descriptor->Address16.Maximum,
fa2344
-        (UINT64) Descriptor->Address16.AddressLength,
fa2344
-        (UINT64) Descriptor->Address16.Granularity,
fa2344
+        Minimum,
fa2344
+        Maximum,
fa2344
+        AddressLength,
fa2344
+        Granularity,
fa2344
         Descriptor->Address16.Flags,
fa2344
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
fa2344
 
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.ResourceLength, &ResourceLength);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Minimum, &Minimum);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Maximum, &Maximum);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.AddressLength, &AddressLength);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Granularity, &Granularity);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.TranslationOffset, &TranslationOffset);
fa2344
+
fa2344
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
fa2344
         OptionIndex + StringLength;
fa2344
     return (Rnode);
fa2344
@@ -302,6 +313,12 @@ RsDoWordBusNumberDescriptor (
fa2344
     UINT8                   *OptionalFields;
fa2344
     UINT16                  StringLength = 0;
fa2344
     UINT32                  OptionIndex = 0;
fa2344
+    UINT16                  ResourceLength = 0;
fa2344
+    UINT16                  Minimum = 0;
fa2344
+    UINT16                  Maximum = 0;
fa2344
+    UINT16                  AddressLength = 0;
fa2344
+    UINT16                  Granularity = 0;
fa2344
+    UINT16                  TranslationOffset = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
     BOOLEAN                 ResSourceIndex = FALSE;
fa2344
@@ -323,8 +340,7 @@ RsDoWordBusNumberDescriptor (
fa2344
      * optional fields present
fa2344
      */
fa2344
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS16);
fa2344
-    Descriptor->Address16.ResourceLength = (UINT16)
fa2344
-        (sizeof (AML_RESOURCE_ADDRESS16) -
fa2344
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS16) -
fa2344
          sizeof (AML_RESOURCE_LARGE_HEADER));
fa2344
 
fa2344
     /* Process all child initialization nodes */
fa2344
@@ -361,8 +377,7 @@ RsDoWordBusNumberDescriptor (
fa2344
 
fa2344
         case 4: /* Address Granularity */
fa2344
 
fa2344
-            Descriptor->Address16.Granularity =
fa2344
-                (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            Granularity = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
fa2344
             GranOp = InitializerOp;
fa2344
@@ -370,8 +385,7 @@ RsDoWordBusNumberDescriptor (
fa2344
 
fa2344
         case 5: /* Min Address */
fa2344
 
fa2344
-            Descriptor->Address16.Minimum =
fa2344
-                (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
fa2344
             MinOp = InitializerOp;
fa2344
@@ -379,8 +393,7 @@ RsDoWordBusNumberDescriptor (
fa2344
 
fa2344
         case 6: /* Max Address */
fa2344
 
fa2344
-            Descriptor->Address16.Maximum =
fa2344
-                (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
fa2344
             MaxOp = InitializerOp;
fa2344
@@ -388,16 +401,14 @@ RsDoWordBusNumberDescriptor (
fa2344
 
fa2344
         case 7: /* Translation Offset */
fa2344
 
fa2344
-            Descriptor->Address16.TranslationOffset =
fa2344
-                (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
fa2344
             break;
fa2344
 
fa2344
         case 8: /* Address Length */
fa2344
 
fa2344
-            Descriptor->Address16.AddressLength =
fa2344
-                (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
fa2344
                  CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength));
fa2344
             LengthOp = InitializerOp;
fa2344
@@ -409,7 +420,7 @@ RsDoWordBusNumberDescriptor (
fa2344
             {
fa2344
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
fa2344
                 OptionIndex++;
fa2344
-                Descriptor->Address16.ResourceLength++;
fa2344
+                ResourceLength++;
fa2344
                 ResSourceIndex = TRUE;
fa2344
             }
fa2344
             break;
fa2344
@@ -421,8 +432,7 @@ RsDoWordBusNumberDescriptor (
fa2344
             {
fa2344
                 if (StringLength)
fa2344
                 {
fa2344
-                    Descriptor->Address16.ResourceLength = (UINT16)
fa2344
-                        (Descriptor->Address16.ResourceLength + StringLength);
fa2344
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
fa2344
 
fa2344
                     strcpy ((char *)
fa2344
                         &OptionalFields[OptionIndex],
fa2344
@@ -468,13 +478,20 @@ RsDoWordBusNumberDescriptor (
fa2344
     /* Validate the Min/Max/Len/Gran values */
fa2344
 
fa2344
     RsLargeAddressCheck (
fa2344
-        (UINT64) Descriptor->Address16.Minimum,
fa2344
-        (UINT64) Descriptor->Address16.Maximum,
fa2344
-        (UINT64) Descriptor->Address16.AddressLength,
fa2344
-        (UINT64) Descriptor->Address16.Granularity,
fa2344
+        Minimum,
fa2344
+        Maximum,
fa2344
+        AddressLength,
fa2344
+        Granularity,
fa2344
         Descriptor->Address16.Flags,
fa2344
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
fa2344
 
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.ResourceLength, &ResourceLength);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Minimum, &Minimum);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Maximum, &Maximum);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.AddressLength, &AddressLength);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Granularity, &Granularity);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.TranslationOffset, &TranslationOffset);
fa2344
+
fa2344
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
fa2344
         OptionIndex + StringLength;
fa2344
     return (Rnode);
fa2344
@@ -507,6 +524,12 @@ RsDoWordSpaceDescriptor (
fa2344
     UINT8                   *OptionalFields;
fa2344
     UINT16                  StringLength = 0;
fa2344
     UINT32                  OptionIndex = 0;
fa2344
+    UINT16                  Minimum = 0;
fa2344
+    UINT16                  Maximum = 0;
fa2344
+    UINT16                  AddressLength = 0;
fa2344
+    UINT16                  Granularity = 0;
fa2344
+    UINT16                  TranslationOffset = 0;
fa2344
+    UINT16                  ResourceLength = 0;
fa2344
     UINT32                  CurrentByteOffset;
fa2344
     UINT32                  i;
fa2344
     BOOLEAN                 ResSourceIndex = FALSE;
fa2344
@@ -527,8 +550,7 @@ RsDoWordSpaceDescriptor (
fa2344
      * optional fields present
fa2344
      */
fa2344
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS16);
fa2344
-    Descriptor->Address16.ResourceLength = (UINT16)
fa2344
-        (sizeof (AML_RESOURCE_ADDRESS16) -
fa2344
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS16) -
fa2344
          sizeof (AML_RESOURCE_LARGE_HEADER));
fa2344
 
fa2344
     /* Process all child initialization nodes */
fa2344
@@ -577,8 +599,7 @@ RsDoWordSpaceDescriptor (
fa2344
 
fa2344
         case 6: /* Address Granularity */
fa2344
 
fa2344
-            Descriptor->Address16.Granularity =
fa2344
-                (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            Granularity = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
fa2344
             GranOp = InitializerOp;
fa2344
@@ -586,8 +607,7 @@ RsDoWordSpaceDescriptor (
fa2344
 
fa2344
         case 7: /* Min Address */
fa2344
 
fa2344
-            Descriptor->Address16.Minimum =
fa2344
-                (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
fa2344
             MinOp = InitializerOp;
fa2344
@@ -595,8 +615,7 @@ RsDoWordSpaceDescriptor (
fa2344
 
fa2344
         case 8: /* Max Address */
fa2344
 
fa2344
-            Descriptor->Address16.Maximum =
fa2344
-                (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
fa2344
             MaxOp = InitializerOp;
fa2344
@@ -604,16 +623,14 @@ RsDoWordSpaceDescriptor (
fa2344
 
fa2344
         case 9: /* Translation Offset */
fa2344
 
fa2344
-            Descriptor->Address16.TranslationOffset =
fa2344
-                (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
fa2344
             break;
fa2344
 
fa2344
         case 10: /* Address Length */
fa2344
 
fa2344
-            Descriptor->Address16.AddressLength =
fa2344
-                (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
+            AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
fa2344
             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
fa2344
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength));
fa2344
             LengthOp = InitializerOp;
fa2344
@@ -625,7 +642,7 @@ RsDoWordSpaceDescriptor (
fa2344
             {
fa2344
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
fa2344
                 OptionIndex++;
fa2344
-                Descriptor->Address16.ResourceLength++;
fa2344
+                ResourceLength++;
fa2344
                 ResSourceIndex = TRUE;
fa2344
             }
fa2344
             break;
fa2344
@@ -637,8 +654,7 @@ RsDoWordSpaceDescriptor (
fa2344
             {
fa2344
                 if (StringLength)
fa2344
                 {
fa2344
-                    Descriptor->Address16.ResourceLength = (UINT16)
fa2344
-                        (Descriptor->Address16.ResourceLength + StringLength);
fa2344
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
fa2344
 
fa2344
                     strcpy ((char *)
fa2344
                         &OptionalFields[OptionIndex],
fa2344
@@ -684,13 +700,20 @@ RsDoWordSpaceDescriptor (
fa2344
     /* Validate the Min/Max/Len/Gran values */
fa2344
 
fa2344
     RsLargeAddressCheck (
fa2344
-        (UINT64) Descriptor->Address16.Minimum,
fa2344
-        (UINT64) Descriptor->Address16.Maximum,
fa2344
-        (UINT64) Descriptor->Address16.AddressLength,
fa2344
-        (UINT64) Descriptor->Address16.Granularity,
fa2344
+        Minimum,
fa2344
+        Maximum,
fa2344
+        AddressLength,
fa2344
+        Granularity,
fa2344
         Descriptor->Address16.Flags,
fa2344
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
fa2344
 
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.ResourceLength, &ResourceLength);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Minimum, &Minimum);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Maximum, &Maximum);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.AddressLength, &AddressLength);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Granularity, &Granularity);
fa2344
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.TranslationOffset, &TranslationOffset);
fa2344
+
fa2344
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
fa2344
         OptionIndex + StringLength;
fa2344
     return (Rnode);
fa2344
diff --git a/source/include/acmacros.h b/source/include/acmacros.h
fa2344
index 21256cb..3649ff0 100644
fa2344
--- a/source/include/acmacros.h
fa2344
+++ b/source/include/acmacros.h
fa2344
@@ -100,7 +100,8 @@
fa2344
 
fa2344
 /* 32-bit source, 16/32/64 destination */
fa2344
 
fa2344
-#define ACPI_MOVE_32_TO_16(d, s)        ACPI_MOVE_16_TO_16(d, s)    /* Truncate to 16 */
fa2344
+#define ACPI_MOVE_32_TO_16(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[3];\
fa2344
+                                         ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[2];}
fa2344
 
fa2344
 #define ACPI_MOVE_32_TO_32(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[3];\
fa2344
                                          ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[2];\
fa2344
@@ -115,9 +116,13 @@
fa2344
 
fa2344
 /* 64-bit source, 16/32/64 destination */
fa2344
 
fa2344
-#define ACPI_MOVE_64_TO_16(d, s)        ACPI_MOVE_16_TO_16(d, s)    /* Truncate to 16 */
fa2344
+#define ACPI_MOVE_64_TO_16(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[7];\
fa2344
+                                         ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[6];}
fa2344
 
fa2344
-#define ACPI_MOVE_64_TO_32(d, s)        ACPI_MOVE_32_TO_32(d, s)    /* Truncate to 32 */
fa2344
+#define ACPI_MOVE_64_TO_32(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[7];\
fa2344
+                                         ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[6];\
fa2344
+                                         ((  UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[5];\
fa2344
+                                         ((  UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[4];}
fa2344
 
fa2344
 #define ACPI_MOVE_64_TO_64(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[7];\
fa2344
                                          ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[6];\
fa2344
@@ -144,7 +149,9 @@
fa2344
 
fa2344
 /* 32-bit source, 16/32/64 destination */
fa2344
 
fa2344
-#define ACPI_MOVE_32_TO_16(d, s)        ACPI_MOVE_16_TO_16(d, s)    /* Truncate to 16 */
fa2344
+#define ACPI_MOVE_32_TO_16(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];\
fa2344
+                                         ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[1];}
fa2344
+
fa2344
 #define ACPI_MOVE_32_TO_32(d, s)        *(UINT32 *)(void *)(d) = *(UINT32 *)(void *)(s)
fa2344
 #define ACPI_MOVE_32_TO_64(d, s)        *(UINT64 *)(void *)(d) = *(UINT32 *)(void *)(s)
fa2344
 
fa2344
diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h
fa2344
index bd45cdb..3eeb572 100644
fa2344
--- a/source/include/platform/aclinux.h
fa2344
+++ b/source/include/platform/aclinux.h
fa2344
@@ -178,6 +178,7 @@
fa2344
 #include <stdlib.h>
fa2344
 #include <ctype.h>
fa2344
 #include <unistd.h>
fa2344
+#include <endian.h>
fa2344
 
fa2344
 /* Define/disable kernel-specific declarators */
fa2344
 
fa2344
@@ -190,8 +191,7 @@
fa2344
 #define ACPI_FLUSH_CPU_CACHE()
fa2344
 #define ACPI_CAST_PTHREAD_T(Pthread) ((ACPI_THREAD_ID) (Pthread))
fa2344
 
fa2344
-#if defined(__ia64__)    || defined(__x86_64__) ||\
fa2344
-    defined(__aarch64__) || defined(__PPC64__)
fa2344
+#if __SIZEOF_LONG__ == 8
fa2344
 #define ACPI_MACHINE_WIDTH          64
fa2344
 #define COMPILER_DEPENDENT_INT64    long
fa2344
 #define COMPILER_DEPENDENT_UINT64   unsigned long
fa2344
@@ -202,6 +202,10 @@
fa2344
 #define ACPI_USE_NATIVE_DIVIDE
fa2344
 #endif
fa2344
 
fa2344
+#if __BYTE_ORDER == __BIG_ENDIAN
fa2344
+#define ACPI_BIG_ENDIAN
fa2344
+#endif
fa2344
+
fa2344
 #ifndef __cdecl
fa2344
 #define __cdecl
fa2344
 #endif