1 From 492e41a24fd088c7ab609ee8ad518f69c9cd29e3 Mon Sep 17 00:00:00 2001
2 From: Al Stone <ahs3@redhat.com>
3 Date: Tue, 22 Sep 2020 18:12:01 -0600
4 Subject: [PATCH 18/45] Support GTDT in a big-endian world
6 Signed-off-by: Al Stone <ahs3@redhat.com>
8 source/common/dmtbdump1.c | 13 +++++++++----
9 source/compiler/dttable1.c | 9 +++++++--
10 2 files changed, 16 insertions(+), 6 deletions(-)
12 Index: acpica-unix2-20220331/source/common/dmtbdump1.c
13 ===================================================================
14 --- acpica-unix2-20220331.orig/source/common/dmtbdump1.c
15 +++ acpica-unix2-20220331/source/common/dmtbdump1.c
16 @@ -1376,7 +1376,7 @@ AcpiDmDumpGtdt (
19 ACPI_GTDT_HEADER *Subtable;
20 - UINT32 Length = Table->Length;
21 + UINT32 Length = AcpiUtReadUint32 (&Table->Length);
22 UINT32 Offset = sizeof (ACPI_TABLE_GTDT);
23 ACPI_DMTABLE_INFO *InfoTable;
24 UINT32 SubtableLength;
25 @@ -1412,7 +1412,7 @@ AcpiDmDumpGtdt (
29 - while (Offset < Table->Length)
30 + while (Offset < Length)
32 /* Common subtable header */
34 @@ -1430,8 +1430,13 @@ AcpiDmDumpGtdt (
35 case ACPI_GTDT_TYPE_TIMER_BLOCK:
37 SubtableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
38 - GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
39 - Subtable))->TimerCount;
43 + Tmp32 = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
44 + Subtable))->TimerCount;
45 + GtCount = AcpiUtReadUint32 (&Tmp32);
48 InfoTable = AcpiDmTableInfoGtdt0;
50 Index: acpica-unix2-20220331/source/compiler/dttable1.c
51 ===================================================================
52 --- acpica-unix2-20220331.orig/source/compiler/dttable1.c
53 +++ acpica-unix2-20220331/source/compiler/dttable1.c
54 @@ -1439,8 +1439,13 @@ DtCompileGtdt (
55 DtPushSubtable (Subtable);
56 ParentTable = DtPeekSubtable ();
58 - GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
59 - Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
63 + Tmp32 = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
64 + Subtable->Buffer - sizeof (ACPI_GTDT_HEADER)))->TimerCount;
65 + GtCount = AcpiUtReadUint32 (&Tmp32);