2021-07-12 03:22:10 +00:00
|
|
|
From bcdec27f562b0df37546b5e8ad2eab76348062eb Mon Sep 17 00:00:00 2001
|
2020-10-19 18:24:09 +00:00
|
|
|
From: Al Stone <ahs3@redhat.com>
|
|
|
|
Date: Sat, 19 Sep 2020 15:44:06 -0600
|
2021-07-12 03:22:10 +00:00
|
|
|
Subject: [PATCH 13/45] Support DRTM in a big-endian world
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
Signed-off-by: Al Stone <ahs3@redhat.com>
|
|
|
|
---
|
|
|
|
source/common/dmtbdump1.c | 25 +++++++++++++++----------
|
|
|
|
source/compiler/dttable1.c | 6 ++++--
|
|
|
|
2 files changed, 19 insertions(+), 12 deletions(-)
|
|
|
|
|
2021-07-12 03:22:10 +00:00
|
|
|
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
|
2020-10-19 18:24:09 +00:00
|
|
|
===================================================================
|
2021-07-12 03:22:10 +00:00
|
|
|
--- acpica-unix2-20210604.orig/source/common/dmtbdump1.c
|
|
|
|
+++ acpica-unix2-20210604/source/common/dmtbdump1.c
|
|
|
|
@@ -770,11 +770,14 @@ AcpiDmDumpDrtm (
|
2020-10-19 18:24:09 +00:00
|
|
|
ACPI_DRTM_RESOURCE_LIST *DrtmRl;
|
|
|
|
ACPI_DRTM_DPS_ID *DrtmDps;
|
|
|
|
UINT32 Count;
|
|
|
|
+ UINT32 ResourceCount;
|
|
|
|
+ UINT32 ValidatedTableCount;
|
2021-07-12 03:22:10 +00:00
|
|
|
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Main table */
|
|
|
|
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0,
|
|
|
|
AcpiDmTableInfoDrtm);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -789,7 +792,7 @@ AcpiDmDumpDrtm (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset);
|
|
|
|
AcpiOsPrintf ("\n");
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, Offset,
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, Offset,
|
|
|
|
DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables),
|
|
|
|
AcpiDmTableInfoDrtm0);
|
|
|
|
if (ACPI_FAILURE (Status))
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -802,10 +805,11 @@ AcpiDmDumpDrtm (
|
2020-10-19 18:24:09 +00:00
|
|
|
/* Dump Validated table addresses */
|
|
|
|
|
|
|
|
Count = 0;
|
|
|
|
- while ((Offset < Table->Length) &&
|
|
|
|
- (DrtmVtl->ValidatedTableCount > Count))
|
2021-07-12 03:22:10 +00:00
|
|
|
+ ValidatedTableCount = AcpiUtReadUint32 (&DrtmVtl->ValidatedTableCount);
|
2020-10-19 18:24:09 +00:00
|
|
|
+ while ((Offset < TableLength) &&
|
|
|
|
+ (ValidatedTableCount > Count))
|
|
|
|
{
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, Offset,
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, Offset,
|
|
|
|
ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64),
|
|
|
|
AcpiDmTableInfoDrtm0a);
|
|
|
|
if (ACPI_FAILURE (Status))
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -821,7 +825,7 @@ AcpiDmDumpDrtm (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset);
|
|
|
|
AcpiOsPrintf ("\n");
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, Offset,
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, Offset,
|
|
|
|
DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources),
|
|
|
|
AcpiDmTableInfoDrtm1);
|
|
|
|
if (ACPI_FAILURE (Status))
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -834,10 +838,11 @@ AcpiDmDumpDrtm (
|
2020-10-19 18:24:09 +00:00
|
|
|
/* Dump the Resource List */
|
|
|
|
|
|
|
|
Count = 0;
|
|
|
|
- while ((Offset < Table->Length) &&
|
|
|
|
- (DrtmRl->ResourceCount > Count))
|
2021-07-12 03:22:10 +00:00
|
|
|
+ ResourceCount = AcpiUtReadUint32 (&DrtmRl->ResourceCount);
|
2020-10-19 18:24:09 +00:00
|
|
|
+ while ((Offset < TableLength) &&
|
|
|
|
+ (ResourceCount > Count))
|
|
|
|
{
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, Offset,
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, Offset,
|
|
|
|
ACPI_ADD_PTR (void, Table, Offset),
|
|
|
|
sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a);
|
|
|
|
if (ACPI_FAILURE (Status))
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -853,7 +858,7 @@ AcpiDmDumpDrtm (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset);
|
|
|
|
AcpiOsPrintf ("\n");
|
|
|
|
- (void) AcpiDmDumpTable (Table->Length, Offset,
|
|
|
|
+ (void) AcpiDmDumpTable (TableLength, Offset,
|
|
|
|
DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2);
|
|
|
|
}
|
|
|
|
|
2021-07-12 03:22:10 +00:00
|
|
|
Index: acpica-unix2-20210604/source/compiler/dttable1.c
|
2020-10-19 18:24:09 +00:00
|
|
|
===================================================================
|
2021-07-12 03:22:10 +00:00
|
|
|
--- acpica-unix2-20210604.orig/source/compiler/dttable1.c
|
|
|
|
+++ acpica-unix2-20210604/source/compiler/dttable1.c
|
|
|
|
@@ -849,7 +849,8 @@ DtCompileDrtm (
|
2020-10-19 18:24:09 +00:00
|
|
|
Count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
- DrtmVtl->ValidatedTableCount = Count;
|
2021-07-12 03:22:10 +00:00
|
|
|
+ AcpiUtWriteUint (&DrtmVtl->ValidatedTableCount, sizeof (UINT32),
|
|
|
|
+ &Count, sizeof (UINT32));
|
2020-10-19 18:24:09 +00:00
|
|
|
DtPopSubtable ();
|
|
|
|
ParentTable = DtPeekSubtable ();
|
|
|
|
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -887,7 +888,8 @@ DtCompileDrtm (
|
2020-10-19 18:24:09 +00:00
|
|
|
Count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
- DrtmRl->ResourceCount = Count;
|
|
|
|
+ AcpiUtWriteUint(&DrtmRl->ResourceCount, sizeof(UINT32),
|
2021-07-12 03:22:10 +00:00
|
|
|
+ &Count, sizeof(UINT32));
|
2020-10-19 18:24:09 +00:00
|
|
|
DtPopSubtable ();
|
|
|
|
ParentTable = DtPeekSubtable ();
|
|
|
|
|