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