acpica-tools/big-endian-v3.patch

161 lines
6.3 KiB
Diff
Raw Normal View History

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;
diff -Naur acpica-unix2-20200214.orig/source/compiler/aslxref.c acpica-unix2-20200214/source/compiler/aslxref.c
--- acpica-unix2-20200214.orig/source/compiler/aslxref.c 2020-02-14 10:33:53.000000000 -0700
+++ acpica-unix2-20200214/source/compiler/aslxref.c 2020-02-26 13:21:43.973602232 -0700
@@ -547,8 +547,14 @@
*/
AslGbl_NsLookupCount++;
- Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
- ACPI_IMODE_EXECUTE, Flags, WalkState, &Node);
+ {
+ UINT32 Tmp32;
+
+ ACPI_MOVE_32_TO_32(&Tmp32, Path);
+
+ Status = AcpiNsLookup (WalkState->ScopeInfo, (char *)&Tmp32, ObjectType,
+ ACPI_IMODE_EXECUTE, Flags, WalkState, &Node);
+ }
if (ACPI_FAILURE (Status))
{
if (Status == AE_NOT_FOUND)
diff -Naur acpica-unix2-20200214.orig/source/compiler/aslload.c acpica-unix2-20200214/source/compiler/aslload.c
--- acpica-unix2-20200214.orig/source/compiler/aslload.c 2020-02-14 10:33:53.000000000 -0700
+++ acpica-unix2-20200214/source/compiler/aslload.c 2020-02-27 13:25:19.308413494 -0700
@@ -175,13 +175,17 @@
ACPI_NAMESPACE_NODE *Node;
ACPI_STATUS Status;
char *ExternalPath;
+ char TmpPath[ACPI_NAMESEG_SIZE];
SourceRegion = UtGetArg (Op, 0);
if (SourceRegion)
{
- Status = AcpiNsLookup (WalkState->ScopeInfo,
- SourceRegion->Asl.Value.String, AmlType, ACPI_IMODE_EXECUTE,
+ char TmpName[ACPI_NAMESEG_SIZE];
+
+ ACPI_MOVE_32_TO_32(TmpName, SourceRegion->Asl.Value.String);
+ Status = AcpiNsLookup (WalkState->ScopeInfo, TmpName,
+ AmlType, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node);
if (Status == AE_NOT_FOUND)
{
@@ -232,8 +236,9 @@
default:
+ ACPI_MOVE_32_TO_32(TmpPath, Child->Asl.Value.String);
Status = AcpiNsLookup (WalkState->ScopeInfo,
- Child->Asl.Value.String,
+ TmpPath,
ACPI_TYPE_LOCAL_REGION_FIELD,
ACPI_IMODE_LOAD_PASS1,
ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |