Dan Horák 54d979
diff -up acpica-unix2-20140424/source/compiler/aslcodegen.c.debian-big_endian acpica-unix2-20140424/source/compiler/aslcodegen.c
Dan Horák 54d979
--- acpica-unix2-20140424/source/compiler/aslcodegen.c.debian-big_endian	2014-04-24 11:48:59.000000000 -0400
Dan Horák 54d979
+++ acpica-unix2-20140424/source/compiler/aslcodegen.c	2014-06-06 20:43:34.711825238 -0400
Al Stone 4a5eac
@@ -237,16 +237,12 @@ CgWriteAmlOpcode (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *Op)
Al Stone afae4e
 {
Al Stone afae4e
     UINT8                   PkgLenFirstByte;
Al Stone afae4e
-    UINT32                  i;
Al Stone afae4e
-    union {
Al Stone afae4e
-        UINT16                  Opcode;
Al Stone afae4e
-        UINT8                   OpcodeBytes[2];
Al Stone afae4e
-    } Aml;
Al Stone afae4e
-    union {
Al Stone afae4e
-        UINT32                  Len;
Al Stone afae4e
-        UINT8                   LenBytes[4];
Al Stone afae4e
-    } PkgLen;
Al Stone afae4e
-
Al Stone afae4e
+    UINT8                   Byte;
Al Stone afae4e
+    UINT16                  Word;
Al Stone afae4e
+    UINT32                  DWord;
Al Stone afae4e
+    UINT64                  QWord;
Al Stone afae4e
+    UINT16                  AmlOpcode;
Al Stone afae4e
+    UINT32                  PkgLen;
Al Stone afae4e
 
Al Stone afae4e
     /* We expect some DEFAULT_ARGs, just ignore them */
Al Stone afae4e
 
Al Stone 4a5eac
@@ -269,51 +265,52 @@ CgWriteAmlOpcode (
Al Stone afae4e
 
Al Stone afae4e
         /* Special opcodes for within a field definition */
Al Stone afae4e
 
Al Stone afae4e
-        Aml.Opcode = AML_FIELD_OFFSET_OP;
Al Stone afae4e
+        AmlOpcode = AML_FIELD_OFFSET_OP;
Al Stone afae4e
         break;
Al Stone afae4e
 
Al Stone afae4e
     case AML_INT_ACCESSFIELD_OP:
Al Stone afae4e
 
Al Stone afae4e
-        Aml.Opcode = AML_FIELD_ACCESS_OP;
Al Stone afae4e
+        AmlOpcode = AML_FIELD_ACCESS_OP;
Al Stone afae4e
         break;
Al Stone afae4e
 
Al Stone afae4e
     case AML_INT_CONNECTION_OP:
Al Stone afae4e
 
Al Stone afae4e
-        Aml.Opcode = AML_FIELD_CONNECTION_OP;
Al Stone afae4e
+        AmlOpcode = AML_FIELD_CONNECTION_OP;
Al Stone afae4e
         break;
Al Stone afae4e
 
Al Stone afae4e
     default:
Al Stone afae4e
 
Al Stone afae4e
-        Aml.Opcode = Op->Asl.AmlOpcode;
Al Stone afae4e
+        AmlOpcode = Op->Asl.AmlOpcode;
Al Stone afae4e
         break;
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone afae4e
-    switch (Aml.Opcode)
Al Stone afae4e
+    switch (AmlOpcode)
Al Stone afae4e
     {
Al Stone afae4e
     case AML_PACKAGE_LENGTH:
Al Stone afae4e
 
Al Stone afae4e
         /* Value is the length to be encoded (Used in field definitions) */
Al Stone afae4e
 
Al Stone afae4e
-        PkgLen.Len = (UINT32) Op->Asl.Value.Integer;
Al Stone afae4e
+        PkgLen = (UINT32) Op->Asl.Value.Integer;
Al Stone afae4e
         break;
Al Stone afae4e
 
Al Stone afae4e
     default:
Al Stone afae4e
 
Al Stone afae4e
         /* Check for two-byte opcode */
Al Stone afae4e
 
Al Stone afae4e
-        if (Aml.Opcode > 0x00FF)
Al Stone afae4e
+        if (AmlOpcode > 0x00FF)
Al Stone afae4e
         {
Al Stone afae4e
             /* Write the high byte first */
Al Stone afae4e
-
Al Stone afae4e
-            CgLocalWriteAmlData (Op, &Aml.OpcodeBytes[1], 1);
Al Stone afae4e
+	    Byte = ACPI_HIBYTE(AmlOpcode);
Al Stone afae4e
+	    CgLocalWriteAmlData (Op, &Byte, 1);
Al Stone afae4e
         }
Al Stone afae4e
 
Al Stone afae4e
-        CgLocalWriteAmlData (Op, &Aml.OpcodeBytes[0], 1);
Al Stone afae4e
+	Byte = ACPI_LOBYTE(AmlOpcode);
Al Stone afae4e
+        CgLocalWriteAmlData (Op, &Byte, 1);
Al Stone afae4e
 
Al Stone afae4e
         /* Subtreelength doesn't include length of package length bytes */
Al Stone afae4e
 
Al Stone afae4e
-        PkgLen.Len = Op->Asl.AmlSubtreeLength + Op->Asl.AmlPkgLenBytes;
Al Stone afae4e
+        PkgLen = Op->Asl.AmlSubtreeLength + Op->Asl.AmlPkgLenBytes;
Al Stone afae4e
         break;
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone 4a5eac
@@ -324,8 +322,8 @@ CgWriteAmlOpcode (
Al Stone afae4e
         if (Op->Asl.AmlPkgLenBytes == 1)
Al Stone afae4e
         {
Al Stone afae4e
             /* Simplest case -- no bytes to follow, just write the count */
Al Stone afae4e
-
Al Stone afae4e
-            CgLocalWriteAmlData (Op, &PkgLen.LenBytes[0], 1);
Al Stone afae4e
+            Byte = ACPI_LOBYTE(PkgLen);
Al Stone afae4e
+            CgLocalWriteAmlData (Op, &Byte, 1);
Al Stone afae4e
         }
Al Stone afae4e
         else if (Op->Asl.AmlPkgLenBytes != 0)
Al Stone afae4e
         {
Al Stone 4a5eac
@@ -335,7 +333,7 @@ CgWriteAmlOpcode (
Al Stone afae4e
              */
Al Stone afae4e
             PkgLenFirstByte = (UINT8)
Al Stone afae4e
                 (((UINT32) (Op->Asl.AmlPkgLenBytes - 1) << 6) |
Al Stone afae4e
-                (PkgLen.LenBytes[0] & 0x0F));
Al Stone afae4e
+                (PkgLen & 0x0F));
Al Stone afae4e
 
Al Stone afae4e
             CgLocalWriteAmlData (Op, &PkgLenFirstByte, 1);
Al Stone afae4e
 
Al Stone 4a5eac
@@ -343,37 +341,44 @@ CgWriteAmlOpcode (
Al Stone afae4e
              * Shift the length over by the 4 bits we just stuffed
Al Stone afae4e
              * in the first byte
Al Stone afae4e
              */
Al Stone afae4e
-            PkgLen.Len >>= 4;
Al Stone afae4e
+            PkgLen >>= 4;
Al Stone afae4e
 
Al Stone afae4e
             /* Now we can write the remaining bytes - either 1, 2, or 3 bytes */
Al Stone afae4e
-
Al Stone afae4e
-            for (i = 0; i < (UINT32) (Op->Asl.AmlPkgLenBytes - 1); i++)
Al Stone afae4e
+            Byte = ACPI_LOBYTE(PkgLen);
Al Stone afae4e
+            CgLocalWriteAmlData (Op, &Byte, 1);
Al Stone afae4e
+            if (Op->Asl.AmlPkgLenBytes >= 3)
Al Stone afae4e
+            {
Al Stone afae4e
+                Byte = ACPI_HIBYTE(PkgLen);
Al Stone afae4e
+                CgLocalWriteAmlData (Op, &Byte, 1);
Al Stone afae4e
+            }
Al Stone afae4e
+            if (Op->Asl.AmlPkgLenBytes >= 4)
Al Stone afae4e
             {
Al Stone afae4e
-                CgLocalWriteAmlData (Op, &PkgLen.LenBytes[i], 1);
Al Stone afae4e
+                Byte = ACPI_LOBYTE(ACPI_HIWORD(PkgLen));
Al Stone afae4e
+                CgLocalWriteAmlData (Op, &Byte, 1);
Al Stone afae4e
             }
Al Stone afae4e
         }
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone afae4e
-    switch (Aml.Opcode)
Al Stone afae4e
+    switch (AmlOpcode)
Al Stone afae4e
     {
Al Stone afae4e
     case AML_BYTE_OP:
Al Stone afae4e
-
Al Stone afae4e
-        CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 1);
Al Stone afae4e
+        Byte = (UINT8) Op->Asl.Value.Integer;
Al Stone afae4e
+        CgLocalWriteAmlData (Op, &Byte, 1);
Al Stone afae4e
         break;
Al Stone afae4e
 
Al Stone afae4e
     case AML_WORD_OP:
Al Stone afae4e
-
Al Stone afae4e
-        CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 2);
Al Stone afae4e
+        ACPI_MOVE_64_TO_16(&Word, &Op->Asl.Value.Integer);
Al Stone afae4e
+        CgLocalWriteAmlData (Op, &Word, 2);
Al Stone afae4e
        break;
Al Stone afae4e
 
Al Stone afae4e
     case AML_DWORD_OP:
Al Stone afae4e
-
Al Stone afae4e
-        CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 4);
Al Stone afae4e
+        ACPI_MOVE_64_TO_32(&DWord, &Op->Asl.Value.Integer);
Al Stone afae4e
+        CgLocalWriteAmlData (Op, &DWord, 4);
Al Stone afae4e
         break;
Al Stone afae4e
 
Al Stone afae4e
     case AML_QWORD_OP:
Al Stone afae4e
-
Al Stone afae4e
-        CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 8);
Al Stone afae4e
+        ACPI_MOVE_64_TO_64(&QWord, &Op->Asl.Value.Integer);
Al Stone afae4e
+        CgLocalWriteAmlData (Op, &QWord, 8);
Al Stone afae4e
         break;
Al Stone afae4e
 
Al Stone afae4e
     case AML_STRING_OP:
Al Stone 4a5eac
@@ -407,6 +412,7 @@ CgWriteTableHeader (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *Op)
Al Stone afae4e
 {
Al Stone afae4e
     ACPI_PARSE_OBJECT       *Child;
Al Stone afae4e
+    UINT32 DWord;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone afae4e
     /* AML filename */
Al Stone 4a5eac
@@ -443,7 +449,7 @@ CgWriteTableHeader (
Al Stone afae4e
     /* OEM Revision */
Al Stone afae4e
 
Al Stone afae4e
     Child = Child->Asl.Next;
Al Stone afae4e
-    TableHeader.OemRevision = (UINT32) Child->Asl.Value.Integer;
Al Stone afae4e
+    ACPI_MOVE_64_TO_32(&TableHeader.OemRevision, &Child->Asl.Value.Integer);
Al Stone afae4e
 
Al Stone afae4e
     /* Compiler ID */
Al Stone afae4e
 
Al Stone 4a5eac
@@ -451,11 +457,12 @@ CgWriteTableHeader (
Al Stone afae4e
 
Al Stone afae4e
     /* Compiler version */
Al Stone afae4e
 
Al Stone afae4e
-    TableHeader.AslCompilerRevision = ASL_REVISION;
Al Stone afae4e
+    DWord = ASL_REVISION;
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&TableHeader.AslCompilerRevision, &DWord);
Al Stone afae4e
 
Al Stone afae4e
     /* Table length. Checksum zero for now, will rewrite later */
Al Stone afae4e
 
Al Stone afae4e
-    TableHeader.Length   = Gbl_TableLength;
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&TableHeader.Length, &Gbl_TableLength);
Al Stone afae4e
     TableHeader.Checksum = 0;
Al Stone afae4e
 
Al Stone afae4e
     CgLocalWriteAmlData (Op, &TableHeader, sizeof (ACPI_TABLE_HEADER));
Al Stone 4a5eac
@@ -519,7 +526,10 @@ CgWriteNode (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *Op)
Al Stone afae4e
 {
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
-
Al Stone afae4e
+    UINT8                   Byte;
Al Stone afae4e
+    UINT16                  Word;
Al Stone afae4e
+    UINT32                  DWord;
Al Stone afae4e
+    UINT64                  QWord;
Al Stone afae4e
 
Al Stone afae4e
     /* Always check for DEFAULT_ARG and other "Noop" nodes */
Al Stone afae4e
     /* TBD: this may not be the best place for this check */
Al Stone 4a5eac
@@ -537,13 +547,24 @@ CgWriteNode (
Al Stone afae4e
     switch (Op->Asl.AmlOpcode)
Al Stone afae4e
     {
Al Stone afae4e
     case AML_RAW_DATA_BYTE:
Al Stone afae4e
+        Byte = (UINT8) Op->Asl.Value.Integer;
Al Stone afae4e
+        CgLocalWriteAmlData (Op, &Byte, 1);
Al Stone afae4e
+        return;
Al Stone afae4e
+
Al Stone afae4e
     case AML_RAW_DATA_WORD:
Al Stone afae4e
-    case AML_RAW_DATA_DWORD:
Al Stone afae4e
-    case AML_RAW_DATA_QWORD:
Al Stone afae4e
+        ACPI_MOVE_64_TO_16(&Word, &Op->Asl.Value.Integer);
Al Stone afae4e
+        CgLocalWriteAmlData (Op, &Word, 2);
Al Stone afae4e
+        return;
Al Stone afae4e
 
Al Stone afae4e
-        CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, Op->Asl.AmlLength);
Al Stone afae4e
+    case AML_RAW_DATA_DWORD:
Al Stone afae4e
+        ACPI_MOVE_64_TO_32(&DWord, &Op->Asl.Value.Integer);
Al Stone afae4e
+        CgLocalWriteAmlData (Op, &DWord, 4);
Al Stone afae4e
         return;
Al Stone afae4e
 
Al Stone afae4e
+    case AML_RAW_DATA_QWORD:
Al Stone afae4e
+        ACPI_MOVE_64_TO_64(&QWord, &Op->Asl.Value.Integer);
Al Stone afae4e
+        CgLocalWriteAmlData (Op, &QWord, 8);
Al Stone afae4e
+        return;
Al Stone afae4e
 
Al Stone afae4e
     case AML_RAW_DATA_BUFFER:
Al Stone afae4e
 
Dan Horák 54d979
diff -up acpica-unix2-20140424/source/compiler/aslopcodes.c.debian-big_endian acpica-unix2-20140424/source/compiler/aslopcodes.c
Dan Horák 54d979
--- acpica-unix2-20140424/source/compiler/aslopcodes.c.debian-big_endian	2014-04-24 11:48:59.000000000 -0400
Dan Horák 54d979
+++ acpica-unix2-20140424/source/compiler/aslopcodes.c	2014-06-06 20:43:34.711825238 -0400
Al Stone 4a5eac
@@ -475,6 +476,7 @@ OpcDoUnicode (
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
     UINT8                   *AsciiString;
Al Stone afae4e
     UINT16                  *UnicodeString;
Al Stone afae4e
+    UINT16                  UChar;
Al Stone afae4e
     ACPI_PARSE_OBJECT       *BufferLengthOp;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone 4a5eac
@@ -501,7 +503,8 @@ OpcDoUnicode (
Al Stone afae4e
 
Al Stone afae4e
     for (i = 0; i < Count; i++)
Al Stone afae4e
     {
Al Stone afae4e
-        UnicodeString[i] = (UINT16) AsciiString[i];
Al Stone afae4e
+        UChar = (UINT16) AsciiString[i];
Al Stone afae4e
+        ACPI_MOVE_16_TO_16(&UnicodeString[i], &UChar);
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone afae4e
     /*
Dan Horák 54d979
diff -up acpica-unix2-20140424/source/compiler/aslrestype1.c.debian-big_endian acpica-unix2-20140424/source/compiler/aslrestype1.c
Dan Horák 54d979
--- acpica-unix2-20140424/source/compiler/aslrestype1.c.debian-big_endian	2014-04-24 11:49:00.000000000 -0400
Dan Horák 54d979
+++ acpica-unix2-20140424/source/compiler/aslrestype1.c	2014-06-06 20:43:34.711825238 -0400
Al Stone 4a5eac
@@ -151,6 +152,11 @@ RsDoMemory24Descriptor (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *MaxOp = NULL;
Al Stone afae4e
     ACPI_PARSE_OBJECT       *LengthOp = NULL;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
+    UINT16                  Minimum = 0;
Al Stone afae4e
+    UINT16                  Maximum = 0;
Al Stone afae4e
+    UINT16                  AddressLength = 0;
Al Stone afae4e
+    UINT16                  Alignment = 0;
Al Stone afae4e
+    UINT16                  ResourceLength;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone 4a5eac
@@ -159,7 +165,8 @@ RsDoMemory24Descriptor (
Al Stone afae4e
 
Al Stone afae4e
     Descriptor = Rnode->Buffer;
Al Stone afae4e
     Descriptor->Memory24.DescriptorType  = ACPI_RESOURCE_NAME_MEMORY24;
Al Stone afae4e
-    Descriptor->Memory24.ResourceLength = 9;
Al Stone afae4e
+    ResourceLength = 9;
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Memory24.ResourceLength, &ResourceLength);
Al Stone afae4e
 
Al Stone afae4e
     /* Process all child initialization nodes */
Al Stone afae4e
 
Al Stone 4a5eac
@@ -176,7 +183,7 @@ RsDoMemory24Descriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 1: /* Min Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Memory24.Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Minimum));
Al Stone afae4e
             MinOp = InitializerOp;
Al Stone 4a5eac
@@ -184,7 +191,7 @@ RsDoMemory24Descriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 2: /* Max Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Memory24.Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Maximum));
Al Stone afae4e
             MaxOp = InitializerOp;
Al Stone 4a5eac
@@ -192,14 +199,14 @@ RsDoMemory24Descriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 3: /* Alignment */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Memory24.Alignment = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Alignment = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_ALIGNMENT,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Alignment));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 4: /* Length */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Memory24.AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.AddressLength));
Al Stone afae4e
             LengthOp = InitializerOp;
Al Stone 4a5eac
@@ -222,12 +229,17 @@ RsDoMemory24Descriptor (
Al Stone afae4e
     /* Validate the Min/Max/Len/Align values (Alignment==0 means 64K) */
Al Stone afae4e
 
Al Stone afae4e
     RsSmallAddressCheck (ACPI_RESOURCE_NAME_MEMORY24,
Al Stone afae4e
-        Descriptor->Memory24.Minimum,
Al Stone afae4e
-        Descriptor->Memory24.Maximum,
Al Stone afae4e
-        Descriptor->Memory24.AddressLength,
Al Stone afae4e
-        Descriptor->Memory24.Alignment,
Al Stone afae4e
+        Minimum,
Al Stone afae4e
+        Maximum,
Al Stone afae4e
+        AddressLength,
Al Stone afae4e
+        Alignment,
Al Stone afae4e
         MinOp, MaxOp, LengthOp, NULL, Op);
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Memory24.Minimum, &Minimum);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Memory24.Maximum, &Maximum);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Memory24.AddressLength, &AddressLength);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Memory24.Alignment, &Alignment);
Al Stone afae4e
+
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Al Stone afae4e
 
Al Stone 4a5eac
@@ -258,6 +270,11 @@ RsDoMemory32Descriptor (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *LengthOp = NULL;
Al Stone afae4e
     ACPI_PARSE_OBJECT       *AlignOp = NULL;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
+    UINT32                  Minimum = 0;
Al Stone afae4e
+    UINT32                  Maximum = 0;
Al Stone afae4e
+    UINT32                  AddressLength = 0;
Al Stone afae4e
+    UINT32                  Alignment = 0;
Al Stone afae4e
+    UINT16                  ResourceLength;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone 4a5eac
@@ -266,7 +283,8 @@ RsDoMemory32Descriptor (
Al Stone afae4e
 
Al Stone afae4e
     Descriptor = Rnode->Buffer;
Al Stone afae4e
     Descriptor->Memory32.DescriptorType  = ACPI_RESOURCE_NAME_MEMORY32;
Al Stone afae4e
-    Descriptor->Memory32.ResourceLength = 17;
Al Stone afae4e
+    ResourceLength = 17;
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Memory32.ResourceLength, &ResourceLength);
Al Stone afae4e
 
Al Stone afae4e
     /* Process all child initialization nodes */
Al Stone afae4e
 
Al Stone 4a5eac
@@ -283,7 +301,7 @@ RsDoMemory32Descriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 1:  /* Min Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Memory32.Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Minimum));
Al Stone afae4e
             MinOp = InitializerOp;
Al Stone 4a5eac
@@ -291,7 +309,7 @@ RsDoMemory32Descriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 2: /* Max Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Memory32.Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Maximum));
Al Stone afae4e
             MaxOp = InitializerOp;
Al Stone 4a5eac
@@ -299,7 +317,7 @@ RsDoMemory32Descriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 3: /* Alignment */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Memory32.Alignment = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Alignment = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_ALIGNMENT,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Alignment));
Al Stone afae4e
             AlignOp = InitializerOp;
Al Stone 4a5eac
@@ -307,7 +325,7 @@ RsDoMemory32Descriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 4: /* Length */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Memory32.AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.AddressLength));
Al Stone afae4e
             LengthOp = InitializerOp;
Al Stone 4a5eac
@@ -330,12 +348,17 @@ RsDoMemory32Descriptor (
Al Stone afae4e
     /* Validate the Min/Max/Len/Align values */
Al Stone afae4e
 
Al Stone afae4e
     RsSmallAddressCheck (ACPI_RESOURCE_NAME_MEMORY32,
Al Stone afae4e
-        Descriptor->Memory32.Minimum,
Al Stone afae4e
-        Descriptor->Memory32.Maximum,
Al Stone afae4e
-        Descriptor->Memory32.AddressLength,
Al Stone afae4e
-        Descriptor->Memory32.Alignment,
Al Stone afae4e
+        Minimum,
Al Stone afae4e
+        Maximum,
Al Stone afae4e
+        AddressLength,
Al Stone afae4e
+        Alignment,
Al Stone afae4e
         MinOp, MaxOp, LengthOp, AlignOp, Op);
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Memory32.Minimum, &Minimum);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Memory32.Maximum, &Maximum);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Memory32.AddressLength, &AddressLength);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Memory32.Alignment, &Alignment);
Al Stone afae4e
+
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Al Stone afae4e
 
Al Stone 4a5eac
@@ -362,6 +385,7 @@ RsDoMemory32FixedDescriptor (
Al Stone afae4e
     AML_RESOURCE            *Descriptor;
Al Stone afae4e
     ACPI_PARSE_OBJECT       *InitializerOp;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
+    UINT16                  ResourceLength;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone 4a5eac
@@ -370,7 +394,8 @@ RsDoMemory32FixedDescriptor (
Al Stone afae4e
 
Al Stone afae4e
     Descriptor = Rnode->Buffer;
Al Stone afae4e
     Descriptor->FixedMemory32.DescriptorType  = ACPI_RESOURCE_NAME_FIXED_MEMORY32;
Al Stone afae4e
-    Descriptor->FixedMemory32.ResourceLength = 9;
Al Stone afae4e
+    ResourceLength = 9;
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->FixedMemory32.ResourceLength, &ResourceLength);
Al Stone afae4e
 
Al Stone afae4e
     /* Process all child initialization nodes */
Al Stone afae4e
 
Al Stone 4a5eac
@@ -387,14 +412,16 @@ RsDoMemory32FixedDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 1: /* Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->FixedMemory32.Address = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            ACPI_MOVE_64_TO_32(&Descriptor->FixedMemory32.Address,
Al Stone afae4e
+                &InitializerOp->Asl.Value.Integer);
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_BASEADDRESS,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedMemory32.Address));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 2: /* Length */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->FixedMemory32.AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            ACPI_MOVE_64_TO_32(&Descriptor->FixedMemory32.AddressLength,
Al Stone afae4e
+                &InitializerOp->Asl.Value.Integer);
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedMemory32.AddressLength));
Al Stone afae4e
             break;
Dan Horák 54d979
diff -up acpica-unix2-20140424/source/compiler/aslrestype1i.c.debian-big_endian acpica-unix2-20140424/source/compiler/aslrestype1i.c
Dan Horák 54d979
--- acpica-unix2-20140424/source/compiler/aslrestype1i.c.debian-big_endian	2014-04-24 11:49:00.000000000 -0400
Dan Horák 54d979
+++ acpica-unix2-20140424/source/compiler/aslrestype1i.c	2014-06-06 20:43:34.711825238 -0400
Al Stone 4a5eac
@@ -201,6 +202,8 @@ RsDoFixedDmaDescriptor (
Al Stone afae4e
     AML_RESOURCE            *Descriptor;
Al Stone afae4e
     ACPI_PARSE_OBJECT       *InitializerOp;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
+    UINT16                  RequestLines = 0;
Al Stone afae4e
+    UINT16                  Channels = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone 4a5eac
@@ -219,14 +222,14 @@ RsDoFixedDmaDescriptor (
Al Stone afae4e
         {
Al Stone afae4e
         case 0: /* DMA Request Lines [WORD] (_DMA) */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->FixedDma.RequestLines = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            RequestLines = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_DMA,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedDma.RequestLines));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 1: /* DMA Channel [WORD] (_TYP) */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->FixedDma.Channels = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Channels = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_DMATYPE,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedDma.Channels));
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -251,6 +254,9 @@ RsDoFixedDmaDescriptor (
Al Stone afae4e
         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->FixedDma.RequestLines, &RequestLines);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->FixedDma.Channels, &Channels);
Al Stone afae4e
+
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Al Stone afae4e
 
Al Stone 4a5eac
@@ -278,6 +284,7 @@ RsDoFixedIoDescriptor (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *InitializerOp;
Al Stone afae4e
     ACPI_PARSE_OBJECT       *AddressOp = NULL;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
+    UINT16                  Address = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone 4a5eac
@@ -296,8 +303,7 @@ RsDoFixedIoDescriptor (
Al Stone afae4e
         {
Al Stone afae4e
         case 0: /* Base Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->FixedIo.Address =
Al Stone afae4e
-                (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Address = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_BASEADDRESS,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedIo.Address));
Al Stone afae4e
             AddressOp = InitializerOp;
Al Stone 4a5eac
@@ -327,11 +333,13 @@ RsDoFixedIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
     /* Error checks */
Al Stone afae4e
 
Al Stone afae4e
-    if (Descriptor->FixedIo.Address > 0x03FF)
Al Stone afae4e
+    if (Address > 0x03FF)
Al Stone afae4e
     {
Al Stone afae4e
         AslError (ASL_WARNING, ASL_MSG_ISA_ADDRESS, AddressOp, NULL);
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->FixedIo.Address, &Address);
Al Stone afae4e
+
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Al Stone afae4e
 
Al Stone 4a5eac
@@ -362,6 +370,8 @@ RsDoIoDescriptor (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *LengthOp = NULL;
Al Stone afae4e
     ACPI_PARSE_OBJECT       *AlignOp = NULL;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
+    UINT16                  Minimum = 0;
Al Stone afae4e
+    UINT16                  Maximum = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone 4a5eac
@@ -387,8 +397,7 @@ RsDoIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 1:  /* Min Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Io.Minimum =
Al Stone afae4e
-                (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Io.Minimum));
Al Stone afae4e
             MinOp = InitializerOp;
Al Stone 4a5eac
@@ -396,8 +405,7 @@ RsDoIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 2: /* Max Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Io.Maximum =
Al Stone afae4e
-                (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Io.Maximum));
Al Stone afae4e
             MaxOp = InitializerOp;
Al Stone 4a5eac
@@ -438,12 +446,15 @@ RsDoIoDescriptor (
Al Stone afae4e
     /* Validate the Min/Max/Len/Align values */
Al Stone afae4e
 
Al Stone afae4e
     RsSmallAddressCheck (ACPI_RESOURCE_NAME_IO,
Al Stone afae4e
-        Descriptor->Io.Minimum,
Al Stone afae4e
-        Descriptor->Io.Maximum,
Al Stone afae4e
+        Minimum,
Al Stone afae4e
+        Maximum,
Al Stone afae4e
         Descriptor->Io.AddressLength,
Al Stone afae4e
         Descriptor->Io.Alignment,
Al Stone afae4e
         MinOp, MaxOp, LengthOp, AlignOp, Op);
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Io.Minimum, &Minimum);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Io.Maximum, &Maximum);
Al Stone afae4e
+
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Al Stone afae4e
 
Al Stone 4a5eac
@@ -564,9 +575,9 @@ RsDoIrqDescriptor (
Al Stone afae4e
         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone afae4e
-    /* Now we can set the channel mask */
Al Stone afae4e
+    /* Now we can set the interrupt mask */
Al Stone afae4e
 
Al Stone afae4e
-    Descriptor->Irq.IrqMask = IrqMask;
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Irq.IrqMask, &IrqMask);
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Al Stone afae4e
 
Al Stone 4a5eac
@@ -666,6 +677,6 @@ RsDoIrqNoFlagsDescriptor (
Al Stone afae4e
 
Al Stone afae4e
     /* Now we can set the interrupt mask */
Al Stone afae4e
 
Al Stone afae4e
-    Descriptor->Irq.IrqMask = IrqMask;
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Irq.IrqMask, &IrqMask);
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Dan Horák 54d979
diff -up acpica-unix2-20140424/source/compiler/aslrestype2.c.debian-big_endian acpica-unix2-20140424/source/compiler/aslrestype2.c
Dan Horák 54d979
--- acpica-unix2-20140424/source/compiler/aslrestype2.c.debian-big_endian	2014-04-24 11:49:00.000000000 -0400
Dan Horák 54d979
+++ acpica-unix2-20140424/source/compiler/aslrestype2.c	2014-06-06 20:43:34.711825238 -0400
Al Stone 4a5eac
@@ -78,6 +79,7 @@ RsDoGeneralRegisterDescriptor (
Al Stone afae4e
     AML_RESOURCE            *Descriptor;
Al Stone afae4e
     ACPI_PARSE_OBJECT       *InitializerOp;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
+    UINT16                  ResourceLength;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone 4a5eac
@@ -86,7 +88,9 @@ RsDoGeneralRegisterDescriptor (
Al Stone afae4e
 
Al Stone afae4e
     Descriptor = Rnode->Buffer;
Al Stone afae4e
     Descriptor->GenericReg.DescriptorType = ACPI_RESOURCE_NAME_GENERIC_REGISTER;
Al Stone afae4e
-    Descriptor->GenericReg.ResourceLength = 12;
Al Stone afae4e
+    ResourceLength = 12;
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->GenericReg.ResourceLength,
Al Stone afae4e
+		    &ResourceLength);
Al Stone afae4e
 
Al Stone afae4e
     /* Process all child initialization nodes */
Al Stone afae4e
 
Al Stone 4a5eac
@@ -117,7 +121,8 @@ RsDoGeneralRegisterDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 3: /* Register Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->GenericReg.Address = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+	    ACPI_MOVE_64_TO_64(&Descriptor->GenericReg.Address,
Al Stone afae4e
+			    &InitializerOp->Asl.Value.Integer);
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_ADDRESS,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.Address));
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -175,6 +180,7 @@ RsDoInterruptDescriptor (
Al Stone afae4e
     AML_RESOURCE            *Rover = NULL;
Al Stone afae4e
     ACPI_PARSE_OBJECT       *InitializerOp;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
+    UINT16                  ResourceLength = 0;
Al Stone afae4e
     UINT16                  StringLength = 0;
Al Stone afae4e
     UINT32                  OptionIndex = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone 4a5eac
@@ -221,7 +227,7 @@ RsDoInterruptDescriptor (
Al Stone afae4e
      * Initial descriptor length -- may be enlarged if there are
Al Stone afae4e
      * optional fields present
Al Stone afae4e
      */
Al Stone afae4e
-    Descriptor->ExtendedIrq.ResourceLength  = 2;  /* Flags and table length byte */
Al Stone afae4e
+    ResourceLength  = 2;  /* Flags and table length byte */
Al Stone afae4e
     Descriptor->ExtendedIrq.InterruptCount  = 0;
Al Stone afae4e
 
Al Stone afae4e
     Rover = ACPI_CAST_PTR (AML_RESOURCE,
Al Stone 4a5eac
@@ -329,10 +335,11 @@ RsDoInterruptDescriptor (
Al Stone afae4e
 
Al Stone afae4e
             /* Save the integer and move pointer to the next one */
Al Stone afae4e
 
Al Stone afae4e
-            Rover->DwordItem = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            ACPI_MOVE_64_TO_32(&Rover->DwordItem,
Al Stone afae4e
+                &InitializerOp->Asl.Value.Integer);
Al Stone afae4e
             Rover = ACPI_ADD_PTR (AML_RESOURCE, &(Rover->DwordItem), 4);
Al Stone afae4e
             Descriptor->ExtendedIrq.InterruptCount++;
Al Stone afae4e
-            Descriptor->ExtendedIrq.ResourceLength += 4;
Al Stone afae4e
+            ResourceLength += 4;
Al Stone afae4e
 
Al Stone afae4e
             /* Case 7: First interrupt number in list */
Al Stone afae4e
 
Al Stone 4a5eac
@@ -368,7 +375,7 @@ RsDoInterruptDescriptor (
Al Stone afae4e
     {
Al Stone afae4e
         Rover->ByteItem = ResSourceIndex;
Al Stone afae4e
         Rover = ACPI_ADD_PTR (AML_RESOURCE, &(Rover->ByteItem), 1);
Al Stone afae4e
-        Descriptor->ExtendedIrq.ResourceLength += 1;
Al Stone afae4e
+        ResourceLength += 1;
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone afae4e
     /* Add optional ResSource string if present */
Al Stone 4a5eac
@@ -380,13 +387,14 @@ RsDoInterruptDescriptor (
Al Stone afae4e
         Rover = ACPI_ADD_PTR (
Al Stone afae4e
                     AML_RESOURCE, &(Rover->ByteItem), StringLength);
Al Stone afae4e
 
Al Stone afae4e
-        Descriptor->ExtendedIrq.ResourceLength = (UINT16)
Al Stone afae4e
-            (Descriptor->ExtendedIrq.ResourceLength + StringLength);
Al Stone afae4e
+        ResourceLength = (UINT16) (ResourceLength + StringLength);
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone afae4e
     Rnode->BufferLength = (ASL_RESDESC_OFFSET (ExtendedIrq.Interrupts[0]) -
Al Stone afae4e
                            ASL_RESDESC_OFFSET (ExtendedIrq.DescriptorType))
Al Stone afae4e
                            + OptionIndex + StringLength;
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->ExtendedIrq.ResourceLength,
Al Stone afae4e
+		    &ResourceLength);
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Al Stone afae4e
 
Al Stone 4a5eac
@@ -437,7 +445,7 @@ RsDoVendorLargeDescriptor (
Al Stone afae4e
 
Al Stone afae4e
     Descriptor = Rnode->Buffer;
Al Stone afae4e
     Descriptor->VendorLarge.DescriptorType  = ACPI_RESOURCE_NAME_VENDOR_LARGE;
Al Stone afae4e
-    Descriptor->VendorLarge.ResourceLength = (UINT16) i;
Al Stone afae4e
+    ACPI_MOVE_32_TO_16(&Descriptor->VendorLarge.ResourceLength, &i);
Al Stone afae4e
 
Al Stone afae4e
     /* Point to end-of-descriptor for vendor data */
Al Stone afae4e
 
Dan Horák 54d979
diff -up acpica-unix2-20140424/source/compiler/aslrestype2d.c.debian-big_endian acpica-unix2-20140424/source/compiler/aslrestype2d.c
Dan Horák 54d979
--- acpica-unix2-20140424/source/compiler/aslrestype2d.c.debian-big_endian	2014-04-24 11:49:00.000000000 -0400
Dan Horák 54d979
+++ acpica-unix2-20140424/source/compiler/aslrestype2d.c	2014-06-06 20:43:34.721825238 -0400
Al Stone 4a5eac
@@ -82,7 +83,13 @@ RsDoDwordIoDescriptor (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *GranOp = NULL;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
     UINT16                  StringLength = 0;
Al Stone afae4e
+    UINT16                  ResourceLength = 0;
Al Stone afae4e
     UINT32                  OptionIndex = 0;
Al Stone afae4e
+    UINT32                  Minimum = 0;
Al Stone afae4e
+    UINT32                  Maximum = 0;
Al Stone afae4e
+    UINT32                  AddressLength = 0;
Al Stone afae4e
+    UINT32                  Granularity = 0;
Al Stone afae4e
+    UINT32                  TranslationOffset = 0;
Al Stone afae4e
     UINT8                   *OptionalFields;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
     BOOLEAN                 ResSourceIndex = FALSE;
Al Stone 4a5eac
@@ -103,8 +110,7 @@ RsDoDwordIoDescriptor (
Al Stone afae4e
      * optional fields present
Al Stone afae4e
      */
Al Stone afae4e
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32);
Al Stone afae4e
-    Descriptor->Address32.ResourceLength = (UINT16)
Al Stone afae4e
-        (sizeof (AML_RESOURCE_ADDRESS32) -
Al Stone afae4e
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS32) -
Al Stone afae4e
          sizeof (AML_RESOURCE_LARGE_HEADER));
Al Stone afae4e
 
Al Stone afae4e
     /* Process all child initialization nodes */
Al Stone 4a5eac
@@ -148,8 +154,7 @@ RsDoDwordIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 5: /* Address Granularity */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address32.Granularity =
Al Stone afae4e
-                (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Granularity = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
Al Stone afae4e
             GranOp = InitializerOp;
Al Stone 4a5eac
@@ -157,8 +162,7 @@ RsDoDwordIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 6: /* Address Min */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address32.Minimum =
Al Stone afae4e
-                (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
Al Stone afae4e
             MinOp = InitializerOp;
Al Stone 4a5eac
@@ -166,8 +170,7 @@ RsDoDwordIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 7: /* Address Max */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address32.Maximum =
Al Stone afae4e
-                (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
Al Stone afae4e
             MaxOp = InitializerOp;
Al Stone 4a5eac
@@ -175,16 +178,14 @@ RsDoDwordIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 8: /* Translation Offset */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address32.TranslationOffset =
Al Stone afae4e
-                (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            TranslationOffset = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 9: /* Address Length */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address32.AddressLength =
Al Stone afae4e
-                (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
Al Stone afae4e
             LengthOp = InitializerOp;
Al Stone 4a5eac
@@ -198,7 +199,7 @@ RsDoDwordIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
                 OptionIndex++;
Al Stone afae4e
-                Descriptor->Address32.ResourceLength++;
Al Stone afae4e
+                ResourceLength++;
Al Stone afae4e
                 ResSourceIndex = TRUE;
Al Stone afae4e
             }
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -212,8 +213,7 @@ RsDoDwordIoDescriptor (
Al Stone afae4e
                 {
Al Stone afae4e
                     /* Found a valid ResourceSource */
Al Stone afae4e
 
Al Stone afae4e
-                    Descriptor->Address32.ResourceLength = (UINT16)
Al Stone afae4e
-                        (Descriptor->Address32.ResourceLength + StringLength);
Al Stone afae4e
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
Al Stone afae4e
 
Al Stone afae4e
                     strcpy ((char *)
Al Stone afae4e
                         &OptionalFields[OptionIndex],
Al Stone 4a5eac
@@ -273,13 +273,20 @@ RsDoDwordIoDescriptor (
Al Stone afae4e
     /* Validate the Min/Max/Len/Gran values */
Al Stone afae4e
 
Al Stone afae4e
     RsLargeAddressCheck (
Al Stone afae4e
-        (UINT64) Descriptor->Address32.Minimum,
Al Stone afae4e
-        (UINT64) Descriptor->Address32.Maximum,
Al Stone afae4e
-        (UINT64) Descriptor->Address32.AddressLength,
Al Stone afae4e
-        (UINT64) Descriptor->Address32.Granularity,
Al Stone afae4e
+        Minimum,
Al Stone afae4e
+        Maximum,
Al Stone afae4e
+        AddressLength,
Al Stone afae4e
+        Granularity,
Al Stone afae4e
         Descriptor->Address32.Flags,
Al Stone afae4e
         MinOp, MaxOp, LengthOp, GranOp, Op);
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address32.ResourceLength, &ResourceLength);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Minimum, &Minimum);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Maximum, &Maximum);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.AddressLength, &AddressLength);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Granularity, &Granularity);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.TranslationOffset, &TranslationOffset);
Al Stone afae4e
+
Al Stone afae4e
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
Al Stone afae4e
                             OptionIndex + StringLength;
Al Stone afae4e
     return (Rnode);
Al Stone 4a5eac
@@ -314,7 +321,13 @@ RsDoDwordMemoryDescriptor (
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
     UINT8                   *OptionalFields;
Al Stone afae4e
     UINT16                  StringLength = 0;
Al Stone afae4e
+    UINT16                  ResourceLength = 0;
Al Stone afae4e
     UINT32                  OptionIndex = 0;
Al Stone afae4e
+    UINT32                  Minimum = 0;
Al Stone afae4e
+    UINT32                  Maximum = 0;
Al Stone afae4e
+    UINT32                  AddressLength = 0;
Al Stone afae4e
+    UINT32                  Granularity = 0;
Al Stone afae4e
+    UINT32                  TranslationOffset = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
     BOOLEAN                 ResSourceIndex = FALSE;
Al Stone afae4e
 
Al Stone 4a5eac
@@ -334,11 +347,9 @@ RsDoDwordMemoryDescriptor (
Al Stone afae4e
      * optional fields present
Al Stone afae4e
      */
Al Stone afae4e
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32);
Al Stone afae4e
-    Descriptor->Address32.ResourceLength = (UINT16)
Al Stone afae4e
-        (sizeof (AML_RESOURCE_ADDRESS32) -
Al Stone afae4e
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS32) -
Al Stone afae4e
          sizeof (AML_RESOURCE_LARGE_HEADER));
Al Stone afae4e
 
Al Stone afae4e
-
Al Stone afae4e
     /* Process all child initialization nodes */
Al Stone afae4e
 
Al Stone afae4e
     for (i = 0; InitializerOp; i++)
Al Stone 4a5eac
@@ -387,8 +398,7 @@ RsDoDwordMemoryDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 6: /* Address Granularity */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address32.Granularity =
Al Stone afae4e
-                (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Granularity = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
Al Stone afae4e
             GranOp = InitializerOp;
Al Stone 4a5eac
@@ -396,8 +406,7 @@ RsDoDwordMemoryDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 7: /* Min Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address32.Minimum =
Al Stone afae4e
-                (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
Al Stone afae4e
             MinOp = InitializerOp;
Al Stone 4a5eac
@@ -405,8 +414,7 @@ RsDoDwordMemoryDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 8: /* Max Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address32.Maximum =
Al Stone afae4e
-                (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
Al Stone afae4e
             MaxOp = InitializerOp;
Al Stone 4a5eac
@@ -414,16 +422,14 @@ RsDoDwordMemoryDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 9: /* Translation Offset */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address32.TranslationOffset =
Al Stone afae4e
-                (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            TranslationOffset = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 10: /* Address Length */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address32.AddressLength =
Al Stone afae4e
-                (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
Al Stone afae4e
             LengthOp = InitializerOp;
Al Stone 4a5eac
@@ -435,7 +441,7 @@ RsDoDwordMemoryDescriptor (
Al Stone afae4e
             {
Al Stone afae4e
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
                 OptionIndex++;
Al Stone afae4e
-                Descriptor->Address32.ResourceLength++;
Al Stone afae4e
+                ResourceLength++;
Al Stone afae4e
                 ResSourceIndex = TRUE;
Al Stone afae4e
             }
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -447,8 +453,8 @@ RsDoDwordMemoryDescriptor (
Al Stone afae4e
             {
Al Stone afae4e
                 if (StringLength)
Al Stone afae4e
                 {
Al Stone afae4e
-                    Descriptor->Address32.ResourceLength = (UINT16)
Al Stone afae4e
-                        (Descriptor->Address32.ResourceLength + StringLength);
Al Stone afae4e
+
Al Stone afae4e
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
Al Stone afae4e
 
Al Stone afae4e
                     strcpy ((char *)
Al Stone afae4e
                         &OptionalFields[OptionIndex],
Al Stone 4a5eac
@@ -509,13 +515,20 @@ RsDoDwordMemoryDescriptor (
Al Stone afae4e
     /* Validate the Min/Max/Len/Gran values */
Al Stone afae4e
 
Al Stone afae4e
     RsLargeAddressCheck (
Al Stone afae4e
-        (UINT64) Descriptor->Address32.Minimum,
Al Stone afae4e
-        (UINT64) Descriptor->Address32.Maximum,
Al Stone afae4e
-        (UINT64) Descriptor->Address32.AddressLength,
Al Stone afae4e
-        (UINT64) Descriptor->Address32.Granularity,
Al Stone afae4e
+        Minimum,
Al Stone afae4e
+        Maximum,
Al Stone afae4e
+        AddressLength,
Al Stone afae4e
+        Granularity,
Al Stone afae4e
         Descriptor->Address32.Flags,
Al Stone afae4e
         MinOp, MaxOp, LengthOp, GranOp, Op);
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address32.ResourceLength, &ResourceLength);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Minimum, &Minimum);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Maximum, &Maximum);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.AddressLength, &AddressLength);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Granularity, &Granularity);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.TranslationOffset, &TranslationOffset);
Al Stone afae4e
+
Al Stone afae4e
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
Al Stone afae4e
                             OptionIndex + StringLength;
Al Stone afae4e
     return (Rnode);
Al Stone 4a5eac
@@ -550,7 +563,13 @@ RsDoDwordSpaceDescriptor (
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
     UINT8                   *OptionalFields;
Al Stone afae4e
     UINT16                  StringLength = 0;
Al Stone afae4e
+    UINT16                  ResourceLength = 0;
Al Stone afae4e
     UINT32                  OptionIndex = 0;
Al Stone afae4e
+    UINT32                  Minimum = 0;
Al Stone afae4e
+    UINT32                  Maximum = 0;
Al Stone afae4e
+    UINT32                  AddressLength = 0;
Al Stone afae4e
+    UINT32                  Granularity = 0;
Al Stone afae4e
+    UINT32                  TranslationOffset = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
     BOOLEAN                 ResSourceIndex = FALSE;
Al Stone afae4e
 
Al Stone 4a5eac
@@ -569,8 +588,7 @@ RsDoDwordSpaceDescriptor (
Al Stone afae4e
      * optional fields present
Al Stone afae4e
      */
Al Stone afae4e
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32);
Al Stone afae4e
-    Descriptor->Address32.ResourceLength = (UINT16)
Al Stone afae4e
-        (sizeof (AML_RESOURCE_ADDRESS32) -
Al Stone afae4e
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS32) -
Al Stone afae4e
          sizeof (AML_RESOURCE_LARGE_HEADER));
Al Stone afae4e
 
Al Stone afae4e
     /* Process all child initialization nodes */
Al Stone 4a5eac
@@ -619,8 +637,7 @@ RsDoDwordSpaceDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 6: /* Address Granularity */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address32.Granularity =
Al Stone afae4e
-                (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Granularity = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
Al Stone afae4e
             GranOp = InitializerOp;
Al Stone 4a5eac
@@ -628,8 +645,7 @@ RsDoDwordSpaceDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 7: /* Min Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address32.Minimum =
Al Stone afae4e
-                (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
Al Stone afae4e
             MinOp = InitializerOp;
Al Stone 4a5eac
@@ -637,8 +653,7 @@ RsDoDwordSpaceDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 8: /* Max Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address32.Maximum =
Al Stone afae4e
-                (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
Al Stone afae4e
             MaxOp = InitializerOp;
Al Stone 4a5eac
@@ -646,16 +661,14 @@ RsDoDwordSpaceDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 9: /* Translation Offset */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address32.TranslationOffset =
Al Stone afae4e
-                (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            TranslationOffset = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 10: /* Address Length */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address32.AddressLength =
Al Stone afae4e
-                (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
Al Stone afae4e
             LengthOp = InitializerOp;
Al Stone 4a5eac
@@ -667,7 +680,7 @@ RsDoDwordSpaceDescriptor (
Al Stone afae4e
             {
Al Stone afae4e
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
                 OptionIndex++;
Al Stone afae4e
-                Descriptor->Address32.ResourceLength++;
Al Stone afae4e
+                ResourceLength++;
Al Stone afae4e
                 ResSourceIndex = TRUE;
Al Stone afae4e
             }
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -679,8 +692,7 @@ RsDoDwordSpaceDescriptor (
Al Stone afae4e
             {
Al Stone afae4e
                 if (StringLength)
Al Stone afae4e
                 {
Al Stone afae4e
-                    Descriptor->Address32.ResourceLength = (UINT16)
Al Stone afae4e
-                        (Descriptor->Address32.ResourceLength + StringLength);
Al Stone afae4e
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
Al Stone afae4e
 
Al Stone afae4e
                     strcpy ((char *)
Al Stone afae4e
                         &OptionalFields[OptionIndex],
Al Stone 4a5eac
@@ -727,13 +739,20 @@ RsDoDwordSpaceDescriptor (
Al Stone afae4e
     /* Validate the Min/Max/Len/Gran values */
Al Stone afae4e
 
Al Stone afae4e
     RsLargeAddressCheck (
Al Stone afae4e
-        (UINT64) Descriptor->Address32.Minimum,
Al Stone afae4e
-        (UINT64) Descriptor->Address32.Maximum,
Al Stone afae4e
-        (UINT64) Descriptor->Address32.AddressLength,
Al Stone afae4e
-        (UINT64) Descriptor->Address32.Granularity,
Al Stone afae4e
+        Minimum,
Al Stone afae4e
+        Maximum,
Al Stone afae4e
+        AddressLength,
Al Stone afae4e
+        Granularity,
Al Stone afae4e
         Descriptor->Address32.Flags,
Al Stone afae4e
         MinOp, MaxOp, LengthOp, GranOp, Op);
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address32.ResourceLength, &ResourceLength);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Minimum, &Minimum);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Maximum, &Maximum);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.AddressLength, &AddressLength);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.Granularity, &Granularity);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->Address32.TranslationOffset, &TranslationOffset);
Al Stone afae4e
+
Al Stone afae4e
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
Al Stone afae4e
                             OptionIndex + StringLength;
Al Stone afae4e
     return (Rnode);
Dan Horák 54d979
diff -up acpica-unix2-20140424/source/compiler/aslrestype2e.c.debian-big_endian acpica-unix2-20140424/source/compiler/aslrestype2e.c
Dan Horák 54d979
--- acpica-unix2-20140424/source/compiler/aslrestype2e.c.debian-big_endian	2014-04-24 11:49:00.000000000 -0400
Dan Horák 54d979
+++ acpica-unix2-20140424/source/compiler/aslrestype2e.c	2014-06-06 20:43:34.721825238 -0400
Al Stone 4a5eac
@@ -81,6 +82,13 @@ RsDoExtendedIoDescriptor (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *GranOp = NULL;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
     UINT16                  StringLength = 0;
Al Stone afae4e
+    UINT16                  ResourceLength = 0;
Al Stone afae4e
+    UINT64                  Minimum = 0;
Al Stone afae4e
+    UINT64                  Maximum = 0;
Al Stone afae4e
+    UINT64                  AddressLength = 0;
Al Stone afae4e
+    UINT64                  Granularity = 0;
Al Stone afae4e
+    UINT64                  TranslationOffset = 0;
Al Stone afae4e
+    UINT64                  TypeSpecific = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone 4a5eac
@@ -95,9 +103,10 @@ RsDoExtendedIoDescriptor (
Al Stone afae4e
     Descriptor->ExtAddress64.ResourceType    = ACPI_ADDRESS_TYPE_IO_RANGE;
Al Stone afae4e
     Descriptor->ExtAddress64.RevisionID      = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
Al Stone afae4e
 
Al Stone afae4e
-    Descriptor->ExtAddress64.ResourceLength  = (UINT16)
Al Stone afae4e
-        (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
Al Stone afae4e
+    ResourceLength  = (UINT16) (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
Al Stone afae4e
          sizeof (AML_RESOURCE_LARGE_HEADER));
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->ExtAddress64.ResourceLength,
Al Stone afae4e
+        &ResourceLength);
Al Stone afae4e
 
Al Stone afae4e
     /* Process all child initialization nodes */
Al Stone afae4e
 
Al Stone 4a5eac
@@ -140,7 +149,7 @@ RsDoExtendedIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 5: /* Address Granularity */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Granularity = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity));
Al Stone afae4e
             GranOp = InitializerOp;
Al Stone 4a5eac
@@ -148,7 +157,7 @@ RsDoExtendedIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 6: /* Address Min */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Minimum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum));
Al Stone afae4e
             MinOp = InitializerOp;
Al Stone 4a5eac
@@ -156,7 +165,7 @@ RsDoExtendedIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 7: /* Address Max */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Maximum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum));
Al Stone afae4e
             MaxOp = InitializerOp;
Al Stone 4a5eac
@@ -164,14 +173,14 @@ RsDoExtendedIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 8: /* Translation Offset */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            TranslationOffset = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 9: /* Address Length */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            AddressLength = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength));
Al Stone afae4e
             LengthOp = InitializerOp;
Al Stone 4a5eac
@@ -179,7 +188,7 @@ RsDoExtendedIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 10: /* Type-Specific Attributes */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            TypeSpecific = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific));
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -215,13 +224,20 @@ RsDoExtendedIoDescriptor (
Al Stone afae4e
     /* Validate the Min/Max/Len/Gran values */
Al Stone afae4e
 
Al Stone afae4e
     RsLargeAddressCheck (
Al Stone afae4e
-        Descriptor->ExtAddress64.Minimum,
Al Stone afae4e
-        Descriptor->ExtAddress64.Maximum,
Al Stone afae4e
-        Descriptor->ExtAddress64.AddressLength,
Al Stone afae4e
-        Descriptor->ExtAddress64.Granularity,
Al Stone afae4e
+        Minimum,
Al Stone afae4e
+        Maximum,
Al Stone afae4e
+        AddressLength,
Al Stone afae4e
+        Granularity,
Al Stone afae4e
         Descriptor->ExtAddress64.Flags,
Al Stone afae4e
         MinOp, MaxOp, LengthOp, GranOp, Op);
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Minimum, &Minimum);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Maximum, &Maximum);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.AddressLength, &AddressLength);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Granularity, &Granularity);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.TranslationOffset, &TranslationOffset);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.TypeSpecific, &TypeSpecific);
Al Stone afae4e
+
Al Stone afae4e
     Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Al Stone 4a5eac
@@ -254,6 +270,13 @@ RsDoExtendedMemoryDescriptor (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *GranOp = NULL;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
     UINT16                  StringLength = 0;
Al Stone afae4e
+    UINT16                  ResourceLength = 0;
Al Stone afae4e
+    UINT64                  Minimum = 0;
Al Stone afae4e
+    UINT64                  Maximum = 0;
Al Stone afae4e
+    UINT64                  AddressLength = 0;
Al Stone afae4e
+    UINT64                  Granularity = 0;
Al Stone afae4e
+    UINT64                  TranslationOffset = 0;
Al Stone afae4e
+    UINT64                  TypeSpecific = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone 4a5eac
@@ -268,9 +291,10 @@ RsDoExtendedMemoryDescriptor (
Al Stone afae4e
     Descriptor->ExtAddress64.ResourceType    = ACPI_ADDRESS_TYPE_MEMORY_RANGE;
Al Stone afae4e
     Descriptor->ExtAddress64.RevisionID      = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
Al Stone afae4e
 
Al Stone afae4e
-    Descriptor->ExtAddress64.ResourceLength  = (UINT16)
Al Stone afae4e
-        (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
Al Stone afae4e
+    ResourceLength  = (UINT16) (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
Al Stone afae4e
          sizeof (AML_RESOURCE_LARGE_HEADER));
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->ExtAddress64.ResourceLength,
Al Stone afae4e
+        &ResourceLength);
Al Stone afae4e
 
Al Stone afae4e
     /* Process all child initialization nodes */
Al Stone afae4e
 
Al Stone 4a5eac
@@ -320,7 +344,7 @@ RsDoExtendedMemoryDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 6: /* Address Granularity */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Granularity = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity));
Al Stone afae4e
             GranOp = InitializerOp;
Al Stone 4a5eac
@@ -328,7 +352,7 @@ RsDoExtendedMemoryDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 7: /* Min Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Minimum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum));
Al Stone afae4e
             MinOp = InitializerOp;
Al Stone 4a5eac
@@ -336,7 +360,7 @@ RsDoExtendedMemoryDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 8: /* Max Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Maximum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum));
Al Stone afae4e
             MaxOp = InitializerOp;
Al Stone 4a5eac
@@ -344,14 +368,14 @@ RsDoExtendedMemoryDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 9: /* Translation Offset */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            TranslationOffset = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 10: /* Address Length */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            AddressLength = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength));
Al Stone afae4e
             LengthOp = InitializerOp;
Al Stone 4a5eac
@@ -359,7 +383,7 @@ RsDoExtendedMemoryDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 11: /* Type-Specific Attributes */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            TypeSpecific = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific));
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -396,13 +420,20 @@ RsDoExtendedMemoryDescriptor (
Al Stone afae4e
     /* Validate the Min/Max/Len/Gran values */
Al Stone afae4e
 
Al Stone afae4e
     RsLargeAddressCheck (
Al Stone afae4e
-        Descriptor->ExtAddress64.Minimum,
Al Stone afae4e
-        Descriptor->ExtAddress64.Maximum,
Al Stone afae4e
-        Descriptor->ExtAddress64.AddressLength,
Al Stone afae4e
-        Descriptor->ExtAddress64.Granularity,
Al Stone afae4e
+        Minimum,
Al Stone afae4e
+        Maximum,
Al Stone afae4e
+        AddressLength,
Al Stone afae4e
+        Granularity,
Al Stone afae4e
         Descriptor->ExtAddress64.Flags,
Al Stone afae4e
         MinOp, MaxOp, LengthOp, GranOp, Op);
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Minimum, &Minimum);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Maximum, &Maximum);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.AddressLength, &AddressLength);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Granularity, &Granularity);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.TranslationOffset, &TranslationOffset);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.TypeSpecific, &TypeSpecific);
Al Stone afae4e
+
Al Stone afae4e
     Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Al Stone 4a5eac
@@ -435,6 +466,13 @@ RsDoExtendedSpaceDescriptor (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *GranOp = NULL;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
     UINT16                  StringLength = 0;
Al Stone afae4e
+    UINT16                  ResourceLength = 0;
Al Stone afae4e
+    UINT64                  Minimum = 0;
Al Stone afae4e
+    UINT64                  Maximum = 0;
Al Stone afae4e
+    UINT64                  AddressLength = 0;
Al Stone afae4e
+    UINT64                  Granularity = 0;
Al Stone afae4e
+    UINT64                  TranslationOffset = 0;
Al Stone afae4e
+    UINT64                  TypeSpecific = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone 4a5eac
@@ -448,9 +486,10 @@ RsDoExtendedSpaceDescriptor (
Al Stone afae4e
     Descriptor->ExtAddress64.DescriptorType  = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64;
Al Stone afae4e
     Descriptor->ExtAddress64.RevisionID      = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
Al Stone afae4e
 
Al Stone afae4e
-    Descriptor->ExtAddress64.ResourceLength  = (UINT16)
Al Stone afae4e
-        (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
Al Stone afae4e
+    ResourceLength  = (UINT16) (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
Al Stone afae4e
          sizeof (AML_RESOURCE_LARGE_HEADER));
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->ExtAddress64.ResourceLength,
Al Stone afae4e
+        &ResourceLength);
Al Stone afae4e
 
Al Stone afae4e
     /* Process all child initialization nodes */
Al Stone afae4e
 
Al Stone 4a5eac
@@ -498,7 +537,7 @@ RsDoExtendedSpaceDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 6: /* Address Granularity */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Granularity = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity));
Al Stone afae4e
             GranOp = InitializerOp;
Al Stone 4a5eac
@@ -506,7 +545,7 @@ RsDoExtendedSpaceDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 7: /* Min Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Minimum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum));
Al Stone afae4e
             MinOp = InitializerOp;
Al Stone 4a5eac
@@ -514,7 +553,7 @@ RsDoExtendedSpaceDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 8: /* Max Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Maximum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum));
Al Stone afae4e
             MaxOp = InitializerOp;
Al Stone 4a5eac
@@ -522,14 +561,14 @@ RsDoExtendedSpaceDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 9: /* Translation Offset */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            TranslationOffset = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 10: /* Address Length */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            AddressLength = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength));
Al Stone afae4e
             LengthOp = InitializerOp;
Al Stone 4a5eac
@@ -537,7 +576,7 @@ RsDoExtendedSpaceDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 11: /* Type-Specific Attributes */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            TypeSpecific = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific));
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -559,13 +598,20 @@ RsDoExtendedSpaceDescriptor (
Al Stone afae4e
     /* Validate the Min/Max/Len/Gran values */
Al Stone afae4e
 
Al Stone afae4e
     RsLargeAddressCheck (
Al Stone afae4e
-        Descriptor->ExtAddress64.Minimum,
Al Stone afae4e
-        Descriptor->ExtAddress64.Maximum,
Al Stone afae4e
-        Descriptor->ExtAddress64.AddressLength,
Al Stone afae4e
-        Descriptor->ExtAddress64.Granularity,
Al Stone afae4e
+        Minimum,
Al Stone afae4e
+        Maximum,
Al Stone afae4e
+        AddressLength,
Al Stone afae4e
+        Granularity,
Al Stone afae4e
         Descriptor->ExtAddress64.Flags,
Al Stone afae4e
         MinOp, MaxOp, LengthOp, GranOp, Op);
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Minimum, &Minimum);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Maximum, &Maximum);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.AddressLength, &AddressLength);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.Granularity, &Granularity);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.TranslationOffset, &TranslationOffset);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->ExtAddress64.TypeSpecific, &TypeSpecific);
Al Stone afae4e
+
Al Stone afae4e
     Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Dan Horák 54d979
diff -up acpica-unix2-20140424/source/compiler/aslrestype2q.c.debian-big_endian acpica-unix2-20140424/source/compiler/aslrestype2q.c
Dan Horák 54d979
--- acpica-unix2-20140424/source/compiler/aslrestype2q.c.debian-big_endian	2014-04-24 11:49:00.000000000 -0400
Dan Horák 54d979
+++ acpica-unix2-20140424/source/compiler/aslrestype2q.c	2014-06-06 20:43:34.721825238 -0400
Al Stone 4a5eac
@@ -83,7 +84,13 @@ RsDoQwordIoDescriptor (
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
     UINT8                   *OptionalFields;
Al Stone afae4e
     UINT16                  StringLength = 0;
Al Stone afae4e
+    UINT16                  ResourceLength = 0;
Al Stone afae4e
     UINT32                  OptionIndex = 0;
Al Stone afae4e
+    UINT64                  Minimum = 0;
Al Stone afae4e
+    UINT64                  Maximum = 0;
Al Stone afae4e
+    UINT64                  AddressLength = 0;
Al Stone afae4e
+    UINT64                  Granularity = 0;
Al Stone afae4e
+    UINT64                  TranslationOffset = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
     BOOLEAN                 ResSourceIndex = FALSE;
Al Stone afae4e
 
Al Stone 4a5eac
@@ -103,8 +110,7 @@ RsDoQwordIoDescriptor (
Al Stone afae4e
      * optional fields present
Al Stone afae4e
      */
Al Stone afae4e
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64);
Al Stone afae4e
-    Descriptor->Address64.ResourceLength = (UINT16)
Al Stone afae4e
-        (sizeof (AML_RESOURCE_ADDRESS64) -
Al Stone afae4e
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS64) -
Al Stone afae4e
          sizeof (AML_RESOURCE_LARGE_HEADER));
Al Stone afae4e
 
Al Stone afae4e
     /* Process all child initialization nodes */
Al Stone 4a5eac
@@ -148,7 +154,7 @@ RsDoQwordIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 5: /* Address Granularity */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Granularity = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
Al Stone afae4e
             GranOp = InitializerOp;
Al Stone 4a5eac
@@ -156,7 +162,7 @@ RsDoQwordIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 6: /* Address Min */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Minimum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
Al Stone afae4e
             MinOp = InitializerOp;
Al Stone 4a5eac
@@ -164,7 +170,7 @@ RsDoQwordIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 7: /* Address Max */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Maximum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
Al Stone afae4e
             MaxOp = InitializerOp;
Al Stone 4a5eac
@@ -172,14 +178,14 @@ RsDoQwordIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 8: /* Translation Offset */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            TranslationOffset = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 9: /* Address Length */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            AddressLength = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
Al Stone afae4e
             LengthOp = InitializerOp;
Al Stone 4a5eac
@@ -191,7 +197,7 @@ RsDoQwordIoDescriptor (
Al Stone afae4e
             {
Al Stone afae4e
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
                 OptionIndex++;
Al Stone afae4e
-                Descriptor->Address64.ResourceLength++;
Al Stone afae4e
+                ResourceLength++;
Al Stone afae4e
                 ResSourceIndex = TRUE;
Al Stone afae4e
             }
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -203,8 +209,7 @@ RsDoQwordIoDescriptor (
Al Stone afae4e
             {
Al Stone afae4e
                 if (StringLength)
Al Stone afae4e
                 {
Al Stone afae4e
-                    Descriptor->Address64.ResourceLength = (UINT16)
Al Stone afae4e
-                        (Descriptor->Address64.ResourceLength + StringLength);
Al Stone afae4e
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
Al Stone afae4e
 
Al Stone afae4e
                     strcpy ((char *)
Al Stone afae4e
                         &OptionalFields[OptionIndex],
Al Stone 4a5eac
@@ -264,13 +269,20 @@ RsDoQwordIoDescriptor (
Al Stone afae4e
     /* Validate the Min/Max/Len/Gran values */
Al Stone afae4e
 
Al Stone afae4e
     RsLargeAddressCheck (
Al Stone afae4e
-        Descriptor->Address64.Minimum,
Al Stone afae4e
-        Descriptor->Address64.Maximum,
Al Stone afae4e
-        Descriptor->Address64.AddressLength,
Al Stone afae4e
-        Descriptor->Address64.Granularity,
Al Stone afae4e
+        Minimum,
Al Stone afae4e
+        Maximum,
Al Stone afae4e
+        AddressLength,
Al Stone afae4e
+        Granularity,
Al Stone afae4e
         Descriptor->Address64.Flags,
Al Stone afae4e
         MinOp, MaxOp, LengthOp, GranOp, Op);
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address64.ResourceLength, &ResourceLength);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Minimum, &Minimum);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Maximum, &Maximum);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.AddressLength, &AddressLength);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Granularity, &Granularity);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.TranslationOffset, &TranslationOffset);
Al Stone afae4e
+
Al Stone afae4e
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
Al Stone afae4e
                             OptionIndex + StringLength;
Al Stone afae4e
     return (Rnode);
Al Stone 4a5eac
@@ -305,7 +317,13 @@ RsDoQwordMemoryDescriptor (
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
     UINT8                   *OptionalFields;
Al Stone afae4e
     UINT16                  StringLength = 0;
Al Stone afae4e
+    UINT16                  ResourceLength = 0;
Al Stone afae4e
     UINT32                  OptionIndex = 0;
Al Stone afae4e
+    UINT64                  Minimum = 0;
Al Stone afae4e
+    UINT64                  Maximum = 0;
Al Stone afae4e
+    UINT64                  AddressLength = 0;
Al Stone afae4e
+    UINT64                  Granularity = 0;
Al Stone afae4e
+    UINT64                  TranslationOffset = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
     BOOLEAN                 ResSourceIndex = FALSE;
Al Stone afae4e
 
Al Stone 4a5eac
@@ -325,8 +343,7 @@ RsDoQwordMemoryDescriptor (
Al Stone afae4e
      * optional fields present
Al Stone afae4e
      */
Al Stone afae4e
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64);
Al Stone afae4e
-    Descriptor->Address64.ResourceLength = (UINT16)
Al Stone afae4e
-        (sizeof (AML_RESOURCE_ADDRESS64) -
Al Stone afae4e
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS64) -
Al Stone afae4e
          sizeof (AML_RESOURCE_LARGE_HEADER));
Al Stone afae4e
 
Al Stone afae4e
     /* Process all child initialization nodes */
Al Stone 4a5eac
@@ -377,7 +394,7 @@ RsDoQwordMemoryDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 6: /* Address Granularity */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Granularity = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
Al Stone afae4e
             GranOp = InitializerOp;
Al Stone 4a5eac
@@ -385,7 +402,7 @@ RsDoQwordMemoryDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 7: /* Min Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Minimum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
Al Stone afae4e
             MinOp = InitializerOp;
Al Stone 4a5eac
@@ -393,7 +410,7 @@ RsDoQwordMemoryDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 8: /* Max Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Maximum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
Al Stone afae4e
             MaxOp = InitializerOp;
Al Stone 4a5eac
@@ -401,14 +418,14 @@ RsDoQwordMemoryDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 9: /* Translation Offset */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            TranslationOffset = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 10: /* Address Length */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            AddressLength = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
Al Stone afae4e
             LengthOp = InitializerOp;
Al Stone 4a5eac
@@ -420,7 +437,7 @@ RsDoQwordMemoryDescriptor (
Al Stone afae4e
             {
Al Stone afae4e
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
                 OptionIndex++;
Al Stone afae4e
-                Descriptor->Address64.ResourceLength++;
Al Stone afae4e
+                ResourceLength++;
Al Stone afae4e
                 ResSourceIndex = TRUE;
Al Stone afae4e
             }
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -432,8 +449,7 @@ RsDoQwordMemoryDescriptor (
Al Stone afae4e
             {
Al Stone afae4e
                 if (StringLength)
Al Stone afae4e
                 {
Al Stone afae4e
-                    Descriptor->Address64.ResourceLength = (UINT16)
Al Stone afae4e
-                        (Descriptor->Address64.ResourceLength + StringLength);
Al Stone afae4e
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
Al Stone afae4e
 
Al Stone afae4e
                     strcpy ((char *)
Al Stone afae4e
                         &OptionalFields[OptionIndex],
Al Stone 4a5eac
@@ -494,13 +510,20 @@ RsDoQwordMemoryDescriptor (
Al Stone afae4e
     /* Validate the Min/Max/Len/Gran values */
Al Stone afae4e
 
Al Stone afae4e
     RsLargeAddressCheck (
Al Stone afae4e
-        Descriptor->Address64.Minimum,
Al Stone afae4e
-        Descriptor->Address64.Maximum,
Al Stone afae4e
-        Descriptor->Address64.AddressLength,
Al Stone afae4e
-        Descriptor->Address64.Granularity,
Al Stone afae4e
+        Minimum,
Al Stone afae4e
+        Maximum,
Al Stone afae4e
+        AddressLength,
Al Stone afae4e
+        Granularity,
Al Stone afae4e
         Descriptor->Address64.Flags,
Al Stone afae4e
         MinOp, MaxOp, LengthOp, GranOp, Op);
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address64.ResourceLength, &ResourceLength);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Minimum, &Minimum);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Maximum, &Maximum);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.AddressLength, &AddressLength);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Granularity, &Granularity);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.TranslationOffset, &TranslationOffset);
Al Stone afae4e
+
Al Stone afae4e
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
Al Stone afae4e
                             OptionIndex + StringLength;
Al Stone afae4e
     return (Rnode);
Al Stone 4a5eac
@@ -535,8 +558,14 @@ RsDoQwordSpaceDescriptor (
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone afae4e
     UINT8                   *OptionalFields;
Al Stone afae4e
     UINT16                  StringLength = 0;
Al Stone afae4e
+    UINT16                  ResourceLength = 0;
Al Stone afae4e
     UINT32                  OptionIndex = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
+    UINT64                  Minimum = 0;
Al Stone afae4e
+    UINT64                  Maximum = 0;
Al Stone afae4e
+    UINT64                  AddressLength = 0;
Al Stone afae4e
+    UINT64                  Granularity = 0;
Al Stone afae4e
+    UINT64                  TranslationOffset = 0;
Al Stone afae4e
     BOOLEAN                 ResSourceIndex = FALSE;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone 4a5eac
@@ -554,8 +583,7 @@ RsDoQwordSpaceDescriptor (
Al Stone afae4e
      * optional fields present
Al Stone afae4e
      */
Al Stone afae4e
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64);
Al Stone afae4e
-    Descriptor->Address64.ResourceLength = (UINT16)
Al Stone afae4e
-        (sizeof (AML_RESOURCE_ADDRESS64) -
Al Stone afae4e
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS64) -
Al Stone afae4e
          sizeof (AML_RESOURCE_LARGE_HEADER));
Al Stone afae4e
 
Al Stone afae4e
     /* Process all child initialization nodes */
Al Stone 4a5eac
@@ -604,7 +632,7 @@ RsDoQwordSpaceDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 6: /* Address Granularity */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Granularity = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
Al Stone afae4e
             GranOp = InitializerOp;
Al Stone 4a5eac
@@ -612,7 +640,7 @@ RsDoQwordSpaceDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 7: /* Min Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Minimum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
Al Stone afae4e
             MinOp = InitializerOp;
Al Stone 4a5eac
@@ -620,7 +648,7 @@ RsDoQwordSpaceDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 8: /* Max Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Maximum = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
Al Stone afae4e
             MaxOp = InitializerOp;
Al Stone 4a5eac
@@ -628,14 +656,14 @@ RsDoQwordSpaceDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 9: /* Translation Offset */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            TranslationOffset = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 10: /* Address Length */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            AddressLength = InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
Al Stone afae4e
             LengthOp = InitializerOp;
Al Stone 4a5eac
@@ -647,7 +675,7 @@ RsDoQwordSpaceDescriptor (
Al Stone afae4e
             {
Al Stone afae4e
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
                 OptionIndex++;
Al Stone afae4e
-                Descriptor->Address64.ResourceLength++;
Al Stone afae4e
+                ResourceLength++;
Al Stone afae4e
                 ResSourceIndex = TRUE;
Al Stone afae4e
             }
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -659,8 +687,7 @@ RsDoQwordSpaceDescriptor (
Al Stone afae4e
             {
Al Stone afae4e
                 if (StringLength)
Al Stone afae4e
                 {
Al Stone afae4e
-                    Descriptor->Address64.ResourceLength = (UINT16)
Al Stone afae4e
-                        (Descriptor->Address64.ResourceLength + StringLength);
Al Stone afae4e
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
Al Stone afae4e
 
Al Stone afae4e
                     strcpy ((char *)
Al Stone afae4e
                         &OptionalFields[OptionIndex],
Al Stone 4a5eac
@@ -706,13 +733,20 @@ RsDoQwordSpaceDescriptor (
Al Stone afae4e
     /* Validate the Min/Max/Len/Gran values */
Al Stone afae4e
 
Al Stone afae4e
     RsLargeAddressCheck (
Al Stone afae4e
-        Descriptor->Address64.Minimum,
Al Stone afae4e
-        Descriptor->Address64.Maximum,
Al Stone afae4e
-        Descriptor->Address64.AddressLength,
Al Stone afae4e
-        Descriptor->Address64.Granularity,
Al Stone afae4e
+        Minimum,
Al Stone afae4e
+        Maximum,
Al Stone afae4e
+        AddressLength,
Al Stone afae4e
+        Granularity,
Al Stone afae4e
         Descriptor->Address64.Flags,
Al Stone afae4e
         MinOp, MaxOp, LengthOp, GranOp, Op);
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address64.ResourceLength, &ResourceLength);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Minimum, &Minimum);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Maximum, &Maximum);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.AddressLength, &AddressLength);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.Granularity, &Granularity);
Al Stone afae4e
+    ACPI_MOVE_64_TO_64(&Descriptor->Address64.TranslationOffset, &TranslationOffset);
Al Stone afae4e
+
Al Stone afae4e
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
Al Stone afae4e
                             OptionIndex + StringLength;
Al Stone afae4e
     return (Rnode);
Dan Horák 54d979
diff -up acpica-unix2-20140424/source/compiler/aslrestype2s.c.debian-big_endian acpica-unix2-20140424/source/compiler/aslrestype2s.c
Dan Horák 54d979
--- acpica-unix2-20140424/source/compiler/aslrestype2s.c.debian-big_endian	2014-04-24 11:49:00.000000000 -0400
Dan Horák 54d979
+++ acpica-unix2-20140424/source/compiler/aslrestype2s.c	2014-06-06 20:43:34.721825238 -0400
Al Stone 4a5eac
@@ -292,6 +293,9 @@ RsDoGpioIntDescriptor (
Al Stone afae4e
     UINT16                  VendorLength;
Al Stone afae4e
     UINT16                  InterruptLength;
Al Stone afae4e
     UINT16                  DescriptorSize;
Al Stone afae4e
+    UINT16                  IntFlags = 0;
Al Stone afae4e
+    UINT16                  DebounceTimeout = 0;
Al Stone afae4e
+    UINT16                  Flags = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone 4a5eac
@@ -347,21 +351,21 @@ RsDoGpioIntDescriptor (
Al Stone afae4e
         {
Al Stone afae4e
         case 0: /* Interrupt Mode - edge/level [Flag] (_MOD) */
Al Stone afae4e
 
Al Stone afae4e
-            RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 0, 0);
Al Stone afae4e
+            RsSetFlagBits16 (&IntFlags, InitializerOp, 0, 0);
Al Stone afae4e
             RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 0);
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 1: /* Interrupt Polarity - Active high/low [Flags] (_POL) */
Al Stone afae4e
 
Al Stone afae4e
-            RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 1, 0);
Al Stone afae4e
+            RsSetFlagBits16 (&IntFlags, InitializerOp, 1, 0);
Al Stone afae4e
             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_POLARITY,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 1, 2);
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 2: /* Share Type - Default: exclusive (0) [Flags] (_SHR) */
Al Stone afae4e
 
Al Stone afae4e
-            RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 3, 0);
Al Stone afae4e
+            RsSetFlagBits16 (&IntFlags, InitializerOp, 3, 0);
Al Stone afae4e
             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 3, 2);
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -375,7 +379,7 @@ RsDoGpioIntDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 4: /* Debounce Timeout [WORD] (_DBT) */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Gpio.DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_DEBOUNCETIME,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.DebounceTimeout));
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -401,7 +405,7 @@ RsDoGpioIntDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 7: /* Resource Usage (consumer/producer) */
Al Stone afae4e
 
Al Stone afae4e
-            RsSetFlagBits16 (&Descriptor->Gpio.Flags, InitializerOp, 0, 1);
Al Stone afae4e
+            RsSetFlagBits16 (&Flags, InitializerOp, 0, 1);
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 8: /* Resource Tag (Descriptor Name) */
Al Stone 4a5eac
@@ -465,6 +469,10 @@ RsDoGpioIntDescriptor (
Al Stone afae4e
         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.IntFlags, &IntFlags);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.DebounceTimeout, &DebounceTimeout);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.Flags, &Flags);
Al Stone afae4e
+
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Al Stone afae4e
 
Al Stone 4a5eac
@@ -498,6 +506,10 @@ RsDoGpioIoDescriptor (
Al Stone afae4e
     UINT16                  VendorLength;
Al Stone afae4e
     UINT16                  InterruptLength;
Al Stone afae4e
     UINT16                  DescriptorSize;
Al Stone afae4e
+    UINT16                  IntFlags = 0;
Al Stone afae4e
+    UINT16                  DebounceTimeout = 0;
Al Stone afae4e
+    UINT16                  DriveStrength = 0;
Al Stone afae4e
+    UINT16                  Flags = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone 4a5eac
@@ -553,7 +565,7 @@ RsDoGpioIoDescriptor (
Al Stone afae4e
         {
Al Stone afae4e
         case 0: /* Share Type [Flags] (_SHR) */
Al Stone afae4e
 
Al Stone afae4e
-            RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 3, 0);
Al Stone afae4e
+            RsSetFlagBits16 (&IntFlags, InitializerOp, 3, 0);
Al Stone afae4e
             RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 3);
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -567,21 +579,21 @@ RsDoGpioIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 2: /* Debounce Timeout [WORD] (_DBT) */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Gpio.DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_DEBOUNCETIME,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.DebounceTimeout));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 3: /* Drive Strength [WORD] (_DRS) */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Gpio.DriveStrength = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            DriveStrength = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_DRIVESTRENGTH,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.DriveStrength));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 4: /* I/O Restriction [Flag] (_IOR) */
Al Stone afae4e
 
Al Stone afae4e
-            RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 0, 0);
Al Stone afae4e
+            RsSetFlagBits16 (&IntFlags, InitializerOp, 0, 0);
Al Stone afae4e
             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_IORESTRICTION,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 0, 2);
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -607,7 +619,7 @@ RsDoGpioIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 7: /* Resource Usage (consumer/producer) */
Al Stone afae4e
 
Al Stone afae4e
-            RsSetFlagBits16 (&Descriptor->Gpio.Flags, InitializerOp, 0, 1);
Al Stone afae4e
+            RsSetFlagBits16 (&Flags, InitializerOp, 0, 1);
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 8: /* Resource Tag (Descriptor Name) */
Al Stone 4a5eac
@@ -670,6 +682,11 @@ RsDoGpioIoDescriptor (
Al Stone afae4e
         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.IntFlags, &IntFlags);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.DebounceTimeout, &DebounceTimeout);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.DriveStrength, &DriveStrength);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Gpio.Flags, &Flags);
Al Stone afae4e
+
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Al Stone afae4e
 
Al Stone 4a5eac
@@ -701,6 +718,9 @@ RsDoI2cSerialBusDescriptor (
Al Stone afae4e
     UINT16                  ResSourceLength;
Al Stone afae4e
     UINT16                  VendorLength;
Al Stone afae4e
     UINT16                  DescriptorSize;
Al Stone afae4e
+    UINT16                  SlaveAddress = 0;
Al Stone afae4e
+    UINT32                  ConnectionSpeed = 0;
Al Stone afae4e
+    UINT16                  TypeSpecificFlags = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone 4a5eac
@@ -748,7 +768,7 @@ RsDoI2cSerialBusDescriptor (
Al Stone afae4e
         {
Al Stone afae4e
         case 0: /* Slave Address [WORD] (_ADR) */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->I2cSerialBus.SlaveAddress = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            SlaveAddress = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_ADDRESS,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.SlaveAddress));
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -762,14 +782,14 @@ RsDoI2cSerialBusDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 2: /* Connection Speed [DWORD] (_SPE) */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->I2cSerialBus.ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.ConnectionSpeed));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 3: /* Addressing Mode [Flag] (_MOD) */
Al Stone afae4e
 
Al Stone afae4e
-            RsSetFlagBits16 (&Descriptor->I2cSerialBus.TypeSpecificFlags, InitializerOp, 0, 0);
Al Stone afae4e
+            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 0, 0);
Al Stone afae4e
             RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.TypeSpecificFlags), 0);
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -817,6 +837,9 @@ RsDoI2cSerialBusDescriptor (
Al Stone afae4e
         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->I2cSerialBus.SlaveAddress, &SlaveAddress);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->I2cSerialBus.ConnectionSpeed, &ConnectionSpeed);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->I2cSerialBus.TypeSpecificFlags, &TypeSpecificFlags);
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Al Stone afae4e
 
Al Stone 4a5eac
@@ -848,6 +871,9 @@ RsDoSpiSerialBusDescriptor (
Al Stone afae4e
     UINT16                  ResSourceLength;
Al Stone afae4e
     UINT16                  VendorLength;
Al Stone afae4e
     UINT16                  DescriptorSize;
Al Stone afae4e
+    UINT16                  DeviceSelection = 0;
Al Stone afae4e
+    UINT32                  ConnectionSpeed = 0;
Al Stone afae4e
+    UINT16                  TypeSpecificFlags = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone 4a5eac
@@ -895,21 +921,21 @@ RsDoSpiSerialBusDescriptor (
Al Stone afae4e
         {
Al Stone afae4e
         case 0: /* Device Selection [WORD] (_ADR) */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->SpiSerialBus.DeviceSelection = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            DeviceSelection = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_ADDRESS,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.DeviceSelection));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 1: /* Device Polarity [Flag] (_DPL) */
Al Stone afae4e
 
Al Stone afae4e
-            RsSetFlagBits16 (&Descriptor->SpiSerialBus.TypeSpecificFlags, InitializerOp, 1, 0);
Al Stone afae4e
+            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 1, 0);
Al Stone afae4e
             RsCreateBitField (InitializerOp, ACPI_RESTAG_DEVICEPOLARITY,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.TypeSpecificFlags), 1);
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 2: /* Wire Mode [Flag] (_MOD) */
Al Stone afae4e
 
Al Stone afae4e
-            RsSetFlagBits16 (&Descriptor->SpiSerialBus.TypeSpecificFlags, InitializerOp, 0, 0);
Al Stone afae4e
+            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 0, 0);
Al Stone afae4e
             RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.TypeSpecificFlags), 0);
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -930,7 +956,7 @@ RsDoSpiSerialBusDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 5: /* Connection Speed [DWORD] (_SPE) */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->SpiSerialBus.ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.ConnectionSpeed));
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -992,6 +1018,10 @@ RsDoSpiSerialBusDescriptor (
Al Stone afae4e
         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->SpiSerialBus.DeviceSelection, &DeviceSelection);
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->SpiSerialBus.ConnectionSpeed, &ConnectionSpeed);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->SpiSerialBus.TypeSpecificFlags, &TypeSpecificFlags);
Al Stone afae4e
+
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Al Stone afae4e
 
Al Stone 4a5eac
@@ -1023,6 +1053,10 @@ RsDoUartSerialBusDescriptor (
Al Stone afae4e
     UINT16                  ResSourceLength;
Al Stone afae4e
     UINT16                  VendorLength;
Al Stone afae4e
     UINT16                  DescriptorSize;
Al Stone afae4e
+    UINT32                  DefaultBaudRate = 0;
Al Stone afae4e
+    UINT16                  TypeSpecificFlags = 0;
Al Stone afae4e
+    UINT16                  RxFifoSize = 0;
Al Stone afae4e
+    UINT16                  TxFifoSize = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone 4a5eac
@@ -1070,21 +1104,21 @@ RsDoUartSerialBusDescriptor (
Al Stone afae4e
         {
Al Stone afae4e
         case 0: /* Connection Speed (Baud Rate) [DWORD] (_SPE) */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->UartSerialBus.DefaultBaudRate = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            DefaultBaudRate = (UINT32) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.DefaultBaudRate));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 1: /* Bits Per Byte [Flags] (_LEN) */
Al Stone afae4e
 
Al Stone afae4e
-            RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 4, 3);
Al Stone afae4e
+            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 4, 3);
Al Stone afae4e
             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_LENGTH,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 4, 3);
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 2: /* Stop Bits [Flags] (_STB) */
Al Stone afae4e
 
Al Stone afae4e
-            RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 2, 1);
Al Stone afae4e
+            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 2, 1);
Al Stone afae4e
             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_STOPBITS,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 2, 2);
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -1098,7 +1132,7 @@ RsDoUartSerialBusDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 4: /* Endianness [Flag] (_END) */
Al Stone afae4e
 
Al Stone afae4e
-            RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 7, 0);
Al Stone afae4e
+            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 7, 0);
Al Stone afae4e
             RsCreateBitField (InitializerOp, ACPI_RESTAG_ENDIANNESS,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 7);
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -1112,21 +1146,21 @@ RsDoUartSerialBusDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 6: /* Flow Control [Flags] (_FLC) */
Al Stone afae4e
 
Al Stone afae4e
-            RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 0, 0);
Al Stone afae4e
+            RsSetFlagBits16 (&TypeSpecificFlags, InitializerOp, 0, 0);
Al Stone afae4e
             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_FLOWCONTROL,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 0, 2);
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 7: /* Rx Buffer Size [WORD] (_RXL) */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->UartSerialBus.RxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            RxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH_RX,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.RxFifoSize));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 8: /* Tx Buffer Size [WORD] (_TXL) */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->UartSerialBus.TxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            TxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH_TX,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TxFifoSize));
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -1184,5 +1218,10 @@ RsDoUartSerialBusDescriptor (
Al Stone afae4e
         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_32_TO_32(&Descriptor->UartSerialBus.DefaultBaudRate, &DefaultBaudRate);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->UartSerialBus.TypeSpecificFlags, &TypeSpecificFlags);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->UartSerialBus.RxFifoSize, &RxFifoSize);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->UartSerialBus.TxFifoSize, &TxFifoSize);
Al Stone afae4e
+
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Dan Horák 54d979
diff -up acpica-unix2-20140424/source/compiler/aslrestype2w.c.debian-big_endian acpica-unix2-20140424/source/compiler/aslrestype2w.c
Dan Horák 54d979
--- acpica-unix2-20140424/source/compiler/aslrestype2w.c.debian-big_endian	2014-04-24 11:49:00.000000000 -0400
Dan Horák 54d979
+++ acpica-unix2-20140424/source/compiler/aslrestype2w.c	2014-06-06 20:43:34.721825238 -0400
Al Stone 4a5eac
@@ -84,6 +85,12 @@ RsDoWordIoDescriptor (
Al Stone afae4e
     UINT8                   *OptionalFields;
Al Stone afae4e
     UINT16                  StringLength = 0;
Al Stone afae4e
     UINT32                  OptionIndex = 0;
Al Stone afae4e
+    UINT16                  ResourceLength = 0;
Al Stone afae4e
+    UINT16                  Minimum = 0;
Al Stone afae4e
+    UINT16                  Maximum = 0;
Al Stone afae4e
+    UINT16                  AddressLength = 0;
Al Stone afae4e
+    UINT16                  Granularity = 0;
Al Stone afae4e
+    UINT16                  TranslationOffset = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
     BOOLEAN                 ResSourceIndex = FALSE;
Al Stone afae4e
 
Al Stone 4a5eac
@@ -103,8 +110,7 @@ RsDoWordIoDescriptor (
Al Stone afae4e
      * optional fields present
Al Stone afae4e
      */
Al Stone afae4e
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS16);
Al Stone afae4e
-    Descriptor->Address16.ResourceLength = (UINT16)
Al Stone afae4e
-        (sizeof (AML_RESOURCE_ADDRESS16) -
Al Stone afae4e
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS16) -
Al Stone afae4e
          sizeof (AML_RESOURCE_LARGE_HEADER));
Al Stone afae4e
 
Al Stone afae4e
     /* Process all child initialization nodes */
Al Stone 4a5eac
@@ -148,7 +154,7 @@ RsDoWordIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 5: /* Address Granularity */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address16.Granularity = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Granularity = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
Al Stone afae4e
             GranOp = InitializerOp;
Al Stone 4a5eac
@@ -156,7 +162,7 @@ RsDoWordIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 6: /* Address Min */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address16.Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
Al Stone afae4e
             MinOp = InitializerOp;
Al Stone 4a5eac
@@ -164,7 +170,7 @@ RsDoWordIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 7: /* Address Max */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address16.Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
Al Stone afae4e
             MaxOp = InitializerOp;
Al Stone 4a5eac
@@ -172,14 +178,14 @@ RsDoWordIoDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 8: /* Translation Offset */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address16.TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 9: /* Address Length */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address16.AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
Al Stone afae4e
                  CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength));
Al Stone afae4e
             LengthOp = InitializerOp;
Al Stone 4a5eac
@@ -191,7 +197,7 @@ RsDoWordIoDescriptor (
Al Stone afae4e
             {
Al Stone afae4e
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
                 OptionIndex++;
Al Stone afae4e
-                Descriptor->Address16.ResourceLength++;
Al Stone afae4e
+                ResourceLength++;
Al Stone afae4e
                 ResSourceIndex = TRUE;
Al Stone afae4e
             }
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -203,8 +209,7 @@ RsDoWordIoDescriptor (
Al Stone afae4e
             {
Al Stone afae4e
                 if (StringLength)
Al Stone afae4e
                 {
Al Stone afae4e
-                    Descriptor->Address16.ResourceLength = (UINT16)
Al Stone afae4e
-                        (Descriptor->Address16.ResourceLength + StringLength);
Al Stone afae4e
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
Al Stone afae4e
 
Al Stone afae4e
                     strcpy ((char *)
Al Stone afae4e
                         &OptionalFields[OptionIndex],
Al Stone 4a5eac
@@ -264,13 +269,20 @@ RsDoWordIoDescriptor (
Al Stone afae4e
     /* Validate the Min/Max/Len/Gran values */
Al Stone afae4e
 
Al Stone afae4e
     RsLargeAddressCheck (
Al Stone afae4e
-        (UINT64) Descriptor->Address16.Minimum,
Al Stone afae4e
-        (UINT64) Descriptor->Address16.Maximum,
Al Stone afae4e
-        (UINT64) Descriptor->Address16.AddressLength,
Al Stone afae4e
-        (UINT64) Descriptor->Address16.Granularity,
Al Stone afae4e
+        Minimum,
Al Stone afae4e
+        Maximum,
Al Stone afae4e
+        AddressLength,
Al Stone afae4e
+        Granularity,
Al Stone afae4e
         Descriptor->Address16.Flags,
Al Stone afae4e
         MinOp, MaxOp, LengthOp, GranOp, Op);
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.ResourceLength, &ResourceLength);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Minimum, &Minimum);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Maximum, &Maximum);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.AddressLength, &AddressLength);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Granularity, &Granularity);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.TranslationOffset, &TranslationOffset);
Al Stone afae4e
+
Al Stone afae4e
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
Al Stone afae4e
                             OptionIndex + StringLength;
Al Stone afae4e
     return (Rnode);
Al Stone 4a5eac
@@ -306,6 +318,12 @@ RsDoWordBusNumberDescriptor (
Al Stone afae4e
     UINT8                   *OptionalFields;
Al Stone afae4e
     UINT16                  StringLength = 0;
Al Stone afae4e
     UINT32                  OptionIndex = 0;
Al Stone afae4e
+    UINT16                  ResourceLength = 0;
Al Stone afae4e
+    UINT16                  Minimum = 0;
Al Stone afae4e
+    UINT16                  Maximum = 0;
Al Stone afae4e
+    UINT16                  AddressLength = 0;
Al Stone afae4e
+    UINT16                  Granularity = 0;
Al Stone afae4e
+    UINT16                  TranslationOffset = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
     BOOLEAN                 ResSourceIndex = FALSE;
Al Stone afae4e
 
Al Stone 4a5eac
@@ -325,8 +343,7 @@ RsDoWordBusNumberDescriptor (
Al Stone afae4e
      * optional fields present
Al Stone afae4e
      */
Al Stone afae4e
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS16);
Al Stone afae4e
-    Descriptor->Address16.ResourceLength = (UINT16)
Al Stone afae4e
-        (sizeof (AML_RESOURCE_ADDRESS16) -
Al Stone afae4e
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS16) -
Al Stone afae4e
          sizeof (AML_RESOURCE_LARGE_HEADER));
Al Stone afae4e
 
Al Stone afae4e
     /* Process all child initialization nodes */
Al Stone 4a5eac
@@ -363,8 +380,7 @@ RsDoWordBusNumberDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 4: /* Address Granularity */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address16.Granularity =
Al Stone afae4e
-                (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Granularity = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
Al Stone afae4e
             GranOp = InitializerOp;
Al Stone 4a5eac
@@ -372,8 +388,7 @@ RsDoWordBusNumberDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 5: /* Min Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address16.Minimum =
Al Stone afae4e
-                (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
Al Stone afae4e
             MinOp = InitializerOp;
Al Stone 4a5eac
@@ -381,8 +396,7 @@ RsDoWordBusNumberDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 6: /* Max Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address16.Maximum =
Al Stone afae4e
-                (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
Al Stone afae4e
             MaxOp = InitializerOp;
Al Stone 4a5eac
@@ -390,16 +404,14 @@ RsDoWordBusNumberDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 7: /* Translation Offset */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address16.TranslationOffset =
Al Stone afae4e
-                (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 8: /* Address Length */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address16.AddressLength =
Al Stone afae4e
-                (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
Al Stone afae4e
                  CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength));
Al Stone afae4e
             LengthOp = InitializerOp;
Al Stone 4a5eac
@@ -411,7 +423,7 @@ RsDoWordBusNumberDescriptor (
Al Stone afae4e
             {
Al Stone afae4e
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
                 OptionIndex++;
Al Stone afae4e
-                Descriptor->Address16.ResourceLength++;
Al Stone afae4e
+                ResourceLength++;
Al Stone afae4e
                 ResSourceIndex = TRUE;
Al Stone afae4e
             }
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -423,8 +435,7 @@ RsDoWordBusNumberDescriptor (
Al Stone afae4e
             {
Al Stone afae4e
                 if (StringLength)
Al Stone afae4e
                 {
Al Stone afae4e
-                    Descriptor->Address16.ResourceLength = (UINT16)
Al Stone afae4e
-                        (Descriptor->Address16.ResourceLength + StringLength);
Al Stone afae4e
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
Al Stone afae4e
 
Al Stone afae4e
                     strcpy ((char *)
Al Stone afae4e
                         &OptionalFields[OptionIndex],
Al Stone 4a5eac
@@ -470,13 +481,20 @@ RsDoWordBusNumberDescriptor (
Al Stone afae4e
     /* Validate the Min/Max/Len/Gran values */
Al Stone afae4e
 
Al Stone afae4e
     RsLargeAddressCheck (
Al Stone afae4e
-        (UINT64) Descriptor->Address16.Minimum,
Al Stone afae4e
-        (UINT64) Descriptor->Address16.Maximum,
Al Stone afae4e
-        (UINT64) Descriptor->Address16.AddressLength,
Al Stone afae4e
-        (UINT64) Descriptor->Address16.Granularity,
Al Stone afae4e
+        Minimum,
Al Stone afae4e
+        Maximum,
Al Stone afae4e
+        AddressLength,
Al Stone afae4e
+        Granularity,
Al Stone afae4e
         Descriptor->Address16.Flags,
Al Stone afae4e
         MinOp, MaxOp, LengthOp, GranOp, Op);
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.ResourceLength, &ResourceLength);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Minimum, &Minimum);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Maximum, &Maximum);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.AddressLength, &AddressLength);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Granularity, &Granularity);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.TranslationOffset, &TranslationOffset);
Al Stone afae4e
+
Al Stone afae4e
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
Al Stone afae4e
                             OptionIndex + StringLength;
Al Stone afae4e
     return (Rnode);
Al Stone 4a5eac
@@ -512,6 +530,12 @@ RsDoWordSpaceDescriptor (
Al Stone afae4e
     UINT8                   *OptionalFields;
Al Stone afae4e
     UINT16                  StringLength = 0;
Al Stone afae4e
     UINT32                  OptionIndex = 0;
Al Stone afae4e
+    UINT16                  Minimum = 0;
Al Stone afae4e
+    UINT16                  Maximum = 0;
Al Stone afae4e
+    UINT16                  AddressLength = 0;
Al Stone afae4e
+    UINT16                  Granularity = 0;
Al Stone afae4e
+    UINT16                  TranslationOffset = 0;
Al Stone afae4e
+    UINT16                  ResourceLength = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
     BOOLEAN                 ResSourceIndex = FALSE;
Al Stone afae4e
 
Al Stone 4a5eac
@@ -530,8 +554,7 @@ RsDoWordSpaceDescriptor (
Al Stone afae4e
      * optional fields present
Al Stone afae4e
      */
Al Stone afae4e
     OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS16);
Al Stone afae4e
-    Descriptor->Address16.ResourceLength = (UINT16)
Al Stone afae4e
-        (sizeof (AML_RESOURCE_ADDRESS16) -
Al Stone afae4e
+    ResourceLength = (UINT16) (sizeof (AML_RESOURCE_ADDRESS16) -
Al Stone afae4e
          sizeof (AML_RESOURCE_LARGE_HEADER));
Al Stone afae4e
 
Al Stone afae4e
     /* Process all child initialization nodes */
Al Stone 4a5eac
@@ -580,8 +603,7 @@ RsDoWordSpaceDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 6: /* Address Granularity */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address16.Granularity =
Al Stone afae4e
-                (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Granularity = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
Al Stone afae4e
             GranOp = InitializerOp;
Al Stone 4a5eac
@@ -589,8 +611,7 @@ RsDoWordSpaceDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 7: /* Min Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address16.Minimum =
Al Stone afae4e
-                (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
Al Stone afae4e
             MinOp = InitializerOp;
Al Stone 4a5eac
@@ -598,8 +619,7 @@ RsDoWordSpaceDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 8: /* Max Address */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address16.Maximum =
Al Stone afae4e
-                (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
Al Stone afae4e
             MaxOp = InitializerOp;
Al Stone 4a5eac
@@ -607,16 +627,14 @@ RsDoWordSpaceDescriptor (
Al Stone afae4e
 
Al Stone afae4e
         case 9: /* Translation Offset */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address16.TranslationOffset =
Al Stone afae4e
-                (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
Al Stone afae4e
             break;
Al Stone afae4e
 
Al Stone afae4e
         case 10: /* Address Length */
Al Stone afae4e
 
Al Stone afae4e
-            Descriptor->Address16.AddressLength =
Al Stone afae4e
-                (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
+            AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
Al Stone afae4e
                 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength));
Al Stone afae4e
             LengthOp = InitializerOp;
Al Stone 4a5eac
@@ -628,7 +646,7 @@ RsDoWordSpaceDescriptor (
Al Stone afae4e
             {
Al Stone afae4e
                 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
Al Stone afae4e
                 OptionIndex++;
Al Stone afae4e
-                Descriptor->Address16.ResourceLength++;
Al Stone afae4e
+                ResourceLength++;
Al Stone afae4e
                 ResSourceIndex = TRUE;
Al Stone afae4e
             }
Al Stone afae4e
             break;
Al Stone 4a5eac
@@ -640,8 +658,7 @@ RsDoWordSpaceDescriptor (
Al Stone afae4e
             {
Al Stone afae4e
                 if (StringLength)
Al Stone afae4e
                 {
Al Stone afae4e
-                    Descriptor->Address16.ResourceLength = (UINT16)
Al Stone afae4e
-                        (Descriptor->Address16.ResourceLength + StringLength);
Al Stone afae4e
+                    ResourceLength = (UINT16) (ResourceLength + StringLength);
Al Stone afae4e
 
Al Stone afae4e
                     strcpy ((char *)
Al Stone afae4e
                         &OptionalFields[OptionIndex],
Al Stone 4a5eac
@@ -687,13 +704,20 @@ RsDoWordSpaceDescriptor (
Al Stone afae4e
     /* Validate the Min/Max/Len/Gran values */
Al Stone afae4e
 
Al Stone afae4e
     RsLargeAddressCheck (
Al Stone afae4e
-        (UINT64) Descriptor->Address16.Minimum,
Al Stone afae4e
-        (UINT64) Descriptor->Address16.Maximum,
Al Stone afae4e
-        (UINT64) Descriptor->Address16.AddressLength,
Al Stone afae4e
-        (UINT64) Descriptor->Address16.Granularity,
Al Stone afae4e
+        Minimum,
Al Stone afae4e
+        Maximum,
Al Stone afae4e
+        AddressLength,
Al Stone afae4e
+        Granularity,
Al Stone afae4e
         Descriptor->Address16.Flags,
Al Stone afae4e
         MinOp, MaxOp, LengthOp, GranOp, Op);
Al Stone afae4e
 
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.ResourceLength, &ResourceLength);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Minimum, &Minimum);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Maximum, &Maximum);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.AddressLength, &AddressLength);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.Granularity, &Granularity);
Al Stone afae4e
+    ACPI_MOVE_16_TO_16(&Descriptor->Address16.TranslationOffset, &TranslationOffset);
Al Stone afae4e
+
Al Stone afae4e
     Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
Al Stone afae4e
                             OptionIndex + StringLength;
Al Stone afae4e
     return (Rnode);
Dan Horák 54d979
diff -up acpica-unix2-20140424/source/include/acmacros.h.debian-big_endian acpica-unix2-20140424/source/include/acmacros.h
Dan Horák 54d979
--- acpica-unix2-20140424/source/include/acmacros.h.debian-big_endian	2014-04-24 11:49:05.000000000 -0400
Dan Horák 54d979
+++ acpica-unix2-20140424/source/include/acmacros.h	2014-06-06 20:43:34.721825238 -0400
Al Stone 6794d0
@@ -111,7 +111,8 @@
Al Stone afae4e
 
Al Stone afae4e
 /* 32-bit source, 16/32/64 destination */
Al Stone afae4e
 
Al Stone afae4e
-#define ACPI_MOVE_32_TO_16(d, s)        ACPI_MOVE_16_TO_16(d, s)    /* Truncate to 16 */
Al Stone afae4e
+#define ACPI_MOVE_32_TO_16(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[3];\
Al Stone afae4e
+                                         ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[2];}
Al Stone afae4e
 
Al Stone afae4e
 #define ACPI_MOVE_32_TO_32(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[3];\
Al Stone afae4e
                                          ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[2];\
Al Stone 6794d0
@@ -126,9 +127,13 @@
Al Stone afae4e
 
Al Stone afae4e
 /* 64-bit source, 16/32/64 destination */
Al Stone afae4e
 
Al Stone afae4e
-#define ACPI_MOVE_64_TO_16(d, s)        ACPI_MOVE_16_TO_16(d, s)    /* Truncate to 16 */
Al Stone afae4e
+#define ACPI_MOVE_64_TO_16(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[7];\
Al Stone afae4e
+                                         ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[6];}
Al Stone afae4e
 
Al Stone afae4e
-#define ACPI_MOVE_64_TO_32(d, s)        ACPI_MOVE_32_TO_32(d, s)    /* Truncate to 32 */
Al Stone afae4e
+#define ACPI_MOVE_64_TO_32(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[7];\
Al Stone afae4e
+                                         ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[6];\
Al Stone afae4e
+                                         ((  UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[5];\
Al Stone afae4e
+                                         ((  UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[4];}
Al Stone afae4e
 
Al Stone afae4e
 #define ACPI_MOVE_64_TO_64(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[7];\
Al Stone afae4e
                                          ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[6];\
Al Stone 6794d0
@@ -155,7 +160,9 @@
Al Stone afae4e
 
Al Stone afae4e
 /* 32-bit source, 16/32/64 destination */
Al Stone afae4e
 
Al Stone afae4e
-#define ACPI_MOVE_32_TO_16(d, s)        ACPI_MOVE_16_TO_16(d, s)    /* Truncate to 16 */
Al Stone afae4e
+#define ACPI_MOVE_32_TO_16(d, s)        {((  UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];\
Al Stone afae4e
+                                         ((  UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[1];}
Al Stone afae4e
+
Al Stone afae4e
 #define ACPI_MOVE_32_TO_32(d, s)        *(UINT32 *)(void *)(d) = *(UINT32 *)(void *)(s)
Al Stone afae4e
 #define ACPI_MOVE_32_TO_64(d, s)        *(UINT64 *)(void *)(d) = *(UINT32 *)(void *)(s)
Al Stone afae4e
 
Dan Horák 54d979
diff -up acpica-unix2-20140424/source/include/platform/aclinux.h.debian-big_endian acpica-unix2-20140424/source/include/platform/aclinux.h
Dan Horák 54d979
--- acpica-unix2-20140424/source/include/platform/aclinux.h.debian-big_endian	2014-04-24 11:49:06.000000000 -0400
Dan Horák 54d979
+++ acpica-unix2-20140424/source/include/platform/aclinux.h	2014-06-06 20:44:28.781825238 -0400
Al Stone 4a5eac
@@ -167,6 +167,7 @@
Al Stone afae4e
 #include <stdlib.h>
Al Stone afae4e
 #include <ctype.h>
Al Stone afae4e
 #include <unistd.h>
Al Stone afae4e
+#include <endian.h>
Al Stone afae4e
 
Al Stone 6794d0
 /* Define/disable kernel-specific declarators */
Al Stone 6794d0
 
Al Stone 4a5eac
@@ -179,8 +180,7 @@
Al Stone afae4e
 #define ACPI_FLUSH_CPU_CACHE()
Al Stone a03e60
 #define ACPI_CAST_PTHREAD_T(Pthread) ((ACPI_THREAD_ID) (Pthread))
Al Stone afae4e
 
Dan Horák 54d979
-#if defined(__ia64__)    || defined(__x86_64__) ||\
Dan Horák 54d979
-    defined(__aarch64__) || defined(__PPC64__)
Al Stone afae4e
+#if __SIZEOF_LONG__ == 8
Al Stone afae4e
 #define ACPI_MACHINE_WIDTH          64
Al Stone afae4e
 #define COMPILER_DEPENDENT_INT64    long
Al Stone afae4e
 #define COMPILER_DEPENDENT_UINT64   unsigned long
Al Stone 4a5eac
@@ -191,6 +191,10 @@
Al Stone afae4e
 #define ACPI_USE_NATIVE_DIVIDE
Al Stone afae4e
 #endif
Al Stone afae4e
 
Al Stone afae4e
+#if __BYTE_ORDER == __BIG_ENDIAN
Al Stone afae4e
+#define ACPI_BIG_ENDIAN
Al Stone afae4e
+#endif
Al Stone afae4e
+
Al Stone afae4e
 #ifndef __cdecl
Al Stone afae4e
 #define __cdecl
Al Stone afae4e
 #endif