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 c32859
@@ -478,6 +479,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 c32859
@@ -504,7 +505,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 c32859
@@ -143,6 +148,11 @@ RsDoMemory24Descriptor (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *LengthOp = NULL;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone c32859
     UINT32                  CurrentByteOffset;
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 c32859
@@ -152,7 +153,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 c32859
@@ -169,7 +169,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 c32859
@@ -177,7 +177,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 c32859
@@ -185,14 +185,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 c32859
@@ -215,12 +220,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 c32859
         MinOp, MaxOp, LengthOp, NULL, Info->DescriptorTypeOp);
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 c32859
@@ -249,6 +254,11 @@ RsDoMemory32Descriptor (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *AlignOp = NULL;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone c32859
     UINT32                  CurrentByteOffset;
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 c32859
@@ -258,7 +259,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 c32859
@@ -275,7 +275,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 c32859
@@ -283,7 +283,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 c32859
@@ -291,7 +291,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 c32859
@@ -299,7 +299,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 c32859
@@ -322,12 +327,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 c32859
         MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
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 c32859
@@ -352,6 +353,7 @@ RsDoMemory32FixedDescriptor (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *InitializerOp;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone c32859
     UINT32                  CurrentByteOffset;
Al Stone afae4e
+    UINT16                  ResourceLength;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone c32859
@@ -361,7 +362,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 c32859
@@ -378,14 +380,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 c32859
@@ -198,6 +200,8 @@ RsDoFixedDmaDescriptor (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *InitializerOp;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone c32859
     UINT32                  CurrentByteOffset;
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 c32859
@@ -217,14 +217,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 c32859
@@ -249,6 +252,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 c32859
@@ -274,6 +275,7 @@ RsDoFixedIoDescriptor (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *AddressOp = NULL;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone c32859
     UINT32                  CurrentByteOffset;
Al Stone afae4e
+    UINT16                  Address = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone c32859
@@ -293,8 +292,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 c32859
@@ -324,11 +326,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 c32859
@@ -357,6 +359,8 @@ RsDoIoDescriptor (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *AlignOp = NULL;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone c32859
     UINT32                  CurrentByteOffset;
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 c32859
@@ -383,8 +382,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 c32859
@@ -392,8 +391,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 c32859
@@ -434,12 +437,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 c32859
         MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
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 c32859
@@ -559,9 +559,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 c32859
@@ -660,6 +660,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 c32859
@@ -76,6 +77,7 @@ RsDoGeneralRegisterDescriptor (
Al Stone afae4e
     ACPI_PARSE_OBJECT       *InitializerOp;
Al Stone afae4e
     ASL_RESOURCE_NODE       *Rnode;
Al Stone c32859
     UINT32                  CurrentByteOffset;
Al Stone afae4e
+    UINT16                  ResourceLength;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone c32859
@@ -85,7 +87,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 c32859
@@ -116,7 +117,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 c32859
@@ -171,6 +172,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 c32859
     UINT32                  CurrentByteOffset;
Al Stone c32859
@@ -219,7 +219,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 c32859
@@ -327,10 +328,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 c32859
@@ -366,7 +366,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 c32859
@@ -378,13 +379,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 c32859
@@ -432,7 +432,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 c32859
@@ -79,7 +85,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 c32859
     UINT32                  CurrentByteOffset;
Al Stone afae4e
     UINT32                  i;
Al Stone c32859
@@ -102,8 +101,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 c32859
@@ -147,8 +146,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 c32859
@@ -156,8 +155,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 c32859
@@ -165,8 +164,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 c32859
@@ -174,16 +172,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 c32859
@@ -197,7 +197,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 c32859
@@ -211,8 +210,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 c32859
@@ -272,13 +279,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 c32859
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
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 c32859
         OptionIndex + StringLength;
Al Stone afae4e
     return (Rnode);
Al Stone c32859
@@ -310,7 +316,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 c32859
     UINT32                  CurrentByteOffset;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
     BOOLEAN                 ResSourceIndex = FALSE;
Al Stone c32859
@@ -332,11 +330,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 c32859
@@ -385,8 +384,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 c32859
@@ -394,8 +3926,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 c32859
@@ -403,8 +402,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 c32859
@@ -412,16 +410,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 c32859
@@ -433,7 +433,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 c32859
@@ -445,8 +445,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 c32859
@@ -507,13 +514,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 c32859
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
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 c32859
         OptionIndex + StringLength;
Al Stone afae4e
     return (Rnode);
Al Stone c32859
@@ -545,7 +551,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 c32859
     UINT32                  CurrentByteOffset;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
     BOOLEAN                 ResSourceIndex = FALSE;
Al Stone c32859
@@ -566,8 +565,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 c32859
@@ -616,8 +615,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 c32859
@@ -625,8 +624,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 c32859
@@ -634,8 +633,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 c32859
@@ -643,16 +641,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 c32859
@@ -664,7 +664,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 c32859
@@ -676,8 +675,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 c32859
@@ -724,13 +731,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 c32859
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
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 c32859
         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 c32859
@@ -78,6 +85,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 c32859
     UINT32                  CurrentByteOffset;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone c32859
@@ -94,9 +95,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 c32859
@@ -139,7 +139,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 c32859
@@ -147,7 +147,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 c32859
@@ -155,7 +155,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 c32859
@@ -163,14 +163,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 c32859
@@ -178,7 +178,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 c32859
@@ -214,13 +221,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 c32859
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
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 c32859
     Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) +
Al Stone c32859
         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 c32859
     UINT32                  CurrentByteOffset;
Al Stone afae4e
     UINT32                  i;
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 c32859
@@ -80,7 +86,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 c32859
     UINT32                  CurrentByteOffset;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
     BOOLEAN                 ResSourceIndex = FALSE;
Al Stone c32859
@@ -102,8 +101,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 c32859
@@ -147,7 +147,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 c32859
@@ -155,7 +155,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 c32859
@@ -163,7 +163,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 c32859
@@ -171,14 +171,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 c32859
@@ -190,7 +190,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 c32859
@@ -202,8 +201,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 c32859
@@ -263,13 +270,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 c32859
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
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 c32859
         OptionIndex + StringLength;
Al Stone afae4e
     return (Rnode);
Al Stone c32859
@@ -301,7 +307,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 c32859
     UINT32                  CurrentByteOffset;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
     BOOLEAN                 ResSourceIndex = FALSE;
Al Stone c32859
@@ -323,8 +322,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 c32859
@@ -375,7 +375,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 c32859
@@ -383,7 +383,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 c32859
@@ -391,7 +391,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 c32859
@@ -399,14 +399,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 c32859
@@ -418,7 +418,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 c32859
@@ -430,8 +429,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 c32859
@@ -492,13 +499,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 c32859
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
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 c32859
         OptionIndex + StringLength;
Al Stone afae4e
     return (Rnode);
Al Stone c32859
@@ -530,9 +536,15 @@ 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 c32859
     UINT32                  CurrentByteOffset;
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 c32859
@@ -551,8 +550,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 c32859
@@ -601,7 +601,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 c32859
@@ -609,7 +609,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 c32859
@@ -617,7 +617,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 c32859
@@ -625,14 +625,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 c32859
@@ -644,7 +644,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 c32859
@@ -656,8 +655,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 c32859
@@ -703,13 +710,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 c32859
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
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 c32859
         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 c32859
@@ -290,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 c32859
     UINT32                  CurrentByteOffset;
Al Stone c32859
     UINT32                  PinCount = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone c32859
@@ -349,21 +349,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 c32859
@@ -377,7 +377,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 c32859
@@ -403,7 +403,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 c32859
@@ -468,6 +472,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 c32859
     MpSaveGpioInfo (Info->MappingOp, Descriptor, PinCount, PinList, ResourceSource);
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Al Stone c32859
@@ -500,6 +504,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 c32859
     UINT32                  CurrentByteOffset;
Al Stone c32859
     UINT32                  PinCount = 0;
Al Stone afae4e
     UINT32                  i;
Al Stone c32859
@@ -560,7 +560,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 c32859
@@ -574,21 +574,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 c32859
@@ -614,7 +614,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 c32859
@@ -678,6 +683,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 c32859
     MpSaveGpioInfo (Info->MappingOp, Descriptor, PinCount, PinList, ResourceSource);
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Al Stone c32859
@@ -707,6 +710,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 c32859
     UINT32                  CurrentByteOffset;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone c32859
@@ -756,7 +756,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 c32859
@@ -770,14 +770,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 c32859
@@ -825,6 +828,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 c32859
     MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Al Stone c32859
@@ -854,6 +857,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 c32859
     UINT32                  CurrentByteOffset;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone c32859
@@ -903,21 +903,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 c32859
@@ -938,7 +938,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 c32859
@@ -1000,6 +1004,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 c32859
     MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
Al Stone afae4e
     return (Rnode);
Al Stone afae4e
 }
Al Stone c32859
@@ -1029,6 +1033,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 c32859
     UINT32                  CurrentByteOffset;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
 
Al Stone c32859
@@ -1078,21 +1078,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 c32859
@@ -1106,7 +1106,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 c32859
@@ -1120,21 +1120,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 c32859
@@ -1192,6 +1197,11 @@ 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 c32859
     MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
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 c32859
@@ -81,6 +87,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 c32859
     UINT32                  CurrentByteOffset;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
     BOOLEAN                 ResSourceIndex = FALSE;
Al Stone c32859
@@ -102,8 +101,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 c32859
@@ -147,7 +147,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 c32859
@@ -155,7 +155,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 c32859
@@ -163,7 +163,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 c32859
@@ -171,14 +171,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 c32859
@@ -190,7 +190,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 c32859
@@ -202,8 +201,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 c32859
@@ -263,13 +270,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 c32859
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
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 c32859
         OptionIndex + StringLength;
Al Stone afae4e
     return (Rnode);
Al Stone c32859
@@ -302,6 +308,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 c32859
     UINT32                  CurrentByteOffset;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
     BOOLEAN                 ResSourceIndex = FALSE;
Al Stone c32859
@@ -323,8 +322,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 c32859
@@ -361,8 +360,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 c32859
@@ -370,8 +369,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 c32859
@@ -379,8 +378,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 c32859
@@ -388,16 +386,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 c32859
@@ -409,7 +409,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 c32859
@@ -421,8 +420,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 c32859
@@ -468,13 +475,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 c32859
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
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 c32859
         OptionIndex + StringLength;
Al Stone afae4e
     return (Rnode);
Al Stone c32859
@@ -507,6 +513,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 c32859
     UINT32                  CurrentByteOffset;
Al Stone afae4e
     UINT32                  i;
Al Stone afae4e
     BOOLEAN                 ResSourceIndex = FALSE;
Al Stone c32859
@@ -527,8 +526,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 c32859
@@ -577,8 +576,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 c32859
@@ -586,8 +585,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 c32859
@@ -595,8 +594,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 c32859
@@ -604,16 +602,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 c32859
@@ -625,7 +625,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 c32859
@@ -637,8 +636,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 c32859
@@ -684,13 +691,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 c32859
         MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
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 c32859
         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