d7f8eec1b2
Signed-off-by: Al Stone <ahs3@redhat.com>
163 lines
5.2 KiB
Diff
163 lines
5.2 KiB
Diff
Index: acpica-unix-20191018/source/common/dmtbdump.c
|
|
===================================================================
|
|
--- acpica-unix-20191018.orig/source/common/dmtbdump.c
|
|
+++ acpica-unix-20191018/source/common/dmtbdump.c
|
|
@@ -277,6 +277,8 @@ AcpiDmDumpRsdt (
|
|
UINT32 Entries;
|
|
UINT32 Offset;
|
|
UINT32 i;
|
|
+ UINT32 Length;
|
|
+ UINT32 Address;
|
|
|
|
|
|
/* Point to start of table pointer array */
|
|
@@ -286,12 +288,14 @@ AcpiDmDumpRsdt (
|
|
|
|
/* RSDT uses 32-bit pointers */
|
|
|
|
- Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT32);
|
|
+ ACPI_MOVE_32_TO_32(&Length, &Table->Length);
|
|
+ Entries = (Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT32);
|
|
|
|
for (i = 0; i < Entries; i++)
|
|
{
|
|
AcpiDmLineHeader2 (Offset, sizeof (UINT32), "ACPI Table Address", i);
|
|
- AcpiOsPrintf ("%8.8X\n", Array[i]);
|
|
+ ACPI_MOVE_32_TO_32(&Address, &Array[i]);
|
|
+ AcpiOsPrintf ("%8.8X\n", Address);
|
|
Offset += sizeof (UINT32);
|
|
}
|
|
}
|
|
@@ -317,6 +321,8 @@ AcpiDmDumpXsdt (
|
|
UINT32 Entries;
|
|
UINT32 Offset;
|
|
UINT32 i;
|
|
+ UINT32 Length;
|
|
+ UINT64 Address;
|
|
|
|
|
|
/* Point to start of table pointer array */
|
|
@@ -326,12 +332,14 @@ AcpiDmDumpXsdt (
|
|
|
|
/* XSDT uses 64-bit pointers */
|
|
|
|
- Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT64);
|
|
+ ACPI_MOVE_32_TO_32(&Length, &Table->Length);
|
|
+ Entries = (Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT64);
|
|
|
|
for (i = 0; i < Entries; i++)
|
|
{
|
|
AcpiDmLineHeader2 (Offset, sizeof (UINT64), "ACPI Table Address", i);
|
|
- AcpiOsPrintf ("%8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Array[i]));
|
|
+ ACPI_MOVE_64_TO_64(&Address, &Array[i]);
|
|
+ AcpiOsPrintf ("%8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Address));
|
|
Offset += sizeof (UINT64);
|
|
}
|
|
}
|
|
@@ -358,12 +366,12 @@ AcpiDmDumpFadt (
|
|
ACPI_TABLE_HEADER *Table)
|
|
{
|
|
ACPI_STATUS Status;
|
|
-
|
|
+ UINT32 Length;
|
|
|
|
/* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
|
|
- AcpiDmTableInfoFadt1);
|
|
+ ACPI_MOVE_32_TO_32(&Length, &Table->Length);
|
|
+ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFadt1);
|
|
if (ACPI_FAILURE (Status))
|
|
{
|
|
return;
|
|
@@ -371,11 +379,9 @@ AcpiDmDumpFadt (
|
|
|
|
/* Check for FADT revision 2 fields (ACPI 1.0B MS extensions) */
|
|
|
|
- if ((Table->Length > ACPI_FADT_V1_SIZE) &&
|
|
- (Table->Length <= ACPI_FADT_V2_SIZE))
|
|
+ if ((Length > ACPI_FADT_V1_SIZE) && (Length <= ACPI_FADT_V2_SIZE))
|
|
{
|
|
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
|
|
- AcpiDmTableInfoFadt2);
|
|
+ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFadt2);
|
|
if (ACPI_FAILURE (Status))
|
|
{
|
|
return;
|
|
@@ -384,10 +390,9 @@ AcpiDmDumpFadt (
|
|
|
|
/* Check for FADT revision 3/4 fields and up (ACPI 2.0+ extended data) */
|
|
|
|
- else if (Table->Length > ACPI_FADT_V2_SIZE)
|
|
+ else if (Length > ACPI_FADT_V2_SIZE)
|
|
{
|
|
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
|
|
- AcpiDmTableInfoFadt3);
|
|
+ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFadt3);
|
|
if (ACPI_FAILURE (Status))
|
|
{
|
|
return;
|
|
@@ -395,9 +400,9 @@ AcpiDmDumpFadt (
|
|
|
|
/* Check for FADT revision 5 fields and up (ACPI 5.0+) */
|
|
|
|
- if (Table->Length > ACPI_FADT_V3_SIZE)
|
|
+ if (Length > ACPI_FADT_V3_SIZE)
|
|
{
|
|
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
|
|
+ Status = AcpiDmDumpTable (Length, 0, Table, 0,
|
|
AcpiDmTableInfoFadt5);
|
|
if (ACPI_FAILURE (Status))
|
|
{
|
|
@@ -407,9 +412,9 @@ AcpiDmDumpFadt (
|
|
|
|
/* Check for FADT revision 6 fields and up (ACPI 6.0+) */
|
|
|
|
- if (Table->Length > ACPI_FADT_V3_SIZE)
|
|
+ if (Length > ACPI_FADT_V3_SIZE)
|
|
{
|
|
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
|
|
+ Status = AcpiDmDumpTable (Length, 0, Table, 0,
|
|
AcpiDmTableInfoFadt6);
|
|
if (ACPI_FAILURE (Status))
|
|
{
|
|
@@ -420,11 +425,11 @@ AcpiDmDumpFadt (
|
|
|
|
/* Validate various fields in the FADT, including length */
|
|
|
|
- AcpiTbCreateLocalFadt (Table, Table->Length);
|
|
+ AcpiTbCreateLocalFadt (Table, Length);
|
|
|
|
/* Validate FADT length against the revision */
|
|
|
|
- AcpiDmValidateFadtLength (Table->Revision, Table->Length);
|
|
+ AcpiDmValidateFadtLength (Table->Revision, Length);
|
|
}
|
|
|
|
|
|
@@ -450,6 +455,7 @@ AcpiDmValidateFadtLength (
|
|
UINT32 Length)
|
|
{
|
|
UINT32 ExpectedLength;
|
|
+ UINT32 Tmp32;
|
|
|
|
|
|
switch (Revision)
|
|
@@ -485,7 +491,8 @@ AcpiDmValidateFadtLength (
|
|
return;
|
|
}
|
|
|
|
- if (Length == ExpectedLength)
|
|
+ ACPI_MOVE_32_TO_32(&Tmp32, &Length);
|
|
+ if (Tmp32 == ExpectedLength)
|
|
{
|
|
return;
|
|
}
|
|
@@ -493,5 +500,5 @@ AcpiDmValidateFadtLength (
|
|
AcpiOsPrintf (
|
|
"\n// ACPI Warning: FADT revision %X does not match length: "
|
|
"found %X expected %X\n",
|
|
- Revision, Length, ExpectedLength);
|
|
+ Revision, Tmp32, ExpectedLength);
|
|
}
|