1 From 6b73a4881e436bb8cf86c05c1cc4b5360efe1c7f Mon Sep 17 00:00:00 2001
2 From: Al Stone <ahs3@redhat.com>
3 Date: Wed, 23 Sep 2020 11:54:49 -0600
4 Subject: [PATCH 19/45] Support HEST in a big-endian world
6 Signed-off-by: Al Stone <ahs3@redhat.com>
8 source/common/dmtbdump1.c | 10 ++++++----
9 source/compiler/dttable1.c | 4 +++-
10 2 files changed, 9 insertions(+), 5 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 @@ -1517,12 +1517,13 @@ AcpiDmDumpHest (
19 ACPI_HEST_HEADER *Subtable;
20 - UINT32 Length = Table->Length;
21 + UINT32 Length = AcpiUtReadUint32 (&Table->Length);
22 UINT32 Offset = sizeof (ACPI_TABLE_HEST);
23 ACPI_DMTABLE_INFO *InfoTable;
24 UINT32 SubtableLength;
26 ACPI_HEST_IA_ERROR_BANK *BankTable;
27 + UINT16 SubtableType;
31 @@ -1536,10 +1537,11 @@ AcpiDmDumpHest (
34 Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
35 - while (Offset < Table->Length)
36 + while (Offset < Length)
39 - switch (Subtable->Type)
40 + SubtableType = Subtable->Type;
41 + switch (SubtableType)
43 case ACPI_HEST_TYPE_IA32_CHECK:
45 @@ -1606,7 +1608,7 @@ AcpiDmDumpHest (
46 /* Cannot continue on unknown type - no length */
48 AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n",
54 Index: acpica-unix2-20220331/source/compiler/dttable1.c
55 ===================================================================
56 --- acpica-unix2-20220331.orig/source/compiler/dttable1.c
57 +++ acpica-unix2-20220331/source/compiler/dttable1.c
58 @@ -1575,6 +1575,7 @@ DtCompileHest (
59 DT_FIELD *SubtableStart;
60 ACPI_DMTABLE_INFO *InfoTable;
66 @@ -1593,7 +1594,8 @@ DtCompileHest (
67 /* Get subtable type */
69 SubtableStart = *PFieldList;
70 - DtCompileInteger ((UINT8 *) &Type, *PFieldList, 2, 0);
71 + DtCompileInteger ((UINT8 *) &Tmp16, *PFieldList, 2, 0);
72 + Type = AcpiUtReadUint32 (&Tmp16);