acpica-tools/0038-Support-PMTT-in-a-big-endian-world.patch
Al Stone fc3eef63e8 Update to 20220331 upstream sources
This includes new source tarballs, updated patches, and updated
expected results for test cases.  In addition, three new tables
(PRMT, RGRT and SVKL) now have big-endian support.

Signed-off-by: Al Stone <ahs3@redhat.com>
2022-04-03 15:18:02 -06:00

86 lines
2.9 KiB
Diff

From bd19995fa268ed3e93c071162d0e9c2d35ada0d4 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Tue, 29 Jun 2021 16:23:30 -0600
Subject: [PATCH 38/45] Support PMTT in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
Index: acpica-unix2-20220331/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20220331.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20220331/source/common/dmtbdump2.c
@@ -2142,8 +2142,9 @@ AcpiDmDumpPmtt (
{
ACPI_STATUS Status;
ACPI_PMTT_HEADER *Subtable;
- UINT32 Length = Table->Length;
+ UINT32 Length = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_PMTT);
+ UINT16 SubtableLength;
/* Main table */
@@ -2157,17 +2158,18 @@ AcpiDmDumpPmtt (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < Length)
{
/* Each of the types below contain the common subtable header */
AcpiOsPrintf ("\n");
+ SubtableLength = AcpiUtReadUint16 (&Subtable->Length);
switch (Subtable->Type)
{
case ACPI_PMTT_TYPE_SOCKET:
Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoPmtt0);
+ SubtableLength, AcpiDmTableInfoPmtt0);
if (ACPI_FAILURE (Status))
{
return;
@@ -2176,7 +2178,7 @@ AcpiDmDumpPmtt (
case ACPI_PMTT_TYPE_CONTROLLER:
Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoPmtt1);
+ SubtableLength, AcpiDmTableInfoPmtt1);
if (ACPI_FAILURE (Status))
{
return;
@@ -2185,7 +2187,7 @@ AcpiDmDumpPmtt (
case ACPI_PMTT_TYPE_DIMM:
Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoPmtt2);
+ SubtableLength, AcpiDmTableInfoPmtt2);
if (ACPI_FAILURE (Status))
{
return;
@@ -2194,7 +2196,7 @@ AcpiDmDumpPmtt (
case ACPI_PMTT_TYPE_VENDOR:
Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoPmttVendor);
+ SubtableLength, AcpiDmTableInfoPmttVendor);
if (ACPI_FAILURE (Status))
{
return;
@@ -2210,9 +2212,9 @@ AcpiDmDumpPmtt (
/* Point to next subtable */
- Offset += Subtable->Length;
+ Offset += SubtableLength;
Subtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
- Subtable, Subtable->Length);
+ Subtable, SubtableLength);
}
}