acpica-tools/big-endian-v3.patch
Al Stone a4c3787ec9 Add s390 fixes to handle PPTT properly
Signed-off-by: Al Stone <ahs3@redhat.com>
2020-02-26 12:57:26 -07:00

107 lines
4.1 KiB
Diff

diff -Naur acpica-unix2-20200214.orig/source/components/namespace/nsutils.c acpica-unix2-20200214/source/components/namespace/nsutils.c
--- acpica-unix2-20200214.orig/source/components/namespace/nsutils.c 2020-02-14 10:33:55.000000000 -0700
+++ acpica-unix2-20200214/source/components/namespace/nsutils.c 2020-02-26 10:25:43.477022167 -0700
@@ -363,6 +363,15 @@
/* Move on the next segment */
+ {
+ /* Make sure the name segment reflects endian-ness first */
+
+ UINT32 Tmp32 = 0;
+
+ memcpy(&Tmp32, Result, ACPI_NAMESEG_SIZE);
+ ACPI_MOVE_32_TO_32(Result, &Tmp32);
+ }
+
ExternalName++;
Result += ACPI_NAMESEG_SIZE;
}
diff -Naur acpica-unix2-20200214.orig/source/common/dmtbdump2.c acpica-unix2-20200214/source/common/dmtbdump2.c
--- acpica-unix2-20200214.orig/source/common/dmtbdump2.c 2020-02-26 11:44:13.732967820 -0700
+++ acpica-unix2-20200214/source/common/dmtbdump2.c 2020-02-26 12:38:44.286849954 -0700
@@ -1670,6 +1670,8 @@
UINT32 Offset = sizeof (ACPI_TABLE_FPDT);
ACPI_DMTABLE_INFO *InfoTable;
UINT32 i;
+ UINT32 TableLen;
+ UINT32 NumPrivRes;
/* There is no main table (other than the standard ACPI header) */
@@ -1677,7 +1679,8 @@
/* Subtables */
Offset = sizeof (ACPI_TABLE_HEADER);
- while (Offset < Table->Length)
+ ACPI_MOVE_32_TO_32(&TableLen, &Table->Length);
+ while (Offset < TableLen)
{
AcpiOsPrintf ("\n");
@@ -1689,7 +1692,7 @@
AcpiOsPrintf ("Invalid subtable length\n");
return;
}
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLen, Offset, Subtable,
Subtable->Length, AcpiDmTableInfoPpttHdr);
if (ACPI_FAILURE (Status))
{
@@ -1731,7 +1734,7 @@
AcpiOsPrintf ("Invalid subtable length\n");
return;
}
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLen, Offset, Subtable,
Subtable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{
@@ -1747,15 +1750,16 @@
/* Dump SMBIOS handles */
+ ACPI_MOVE_32_TO_32(&NumPrivRes, &PpttProcessor->NumberOfPrivResources);
if ((UINT8)(Subtable->Length - SubtableOffset) <
- (UINT8)(PpttProcessor->NumberOfPrivResources * 4))
+ (UINT8)(NumPrivRes * 4))
{
AcpiOsPrintf ("Invalid private resource number\n");
return;
}
- for (i = 0; i < PpttProcessor->NumberOfPrivResources; i++)
+ for (i = 0; i < NumPrivRes; i++)
{
- Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
+ Status = AcpiDmDumpTable (TableLen, Offset + SubtableOffset,
ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable, SubtableOffset),
4, AcpiDmTableInfoPptt0a);
if (ACPI_FAILURE (Status))
diff -Naur acpica-unix2-20200214.orig/source/compiler/dttable2.c acpica-unix2-20200214/source/compiler/dttable2.c
--- acpica-unix2-20200214.orig/source/compiler/dttable2.c 2020-02-26 11:44:13.726967769 -0700
+++ acpica-unix2-20200214/source/compiler/dttable2.c 2020-02-26 12:39:03.671014890 -0700
@@ -1087,9 +1087,11 @@
Subtable->Buffer, sizeof (ACPI_SUBTABLE_HEADER));
if (PpttProcessor)
{
+ UINT32 NumPrivRes;
+
/* Compile initiator proximity domain list */
- PpttProcessor->NumberOfPrivResources = 0;
+ NumPrivRes = 0;
while (*PFieldList)
{
Status = DtCompileTable (PFieldList,
@@ -1105,8 +1107,9 @@
DtInsertSubtable (ParentTable, Subtable);
PpttHeader->Length += (UINT8)(Subtable->Length);
- PpttProcessor->NumberOfPrivResources++;
+ NumPrivRes++;
}
+ ACPI_MOVE_32_TO_32(&PpttProcessor->NumberOfPrivResources, &NumPrivRes);
}
break;