Blame SOURCES/debian-unaligned.patch

32dd66
Patch carried over from the prior iasl package and updated.  This allows
32dd66
for builds on systems requiring aligned memory access. Please see
32dd66
http://lists.acpica.org/pipermail/devel/2010-July/000159.html.  Resolves
32dd66
BZ#865013 and BZ#856856.
32dd66
--
32dd66
32dd66
Add more platforms to the list of the ones requiring aligned memory access.
32dd66
Also fix callsites where wrong assumptions where made in terms of aligment.
32dd66
32dd66
Signed-off-by: Mattia Dongili <malattia@linux.it>
32dd66
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
32dd66
---
32dd66
 source/compiler/asltree.c             | 15 ++++++++++-----
32dd66
 source/components/executer/exoparg2.c | 12 +++++++++---
32dd66
 source/include/actypes.h              | 26 +++++++++++++-------------
32dd66
 3 file modificati, 32 inserzioni(+), 21 rimozioni(-)
32dd66
32dd66
diff --git a/source/compiler/asltree.c b/source/compiler/asltree.c
32dd66
index ebf87f3..fd859d7 100644
32dd66
--- a/source/compiler/asltree.c
32dd66
+++ b/source/compiler/asltree.c
32dd66
@@ -577,28 +577,31 @@ TrCreateValuedLeafNode (
32dd66
         "\nCreateValuedLeafNode  Ln/Col %u/%u NewNode %p  Op %s  Value %8.8X%8.8X  ",
32dd66
         Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode),
32dd66
         ACPI_FORMAT_UINT64 (Value));
32dd66
-    Op->Asl.Value.Integer = Value;
32dd66
 
32dd66
     switch (ParseOpcode)
32dd66
     {
32dd66
     case PARSEOP_STRING_LITERAL:
32dd66
32dd66
-        DbgPrint (ASL_PARSE_OUTPUT, "STRING->%s", Value);
32dd66
+        Op->Asl.Value.String = (ACPI_STRING) (ACPI_SIZE) Value;
32dd66
+        DbgPrint (ASL_PARSE_OUTPUT, "STRING->%s", Op->Asl.Value.String);
32dd66
         break;
32dd66
 
32dd66
     case PARSEOP_NAMESEG:
32dd66
32dd66
-        DbgPrint (ASL_PARSE_OUTPUT, "NAMESEG->%s", Value);
32dd66
+        Op->Asl.Value.String = (ACPI_STRING) (ACPI_SIZE) Value;
32dd66
+        DbgPrint (ASL_PARSE_OUTPUT, "NAMESEG->%s", Op->Asl.Value.String);
32dd66
         break;
32dd66
 
32dd66
     case PARSEOP_NAMESTRING:
32dd66
32dd66
-        DbgPrint (ASL_PARSE_OUTPUT, "NAMESTRING->%s", Value);
32dd66
+        Op->Asl.Value.String = (ACPI_STRING) (ACPI_SIZE) Value;
32dd66
+        DbgPrint (ASL_PARSE_OUTPUT, "NAMESTRING->%s", Op->Asl.Value.String);
32dd66
         break;
32dd66
 
32dd66
     case PARSEOP_EISAID:
32dd66
32dd66
-        DbgPrint (ASL_PARSE_OUTPUT, "EISAID->%s", Value);
32dd66
+        Op->Asl.Value.String = (ACPI_STRING) (ACPI_SIZE) Value;
32dd66
+        DbgPrint (ASL_PARSE_OUTPUT, "EISAID->%s", Op->Asl.Value.String);
32dd66
         break;
32dd66
 
32dd66
     case PARSEOP_METHOD:
32dd66
@@ -608,11 +610,13 @@ TrCreateValuedLeafNode (
32dd66
 
32dd66
     case PARSEOP_INTEGER:
32dd66
32dd66
+        Op->Asl.Value.Integer = Value;
32dd66
         DbgPrint (ASL_PARSE_OUTPUT, "INTEGER");
32dd66
         break;
32dd66
 
32dd66
     default:
32dd66
32dd66
+        Op->Asl.Value.Integer = Value;
32dd66
         break;
32dd66
     }
32dd66
 
32dd66
diff --git a/source/components/executer/exoparg2.c b/source/components/executer/exoparg2.c
32dd66
index e55f40c..ed5b1fd 100644
32dd66
--- a/source/components/executer/exoparg2.c
32dd66
+++ b/source/components/executer/exoparg2.c
32dd66
@@ -175,6 +176,8 @@ AcpiExOpcode_2A_2T_1R (
32dd66
     ACPI_OPERAND_OBJECT     **Operand = &WalkState->Operands[0];
32dd66
     ACPI_OPERAND_OBJECT     *ReturnDesc1 = NULL;
32dd66
     ACPI_OPERAND_OBJECT     *ReturnDesc2 = NULL;
32dd66
+    UINT64                  ReturnValue1 = 0;
32dd66
+    UINT64                  ReturnValue2 = 0;
32dd66
     ACPI_STATUS             Status;
32dd66
 
32dd66
 
32dd66
@@ -208,8 +211,10 @@ AcpiExOpcode_2A_2T_1R (
32dd66
 
32dd66
         Status = AcpiUtDivide (Operand[0]->Integer.Value,
32dd66
                                Operand[1]->Integer.Value,
32dd66
-                               &ReturnDesc1->Integer.Value,
32dd66
-                               &ReturnDesc2->Integer.Value);
32dd66
+                               &ReturnValue1, &ReturnValue2);
32dd66
+        ReturnDesc1->Integer.Value = ReturnValue1;
32dd66
+        ReturnDesc2->Integer.Value = ReturnValue2;
32dd66
+
32dd66
         if (ACPI_FAILURE (Status))
32dd66
         {
32dd66
             goto Cleanup;
32dd66
@@ -283,6 +285,7 @@ AcpiExOpcode_2A_1T_1R (
32dd66
     ACPI_OPERAND_OBJECT     **Operand = &WalkState->Operands[0];
32dd66
     ACPI_OPERAND_OBJECT     *ReturnDesc = NULL;
32dd66
     UINT64                  Index;
32dd66
+    UINT64                  ReturnValue = 0;
32dd66
     ACPI_STATUS             Status = AE_OK;
32dd66
     ACPI_SIZE               Length = 0;
32dd66
 
32dd66
@@ -326,7 +333,8 @@ AcpiExOpcode_2A_1T_1R (
32dd66
         Status = AcpiUtDivide (Operand[0]->Integer.Value,
32dd66
                                Operand[1]->Integer.Value,
32dd66
                                NULL,
32dd66
-                               &ReturnDesc->Integer.Value);
32dd66
+                               &ReturnValue);
32dd66
+        ReturnDesc->Integer.Value = ReturnValue;
32dd66
         break;
32dd66
 
32dd66
     case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */
32dd66
diff --git a/source/include/actypes.h b/source/include/actypes.h
32dd66
index 07fb7d5..08bdf2f 100644
32dd66
--- a/source/include/actypes.h
32dd66
+++ b/source/include/actypes.h
32dd66
@@ -142,6 +142,19 @@ typedef COMPILER_DEPENDENT_INT64        INT64;
32dd66
  */
32dd66
 #define ACPI_THREAD_ID                  UINT64
32dd66
 
32dd66
+/*
32dd66
+ * In the case of the Itanium Processor Family (IPF), the hardware does not
32dd66
+ * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag
32dd66
+ * to indicate that special precautions must be taken to avoid alignment faults.
32dd66
+ * (IA64 or ia64 is currently used by existing compilers to indicate IPF.)
32dd66
+ *
32dd66
+ * Note: EM64T and other X86-64 processors support misaligned transfers,
32dd66
+ * so there is no need to define this flag.
32dd66
+ */
32dd66
+#if defined (__IA64__) || defined (__ia64__) || defined(__alpha__) || defined(__sparc__) || defined(__hppa__) || defined(__arm__)
32dd66
+#define ACPI_MISALIGNMENT_NOT_SUPPORTED
32dd66
+#endif
32dd66
+
32dd66
 
32dd66
 /*******************************************************************************
32dd66
  *
32dd66
@@ -168,19 +181,6 @@ typedef UINT64                          ACPI_PHYSICAL_ADDRESS;
32dd66
 #define ACPI_SIZE_MAX                   ACPI_UINT64_MAX
32dd66
 #define ACPI_USE_NATIVE_DIVIDE          /* Has native 64-bit integer support */
32dd66
 
32dd66
-/*
32dd66
- * In the case of the Itanium Processor Family (IPF), the hardware does not
32dd66
- * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag
32dd66
- * to indicate that special precautions must be taken to avoid alignment faults.
32dd66
- * (IA64 or ia64 is currently used by existing compilers to indicate IPF.)
32dd66
- *
32dd66
- * Note: EM64T and other X86-64 processors support misaligned transfers,
32dd66
- * so there is no need to define this flag.
32dd66
- */
32dd66
-#if defined (__IA64__) || defined (__ia64__)
32dd66
-#define ACPI_MISALIGNMENT_NOT_SUPPORTED
32dd66
-#endif
32dd66
-
32dd66
 
32dd66
 /*******************************************************************************
32dd66
  *
32dd66
-- 
32dd66
1.7.12.1
32dd66