acpica-tools/0027-Support-PPTT-in-a-big-endian-world.patch
DistroBaker 80dc240519 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/acpica-tools.git#defe2b64332fc44bf9915c8f57d2614c529cdb43
2020-10-31 12:18:15 +01:00

105 lines
4.0 KiB
Diff

From c5d7294c6deb7fe87eac981234d4c484313d5e40 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Fri, 25 Sep 2020 17:16:12 -0600
Subject: [PATCH 27/40] Support PPTT in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 15 +++++++++------
source/compiler/dttable2.c | 7 +++++--
2 files changed, 14 insertions(+), 8 deletions(-)
Index: acpica-unix2-20200925/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20200925.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20200925/source/common/dmtbdump2.c
@@ -1649,6 +1649,8 @@ AcpiDmDumpPptt (
UINT32 Offset = sizeof (ACPI_TABLE_FPDT);
ACPI_DMTABLE_INFO *InfoTable;
UINT32 i;
+ UINT32 TableLength = AcpiUtReadUint32(&Table->Length);
+ UINT32 NumPrivRes;
/* There is no main table (other than the standard ACPI header) */
@@ -1656,7 +1658,7 @@ AcpiDmDumpPptt (
/* Subtables */
Offset = sizeof (ACPI_TABLE_HEADER);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
AcpiOsPrintf ("\n");
@@ -1668,7 +1670,7 @@ AcpiDmDumpPptt (
AcpiOsPrintf ("Invalid subtable length\n");
return;
}
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
Subtable->Length, AcpiDmTableInfoPpttHdr);
if (ACPI_FAILURE (Status))
{
@@ -1710,7 +1712,7 @@ AcpiDmDumpPptt (
AcpiOsPrintf ("Invalid subtable length\n");
return;
}
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
Subtable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{
@@ -1726,15 +1728,16 @@ AcpiDmDumpPptt (
/* Dump SMBIOS handles */
+ NumPrivRes = AcpiUtReadUint32(&PpttProcessor->NumberOfPrivResources);
if ((UINT8)(Subtable->Length - SubtableOffset) <
- (UINT8)(PpttProcessor->NumberOfPrivResources * 4))
+ (UINT8)(NumPrivRes * 4))
{
AcpiOsPrintf ("Invalid private resource number\n");
return;
}
- for (i = 0; i < PpttProcessor->NumberOfPrivResources; i++)
+ for (i = 0; i < NumPrivRes; i++)
{
- Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
+ Status = AcpiDmDumpTable (TableLength, Offset + SubtableOffset,
ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable, SubtableOffset),
4, AcpiDmTableInfoPptt0a);
if (ACPI_FAILURE (Status))
Index: acpica-unix2-20200925/source/compiler/dttable2.c
===================================================================
--- acpica-unix2-20200925.orig/source/compiler/dttable2.c
+++ acpica-unix2-20200925/source/compiler/dttable2.c
@@ -1028,6 +1028,7 @@ DtCompilePptt (
ACPI_DMTABLE_INFO *InfoTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_FIELD *SubtableStart;
+ UINT32 NumPrivRes;
ParentTable = DtPeekSubtable ();
@@ -1092,7 +1093,7 @@ DtCompilePptt (
{
/* Compile initiator proximity domain list */
- PpttProcessor->NumberOfPrivResources = 0;
+ NumPrivRes = 0;
while (*PFieldList)
{
Status = DtCompileTable (PFieldList,
@@ -1108,8 +1109,10 @@ DtCompilePptt (
DtInsertSubtable (ParentTable, Subtable);
PpttHeader->Length += (UINT8)(Subtable->Length);
- PpttProcessor->NumberOfPrivResources++;
+ NumPrivRes++;
}
+ PpttProcessor->NumberOfPrivResources =
+ AcpiUtReadUint32(&NumPrivRes);
}
break;