88c41d
Patch carried over from the prior iasl package and updated.  This allows
88c41d
for builds on systems requiring aligned memory access. Please see
88c41d
http://lists.acpica.org/pipermail/devel/2010-July/000159.html.  Resolves
88c41d
BZ#865013 and BZ#856856.
88c41d
--
88c41d
88c41d
Add more platforms to the list of the ones requiring aligned memory access.
88c41d
Also fix callsites where wrong assumptions where made in terms of aligment.
88c41d
88c41d
Signed-off-by: Mattia Dongili <malattia@linux.it>
88c41d
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
88c41d
---
88c41d
 source/components/executer/exoparg2.c |   12 +++++++++---
88c41d
 source/include/actypes.h              |   26 +++++++++++++-------------
88c41d
 3 files changed, 32 insertions(+), 21 deletions(-)
88c41d
88c41d
Index: acpica-unix2-20170728/source/components/executer/exoparg2.c
88c41d
===================================================================
88c41d
--- acpica-unix2-20170728.orig/source/components/executer/exoparg2.c
88c41d
+++ acpica-unix2-20170728/source/components/executer/exoparg2.c
88c41d
@@ -172,6 +172,8 @@ AcpiExOpcode_2A_2T_1R (
88c41d
     ACPI_OPERAND_OBJECT     **Operand = &WalkState->Operands[0];
88c41d
     ACPI_OPERAND_OBJECT     *ReturnDesc1 = NULL;
88c41d
     ACPI_OPERAND_OBJECT     *ReturnDesc2 = NULL;
88c41d
+    UINT64                  ReturnValue1 = 0;
88c41d
+    UINT64                  ReturnValue2 = 0;
88c41d
     ACPI_STATUS             Status;
88c41d
 
88c41d
 
88c41d
@@ -206,8 +208,10 @@ AcpiExOpcode_2A_2T_1R (
88c41d
         Status = AcpiUtDivide (
88c41d
             Operand[0]->Integer.Value,
88c41d
             Operand[1]->Integer.Value,
88c41d
-            &ReturnDesc1->Integer.Value,
88c41d
-            &ReturnDesc2->Integer.Value);
88c41d
+            &ReturnValue1, &ReturnValue2);
88c41d
+        ReturnDesc1->Integer.Value = ReturnValue1;
88c41d
+        ReturnDesc2->Integer.Value = ReturnValue2;
88c41d
+
88c41d
         if (ACPI_FAILURE (Status))
88c41d
         {
88c41d
             goto Cleanup;
88c41d
@@ -282,6 +286,7 @@ AcpiExOpcode_2A_1T_1R (
88c41d
     ACPI_OPERAND_OBJECT     **Operand = &WalkState->Operands[0];
88c41d
     ACPI_OPERAND_OBJECT     *ReturnDesc = NULL;
88c41d
     UINT64                  Index;
88c41d
+    UINT64                  ReturnValue = 0;
88c41d
     ACPI_STATUS             Status = AE_OK;
88c41d
     ACPI_SIZE               Length = 0;
88c41d
 
88c41d
@@ -327,7 +332,8 @@ AcpiExOpcode_2A_1T_1R (
88c41d
             Operand[0]->Integer.Value,
88c41d
             Operand[1]->Integer.Value,
88c41d
             NULL,
88c41d
-            &ReturnDesc->Integer.Value);
88c41d
+            &ReturnValue);
88c41d
+        ReturnDesc->Integer.Value = ReturnValue;
88c41d
         break;
88c41d
 
88c41d
     case AML_CONCATENATE_OP: /* Concatenate (Data1, Data2, Result) */
88c41d
Index: acpica-unix2-20170728/source/include/actypes.h
88c41d
===================================================================
88c41d
--- acpica-unix2-20170728.orig/source/include/actypes.h
88c41d
+++ acpica-unix2-20170728/source/include/actypes.h
88c41d
@@ -143,6 +143,19 @@ typedef COMPILER_DEPENDENT_INT64
88c41d
  */
88c41d
 #define ACPI_THREAD_ID                  UINT64
88c41d
 
88c41d
+/*
88c41d
+ * In the case of the Itanium Processor Family (IPF), the hardware does not
88c41d
+ * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag
88c41d
+ * to indicate that special precautions must be taken to avoid alignment faults.
88c41d
+ * (IA64 or ia64 is currently used by existing compilers to indicate IPF.)
88c41d
+ *
88c41d
+ * Note: EM64T and other X86-64 processors support misaligned transfers,
88c41d
+ * so there is no need to define this flag.
88c41d
+ */
88c41d
+#if defined (__IA64__) || defined (__ia64__) || defined(__alpha__) || defined(__sparc__) || defined(__hppa__) || defined(__arm__)
88c41d
+#define ACPI_MISALIGNMENT_NOT_SUPPORTED
88c41d
+#endif
88c41d
+
88c41d
 
88c41d
 /*******************************************************************************
88c41d
  *
88c41d
@@ -170,20 +183,6 @@ typedef UINT64
88c41d
 #define ACPI_USE_NATIVE_DIVIDE          /* Has native 64-bit integer support */
88c41d
 #define ACPI_USE_NATIVE_MATH64          /* Has native 64-bit integer support */
88c41d
 
88c41d
-/*
88c41d
- * In the case of the Itanium Processor Family (IPF), the hardware does not
88c41d
- * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED
88c41d
- * flag to indicate that special precautions must be taken to avoid alignment
88c41d
- * faults. (IA64 or ia64 is currently used by existing compilers to indicate
88c41d
- * IPF.)
88c41d
- *
88c41d
- * Note: EM64T and other X86-64 processors support misaligned transfers,
88c41d
- * so there is no need to define this flag.
88c41d
- */
88c41d
-#if defined (__IA64__) || defined (__ia64__)
88c41d
-#define ACPI_MISALIGNMENT_NOT_SUPPORTED
88c41d
-#endif
88c41d
-
88c41d
 
88c41d
 /*******************************************************************************
88c41d
  *