2021-07-23 13:25:41 +00:00
|
|
|
From 492e41a24fd088c7ab609ee8ad518f69c9cd29e3 Mon Sep 17 00:00:00 2001
|
2020-10-31 11:18:15 +00:00
|
|
|
From: Al Stone <ahs3@redhat.com>
|
|
|
|
Date: Tue, 22 Sep 2020 18:12:01 -0600
|
2021-07-23 13:25:41 +00:00
|
|
|
Subject: [PATCH 18/45] Support GTDT in a big-endian world
|
2020-10-31 11:18:15 +00:00
|
|
|
|
|
|
|
Signed-off-by: Al Stone <ahs3@redhat.com>
|
|
|
|
---
|
|
|
|
source/common/dmtbdump1.c | 13 +++++++++----
|
|
|
|
source/compiler/dttable1.c | 9 +++++++--
|
|
|
|
2 files changed, 16 insertions(+), 6 deletions(-)
|
|
|
|
|
2021-07-23 13:25:41 +00:00
|
|
|
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
|
2020-10-31 11:18:15 +00:00
|
|
|
===================================================================
|
2021-07-23 13:25:41 +00:00
|
|
|
--- acpica-unix2-20210604.orig/source/common/dmtbdump1.c
|
|
|
|
+++ acpica-unix2-20210604/source/common/dmtbdump1.c
|
|
|
|
@@ -1075,7 +1075,7 @@ AcpiDmDumpGtdt (
|
2020-10-31 11:18:15 +00:00
|
|
|
{
|
|
|
|
ACPI_STATUS Status;
|
|
|
|
ACPI_GTDT_HEADER *Subtable;
|
|
|
|
- UINT32 Length = Table->Length;
|
2021-07-23 13:25:41 +00:00
|
|
|
+ UINT32 Length = AcpiUtReadUint32 (&Table->Length);
|
2020-10-31 11:18:15 +00:00
|
|
|
UINT32 Offset = sizeof (ACPI_TABLE_GTDT);
|
|
|
|
ACPI_DMTABLE_INFO *InfoTable;
|
|
|
|
UINT32 SubtableLength;
|
2021-07-23 13:25:41 +00:00
|
|
|
@@ -1111,7 +1111,7 @@ AcpiDmDumpGtdt (
|
2020-10-31 11:18:15 +00:00
|
|
|
|
|
|
|
/* Subtables */
|
|
|
|
|
|
|
|
- while (Offset < Table->Length)
|
|
|
|
+ while (Offset < Length)
|
|
|
|
{
|
|
|
|
/* Common subtable header */
|
|
|
|
|
2021-07-23 13:25:41 +00:00
|
|
|
@@ -1129,8 +1129,13 @@ AcpiDmDumpGtdt (
|
2020-10-31 11:18:15 +00:00
|
|
|
case ACPI_GTDT_TYPE_TIMER_BLOCK:
|
|
|
|
|
|
|
|
SubtableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
|
|
|
|
- GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
|
|
|
|
- Subtable))->TimerCount;
|
2021-07-23 13:25:41 +00:00
|
|
|
+ {
|
|
|
|
+ UINT32 Tmp32;
|
2020-10-31 11:18:15 +00:00
|
|
|
+
|
|
|
|
+ Tmp32 = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
|
|
|
|
+ Subtable))->TimerCount;
|
2021-07-23 13:25:41 +00:00
|
|
|
+ GtCount = AcpiUtReadUint32 (&Tmp32);
|
|
|
|
+ }
|
2020-10-31 11:18:15 +00:00
|
|
|
|
|
|
|
InfoTable = AcpiDmTableInfoGtdt0;
|
|
|
|
break;
|
2021-07-23 13:25:41 +00:00
|
|
|
Index: acpica-unix2-20210604/source/compiler/dttable1.c
|
2020-10-31 11:18:15 +00:00
|
|
|
===================================================================
|
2021-07-23 13:25:41 +00:00
|
|
|
--- acpica-unix2-20210604.orig/source/compiler/dttable1.c
|
|
|
|
+++ acpica-unix2-20210604/source/compiler/dttable1.c
|
|
|
|
@@ -1071,8 +1071,13 @@ DtCompileGtdt (
|
2020-10-31 11:18:15 +00:00
|
|
|
DtPushSubtable (Subtable);
|
|
|
|
ParentTable = DtPeekSubtable ();
|
|
|
|
|
|
|
|
- GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
|
|
|
|
- Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
|
2021-07-23 13:25:41 +00:00
|
|
|
+ {
|
|
|
|
+ UINT32 Tmp32;
|
2020-10-31 11:18:15 +00:00
|
|
|
+
|
|
|
|
+ Tmp32 = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
|
2021-07-23 13:25:41 +00:00
|
|
|
+ Subtable->Buffer - sizeof (ACPI_GTDT_HEADER)))->TimerCount;
|
|
|
|
+ GtCount = AcpiUtReadUint32 (&Tmp32);
|
|
|
|
+ }
|
2020-10-31 11:18:15 +00:00
|
|
|
|
|
|
|
while (GtCount)
|
|
|
|
{
|