97df1c2ef7
Signed-off-by: Al Stone <ahs3@redhat.com>
86 lines
2.9 KiB
Diff
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-20211217/source/common/dmtbdump2.c
|
|
===================================================================
|
|
--- acpica-unix2-20211217.orig/source/common/dmtbdump2.c
|
|
+++ acpica-unix2-20211217/source/common/dmtbdump2.c
|
|
@@ -2095,8 +2095,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 */
|
|
@@ -2110,17 +2111,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;
|
|
@@ -2129,7 +2131,7 @@ AcpiDmDumpPmtt (
|
|
|
|
case ACPI_PMTT_TYPE_CONTROLLER:
|
|
Status = AcpiDmDumpTable (Length, Offset, Subtable,
|
|
- Subtable->Length, AcpiDmTableInfoPmtt1);
|
|
+ SubtableLength, AcpiDmTableInfoPmtt1);
|
|
if (ACPI_FAILURE (Status))
|
|
{
|
|
return;
|
|
@@ -2138,7 +2140,7 @@ AcpiDmDumpPmtt (
|
|
|
|
case ACPI_PMTT_TYPE_DIMM:
|
|
Status = AcpiDmDumpTable (Length, Offset, Subtable,
|
|
- Subtable->Length, AcpiDmTableInfoPmtt2);
|
|
+ SubtableLength, AcpiDmTableInfoPmtt2);
|
|
if (ACPI_FAILURE (Status))
|
|
{
|
|
return;
|
|
@@ -2147,7 +2149,7 @@ AcpiDmDumpPmtt (
|
|
|
|
case ACPI_PMTT_TYPE_VENDOR:
|
|
Status = AcpiDmDumpTable (Length, Offset, Subtable,
|
|
- Subtable->Length, AcpiDmTableInfoPmttVendor);
|
|
+ SubtableLength, AcpiDmTableInfoPmttVendor);
|
|
if (ACPI_FAILURE (Status))
|
|
{
|
|
return;
|
|
@@ -2163,9 +2165,9 @@ AcpiDmDumpPmtt (
|
|
|
|
/* Point to next subtable */
|
|
|
|
- Offset += Subtable->Length;
|
|
+ Offset += SubtableLength;
|
|
Subtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
|
|
- Subtable, Subtable->Length);
|
|
+ Subtable, SubtableLength);
|
|
}
|
|
}
|
|
|