Blame SOURCES/0033-Support-TCPA-in-a-big-endian-world.patch

214d7a
From b69b833f5a9205080b27d83379a31fad7fca1575 Mon Sep 17 00:00:00 2001
214d7a
From: Al Stone <ahs3@redhat.com>
214d7a
Date: Sun, 27 Sep 2020 12:09:28 -0600
214d7a
Subject: [PATCH 33/45] Support TCPA in a big-endian world
214d7a
214d7a
Signed-off-by: Al Stone <ahs3@redhat.com>
214d7a
---
214d7a
 source/common/dmtbdump3.c  | 13 ++++++++-----
214d7a
 source/compiler/dttable2.c |  4 +++-
214d7a
 2 files changed, 11 insertions(+), 6 deletions(-)
214d7a
214d7a
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
214d7a
===================================================================
214d7a
--- acpica-unix2-20210604.orig/source/common/dmtbdump3.c
214d7a
+++ acpica-unix2-20210604/source/common/dmtbdump3.c
214d7a
@@ -401,11 +401,13 @@ AcpiDmDumpTcpa (
214d7a
     ACPI_TABLE_TCPA_HDR     *Subtable = ACPI_ADD_PTR (
214d7a
                                 ACPI_TABLE_TCPA_HDR, Table, Offset);
214d7a
     ACPI_STATUS             Status;
214d7a
+    UINT32                  TableLength = AcpiUtReadUint32 (&Table->Length);
214d7a
+    UINT16                  PlatformClass;
214d7a
 
214d7a
 
214d7a
     /* Main table */
214d7a
 
214d7a
-    Status = AcpiDmDumpTable (Table->Length, 0, Table,
214d7a
+    Status = AcpiDmDumpTable (TableLength, 0, Table,
214d7a
         0, AcpiDmTableInfoTcpaHdr);
214d7a
     if (ACPI_FAILURE (Status))
214d7a
     {
214d7a
@@ -416,18 +418,19 @@ AcpiDmDumpTcpa (
214d7a
      * Examine the PlatformClass field to determine the table type.
214d7a
      * Either a client or server table. Only one.
214d7a
      */
214d7a
-    switch (CommonHeader->PlatformClass)
214d7a
+    PlatformClass = AcpiUtReadUint16 (&CommonHeader->PlatformClass);
214d7a
+    switch (PlatformClass)
214d7a
     {
214d7a
     case ACPI_TCPA_CLIENT_TABLE:
214d7a
 
214d7a
-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
214d7a
+        Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
214d7a
             Table->Length - Offset, AcpiDmTableInfoTcpaClient);
214d7a
         break;
214d7a
 
214d7a
     case ACPI_TCPA_SERVER_TABLE:
214d7a
 
214d7a
-        Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
214d7a
-            Table->Length - Offset, AcpiDmTableInfoTcpaServer);
214d7a
+        Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
214d7a
+            TableLength - Offset, AcpiDmTableInfoTcpaServer);
214d7a
         break;
214d7a
 
214d7a
     default:
214d7a
Index: acpica-unix2-20210604/source/compiler/dttable2.c
214d7a
===================================================================
214d7a
--- acpica-unix2-20210604.orig/source/compiler/dttable2.c
214d7a
+++ acpica-unix2-20210604/source/compiler/dttable2.c
214d7a
@@ -2139,6 +2139,7 @@ DtCompileTcpa (
214d7a
     ACPI_TABLE_TCPA_HDR     *TcpaHeader;
214d7a
     DT_SUBTABLE             *ParentTable;
214d7a
     ACPI_STATUS             Status;
214d7a
+    UINT16                  PlatformClass;
214d7a
 
214d7a
 
214d7a
     /* Compile the main table */
214d7a
@@ -2159,7 +2160,8 @@ DtCompileTcpa (
214d7a
      */
214d7a
     TcpaHeader = ACPI_CAST_PTR (ACPI_TABLE_TCPA_HDR, ParentTable->Buffer);
214d7a
 
214d7a
-    switch (TcpaHeader->PlatformClass)
214d7a
+    PlatformClass = AcpiUtReadUint16 (&TcpaHeader->PlatformClass);
214d7a
+    switch (PlatformClass)
214d7a
     {
214d7a
     case ACPI_TCPA_CLIENT_TABLE:
214d7a