|
|
9897bb |
From 0fb79a24fb70ab1e1e4879220af82a9fa00af586 Mon Sep 17 00:00:00 2001
|
|
|
9897bb |
From: Al Stone <ahs3@redhat.com>
|
|
|
9897bb |
Date: Mon, 28 Sep 2020 13:01:18 -0600
|
|
|
9897bb |
Subject: [PATCH 36/45] Support MCFG in a big-endian world
|
|
|
9897bb |
|
|
|
9897bb |
Signed-off-by: Al Stone <ahs3@redhat.com>
|
|
|
9897bb |
---
|
|
|
9897bb |
source/common/dmtbdump2.c | 11 ++++++-----
|
|
|
9897bb |
1 file changed, 6 insertions(+), 5 deletions(-)
|
|
|
9897bb |
|
|
|
9897bb |
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
|
|
|
9897bb |
===================================================================
|
|
|
9897bb |
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
|
|
|
9897bb |
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
|
|
|
9897bb |
@@ -930,11 +930,12 @@ AcpiDmDumpMcfg (
|
|
|
9897bb |
ACPI_STATUS Status;
|
|
|
9897bb |
UINT32 Offset = sizeof (ACPI_TABLE_MCFG);
|
|
|
9897bb |
ACPI_MCFG_ALLOCATION *Subtable;
|
|
|
9897bb |
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
|
|
9897bb |
|
|
|
9897bb |
|
|
|
9897bb |
/* Main table */
|
|
|
9897bb |
|
|
|
9897bb |
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMcfg);
|
|
|
9897bb |
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoMcfg);
|
|
|
9897bb |
if (ACPI_FAILURE (Status))
|
|
|
9897bb |
{
|
|
|
9897bb |
return;
|
|
|
9897bb |
@@ -943,17 +944,17 @@ AcpiDmDumpMcfg (
|
|
|
9897bb |
/* Subtables */
|
|
|
9897bb |
|
|
|
9897bb |
Subtable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset);
|
|
|
9897bb |
- while (Offset < Table->Length)
|
|
|
9897bb |
+ while (Offset < TableLength)
|
|
|
9897bb |
{
|
|
|
9897bb |
- if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length)
|
|
|
9897bb |
+ if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > TableLength)
|
|
|
9897bb |
{
|
|
|
9897bb |
AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n",
|
|
|
9897bb |
- (UINT32) sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length));
|
|
|
9897bb |
+ (UINT32) sizeof (ACPI_MCFG_ALLOCATION) - (Offset - TableLength));
|
|
|
9897bb |
return;
|
|
|
9897bb |
}
|
|
|
9897bb |
|
|
|
9897bb |
AcpiOsPrintf ("\n");
|
|
|
9897bb |
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
|
|
|
9897bb |
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
|
|
|
9897bb |
sizeof (ACPI_MCFG_ALLOCATION), AcpiDmTableInfoMcfg0);
|
|
|
9897bb |
if (ACPI_FAILURE (Status))
|
|
|
9897bb |
{
|