1 From 35f533074fb78d52e87c5a14406a136480a6fe62 Mon Sep 17 00:00:00 2001
2 From: Al Stone <ahs3@redhat.com>
3 Date: Tue, 22 Sep 2020 17:51:45 -0600
4 Subject: [PATCH 17/45] Support most FPDTs in a big-endian world
6 NB: there is no support for vendor specific records even in
7 the little-endian version.
9 Signed-off-by: Al Stone <ahs3@redhat.com>
11 source/common/dmtbdump1.c | 12 +++++++-----
12 source/compiler/dttable1.c | 4 +++-
13 2 files changed, 10 insertions(+), 6 deletions(-)
15 Index: acpica-unix2-20220331/source/common/dmtbdump1.c
16 ===================================================================
17 --- acpica-unix2-20220331.orig/source/common/dmtbdump1.c
18 +++ acpica-unix2-20220331/source/common/dmtbdump1.c
19 @@ -1289,9 +1289,10 @@ AcpiDmDumpFpdt (
22 ACPI_FPDT_HEADER *Subtable;
23 - UINT32 Length = Table->Length;
24 + UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
25 UINT32 Offset = sizeof (ACPI_TABLE_FPDT);
26 ACPI_DMTABLE_INFO *InfoTable;
27 + UINT16 SubtableType;
30 /* There is no main table (other than the standard ACPI header) */
31 @@ -1299,19 +1300,20 @@ AcpiDmDumpFpdt (
34 Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset);
35 - while (Offset < Table->Length)
36 + while (Offset < TableLength)
38 /* Common subtable header */
41 - Status = AcpiDmDumpTable (Length, Offset, Subtable,
42 + Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
43 Subtable->Length, AcpiDmTableInfoFpdtHdr);
44 if (ACPI_FAILURE (Status))
49 - switch (Subtable->Type)
50 + SubtableType = AcpiUtReadUint16 (&Subtable->Type);
51 + switch (SubtableType)
53 case ACPI_FPDT_TYPE_BOOT:
55 @@ -1338,7 +1340,7 @@ AcpiDmDumpFpdt (
59 - Status = AcpiDmDumpTable (Length, Offset, Subtable,
60 + Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
61 Subtable->Length, InfoTable);
62 if (ACPI_FAILURE (Status))
64 Index: acpica-unix2-20220331/source/compiler/dttable1.c
65 ===================================================================
66 --- acpica-unix2-20220331.orig/source/compiler/dttable1.c
67 +++ acpica-unix2-20220331/source/compiler/dttable1.c
68 @@ -1493,6 +1493,7 @@ DtCompileFpdt (
69 ACPI_DMTABLE_INFO *InfoTable;
70 DT_FIELD **PFieldList = (DT_FIELD **) List;
71 DT_FIELD *SubtableStart;
72 + UINT16 SubtableType;
76 @@ -1511,7 +1512,8 @@ DtCompileFpdt (
78 FpdtHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
80 - switch (FpdtHeader->Type)
81 + SubtableType = AcpiUtReadUint16 (&FpdtHeader->Type);
82 + switch (SubtableType)
84 case ACPI_FPDT_TYPE_BOOT: