Blame SOURCES/0019-Support-HEST-in-a-big-endian-world.patch

214d7a
From 6b73a4881e436bb8cf86c05c1cc4b5360efe1c7f Mon Sep 17 00:00:00 2001
214d7a
From: Al Stone <ahs3@redhat.com>
214d7a
Date: Wed, 23 Sep 2020 11:54:49 -0600
214d7a
Subject: [PATCH 19/45] Support HEST in a big-endian world
214d7a
214d7a
Signed-off-by: Al Stone <ahs3@redhat.com>
214d7a
---
214d7a
 source/common/dmtbdump1.c  | 10 ++++++----
214d7a
 source/compiler/dttable1.c |  4 +++-
214d7a
 2 files changed, 9 insertions(+), 5 deletions(-)
214d7a
214d7a
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
214d7a
===================================================================
214d7a
--- acpica-unix2-20210604.orig/source/common/dmtbdump1.c
214d7a
+++ acpica-unix2-20210604/source/common/dmtbdump1.c
214d7a
@@ -1216,12 +1216,13 @@ AcpiDmDumpHest (
214d7a
 {
214d7a
     ACPI_STATUS             Status;
214d7a
     ACPI_HEST_HEADER        *Subtable;
214d7a
-    UINT32                  Length = Table->Length;
214d7a
+    UINT32                  Length = AcpiUtReadUint32 (&Table->Length);
214d7a
     UINT32                  Offset = sizeof (ACPI_TABLE_HEST);
214d7a
     ACPI_DMTABLE_INFO       *InfoTable;
214d7a
     UINT32                  SubtableLength;
214d7a
     UINT32                  BankCount;
214d7a
     ACPI_HEST_IA_ERROR_BANK *BankTable;
214d7a
+    UINT16                  SubtableType;
214d7a
 
214d7a
 
214d7a
     /* Main table */
214d7a
@@ -1235,10 +1236,11 @@ AcpiDmDumpHest (
214d7a
     /* Subtables */
214d7a
 
214d7a
     Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
214d7a
-    while (Offset < Table->Length)
214d7a
+    while (Offset < Length)
214d7a
     {
214d7a
         BankCount = 0;
214d7a
-        switch (Subtable->Type)
214d7a
+        SubtableType = Subtable->Type;
214d7a
+        switch (SubtableType)
214d7a
         {
214d7a
         case ACPI_HEST_TYPE_IA32_CHECK:
214d7a
 
214d7a
@@ -1305,7 +1307,7 @@ AcpiDmDumpHest (
214d7a
             /* Cannot continue on unknown type - no length */
214d7a
 
214d7a
             AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n",
214d7a
-                Subtable->Type);
214d7a
+                SubtableType);
214d7a
             return;
214d7a
         }
214d7a
 
214d7a
Index: acpica-unix2-20210604/source/compiler/dttable1.c
214d7a
===================================================================
214d7a
--- acpica-unix2-20210604.orig/source/compiler/dttable1.c
214d7a
+++ acpica-unix2-20210604/source/compiler/dttable1.c
214d7a
@@ -1207,6 +1207,7 @@ DtCompileHest (
214d7a
     DT_FIELD                *SubtableStart;
214d7a
     ACPI_DMTABLE_INFO       *InfoTable;
214d7a
     UINT16                  Type;
214d7a
+    UINT16                  Tmp16;
214d7a
     UINT32                  BankCount;
214d7a
 
214d7a
 
214d7a
@@ -1225,7 +1226,8 @@ DtCompileHest (
214d7a
         /* Get subtable type */
214d7a
 
214d7a
         SubtableStart = *PFieldList;
214d7a
-        DtCompileInteger ((UINT8 *) &Type, *PFieldList, 2, 0);
214d7a
+        DtCompileInteger ((UINT8 *) &Tmp16, *PFieldList, 2, 0);
214d7a
+        Type = AcpiUtReadUint32 (&Tmp16);
214d7a
 
214d7a
         switch (Type)
214d7a
         {