2021-07-12 03:22:10 +00:00
|
|
|
From 8923211d8bc1b0e4d3af6ff31ed6479057f612f6 Mon Sep 17 00:00:00 2001
|
2020-10-19 18:24:09 +00:00
|
|
|
From: Al Stone <ahs3@redhat.com>
|
|
|
|
Date: Fri, 25 Sep 2020 17:16:12 -0600
|
2021-07-12 03:22:10 +00:00
|
|
|
Subject: [PATCH 30/45] Support PPTT in a big-endian world
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
Signed-off-by: Al Stone <ahs3@redhat.com>
|
|
|
|
---
|
2021-07-12 03:22:10 +00:00
|
|
|
source/common/dmtbdump2.c | 17 ++++++++++-------
|
2020-10-19 18:24:09 +00:00
|
|
|
source/compiler/dttable2.c | 7 +++++--
|
2021-07-12 03:22:10 +00:00
|
|
|
2 files changed, 15 insertions(+), 9 deletions(-)
|
2020-10-19 18:24:09 +00:00
|
|
|
|
2022-03-18 22:08:40 +00:00
|
|
|
Index: acpica-unix2-20211217/source/common/dmtbdump2.c
|
2020-10-19 18:24:09 +00:00
|
|
|
===================================================================
|
2022-03-18 22:08:40 +00:00
|
|
|
--- acpica-unix2-20211217.orig/source/common/dmtbdump2.c
|
|
|
|
+++ acpica-unix2-20211217/source/common/dmtbdump2.c
|
|
|
|
@@ -2194,6 +2194,8 @@ AcpiDmDumpPptt (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 Offset = sizeof (ACPI_TABLE_FPDT);
|
|
|
|
ACPI_DMTABLE_INFO *InfoTable;
|
|
|
|
UINT32 i;
|
2021-07-12 03:22:10 +00:00
|
|
|
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
2020-10-19 18:24:09 +00:00
|
|
|
+ UINT32 NumPrivRes;
|
|
|
|
|
|
|
|
|
|
|
|
/* There is no main table (other than the standard ACPI header) */
|
2022-03-18 22:08:40 +00:00
|
|
|
@@ -2201,7 +2203,7 @@ AcpiDmDumpPptt (
|
2020-10-19 18:24:09 +00:00
|
|
|
/* Subtables */
|
|
|
|
|
|
|
|
Offset = sizeof (ACPI_TABLE_HEADER);
|
|
|
|
- while (Offset < Table->Length)
|
|
|
|
+ while (Offset < TableLength)
|
|
|
|
{
|
|
|
|
AcpiOsPrintf ("\n");
|
|
|
|
|
2022-03-18 22:08:40 +00:00
|
|
|
@@ -2213,7 +2215,7 @@ AcpiDmDumpPptt (
|
2020-10-19 18:24:09 +00:00
|
|
|
AcpiOsPrintf ("Invalid subtable length\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
|
|
|
|
Subtable->Length, AcpiDmTableInfoPpttHdr);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
2022-03-18 22:08:40 +00:00
|
|
|
@@ -2255,7 +2257,7 @@ AcpiDmDumpPptt (
|
2020-10-19 18:24:09 +00:00
|
|
|
AcpiOsPrintf ("Invalid subtable length\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
|
|
|
|
Subtable->Length, InfoTable);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
2022-03-18 22:08:40 +00:00
|
|
|
@@ -2271,15 +2273,16 @@ AcpiDmDumpPptt (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Dump SMBIOS handles */
|
|
|
|
|
2021-07-12 03:22:10 +00:00
|
|
|
- if ((UINT8)(Subtable->Length - SubtableOffset) <
|
2020-10-19 18:24:09 +00:00
|
|
|
- (UINT8)(PpttProcessor->NumberOfPrivResources * 4))
|
2021-07-12 03:22:10 +00:00
|
|
|
+ NumPrivRes = AcpiUtReadUint32 (&PpttProcessor->NumberOfPrivResources);
|
|
|
|
+ if ((UINT8) (Subtable->Length - SubtableOffset) <
|
|
|
|
+ (UINT8) (NumPrivRes * 4))
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
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))
|
2022-03-18 22:08:40 +00:00
|
|
|
Index: acpica-unix2-20211217/source/compiler/dttable2.c
|
2020-10-19 18:24:09 +00:00
|
|
|
===================================================================
|
2022-03-18 22:08:40 +00:00
|
|
|
--- acpica-unix2-20211217.orig/source/compiler/dttable2.c
|
|
|
|
+++ acpica-unix2-20211217/source/compiler/dttable2.c
|
|
|
|
@@ -1507,6 +1507,7 @@ DtCompilePptt (
|
2020-10-19 18:24:09 +00:00
|
|
|
DT_FIELD **PFieldList = (DT_FIELD **) List;
|
|
|
|
DT_FIELD *SubtableStart;
|
2021-07-12 03:22:10 +00:00
|
|
|
ACPI_TABLE_HEADER *PpttAcpiHeader;
|
2020-10-19 18:24:09 +00:00
|
|
|
+ UINT32 NumPrivRes;
|
|
|
|
|
|
|
|
|
|
|
|
ParentTable = DtPeekSubtable ();
|
2022-03-18 22:08:40 +00:00
|
|
|
@@ -1571,7 +1572,7 @@ DtCompilePptt (
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
/* Compile initiator proximity domain list */
|
|
|
|
|
|
|
|
- PpttProcessor->NumberOfPrivResources = 0;
|
|
|
|
+ NumPrivRes = 0;
|
|
|
|
while (*PFieldList)
|
|
|
|
{
|
|
|
|
Status = DtCompileTable (PFieldList,
|
2022-03-18 22:08:40 +00:00
|
|
|
@@ -1587,8 +1588,10 @@ DtCompilePptt (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
DtInsertSubtable (ParentTable, Subtable);
|
|
|
|
PpttHeader->Length += (UINT8)(Subtable->Length);
|
|
|
|
- PpttProcessor->NumberOfPrivResources++;
|
|
|
|
+ NumPrivRes++;
|
|
|
|
}
|
|
|
|
+ PpttProcessor->NumberOfPrivResources =
|
2021-07-12 03:22:10 +00:00
|
|
|
+ AcpiUtReadUint32 (&NumPrivRes);
|
2020-10-19 18:24:09 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|