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