]> git.pld-linux.org Git - packages/acpica.git/blob - 0040-Support-S3PT-in-a-big-endian-world.patch
- initial update to 20221020
[packages/acpica.git] / 0040-Support-S3PT-in-a-big-endian-world.patch
1 From 9fc0e46189feb926b13713422ea2722e273a31b5 Mon Sep 17 00:00:00 2001
2 From: Al Stone <ahs3@redhat.com>
3 Date: Mon, 19 Oct 2020 17:30:30 -0400
4 Subject: [PATCH 40/45] Support S3PT in a big-endian world
5
6 ---
7  source/common/dmtbdump2.c  | 15 +++++++++------
8  source/compiler/dttable2.c |  4 +++-
9  2 files changed, 12 insertions(+), 7 deletions(-)
10
11 Index: acpica-unix2-20220331/source/common/dmtbdump2.c
12 ===================================================================
13 --- acpica-unix2-20220331.orig/source/common/dmtbdump2.c
14 +++ acpica-unix2-20220331/source/common/dmtbdump2.c
15 @@ -2495,6 +2495,8 @@ AcpiDmDumpS3pt (
16      ACPI_FPDT_HEADER        *Subtable;
17      ACPI_DMTABLE_INFO       *InfoTable;
18      ACPI_TABLE_S3PT         *S3ptTable = ACPI_CAST_PTR (ACPI_TABLE_S3PT, Tables);
19 +    UINT32                  S3ptTableLength = AcpiUtReadUint32 (&S3ptTable->Length);
20 +    UINT16                  SubtableType;
21  
22  
23      /* Main table */
24 @@ -2506,19 +2508,20 @@ AcpiDmDumpS3pt (
25      }
26  
27      Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, S3ptTable, Offset);
28 -    while (Offset < S3ptTable->Length)
29 +    while (Offset < S3ptTableLength)
30      {
31          /* Common subtable header */
32  
33          AcpiOsPrintf ("\n");
34 -        Status = AcpiDmDumpTable (S3ptTable->Length, Offset, Subtable,
35 +        Status = AcpiDmDumpTable (S3ptTableLength, Offset, Subtable,
36              Subtable->Length, AcpiDmTableInfoS3ptHdr);
37          if (ACPI_FAILURE (Status))
38          {
39              return 0;
40          }
41  
42 -        switch (Subtable->Type)
43 +        SubtableType = AcpiUtReadUint16 (&Subtable->Type);
44 +        switch (SubtableType)
45          {
46          case ACPI_S3PT_TYPE_RESUME:
47  
48 @@ -2533,7 +2536,7 @@ AcpiDmDumpS3pt (
49          default:
50  
51              AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n",
52 -                Subtable->Type);
53 +                SubtableType);
54  
55              /* Attempt to continue */
56  
57 @@ -2546,7 +2549,7 @@ AcpiDmDumpS3pt (
58          }
59  
60          AcpiOsPrintf ("\n");
61 -        Status = AcpiDmDumpTable (S3ptTable->Length, Offset, Subtable,
62 +        Status = AcpiDmDumpTable (S3ptTableLength, Offset, Subtable,
63              Subtable->Length, InfoTable);
64          if (ACPI_FAILURE (Status))
65          {
66 @@ -2560,7 +2563,7 @@ NextSubtable:
67          Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable, Subtable->Length);
68      }
69  
70 -    return (S3ptTable->Length);
71 +    return (S3ptTableLength);
72  }
73  
74  
75 Index: acpica-unix2-20220331/source/compiler/dttable2.c
76 ===================================================================
77 --- acpica-unix2-20220331.orig/source/compiler/dttable2.c
78 +++ acpica-unix2-20220331/source/compiler/dttable2.c
79 @@ -1803,6 +1803,7 @@ DtCompileS3pt (
80      DT_SUBTABLE             *ParentTable;
81      ACPI_DMTABLE_INFO       *InfoTable;
82      DT_FIELD                *SubtableStart;
83 +    UINT16                  S3ptHeaderType;
84  
85  
86      Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3pt,
87 @@ -1830,7 +1831,8 @@ DtCompileS3pt (
88  
89          S3ptHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
90  
91 -        switch (S3ptHeader->Type)
92 +        S3ptHeaderType = AcpiUtReadUint16 (&S3ptHeader->Type);
93 +        switch (S3ptHeaderType)
94          {
95          case ACPI_S3PT_TYPE_RESUME:
96  
This page took 0.068618 seconds and 3 git commands to generate.