acpica-tools/0015-Support-GTDT-in-a-big-endian-world.patch
Al Stone edb6c78416 Update to upstream 20200925 version
This update also means a major update for all of the big-endian patching
that has been done.  The older mechanism was getting to unwieldy to keep
maintained, and too sensitive to upstream changes.  Hence, redid all of
the old patches, and took the opportunity to make them more amenable to
change over time.  Ultimately, the goal is to have upstream accept these
in some form.

Signed-off-by: Al Stone <ahs3@redhat.com>
2020-10-19 12:24:09 -06:00

70 lines
2.4 KiB
Diff

From faba93b1dd7ce4aa8983880e917d108496cd173f Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Tue, 22 Sep 2020 18:12:01 -0600
Subject: [PATCH 15/40] Support GTDT in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump1.c | 13 +++++++++----
source/compiler/dttable1.c | 9 +++++++--
2 files changed, 16 insertions(+), 6 deletions(-)
Index: acpica-unix2-20200925/source/common/dmtbdump1.c
===================================================================
--- acpica-unix2-20200925.orig/source/common/dmtbdump1.c
+++ acpica-unix2-20200925/source/common/dmtbdump1.c
@@ -997,7 +997,7 @@ AcpiDmDumpGtdt (
{
ACPI_STATUS Status;
ACPI_GTDT_HEADER *Subtable;
- UINT32 Length = Table->Length;
+ UINT32 Length = AcpiUtReadUint32(&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_GTDT);
ACPI_DMTABLE_INFO *InfoTable;
UINT32 SubtableLength;
@@ -1033,7 +1033,7 @@ AcpiDmDumpGtdt (
/* Subtables */
- while (Offset < Table->Length)
+ while (Offset < Length)
{
/* Common subtable header */
@@ -1051,8 +1051,13 @@ AcpiDmDumpGtdt (
case ACPI_GTDT_TYPE_TIMER_BLOCK:
SubtableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
- GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
- Subtable))->TimerCount;
+ {
+ UINT32 Tmp32;
+
+ Tmp32 = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
+ Subtable))->TimerCount;
+ GtCount = AcpiUtReadUint32(&Tmp32);
+ }
InfoTable = AcpiDmTableInfoGtdt0;
break;
Index: acpica-unix2-20200925/source/compiler/dttable1.c
===================================================================
--- acpica-unix2-20200925.orig/source/compiler/dttable1.c
+++ acpica-unix2-20200925/source/compiler/dttable1.c
@@ -997,8 +997,13 @@ DtCompileGtdt (
DtPushSubtable (Subtable);
ParentTable = DtPeekSubtable ();
- GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
- Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
+ {
+ UINT32 Tmp32;
+
+ Tmp32 = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
+ Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
+ GtCount = AcpiUtReadUint32(&Tmp32);
+ }
while (GtCount)
{