]>
Commit | Line | Data |
---|---|---|
1 | From b11d50752feb9f1b52db076d1fb4753b30a53642 Mon Sep 17 00:00:00 2001 | |
2 | From: Al Stone <ahs3@redhat.com> | |
3 | Date: Wed, 23 Sep 2020 12:49:52 -0600 | |
4 | Subject: [PATCH 23/45] Support SLIT in a big-endian world | |
5 | ||
6 | Signed-off-by: Al Stone <ahs3@redhat.com> | |
7 | --- | |
8 | source/common/dmtbdump3.c | 8 +++++--- | |
9 | source/compiler/dttable2.c | 2 +- | |
10 | 2 files changed, 6 insertions(+), 4 deletions(-) | |
11 | ||
12 | Index: acpica-unix2-20220331/source/common/dmtbdump3.c | |
13 | =================================================================== | |
14 | --- acpica-unix2-20220331.orig/source/common/dmtbdump3.c | |
15 | +++ acpica-unix2-20220331/source/common/dmtbdump3.c | |
16 | @@ -96,11 +96,12 @@ AcpiDmDumpSlit ( | |
17 | UINT32 Localities; | |
18 | UINT32 i; | |
19 | UINT32 j; | |
20 | + UINT32 TableLength = AcpiUtReadUint32 (&Table->Length); | |
21 | ||
22 | ||
23 | /* Main table */ | |
24 | ||
25 | - Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSlit); | |
26 | + Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoSlit); | |
27 | if (ACPI_FAILURE (Status)) | |
28 | { | |
29 | return; | |
30 | @@ -108,7 +109,8 @@ AcpiDmDumpSlit ( | |
31 | ||
32 | /* Display the Locality NxN Matrix */ | |
33 | ||
34 | - Localities = (UINT32) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount; | |
35 | + Localities = (UINT32) | |
36 | + AcpiUtReadUint64 (&ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount); | |
37 | Offset = ACPI_OFFSET (ACPI_TABLE_SLIT, Entry[0]); | |
38 | Row = (UINT8 *) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->Entry; | |
39 | ||
40 | @@ -121,7 +123,7 @@ AcpiDmDumpSlit ( | |
41 | { | |
42 | /* Check for beyond EOT */ | |
43 | ||
44 | - if (Offset >= Table->Length) | |
45 | + if (Offset >= TableLength) | |
46 | { | |
47 | AcpiOsPrintf ( | |
48 | "\n**** Not enough room in table for all localities\n"); | |
49 | Index: acpica-unix2-20220331/source/compiler/dttable2.c | |
50 | =================================================================== | |
51 | --- acpica-unix2-20220331.orig/source/compiler/dttable2.c | |
52 | +++ acpica-unix2-20220331/source/compiler/dttable2.c | |
53 | @@ -2234,7 +2234,7 @@ DtCompileSlit ( | |
54 | ParentTable = DtPeekSubtable (); | |
55 | DtInsertSubtable (ParentTable, Subtable); | |
56 | ||
57 | - Localities = *ACPI_CAST_PTR (UINT32, Subtable->Buffer); | |
58 | + Localities = (UINT32) AcpiUtReadUint64 (Subtable->Buffer); | |
59 | LocalityBuffer = UtLocalCalloc (Localities); | |
60 | LocalityListLength = 0; | |
61 |