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

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