Blame SOURCES/debian-unaligned.patch

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