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