acpica-tools/0013-Support-DRTM-in-a-big-endian-world.patch
Al Stone 5a8256ff73 Update the patches so they apply
Signed-off-by: Al Stone <ahs3@redhat.com>
2022-03-09 19:45:13 -07:00

113 lines
4.1 KiB
Diff

From bcdec27f562b0df37546b5e8ad2eab76348062eb Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Sat, 19 Sep 2020 15:44:06 -0600
Subject: [PATCH 13/45] Support DRTM in a big-endian world
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(-)
Index: acpica-unix2-20210730/source/common/dmtbdump1.c
===================================================================
--- acpica-unix2-20210730.orig/source/common/dmtbdump1.c
+++ acpica-unix2-20210730/source/common/dmtbdump1.c
@@ -989,11 +989,14 @@ AcpiDmDumpDrtm (
ACPI_DRTM_RESOURCE_LIST *DrtmRl;
ACPI_DRTM_DPS_ID *DrtmDps;
UINT32 Count;
+ UINT32 ResourceCount;
+ UINT32 ValidatedTableCount;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
/* Main table */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0,
AcpiDmTableInfoDrtm);
if (ACPI_FAILURE (Status))
{
@@ -1008,7 +1011,7 @@ AcpiDmDumpDrtm (
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))
@@ -1021,10 +1024,11 @@ AcpiDmDumpDrtm (
/* Dump Validated table addresses */
Count = 0;
- while ((Offset < Table->Length) &&
- (DrtmVtl->ValidatedTableCount > Count))
+ ValidatedTableCount = AcpiUtReadUint32 (&DrtmVtl->ValidatedTableCount);
+ 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))
@@ -1040,7 +1044,7 @@ AcpiDmDumpDrtm (
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))
@@ -1053,10 +1057,11 @@ AcpiDmDumpDrtm (
/* Dump the Resource List */
Count = 0;
- while ((Offset < Table->Length) &&
- (DrtmRl->ResourceCount > Count))
+ ResourceCount = AcpiUtReadUint32 (&DrtmRl->ResourceCount);
+ 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))
@@ -1072,7 +1077,7 @@ AcpiDmDumpDrtm (
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);
}
Index: acpica-unix2-20210730/source/compiler/dttable1.c
===================================================================
--- acpica-unix2-20210730.orig/source/compiler/dttable1.c
+++ acpica-unix2-20210730/source/compiler/dttable1.c
@@ -1066,7 +1066,8 @@ DtCompileDrtm (
Count++;
}
- DrtmVtl->ValidatedTableCount = Count;
+ AcpiUtWriteUint (&DrtmVtl->ValidatedTableCount, sizeof (UINT32),
+ &Count, sizeof (UINT32));
DtPopSubtable ();
ParentTable = DtPeekSubtable ();
@@ -1104,7 +1105,8 @@ DtCompileDrtm (
Count++;
}
- DrtmRl->ResourceCount = Count;
+ AcpiUtWriteUint(&DrtmRl->ResourceCount, sizeof(UINT32),
+ &Count, sizeof(UINT32));
DtPopSubtable ();
ParentTable = DtPeekSubtable ();