]> git.pld-linux.org Git - packages/acpica.git/blame - acpica-unaligned.patch
- updated tests
[packages/acpica.git] / acpica-unaligned.patch
CommitLineData
f3dfbd7c
ER
1Patch carried over from the prior iasl package and updated. This allows
2for builds on systems requiring aligned memory access. Please see
3http://lists.acpica.org/pipermail/devel/2010-July/000159.html. Resolves
4BZ#865013 and BZ#856856.
5--
6
7Add more platforms to the list of the ones requiring aligned memory access.
8Also fix callsites where wrong assumptions where made in terms of aligment.
9
10Signed-off-by: Mattia Dongili <malattia@linux.it>
11Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12---
77760c90
JB
13 source/components/executer/exoparg2.c | 12 +++++++++---
14 source/include/actypes.h | 26 +++++++++++++-------------
15 3 files changed, 32 insertions(+), 21 deletions(-)
f3dfbd7c 16
b643ab7e 17Index: acpica-unix2-20220331/source/components/executer/exoparg2.c
77760c90 18===================================================================
b643ab7e
JB
19--- acpica-unix2-20220331.orig/source/components/executer/exoparg2.c
20+++ acpica-unix2-20220331/source/components/executer/exoparg2.c
77760c90 21@@ -172,6 +172,8 @@ AcpiExOpcode_2A_2T_1R (
f3dfbd7c
ER
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
77760c90
JB
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);
f3dfbd7c
ER
37+ ReturnDesc1->Integer.Value = ReturnValue1;
38+ ReturnDesc2->Integer.Value = ReturnValue2;
39+
40 if (ACPI_FAILURE (Status))
41 {
42 goto Cleanup;
77760c90 43@@ -282,6 +286,7 @@ AcpiExOpcode_2A_1T_1R (
f3dfbd7c
ER
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
77760c90
JB
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);
f3dfbd7c
ER
57+ ReturnDesc->Integer.Value = ReturnValue;
58 break;
59
77760c90 60 case AML_CONCATENATE_OP: /* Concatenate (Data1, Data2, Result) */
b643ab7e 61Index: acpica-unix2-20220331/source/include/actypes.h
77760c90 62===================================================================
b643ab7e
JB
63--- acpica-unix2-20220331.orig/source/include/actypes.h
64+++ acpica-unix2-20220331/source/include/actypes.h
77760c90 65@@ -143,6 +143,19 @@ typedef COMPILER_DEPENDENT_INT64
f3dfbd7c
ER
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 *
25d7dd99 85@@ -170,20 +183,6 @@ typedef UINT64
f3dfbd7c 86 #define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */
25d7dd99 87 #define ACPI_USE_NATIVE_MATH64 /* Has native 64-bit integer support */
f3dfbd7c
ER
88
89-/*
90- * In the case of the Itanium Processor Family (IPF), the hardware does not
25d7dd99
JB
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.)
f3dfbd7c
ER
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 *
This page took 0.172433 seconds and 4 git commands to generate.