1 From b69b833f5a9205080b27d83379a31fad7fca1575 Mon Sep 17 00:00:00 2001
2 From: Al Stone <ahs3@redhat.com>
3 Date: Sun, 27 Sep 2020 12:09:28 -0600
4 Subject: [PATCH 33/45] Support TCPA in a big-endian world
6 Signed-off-by: Al Stone <ahs3@redhat.com>
8 source/common/dmtbdump3.c | 13 ++++++++-----
9 source/compiler/dttable2.c | 4 +++-
10 2 files changed, 11 insertions(+), 6 deletions(-)
12 Index: acpica-unix2-20220331/source/common/dmtbdump3.c
13 ===================================================================
14 --- acpica-unix2-20220331.orig/source/common/dmtbdump3.c
15 +++ acpica-unix2-20220331/source/common/dmtbdump3.c
16 @@ -406,11 +406,13 @@ AcpiDmDumpTcpa (
17 ACPI_TABLE_TCPA_HDR *Subtable = ACPI_ADD_PTR (
18 ACPI_TABLE_TCPA_HDR, Table, Offset);
20 + UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
21 + UINT16 PlatformClass;
26 - Status = AcpiDmDumpTable (Table->Length, 0, Table,
27 + Status = AcpiDmDumpTable (TableLength, 0, Table,
28 0, AcpiDmTableInfoTcpaHdr);
29 if (ACPI_FAILURE (Status))
31 @@ -421,18 +423,19 @@ AcpiDmDumpTcpa (
32 * Examine the PlatformClass field to determine the table type.
33 * Either a client or server table. Only one.
35 - switch (CommonHeader->PlatformClass)
36 + PlatformClass = AcpiUtReadUint16 (&CommonHeader->PlatformClass);
37 + switch (PlatformClass)
39 case ACPI_TCPA_CLIENT_TABLE:
41 - Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
42 + Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
43 Table->Length - Offset, AcpiDmTableInfoTcpaClient);
46 case ACPI_TCPA_SERVER_TABLE:
48 - Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
49 - Table->Length - Offset, AcpiDmTableInfoTcpaServer);
50 + Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
51 + TableLength - Offset, AcpiDmTableInfoTcpaServer);
55 Index: acpica-unix2-20220331/source/compiler/dttable2.c
56 ===================================================================
57 --- acpica-unix2-20220331.orig/source/compiler/dttable2.c
58 +++ acpica-unix2-20220331/source/compiler/dttable2.c
59 @@ -2540,6 +2540,7 @@ DtCompileTcpa (
60 ACPI_TABLE_TCPA_HDR *TcpaHeader;
61 DT_SUBTABLE *ParentTable;
63 + UINT16 PlatformClass;
66 /* Compile the main table */
67 @@ -2560,7 +2561,8 @@ DtCompileTcpa (
69 TcpaHeader = ACPI_CAST_PTR (ACPI_TABLE_TCPA_HDR, ParentTable->Buffer);
71 - switch (TcpaHeader->PlatformClass)
72 + PlatformClass = AcpiUtReadUint16 (&TcpaHeader->PlatformClass);
73 + switch (PlatformClass)
75 case ACPI_TCPA_CLIENT_TABLE: