| 1 |
Patch carried over from the prior iasl package and updated. This allows |
| 2 |
for builds on systems requiring aligned memory access. Please see |
| 3 |
http://lists.acpica.org/pipermail/devel/2010-July/000159.html. Resolves |
| 4 |
BZ#865013 and BZ#856856. |
| 5 |
-- |
| 6 |
|
| 7 |
Add more platforms to the list of the ones requiring aligned memory access. |
| 8 |
Also fix callsites where wrong assumptions where made in terms of aligment. |
| 9 |
|
| 10 |
Signed-off-by: Mattia Dongili <[email protected]> |
| 11 |
Signed-off-by: Paolo Bonzini <[email protected]> |
| 12 |
--- |
| 13 |
source/components/executer/exoparg2.c | 12 +++++++++--- |
| 14 |
source/include/actypes.h | 26 +++++++++++++------------- |
| 15 |
3 files changed, 32 insertions(+), 21 deletions(-) |
| 16 |
|
| 17 |
Index: acpica-unix-20191213/source/components/executer/exoparg2.c |
| 18 |
=================================================================== |
| 19 |
--- acpica-unix-20191213.orig/source/components/executer/exoparg2.c |
| 20 |
+++ acpica-unix-20191213/source/components/executer/exoparg2.c |
| 21 |
@@ -172,6 +172,8 @@ AcpiExOpcode_2A_2T_1R ( |
| 22 |
ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; |
| 23 |
ACPI_OPERAND_OBJECT *ReturnDesc1 = NULL; |
| 24 |
ACPI_OPERAND_OBJECT *ReturnDesc2 = NULL; |
| 25 |
+ UINT64 ReturnValue1 = 0; |
| 26 |
+ UINT64 ReturnValue2 = 0; |
| 27 |
ACPI_STATUS Status; |
| 28 |
|
| 29 |
|
| 30 |
@@ -206,8 +208,10 @@ AcpiExOpcode_2A_2T_1R ( |
| 31 |
Status = AcpiUtDivide ( |
| 32 |
Operand[0]->Integer.Value, |
| 33 |
Operand[1]->Integer.Value, |
| 34 |
- &ReturnDesc1->Integer.Value, |
| 35 |
- &ReturnDesc2->Integer.Value); |
| 36 |
+ &ReturnValue1, &ReturnValue2); |
| 37 |
+ ReturnDesc1->Integer.Value = ReturnValue1; |
| 38 |
+ ReturnDesc2->Integer.Value = ReturnValue2; |
| 39 |
+ |
| 40 |
if (ACPI_FAILURE (Status)) |
| 41 |
{ |
| 42 |
goto Cleanup; |
| 43 |
@@ -282,6 +286,7 @@ AcpiExOpcode_2A_1T_1R ( |
| 44 |
ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; |
| 45 |
ACPI_OPERAND_OBJECT *ReturnDesc = NULL; |
| 46 |
UINT64 Index; |
| 47 |
+ UINT64 ReturnValue = 0; |
| 48 |
ACPI_STATUS Status = AE_OK; |
| 49 |
ACPI_SIZE Length = 0; |
| 50 |
|
| 51 |
@@ -327,7 +332,8 @@ AcpiExOpcode_2A_1T_1R ( |
| 52 |
Operand[0]->Integer.Value, |
| 53 |
Operand[1]->Integer.Value, |
| 54 |
NULL, |
| 55 |
- &ReturnDesc->Integer.Value); |
| 56 |
+ &ReturnValue); |
| 57 |
+ ReturnDesc->Integer.Value = ReturnValue; |
| 58 |
break; |
| 59 |
|
| 60 |
case AML_CONCATENATE_OP: /* Concatenate (Data1, Data2, Result) */ |
| 61 |
Index: acpica-unix-20191213/source/include/actypes.h |
| 62 |
=================================================================== |
| 63 |
--- acpica-unix-20191213.orig/source/include/actypes.h |
| 64 |
+++ acpica-unix-20191213/source/include/actypes.h |
| 65 |
@@ -143,6 +143,19 @@ typedef COMPILER_DEPENDENT_INT64 |
| 66 |
*/ |
| 67 |
#define ACPI_THREAD_ID UINT64 |
| 68 |
|
| 69 |
+/* |
| 70 |
+ * In the case of the Itanium Processor Family (IPF), the hardware does not |
| 71 |
+ * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag |
| 72 |
+ * to indicate that special precautions must be taken to avoid alignment faults. |
| 73 |
+ * (IA64 or ia64 is currently used by existing compilers to indicate IPF.) |
| 74 |
+ * |
| 75 |
+ * Note: EM64T and other X86-64 processors support misaligned transfers, |
| 76 |
+ * so there is no need to define this flag. |
| 77 |
+ */ |
| 78 |
+#if defined (__IA64__) || defined (__ia64__) || defined(__alpha__) || defined(__sparc__) || defined(__hppa__) || defined(__arm__) |
| 79 |
+#define ACPI_MISALIGNMENT_NOT_SUPPORTED |
| 80 |
+#endif |
| 81 |
+ |
| 82 |
|
| 83 |
/******************************************************************************* |
| 84 |
* |
| 85 |
@@ -170,20 +183,6 @@ typedef UINT64 |
| 86 |
#define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */ |
| 87 |
#define ACPI_USE_NATIVE_MATH64 /* Has native 64-bit integer support */ |
| 88 |
|
| 89 |
-/* |
| 90 |
- * In the case of the Itanium Processor Family (IPF), the hardware does not |
| 91 |
- * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED |
| 92 |
- * flag to indicate that special precautions must be taken to avoid alignment |
| 93 |
- * faults. (IA64 or ia64 is currently used by existing compilers to indicate |
| 94 |
- * IPF.) |
| 95 |
- * |
| 96 |
- * Note: EM64T and other X86-64 processors support misaligned transfers, |
| 97 |
- * so there is no need to define this flag. |
| 98 |
- */ |
| 99 |
-#if defined (__IA64__) || defined (__ia64__) |
| 100 |
-#define ACPI_MISALIGNMENT_NOT_SUPPORTED |
| 101 |
-#endif |
| 102 |
- |
| 103 |
|
| 104 |
/******************************************************************************* |
| 105 |
* |