2021-07-12 03:22:10 +00:00
|
|
|
From 9fc0e46189feb926b13713422ea2722e273a31b5 Mon Sep 17 00:00:00 2001
|
2020-10-23 19:04:26 +00:00
|
|
|
From: Al Stone <ahs3@redhat.com>
|
|
|
|
Date: Mon, 19 Oct 2020 17:30:30 -0400
|
2021-07-12 03:22:10 +00:00
|
|
|
Subject: [PATCH 40/45] Support S3PT in a big-endian world
|
2020-10-23 19:04:26 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
source/common/dmtbdump2.c | 15 +++++++++------
|
|
|
|
source/compiler/dttable2.c | 4 +++-
|
|
|
|
2 files changed, 12 insertions(+), 7 deletions(-)
|
|
|
|
|
2021-07-12 03:22:10 +00:00
|
|
|
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
|
2020-10-25 17:36:21 +00:00
|
|
|
===================================================================
|
2021-07-12 03:22:10 +00:00
|
|
|
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
|
|
|
|
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
|
|
|
|
@@ -2039,6 +2039,8 @@ AcpiDmDumpS3pt (
|
2020-10-23 19:04:26 +00:00
|
|
|
ACPI_FPDT_HEADER *Subtable;
|
|
|
|
ACPI_DMTABLE_INFO *InfoTable;
|
|
|
|
ACPI_TABLE_S3PT *S3ptTable = ACPI_CAST_PTR (ACPI_TABLE_S3PT, Tables);
|
2021-07-12 03:22:10 +00:00
|
|
|
+ UINT32 S3ptTableLength = AcpiUtReadUint32 (&S3ptTable->Length);
|
2020-10-23 19:04:26 +00:00
|
|
|
+ UINT16 SubtableType;
|
|
|
|
|
|
|
|
|
|
|
|
/* Main table */
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -2050,19 +2052,20 @@ AcpiDmDumpS3pt (
|
2020-10-23 19:04:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, S3ptTable, Offset);
|
|
|
|
- while (Offset < S3ptTable->Length)
|
|
|
|
+ while (Offset < S3ptTableLength)
|
|
|
|
{
|
|
|
|
/* Common subtable header */
|
|
|
|
|
|
|
|
AcpiOsPrintf ("\n");
|
|
|
|
- Status = AcpiDmDumpTable (S3ptTable->Length, Offset, Subtable,
|
|
|
|
+ Status = AcpiDmDumpTable (S3ptTableLength, Offset, Subtable,
|
|
|
|
Subtable->Length, AcpiDmTableInfoS3ptHdr);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
- switch (Subtable->Type)
|
2021-07-12 03:22:10 +00:00
|
|
|
+ SubtableType = AcpiUtReadUint16 (&Subtable->Type);
|
2020-10-23 19:04:26 +00:00
|
|
|
+ switch (SubtableType)
|
|
|
|
{
|
|
|
|
case ACPI_S3PT_TYPE_RESUME:
|
|
|
|
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -2077,7 +2080,7 @@ AcpiDmDumpS3pt (
|
2020-10-23 19:04:26 +00:00
|
|
|
default:
|
|
|
|
|
|
|
|
AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n",
|
|
|
|
- Subtable->Type);
|
|
|
|
+ SubtableType);
|
|
|
|
|
|
|
|
/* Attempt to continue */
|
|
|
|
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -2090,7 +2093,7 @@ AcpiDmDumpS3pt (
|
2020-10-23 19:04:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AcpiOsPrintf ("\n");
|
|
|
|
- Status = AcpiDmDumpTable (S3ptTable->Length, Offset, Subtable,
|
|
|
|
+ Status = AcpiDmDumpTable (S3ptTableLength, Offset, Subtable,
|
|
|
|
Subtable->Length, InfoTable);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -2104,7 +2107,7 @@ NextSubtable:
|
2020-10-23 19:04:26 +00:00
|
|
|
Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable, Subtable->Length);
|
|
|
|
}
|
|
|
|
|
|
|
|
- return (S3ptTable->Length);
|
|
|
|
+ return (S3ptTableLength);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-07-12 03:22:10 +00:00
|
|
|
Index: acpica-unix2-20210604/source/compiler/dttable2.c
|
2020-10-25 17:36:21 +00:00
|
|
|
===================================================================
|
2021-07-12 03:22:10 +00:00
|
|
|
--- acpica-unix2-20210604.orig/source/compiler/dttable2.c
|
|
|
|
+++ acpica-unix2-20210604/source/compiler/dttable2.c
|
|
|
|
@@ -1406,6 +1406,7 @@ DtCompileS3pt (
|
2020-10-23 19:04:26 +00:00
|
|
|
DT_SUBTABLE *ParentTable;
|
|
|
|
ACPI_DMTABLE_INFO *InfoTable;
|
|
|
|
DT_FIELD *SubtableStart;
|
|
|
|
+ UINT16 S3ptHeaderType;
|
|
|
|
|
|
|
|
|
|
|
|
Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3pt,
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -1433,7 +1434,8 @@ DtCompileS3pt (
|
2020-10-23 19:04:26 +00:00
|
|
|
|
|
|
|
S3ptHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
|
|
|
|
|
|
|
|
- switch (S3ptHeader->Type)
|
2021-07-12 03:22:10 +00:00
|
|
|
+ S3ptHeaderType = AcpiUtReadUint16 (&S3ptHeader->Type);
|
2020-10-23 19:04:26 +00:00
|
|
|
+ switch (S3ptHeaderType)
|
|
|
|
{
|
|
|
|
case ACPI_S3PT_TYPE_RESUME:
|
|
|
|
|