Blame debian-unaligned.patch

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