]> git.pld-linux.org Git - packages/acpica.git/blame - 0030-Support-PPTT-in-a-big-endian-world.patch
- updated tests
[packages/acpica.git] / 0030-Support-PPTT-in-a-big-endian-world.patch
CommitLineData
b643ab7e
JB
1From 8923211d8bc1b0e4d3af6ff31ed6479057f612f6 Mon Sep 17 00:00:00 2001
2From: Al Stone <ahs3@redhat.com>
3Date: Fri, 25 Sep 2020 17:16:12 -0600
4Subject: [PATCH 30/45] Support PPTT in a big-endian world
5
6Signed-off-by: Al Stone <ahs3@redhat.com>
7---
8 source/common/dmtbdump2.c | 17 ++++++++++-------
9 source/compiler/dttable2.c | 7 +++++--
10 2 files changed, 15 insertions(+), 9 deletions(-)
11
12Index: acpica-unix2-20220331/source/common/dmtbdump2.c
13===================================================================
14--- acpica-unix2-20220331.orig/source/common/dmtbdump2.c
15+++ acpica-unix2-20220331/source/common/dmtbdump2.c
16@@ -2241,6 +2241,8 @@ AcpiDmDumpPptt (
17 UINT32 Offset = sizeof (ACPI_TABLE_FPDT);
18 ACPI_DMTABLE_INFO *InfoTable;
19 UINT32 i;
20+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
21+ UINT32 NumPrivRes;
22
23
24 /* There is no main table (other than the standard ACPI header) */
25@@ -2248,7 +2250,7 @@ AcpiDmDumpPptt (
26 /* Subtables */
27
28 Offset = sizeof (ACPI_TABLE_HEADER);
29- while (Offset < Table->Length)
30+ while (Offset < TableLength)
31 {
32 AcpiOsPrintf ("\n");
33
34@@ -2260,7 +2262,7 @@ AcpiDmDumpPptt (
35 AcpiOsPrintf ("Invalid subtable length\n");
36 return;
37 }
38- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
39+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
40 Subtable->Length, AcpiDmTableInfoPpttHdr);
41 if (ACPI_FAILURE (Status))
42 {
43@@ -2302,7 +2304,7 @@ AcpiDmDumpPptt (
44 AcpiOsPrintf ("Invalid subtable length\n");
45 return;
46 }
47- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
48+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
49 Subtable->Length, InfoTable);
50 if (ACPI_FAILURE (Status))
51 {
52@@ -2318,15 +2320,16 @@ AcpiDmDumpPptt (
53
54 /* Dump SMBIOS handles */
55
56- if ((UINT8)(Subtable->Length - SubtableOffset) <
57- (UINT8)(PpttProcessor->NumberOfPrivResources * 4))
58+ NumPrivRes = AcpiUtReadUint32 (&PpttProcessor->NumberOfPrivResources);
59+ if ((UINT8) (Subtable->Length - SubtableOffset) <
60+ (UINT8) (NumPrivRes * 4))
61 {
62 AcpiOsPrintf ("Invalid private resource number\n");
63 return;
64 }
65- for (i = 0; i < PpttProcessor->NumberOfPrivResources; i++)
66+ for (i = 0; i < NumPrivRes; i++)
67 {
68- Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
69+ Status = AcpiDmDumpTable (TableLength, Offset + SubtableOffset,
70 ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable, SubtableOffset),
71 4, AcpiDmTableInfoPptt0a);
72 if (ACPI_FAILURE (Status))
73Index: acpica-unix2-20220331/source/compiler/dttable2.c
74===================================================================
75--- acpica-unix2-20220331.orig/source/compiler/dttable2.c
76+++ acpica-unix2-20220331/source/compiler/dttable2.c
77@@ -1520,6 +1520,7 @@ DtCompilePptt (
78 DT_FIELD **PFieldList = (DT_FIELD **) List;
79 DT_FIELD *SubtableStart;
80 ACPI_TABLE_HEADER *PpttAcpiHeader;
81+ UINT32 NumPrivRes;
82
83
84 ParentTable = DtPeekSubtable ();
85@@ -1584,7 +1585,7 @@ DtCompilePptt (
86 {
87 /* Compile initiator proximity domain list */
88
89- PpttProcessor->NumberOfPrivResources = 0;
90+ NumPrivRes = 0;
91 while (*PFieldList)
92 {
93 Status = DtCompileTable (PFieldList,
94@@ -1600,8 +1601,10 @@ DtCompilePptt (
95
96 DtInsertSubtable (ParentTable, Subtable);
97 PpttHeader->Length += (UINT8)(Subtable->Length);
98- PpttProcessor->NumberOfPrivResources++;
99+ NumPrivRes++;
100 }
101+ PpttProcessor->NumberOfPrivResources =
102+ AcpiUtReadUint32 (&NumPrivRes);
103 }
104 break;
105
This page took 0.123499 seconds and 4 git commands to generate.