Blame 0039-Add-partial-big-endian-support-for-WPBT-tables.patch

edb6c78
From 9d7f9c8f4ecbee2e621d471a8c4944cebe62947d Mon Sep 17 00:00:00 2001
edb6c78
From: Al Stone <ahs3@redhat.com>
edb6c78
Date: Wed, 30 Sep 2020 18:59:57 -0600
6c29d68
Subject: [PATCH 1/5] Add partial big-endian support for WPBT tables
edb6c78
edb6c78
There's some weirdness here that at present does not warrant
edb6c78
further investigation; this is just a really low priority table.
edb6c78
edb6c78
Signed-off-by: Al Stone <ahs3@redhat.com>
edb6c78
---
edb6c78
 source/common/dmtbdump3.c  | 8 ++++----
edb6c78
 source/compiler/dttable2.c | 3 ++-
edb6c78
 2 files changed, 6 insertions(+), 5 deletions(-)
edb6c78
38a008c
Index: acpica-unix2-20200925/source/common/dmtbdump3.c
38a008c
===================================================================
38a008c
--- acpica-unix2-20200925.orig/source/common/dmtbdump3.c
38a008c
+++ acpica-unix2-20200925/source/common/dmtbdump3.c
38a008c
@@ -628,13 +628,13 @@ AcpiDmDumpWpbt (
edb6c78
 {
edb6c78
     ACPI_STATUS             Status;
edb6c78
     ACPI_TABLE_WPBT         *Subtable;
edb6c78
-    UINT32                  Length = Table->Length;
edb6c78
+    UINT32                  TableLength = AcpiUtReadUint32(&Table->Length);
edb6c78
     UINT16                  ArgumentsLength;
edb6c78
 
edb6c78
 
edb6c78
     /* Dump the main table */
edb6c78
 
edb6c78
-    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoWpbt);
edb6c78
+    Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoWpbt);
edb6c78
     if (ACPI_FAILURE (Status))
edb6c78
     {
edb6c78
         return;
38a008c
@@ -643,10 +643,10 @@ AcpiDmDumpWpbt (
edb6c78
     /* Extract the arguments buffer length from the main table */
edb6c78
 
edb6c78
     Subtable = ACPI_CAST_PTR (ACPI_TABLE_WPBT, Table);
edb6c78
-    ArgumentsLength = Subtable->ArgumentsLength;
edb6c78
+    ArgumentsLength = AcpiUtReadUint16(&Subtable->ArgumentsLength);
edb6c78
 
edb6c78
     /* Dump the arguments buffer */
edb6c78
 
edb6c78
-    (void) AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength,
edb6c78
+    (void) AcpiDmDumpTable (TableLength, 0, Table, ArgumentsLength,
edb6c78
         AcpiDmTableInfoWpbt0);
edb6c78
 }
38a008c
Index: acpica-unix2-20200925/source/compiler/dttable2.c
38a008c
===================================================================
38a008c
--- acpica-unix2-20200925.orig/source/compiler/dttable2.c
38a008c
+++ acpica-unix2-20200925/source/compiler/dttable2.c
38a008c
@@ -2190,7 +2190,8 @@ DtCompileWpbt (
edb6c78
 
edb6c78
     /* Extract the length of the Arguments buffer, insert into main table */
edb6c78
 
edb6c78
-    Length = (UINT16) Subtable->TotalLength;
edb6c78
+    AcpiUtWriteUint(&Length, sizeof(UINT16),
edb6c78
+		   &Subtable->TotalLength, sizeof(UINT32));
edb6c78
     Table = ACPI_CAST_PTR (ACPI_TABLE_WPBT, ParentTable->Buffer);
edb6c78
     Table->ArgumentsLength = Length;
edb6c78