Blame SOURCES/0009-Support-ASF-tables-in-a-big-endian-world.patch

214d7a
From ce811b4c38b9a09533ee8bafa22813f6e43c023d Mon Sep 17 00:00:00 2001
214d7a
From: Al Stone <ahs3@redhat.com>
214d7a
Date: Fri, 18 Sep 2020 16:41:02 -0600
214d7a
Subject: [PATCH 09/45] Support ASF! tables in a big-endian world
214d7a
214d7a
Read the table length properly and it all works right for big-endian.
214d7a
214d7a
Signed-off-by: Al Stone <ahs3@redhat.com>
214d7a
---
214d7a
 source/common/dmtbdump1.c | 10 ++++++----
214d7a
 1 file changed, 6 insertions(+), 4 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
@@ -79,16 +79,18 @@ AcpiDmDumpAsf (
214d7a
     UINT32                  DataOffset = 0;
214d7a
     UINT32                  i;
214d7a
     UINT8                   Type;
214d7a
+    UINT32                  TableLength;
214d7a
 
214d7a
 
214d7a
     /* No main table, only subtables */
214d7a
 
214d7a
     Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
214d7a
-    while (Offset < Table->Length)
214d7a
+    TableLength = AcpiUtReadUint32 (&Table->Length);
214d7a
+    while (Offset < TableLength)
214d7a
     {
214d7a
         /* Common subtable header */
214d7a
 
214d7a
-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
214d7a
+        Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
214d7a
             Subtable->Header.Length, AcpiDmTableInfoAsfHdr);
214d7a
         if (ACPI_FAILURE (Status))
214d7a
         {
214d7a
@@ -146,7 +148,7 @@ AcpiDmDumpAsf (
214d7a
             return;
214d7a
         }
214d7a
 
214d7a
-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
214d7a
+        Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
214d7a
             Subtable->Header.Length, InfoTable);
214d7a
         if (ACPI_FAILURE (Status))
214d7a
         {
214d7a
@@ -163,7 +165,7 @@ AcpiDmDumpAsf (
214d7a
             for (i = 0; i < DataCount; i++)
214d7a
             {
214d7a
                 AcpiOsPrintf ("\n");
214d7a
-                Status = AcpiDmDumpTable (Table->Length, DataOffset,
214d7a
+                Status = AcpiDmDumpTable (TableLength, DataOffset,
214d7a
                     DataTable, DataLength, DataInfoTable);
214d7a
                 if (ACPI_FAILURE (Status))
214d7a
                 {