Compare commits

..

No commits in common. "c9" and "c8" have entirely different histories.
c9 ... c8

93 changed files with 7870 additions and 9358 deletions

View File

@ -1,2 +1,2 @@
5b87f09fecda40cb089bdeb83e3a01d7615617dd SOURCES/acpica-unix2-20210604.tar_0.gz
1085e6c2a793cb2e3aca94c420e8300afe9eae59 SOURCES/acpitests-unix-20210604.tar.gz
f2467ae9c55ee4b24c21c0b06b402c6bdd444260 SOURCES/acpica-unix2-20180629.tar.gz
ccdf02b035f86624d0652b28580413ac2e21f6f6 SOURCES/acpitests-unix-20180629.tar.gz

4
.gitignore vendored
View File

@ -1,2 +1,2 @@
SOURCES/acpica-unix2-20210604.tar_0.gz
SOURCES/acpitests-unix-20210604.tar.gz
SOURCES/acpica-unix2-20180629.tar.gz
SOURCES/acpitests-unix-20180629.tar.gz

View File

@ -1,530 +0,0 @@
From 4594630ec2e6a33efce3047a86b08fa170b75848 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Thu, 15 Oct 2020 11:53:33 -0600
Subject: [PATCH 01/45] Add in basic infrastructure for big-endian support
This adds in some basic functions -- AcpiUtReadUint32(), for example,
to read a UINT32 value in little-endian form and return it in host-native
format -- along with AcpiUtWriteUint() that writes out an integer in
host-native format as a little-endian value.
But, to do that, I'm adding the functions in a new file: utendian.c. So,
the header files need fixing, and the makefiles need to be sure to compile
the new code. Further, UtIsBigEndianMachine() needed to be moved out of
compiler/aslutils.c so it could be used in the new functions and avoid
having to do some conditional compilation depending on endian-ness.
However, this sets things up for the future, where endian-aware code can
be added as the need is uncovered. For now, these functions cover all of
the cases I know about.
Signed-off-by: Al Stone <ahs3@redhat.com>
---
generate/unix/acpibin/Makefile | 1 +
generate/unix/acpidump/Makefile | 1 +
generate/unix/acpiexamples/Makefile | 1 +
generate/unix/acpiexec/Makefile | 1 +
generate/unix/acpihelp/Makefile | 1 +
generate/unix/iasl/Makefile | 1 +
source/compiler/aslcompiler.h | 4 -
source/compiler/aslutils.c | 27 ---
source/components/utilities/utendian.c | 236 +++++++++++++++++++++++++
source/include/acmacros.h | 56 ------
source/include/acutils.h | 32 ++++
source/include/platform/aclinux.h | 1 +
12 files changed, 275 insertions(+), 87 deletions(-)
create mode 100644 source/components/utilities/utendian.c
Index: acpica-unix2-20210604/generate/unix/acpibin/Makefile
===================================================================
--- acpica-unix2-20210604.orig/generate/unix/acpibin/Makefile
+++ acpica-unix2-20210604/generate/unix/acpibin/Makefile
@@ -37,6 +37,7 @@ OBJECTS = \
$(OBJDIR)/utcache.o\
$(OBJDIR)/utdebug.o\
$(OBJDIR)/utdecode.o\
+ $(OBJDIR)/utendian.o\
$(OBJDIR)/utexcep.o\
$(OBJDIR)/utglobal.o\
$(OBJDIR)/utlock.o\
Index: acpica-unix2-20210604/generate/unix/acpidump/Makefile
===================================================================
--- acpica-unix2-20210604.orig/generate/unix/acpidump/Makefile
+++ acpica-unix2-20210604/generate/unix/acpidump/Makefile
@@ -36,6 +36,7 @@ OBJECTS = \
$(OBJDIR)/osunixdir.o\
$(OBJDIR)/osunixmap.o\
$(OBJDIR)/osunixxf.o\
+ $(OBJDIR)/utendian.o\
$(OBJDIR)/tbprint.o\
$(OBJDIR)/tbxfroot.o\
$(OBJDIR)/utascii.o\
Index: acpica-unix2-20210604/generate/unix/acpiexamples/Makefile
===================================================================
--- acpica-unix2-20210604.orig/generate/unix/acpiexamples/Makefile
+++ acpica-unix2-20210604/generate/unix/acpiexamples/Makefile
@@ -139,6 +139,7 @@ OBJECTS = \
$(OBJDIR)/utdebug.o\
$(OBJDIR)/utdecode.o\
$(OBJDIR)/utdelete.o\
+ $(OBJDIR)/utendian.o\
$(OBJDIR)/uterror.o\
$(OBJDIR)/uteval.o\
$(OBJDIR)/utexcep.o\
Index: acpica-unix2-20210604/generate/unix/acpiexec/Makefile
===================================================================
--- acpica-unix2-20210604.orig/generate/unix/acpiexec/Makefile
+++ acpica-unix2-20210604/generate/unix/acpiexec/Makefile
@@ -214,6 +214,7 @@ OBJECTS = \
$(OBJDIR)/utdebug.o\
$(OBJDIR)/utdecode.o\
$(OBJDIR)/utdelete.o\
+ $(OBJDIR)/utendian.o\
$(OBJDIR)/uterror.o\
$(OBJDIR)/uteval.o\
$(OBJDIR)/utexcep.o\
Index: acpica-unix2-20210604/generate/unix/acpihelp/Makefile
===================================================================
--- acpica-unix2-20210604.orig/generate/unix/acpihelp/Makefile
+++ acpica-unix2-20210604/generate/unix/acpihelp/Makefile
@@ -45,6 +45,7 @@ OBJECTS = \
$(OBJDIR)/getopt.o\
$(OBJDIR)/osunixxf.o\
$(OBJDIR)/utdebug.o\
+ $(OBJDIR)/utendian.o\
$(OBJDIR)/utexcep.o\
$(OBJDIR)/utglobal.o\
$(OBJDIR)/uthex.o\
Index: acpica-unix2-20210604/generate/unix/iasl/Makefile
===================================================================
--- acpica-unix2-20210604.orig/generate/unix/iasl/Makefile
+++ acpica-unix2-20210604/generate/unix/iasl/Makefile
@@ -225,6 +225,7 @@ OBJECTS = \
$(OBJDIR)/utdebug.o\
$(OBJDIR)/utdecode.o\
$(OBJDIR)/utdelete.o\
+ $(OBJDIR)/utendian.o\
$(OBJDIR)/uterror.o\
$(OBJDIR)/utexcep.o\
$(OBJDIR)/utglobal.o\
Index: acpica-unix2-20210604/source/compiler/aslcompiler.h
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/aslcompiler.h
+++ acpica-unix2-20210604/source/compiler/aslcompiler.h
@@ -1120,10 +1120,6 @@ BOOLEAN
UtIsIdInteger (
UINT8 *Target);
-UINT8
-UtIsBigEndianMachine (
- void);
-
BOOLEAN
UtQueryForOverwrite (
char *Pathname);
Index: acpica-unix2-20210604/source/compiler/aslutils.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/aslutils.c
+++ acpica-unix2-20210604/source/compiler/aslutils.c
@@ -73,33 +73,6 @@ UtDisplayErrorSummary (
/*******************************************************************************
*
- * FUNCTION: UtIsBigEndianMachine
- *
- * PARAMETERS: None
- *
- * RETURN: TRUE if machine is big endian
- * FALSE if machine is little endian
- *
- * DESCRIPTION: Detect whether machine is little endian or big endian.
- *
- ******************************************************************************/
-
-UINT8
-UtIsBigEndianMachine (
- void)
-{
- union {
- UINT32 Integer;
- UINT8 Bytes[4];
- } Overlay = {0xFF000000};
-
-
- return (Overlay.Bytes[0]); /* Returns 0xFF (TRUE) for big endian */
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: UtIsIdInteger
*
* PARAMETERS: Pointer to an ACPI ID (HID, CID) string
Index: acpica-unix2-20210604/source/components/utilities/utendian.c
===================================================================
--- /dev/null
+++ acpica-unix2-20210604/source/components/utilities/utendian.c
@@ -0,0 +1,236 @@
+/******************************************************************************
+ *
+ * Module Name: utendian -- byte swapping support for other-endianness
+ *
+ *****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Copyright (c) 2020, Al Stone <ahs3@redhat.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Alternatively, you may choose to be licensed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ *****************************************************************************/
+
+#include "acpi.h"
+#include "accommon.h"
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("utendian")
+
+/*
+ * Endianness support functions.
+ *
+ * Ultimately, everything in ACPI tables or AML must be in little-endian
+ * format. However, we sometimes find it necessary to run on a big-endian
+ * machine and create or read those little-endian values. This is a small
+ * libary of functions to make that easier, and more visible.
+ *
+ */
+
+/*******************************************************************************
+ *
+ * FUNCTION: UtIsBigEndianMachine
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: TRUE if machine is big endian
+ * FALSE if machine is little endian
+ *
+ * DESCRIPTION: Detect whether machine is little endian or big endian.
+ *
+ ******************************************************************************/
+
+UINT8
+UtIsBigEndianMachine (
+ void)
+{
+ union {
+ UINT32 Integer;
+ UINT8 Bytes[4];
+ } Overlay = {0xFF000000};
+
+
+ return (Overlay.Bytes[0]); /* Returns 0xFF (TRUE) for big endian */
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtReadUint16
+ *
+ * PARAMETERS: Src - location containing the little-endian
+ * value
+ *
+ * RETURN: UINT16 value in host-native form
+ *
+ * DESCRIPTION: Read a UINT16 little-endian value from a given location
+ * and return it in host-native form
+ *
+ ******************************************************************************/
+
+UINT16
+AcpiUtReadUint16 (
+ void *SrcPtr)
+{
+ UINT16 Result = 0;
+ UINT8 *Dst = (UINT8 *) &Result;
+ UINT8 *Src = (UINT8 *) SrcPtr;
+
+ if (!UtIsBigEndianMachine())
+ {
+ return (*(UINT16 *) SrcPtr);
+ }
+
+ Dst[0] = Src[1];
+ Dst[1] = Src[0];
+
+ return (Result);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtReadUint32
+ *
+ * PARAMETERS: Src - location containing the little-endian
+ * value
+ *
+ * RETURN: UINT32 value in host-native form
+ *
+ * DESCRIPTION: Read a UINT32 little-endian value from a given location
+ * and return it in host-native form
+ *
+ ******************************************************************************/
+
+UINT32
+AcpiUtReadUint32 (
+ void *SrcPtr)
+{
+ UINT32 Result = 0;
+ UINT8 *Dst = (UINT8 *) &Result;
+ UINT8 *Src = (UINT8 *) SrcPtr;
+
+ if (!UtIsBigEndianMachine())
+ {
+ return (*(UINT32 *) SrcPtr);
+ }
+
+ Dst[0] = Src[3];
+ Dst[1] = Src[2];
+ Dst[2] = Src[1];
+ Dst[3] = Src[0];
+
+ return (Result);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtReadUint64
+ *
+ * PARAMETERS: Src - location containing the little-endian
+ * value
+ *
+ * RETURN: UINT64 value in host-native form
+ *
+ * DESCRIPTION: Read a UINT64 little-endian value from a given location
+ * and return it in host-native form
+ *
+ ******************************************************************************/
+
+UINT64
+AcpiUtReadUint64 (
+ void *SrcPtr)
+{
+ UINT64 Result = 0;
+ UINT8 *Dst = (UINT8 *) &Result;
+ UINT8 *Src = (UINT8 *) SrcPtr;
+
+ if (!UtIsBigEndianMachine())
+ {
+ return (*(UINT64 *) SrcPtr);
+ }
+
+ Dst[0] = Src[7];
+ Dst[1] = Src[6];
+ Dst[2] = Src[5];
+ Dst[3] = Src[4];
+ Dst[4] = Src[3];
+ Dst[5] = Src[2];
+ Dst[6] = Src[1];
+ Dst[7] = Src[0];
+
+ return (Result);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtWriteUint
+ *
+ * PARAMETERS: DstPtr - where to place the retrieved value
+ * DstLength - space in bytes for this int type
+ * SrcPtr - where the little-endian value lives
+ * SrcLength - space in bytes for this int type
+ *
+ * RETURN: None.
+ *
+ * DESCRIPTION: Write a host-native integer value of the given size, and
+ * store it in the location specified in little-endian form.
+ * Given the amount of integer type casting done, this general
+ * version seems the most useful (vs 32->32, 32->16, 16->32,
+ * ad infinitum)
+ *
+ ******************************************************************************/
+
+void
+AcpiUtWriteUint (
+ void *DstPtr,
+ int DstLength,
+ const void *SrcPtr,
+ const int SrcLength)
+{
+ UINT8 *Dst = (UINT8 *) DstPtr;
+ UINT8 *Src = (UINT8 *) SrcPtr;
+ int Length;
+ int ii;
+
+ if (!UtIsBigEndianMachine())
+ {
+ Length = SrcLength > DstLength ? DstLength : SrcLength;
+ memcpy (Dst, Src, Length);
+ return;
+ }
+
+ Length = SrcLength >= DstLength ? DstLength : SrcLength;
+ for (ii = 0; ii < Length; ii++)
+ Dst[ii] = Src[SrcLength - ii - 1];
+
+}
Index: acpica-unix2-20210604/source/include/acmacros.h
===================================================================
--- acpica-unix2-20210604.orig/source/include/acmacros.h
+++ acpica-unix2-20210604/source/include/acmacros.h
@@ -76,61 +76,6 @@
* If the hardware supports the transfer of unaligned data, just do the store.
* Otherwise, we have to move one byte at a time.
*/
-#ifdef ACPI_BIG_ENDIAN
-/*
- * Macros for big-endian machines
- */
-
-/* These macros reverse the bytes during the move, converting little-endian to big endian */
-
- /* Big Endian <== Little Endian */
- /* Hi...Lo Lo...Hi */
-/* 16-bit source, 16/32/64 destination */
-
-#define ACPI_MOVE_16_TO_16(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[1];\
- (( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[0];}
-
-#define ACPI_MOVE_16_TO_32(d, s) {(*(UINT32 *)(void *)(d))=0;\
- ((UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[1];\
- ((UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[0];}
-
-#define ACPI_MOVE_16_TO_64(d, s) {(*(UINT64 *)(void *)(d))=0;\
- ((UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[1];\
- ((UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[0];}
-
-/* 32-bit source, 16/32/64 destination */
-
-#define ACPI_MOVE_32_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */
-
-#define ACPI_MOVE_32_TO_32(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[3];\
- (( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[2];\
- (( UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[1];\
- (( UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[0];}
-
-#define ACPI_MOVE_32_TO_64(d, s) {(*(UINT64 *)(void *)(d))=0;\
- ((UINT8 *)(void *)(d))[4] = ((UINT8 *)(void *)(s))[3];\
- ((UINT8 *)(void *)(d))[5] = ((UINT8 *)(void *)(s))[2];\
- ((UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[1];\
- ((UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[0];}
-
-/* 64-bit source, 16/32/64 destination */
-
-#define ACPI_MOVE_64_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */
-
-#define ACPI_MOVE_64_TO_32(d, s) ACPI_MOVE_32_TO_32(d, s) /* Truncate to 32 */
-
-#define ACPI_MOVE_64_TO_64(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[7];\
- (( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[6];\
- (( UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[5];\
- (( UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[4];\
- (( UINT8 *)(void *)(d))[4] = ((UINT8 *)(void *)(s))[3];\
- (( UINT8 *)(void *)(d))[5] = ((UINT8 *)(void *)(s))[2];\
- (( UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[1];\
- (( UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[0];}
-#else
-/*
- * Macros for little-endian machines
- */
#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
@@ -193,7 +138,6 @@
(( UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[6];\
(( UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[7];}
#endif
-#endif
/*
Index: acpica-unix2-20210604/source/include/acutils.h
===================================================================
--- acpica-unix2-20210604.orig/source/include/acutils.h
+++ acpica-unix2-20210604/source/include/acutils.h
@@ -1167,4 +1167,36 @@ AcpiUtConvertUuidToString (
char *OutString);
#endif
+
+/*
+ * utendian -- byte-swapping for big-endian support
+ */
+
+UINT8
+UtIsBigEndianMachine (
+ void);
+
+#if defined(ACPI_ASL_COMPILER) || defined(ACPI_EXEC_APP) || \
+ defined(ACPI_HELP_APP) || defined(ACPI_DUMP_APP) || \
+ defined(ACPI_EXAMPLE_APP) || defined(ACPI_BIN_APP)
+UINT32
+AcpiUtReadUint32 (
+ void *SrcPtr);
+
+UINT16
+AcpiUtReadUint16 (
+ void *SrcPtr);
+
+UINT64
+AcpiUtReadUint64 (
+ void *SrcPtr);
+
+void
+AcpiUtWriteUint (
+ void *DstPtr,
+ int DstLength,
+ const void *SrcPtr,
+ const int SrcLength);
+#endif
+
#endif /* _ACUTILS_H */
Index: acpica-unix2-20210604/source/include/platform/aclinux.h
===================================================================
--- acpica-unix2-20210604.orig/source/include/platform/aclinux.h
+++ acpica-unix2-20210604/source/include/platform/aclinux.h
@@ -198,6 +198,7 @@
#ifdef ACPI_USE_STANDARD_HEADERS
#include <unistd.h>
+#include <endian.h>
#endif
/* Define/disable kernel-specific declarators */

View File

@ -1,200 +0,0 @@
From 51b0d06c0a6c4d4e19432ebf930299855c8fcf23 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Fri, 18 Sep 2020 15:14:30 -0600
Subject: [PATCH 02/45] Modify utility functions to be endian-agnostic
All of the modifications here use the big-endian code previously added
(see utendian.c) to make themselves endian-agnostic; i.e., that the code
does not need to change further to work on both big- and little-endian
machines.
These particular files were changed to handle the reading and writing
of files (the length is often embedded in the binary stream), and to
handle the reading and writing of integer values. The common cases are
to "read" a 32-bit unsigned int in little-endian format, but convert it
to host-native, and to write a byte, word, double word or quad word value
as little-endian, regardless of host-native format.
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/acfileio.c | 16 ++++++++++------
source/common/dmtable.c | 8 ++++----
source/compiler/dtfield.c | 2 +-
source/compiler/dtsubtable.c | 4 ++--
source/components/tables/tbprint.c | 13 +++++++++----
5 files changed, 26 insertions(+), 17 deletions(-)
Index: acpica-unix2-20210604/source/common/acfileio.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/acfileio.c
+++ acpica-unix2-20210604/source/common/acfileio.c
@@ -280,6 +280,7 @@ AcGetOneTableFromFile (
ACPI_TABLE_HEADER *Table;
INT32 Count;
long TableOffset;
+ UINT32 Length;
*ReturnTable = NULL;
@@ -319,7 +320,8 @@ AcGetOneTableFromFile (
/* Allocate a buffer for the entire table */
- Table = AcpiOsAllocate ((ACPI_SIZE) TableHeader.Length);
+ Length = AcpiUtReadUint32 (&TableHeader.Length);
+ Table = AcpiOsAllocate ((ACPI_SIZE) Length);
if (!Table)
{
return (AE_NO_MEMORY);
@@ -329,13 +331,13 @@ AcGetOneTableFromFile (
fseek (File, TableOffset, SEEK_SET);
- Count = fread (Table, 1, TableHeader.Length, File);
+ Count = fread (Table, 1, Length, File);
/*
* Checks for data table headers happen later in the execution. Only verify
* for Aml tables at this point in the code.
*/
- if (GetOnlyAmlTables && Count != (INT32) TableHeader.Length)
+ if (GetOnlyAmlTables && Count != (INT32) Length)
{
Status = AE_ERROR;
goto ErrorExit;
@@ -343,7 +345,7 @@ AcGetOneTableFromFile (
/* Validate the checksum (just issue a warning) */
- Status = AcpiTbVerifyChecksum (Table, TableHeader.Length);
+ Status = AcpiTbVerifyChecksum (Table, Length);
if (ACPI_FAILURE (Status))
{
Status = AcCheckTextModeCorruption (Table);
@@ -436,6 +438,7 @@ AcValidateTableHeader (
long OriginalOffset;
UINT32 FileSize;
UINT32 i;
+ UINT32 Length;
ACPI_FUNCTION_TRACE (AcValidateTableHeader);
@@ -467,11 +470,12 @@ AcValidateTableHeader (
/* Validate table length against bytes remaining in the file */
FileSize = CmGetFileSize (File);
- if (TableHeader.Length > (UINT32) (FileSize - TableOffset))
+ Length = AcpiUtReadUint32 (&TableHeader.Length);
+ if (Length > (UINT32) (FileSize - TableOffset))
{
fprintf (stderr, "Table [%4.4s] is too long for file - "
"needs: 0x%.2X, remaining in file: 0x%.2X\n",
- TableHeader.Signature, TableHeader.Length,
+ TableHeader.Signature, Length,
(UINT32) (FileSize - TableOffset));
return (AE_BAD_HEADER);
}
Index: acpica-unix2-20210604/source/common/dmtable.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtable.c
+++ acpica-unix2-20210604/source/common/dmtable.c
@@ -591,7 +591,7 @@ AcpiDmDumpDataTable (
{
/* Dump the raw table data */
- Length = Table->Length;
+ Length = AcpiUtReadUint32 (&Table->Length);
AcpiOsPrintf ("\n/*\n%s: Length %d (0x%X)\n\n",
ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
@@ -608,7 +608,7 @@ AcpiDmDumpDataTable (
*/
if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_FACS))
{
- Length = Table->Length;
+ Length = AcpiUtReadUint32 (&Table->Length);
Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);
if (ACPI_FAILURE (Status))
{
@@ -628,7 +628,7 @@ AcpiDmDumpDataTable (
/*
* All other tables must use the common ACPI table header, dump it now
*/
- Length = Table->Length;
+ Length = AcpiUtReadUint32(&Table->Length);
Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHeader);
if (ACPI_FAILURE (Status))
{
@@ -1262,7 +1262,7 @@ AcpiDmDumpTable (
AcpiOsPrintf ("%2.2X", *Target);
Temp8 = AcpiDmGenerateChecksum (Table,
- ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
+ AcpiUtReadUint32 (&(ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length)),
ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);
if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum)
Index: acpica-unix2-20210604/source/compiler/dtfield.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dtfield.c
+++ acpica-unix2-20210604/source/compiler/dtfield.c
@@ -361,7 +361,7 @@ DtCompileInteger (
DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, AslGbl_MsgBuffer);
}
- memcpy (Buffer, &Value, ByteLength);
+ AcpiUtWriteUint (Buffer, ByteLength, &Value, sizeof (UINT64));
return;
}
Index: acpica-unix2-20210604/source/compiler/dtsubtable.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dtsubtable.c
+++ acpica-unix2-20210604/source/compiler/dtsubtable.c
@@ -378,6 +378,6 @@ DtSetSubtableLength (
return;
}
- memcpy (Subtable->LengthField, &Subtable->TotalLength,
- Subtable->SizeOfLengthField);
+ AcpiUtWriteUint (Subtable->LengthField, Subtable->SizeOfLengthField,
+ &Subtable->TotalLength, sizeof (Subtable->TotalLength));
}
Index: acpica-unix2-20210604/source/components/tables/tbprint.c
===================================================================
--- acpica-unix2-20210604.orig/source/components/tables/tbprint.c
+++ acpica-unix2-20210604/source/components/tables/tbprint.c
@@ -44,6 +44,8 @@
#include "acpi.h"
#include "accommon.h"
#include "actables.h"
+#include "platform/acenv.h"
+#include "acutils.h"
#define _COMPONENT ACPI_TABLES
ACPI_MODULE_NAME ("tbprint")
@@ -151,7 +153,7 @@ AcpiTbPrintTableHeader (
ACPI_INFO (("%-4.4s 0x%8.8X%8.8X %06X",
Header->Signature, ACPI_FORMAT_UINT64 (Address),
- Header->Length));
+ AcpiUtReadUint32 (&Header->Length)));
}
else if (ACPI_VALIDATE_RSDP_SIG (Header->Signature))
{
@@ -178,9 +180,12 @@ AcpiTbPrintTableHeader (
"%-4.4s 0x%8.8X%8.8X"
" %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)",
LocalHeader.Signature, ACPI_FORMAT_UINT64 (Address),
- LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId,
- LocalHeader.OemTableId, LocalHeader.OemRevision,
- LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision));
+ AcpiUtReadUint32 (&LocalHeader.Length),
+ LocalHeader.Revision, LocalHeader.OemId,
+ LocalHeader.OemTableId,
+ AcpiUtReadUint32 (&LocalHeader.OemRevision),
+ LocalHeader.AslCompilerId,
+ AcpiUtReadUint32 (&LocalHeader.AslCompilerRevision)));
}
}

View File

@ -1,45 +0,0 @@
From 62cc2f4ae212bd0fad83f643921ac216ebb9a986 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Fri, 18 Sep 2020 15:20:37 -0600
Subject: [PATCH 03/45] Always display table header content in human-readable
form
When comparing two binary data tables, little-endian values are read
from each table header and printed out. Make sure they show up in a
form that makes sense to humans.
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/tools/acpibin/abcompare.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Index: acpica-unix2-20210604/source/tools/acpibin/abcompare.c
===================================================================
--- acpica-unix2-20210604.orig/source/tools/acpibin/abcompare.c
+++ acpica-unix2-20210604/source/tools/acpibin/abcompare.c
@@ -42,6 +42,7 @@
*/
#include "acpibin.h"
+#include "acutils.h"
ACPI_TABLE_HEADER Header1;
@@ -179,14 +180,14 @@ AbPrintHeadersInfo (
/* Display header information for both headers */
printf ("Signature %8.4s : %4.4s\n", Header->Signature, Header2->Signature);
- printf ("Length %8.8X : %8.8X\n", Header->Length, Header2->Length);
+ printf ("Length %8.8X : %8.8X\n", AcpiUtReadUint32 (&Header->Length), AcpiUtReadUint32 (&Header2->Length));
printf ("Revision %8.2X : %2.2X\n", Header->Revision, Header2->Revision);
printf ("Checksum %8.2X : %2.2X\n", Header->Checksum, Header2->Checksum);
printf ("OEM ID %8.6s : %.6s\n", Header->OemId, Header2->OemId);
printf ("OEM Table ID %8.8s : %.8s\n", Header->OemTableId, Header2->OemTableId);
- printf ("OEM Revision %8.8X : %8.8X\n", Header->OemRevision, Header2->OemRevision);
+ printf ("OEM Revision %8.8X : %8.8X\n", AcpiUtReadUint32 (&Header->OemRevision), AcpiUtReadUint32 (&Header2->OemRevision));
printf ("ASL Compiler ID %8.4s : %.4s\n", Header->AslCompilerId, Header2->AslCompilerId);
- printf ("Compiler Revision %8.8X : %8.8X\n", Header->AslCompilerRevision, Header2->AslCompilerRevision);
+ printf ("Compiler Revision %8.8X : %8.8X\n", AcpiUtReadUint32 (&Header->AslCompilerRevision), AcpiUtReadUint32 (&Header2->AslCompilerRevision));
printf ("\n");
}

View File

@ -1,78 +0,0 @@
From 16734feab4204d6930c1ede62e527920607daace Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Wed, 16 Sep 2020 16:27:06 -0600
Subject: [PATCH 04/45] Re-enable support for big-endian machines
First, disable the big-endian check and fail. Then, make sure the
namespace gets initialized properly (NB: needed even if we are only
compiling/disassembling data tables).
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/compiler/aslmain.c | 12 ------------
source/components/namespace/nsutils.c | 7 +++++--
2 files changed, 5 insertions(+), 14 deletions(-)
Index: acpica-unix2-20210604/source/compiler/aslmain.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/aslmain.c
+++ acpica-unix2-20210604/source/compiler/aslmain.c
@@ -101,18 +101,6 @@ main (
signal (SIGINT, AslSignalHandler);
- /*
- * Big-endian machines are not currently supported. ACPI tables must
- * be little-endian, and support for big-endian machines needs to
- * be implemented.
- */
- if (UtIsBigEndianMachine ())
- {
- fprintf (stderr,
- "iASL is not currently supported on big-endian machines.\n");
- return (-1);
- }
-
AcpiOsInitialize ();
ACPI_DEBUG_INITIALIZE (); /* For debug version only */
Index: acpica-unix2-20210604/source/components/namespace/nsutils.c
===================================================================
--- acpica-unix2-20210604.orig/source/components/namespace/nsutils.c
+++ acpica-unix2-20210604/source/components/namespace/nsutils.c
@@ -272,6 +272,7 @@ AcpiNsBuildInternalName (
const char *ExternalName = Info->NextExternalChar;
char *Result = NULL;
UINT32 i;
+ char TmpSeg[ACPI_NAMESEG_SIZE+1];
ACPI_FUNCTION_TRACE (NsBuildInternalName);
@@ -335,6 +336,7 @@ AcpiNsBuildInternalName (
for (; NumSegments; NumSegments--)
{
+ memset (TmpSeg, 0, ACPI_NAMESEG_SIZE+1);
for (i = 0; i < ACPI_NAMESEG_SIZE; i++)
{
if (ACPI_IS_PATH_SEPARATOR (*ExternalName) ||
@@ -342,16 +344,17 @@ AcpiNsBuildInternalName (
{
/* Pad the segment with underscore(s) if segment is short */
- Result[i] = '_';
+ TmpSeg[i] = '_';
}
else
{
/* Convert the character to uppercase and save it */
- Result[i] = (char) toupper ((int) *ExternalName);
+ TmpSeg[i] = (char) toupper ((int) *ExternalName);
ExternalName++;
}
}
+ AcpiUtWriteUint (Result, ACPI_NAMESEG_SIZE, TmpSeg, ACPI_NAMESEG_SIZE);
/* Now we must have a path separator, or the pathname is bad */

View File

@ -1,41 +0,0 @@
From 055fee09d8f9244b6c437ad18b98edb81a87e8bc Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Tue, 27 Oct 2020 17:50:52 -0600
Subject: [PATCH 05/45] Correct an endian-ness problem when converting ASL to
ASL+
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/compiler/cvparser.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: acpica-unix2-20210604/source/compiler/cvparser.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/cvparser.c
+++ acpica-unix2-20210604/source/compiler/cvparser.c
@@ -144,6 +144,7 @@ CvInitFileTree (
char *ChildFilename = NULL;
UINT8 *AmlStart;
UINT32 AmlLength;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
if (!AcpiGbl_CaptureComments)
@@ -152,7 +153,7 @@ CvInitFileTree (
}
- AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER);
+ AmlLength = TableLength - sizeof (ACPI_TABLE_HEADER);
AmlStart = ((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER));
CvDbgPrint ("AmlLength: %x\n", AmlLength);
@@ -162,7 +163,7 @@ CvInitFileTree (
AcpiGbl_FileTreeRoot = AcpiOsAcquireObject (AcpiGbl_FileCache);
AcpiGbl_FileTreeRoot->FileStart = (char *)(AmlStart);
- AcpiGbl_FileTreeRoot->FileEnd = (char *)(AmlStart + Table->Length);
+ AcpiGbl_FileTreeRoot->FileEnd = (char *)(AmlStart + TableLength);
AcpiGbl_FileTreeRoot->Next = NULL;
AcpiGbl_FileTreeRoot->Parent = NULL;
AcpiGbl_FileTreeRoot->Filename = (char *)(AmlStart+2);

View File

@ -1,32 +0,0 @@
From 790c016107e98ded2d0ae579f84dd4cd3fa06587 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Tue, 29 Jun 2021 17:48:31 -0600
Subject: [PATCH 06/45] Use more reliable ACPI_COPY_NAMSEG in GPE name checks
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/compiler/aslanalyze.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: acpica-unix2-20210604/source/compiler/aslanalyze.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/aslanalyze.c
+++ acpica-unix2-20210604/source/compiler/aslanalyze.c
@@ -469,7 +469,7 @@ ApCheckForGpeNameConflict (
/* Need a null-terminated string version of NameSeg */
- ACPI_MOVE_32_TO_32 (Name, Op->Asl.NameSeg);
+ ACPI_COPY_NAMESEG (Name, Op->Asl.NameSeg);
Name[ACPI_NAMESEG_SIZE] = 0;
/*
@@ -496,7 +496,7 @@ ApCheckForGpeNameConflict (
* We are now sure we have an _Lxx or _Exx.
* Create the target name that would cause collision (Flip E/L)
*/
- ACPI_MOVE_32_TO_32 (Target, Name);
+ ACPI_COPY_NAMESEG (Target, Name);
/* Inject opposite letter ("L" versus "E") */

View File

@ -1,53 +0,0 @@
From 9a4a32c597fcdfa8a3bc33230c40a18e39c3449d Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Thu, 1 Jul 2021 17:46:19 -0600
Subject: [PATCH 07/45] Handle dumping Unicode properly when big-endian
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump.c
+++ acpica-unix2-20210604/source/common/dmtbdump.c
@@ -146,6 +146,8 @@ AcpiDmDumpUnicode (
UINT8 *Buffer;
UINT32 Length;
UINT32 i;
+ UINT16 Tmp16;
+ UINT32 start;
Buffer = ((UINT8 *) Table) + BufferOffset;
@@ -155,7 +157,8 @@ AcpiDmDumpUnicode (
for (i = 0; i < Length; i += 2)
{
- if (!isprint (Buffer[i]))
+ Tmp16 = AcpiUtReadUint16 (&Buffer[i]);
+ if (!isprint (Tmp16))
{
goto DumpRawBuffer;
}
@@ -163,7 +166,8 @@ AcpiDmDumpUnicode (
/* Ensure all high bytes are zero */
- for (i = 1; i < Length; i += 2)
+ start = UtIsBigEndianMachine() ? 0 : 1;
+ for (i = start; i < Length; i += 2)
{
if (Buffer[i])
{
@@ -176,7 +180,8 @@ AcpiDmDumpUnicode (
AcpiOsPrintf ("\"");
for (i = 0; i < Length; i += 2)
{
- AcpiOsPrintf ("%c", Buffer[i]);
+ Tmp16 = AcpiUtReadUint16 (&Buffer[i]);
+ AcpiOsPrintf ("%c", Tmp16);
}
AcpiOsPrintf ("\"\n");

View File

@ -1,32 +0,0 @@
From 7b107ab7348d903108140f6033e90596b12325c4 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Thu, 15 Oct 2020 12:12:11 -0600
Subject: [PATCH 08/45] Support MADT (aka APIC) in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -763,7 +763,7 @@ AcpiDmDumpMadt (
{
ACPI_STATUS Status;
ACPI_SUBTABLE_HEADER *Subtable;
- UINT32 Length = Table->Length;
+ UINT32 Length = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_MADT);
ACPI_DMTABLE_INFO *InfoTable;
@@ -779,7 +779,7 @@ AcpiDmDumpMadt (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < Length)
{
/* Common subtable header */

View File

@ -1,55 +0,0 @@
From ce811b4c38b9a09533ee8bafa22813f6e43c023d Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Fri, 18 Sep 2020 16:41:02 -0600
Subject: [PATCH 09/45] Support ASF! tables in a big-endian world
Read the table length properly and it all works right for big-endian.
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump1.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump1.c
+++ acpica-unix2-20210604/source/common/dmtbdump1.c
@@ -79,16 +79,18 @@ AcpiDmDumpAsf (
UINT32 DataOffset = 0;
UINT32 i;
UINT8 Type;
+ UINT32 TableLength;
/* No main table, only subtables */
Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
- while (Offset < Table->Length)
+ TableLength = AcpiUtReadUint32 (&Table->Length);
+ while (Offset < TableLength)
{
/* Common subtable header */
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
Subtable->Header.Length, AcpiDmTableInfoAsfHdr);
if (ACPI_FAILURE (Status))
{
@@ -146,7 +148,7 @@ AcpiDmDumpAsf (
return;
}
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
Subtable->Header.Length, InfoTable);
if (ACPI_FAILURE (Status))
{
@@ -163,7 +165,7 @@ AcpiDmDumpAsf (
for (i = 0; i < DataCount; i++)
{
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, DataOffset,
+ Status = AcpiDmDumpTable (TableLength, DataOffset,
DataTable, DataLength, DataInfoTable);
if (ACPI_FAILURE (Status))
{

View File

@ -1,32 +0,0 @@
From 0c4be57a5e0e45b4197c2d9a0b26462d3b1a9b80 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Fri, 18 Sep 2020 16:54:13 -0600
Subject: [PATCH 10/45] Support CPEP tables in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump1.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump1.c
+++ acpica-unix2-20210604/source/common/dmtbdump1.c
@@ -319,7 +319,7 @@ AcpiDmDumpCpep (
{
ACPI_STATUS Status;
ACPI_CPEP_POLLING *Subtable;
- UINT32 Length = Table->Length;
+ UINT32 Length = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_CPEP);
@@ -334,7 +334,7 @@ AcpiDmDumpCpep (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < Length)
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, Subtable,

View File

@ -1,256 +0,0 @@
From 2cb0b87a15682da4f19f707fa3ffece504f94b5a Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Sat, 19 Sep 2020 13:37:38 -0600
Subject: [PATCH 11/45] Support DBG2 table in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump1.c | 37 ++++++++++++++++++--------------
source/compiler/dttable1.c | 43 ++++++++++++++++++++++++--------------
2 files changed, 48 insertions(+), 32 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump1.c
+++ acpica-unix2-20210604/source/common/dmtbdump1.c
@@ -374,7 +374,7 @@ AcpiDmDumpCsrt (
ACPI_CSRT_GROUP *Subtable;
ACPI_CSRT_SHARED_INFO *SharedInfoTable;
ACPI_CSRT_DESCRIPTOR *SubSubtable;
- UINT32 Length = Table->Length;
+ UINT32 Length = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_CSRT);
UINT32 SubOffset;
UINT32 SubSubOffset;
@@ -386,7 +386,7 @@ AcpiDmDumpCsrt (
/* Subtables (Resource Groups) */
Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < Length)
{
/* Resource group subtable */
@@ -420,7 +420,7 @@ AcpiDmDumpCsrt (
Offset + SubOffset);
while ((SubOffset < Subtable->Length) &&
- ((Offset + SubOffset) < Table->Length))
+ ((Offset + SubOffset) < Length))
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubtable,
@@ -481,12 +481,13 @@ AcpiDmDumpDbg2 (
{
ACPI_STATUS Status;
ACPI_DBG2_DEVICE *Subtable;
- UINT32 Length = Table->Length;
+ UINT32 Length = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_DBG2);
UINT32 i;
UINT32 ArrayOffset;
UINT32 AbsoluteOffset;
UINT8 *Array;
+ UINT16 SubtableLength;
/* Main table */
@@ -500,11 +501,12 @@ AcpiDmDumpDbg2 (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < Length)
{
AcpiOsPrintf ("\n");
+ SubtableLength = AcpiUtReadUint16 (&Subtable->Length);
Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoDbg2Device);
+ SubtableLength, AcpiDmTableInfoDbg2Device);
if (ACPI_FAILURE (Status))
{
return;
@@ -514,13 +516,13 @@ AcpiDmDumpDbg2 (
for (i = 0; i < Subtable->RegisterCount; i++)
{
- ArrayOffset = Subtable->BaseAddressOffset +
+ ArrayOffset = AcpiUtReadUint16 (&Subtable->BaseAddressOffset) +
(sizeof (ACPI_GENERIC_ADDRESS) * i);
AbsoluteOffset = Offset + ArrayOffset;
Array = (UINT8 *) Subtable + ArrayOffset;
Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
- Subtable->Length, AcpiDmTableInfoDbg2Addr);
+ SubtableLength, AcpiDmTableInfoDbg2Addr);
if (ACPI_FAILURE (Status))
{
return;
@@ -531,13 +533,13 @@ AcpiDmDumpDbg2 (
for (i = 0; i < Subtable->RegisterCount; i++)
{
- ArrayOffset = Subtable->AddressSizeOffset +
+ ArrayOffset = AcpiUtReadUint16 (&Subtable->AddressSizeOffset) +
(sizeof (UINT32) * i);
AbsoluteOffset = Offset + ArrayOffset;
Array = (UINT8 *) Subtable + ArrayOffset;
Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
- Subtable->Length, AcpiDmTableInfoDbg2Size);
+ SubtableLength, AcpiDmTableInfoDbg2Size);
if (ACPI_FAILURE (Status))
{
return;
@@ -547,12 +549,12 @@ AcpiDmDumpDbg2 (
/* Dump the Namestring (required) */
AcpiOsPrintf ("\n");
- ArrayOffset = Subtable->NamepathOffset;
+ ArrayOffset = AcpiUtReadUint16 (&Subtable->NamepathOffset);
AbsoluteOffset = Offset + ArrayOffset;
Array = (UINT8 *) Subtable + ArrayOffset;
Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
- Subtable->Length, AcpiDmTableInfoDbg2Name);
+ SubtableLength, AcpiDmTableInfoDbg2Name);
if (ACPI_FAILURE (Status))
{
return;
@@ -562,8 +564,11 @@ AcpiDmDumpDbg2 (
if (Subtable->OemDataOffset)
{
- Status = AcpiDmDumpTable (Length, Offset + Subtable->OemDataOffset,
- Table, Subtable->OemDataLength,
+ Array = (UINT8 *) Subtable + AcpiUtReadUint16 (&Subtable->OemDataOffset);
+
+ Status = AcpiDmDumpTable (Length,
+ Offset + AcpiUtReadUint16 (&Subtable->OemDataOffset),
+ Array, AcpiUtReadUint16 (&Subtable->OemDataLength),
AcpiDmTableInfoDbg2OemData);
if (ACPI_FAILURE (Status))
{
@@ -573,9 +578,9 @@ AcpiDmDumpDbg2 (
/* Point to next subtable */
- Offset += Subtable->Length;
+ Offset += SubtableLength;
Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Subtable,
- Subtable->Length);
+ SubtableLength);
}
}
Index: acpica-unix2-20210604/source/compiler/dttable1.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable1.c
+++ acpica-unix2-20210604/source/compiler/dttable1.c
@@ -355,6 +355,7 @@ DtCompileCsrt (
DT_FIELD **PFieldList = (DT_FIELD **) List;
UINT32 DescriptorCount;
UINT32 GroupLength;
+ UINT32 Tmp;
/* Subtables (Resource Groups) */
@@ -373,12 +374,13 @@ DtCompileCsrt (
/* Compute the number of resource descriptors */
- GroupLength =
- (ACPI_CAST_PTR (ACPI_CSRT_GROUP,
- Subtable->Buffer))->Length -
- (ACPI_CAST_PTR (ACPI_CSRT_GROUP,
- Subtable->Buffer))->SharedInfoLength -
- sizeof (ACPI_CSRT_GROUP);
+ Tmp = AcpiUtReadUint32 (&(ACPI_CAST_PTR (ACPI_CSRT_GROUP,
+ Subtable->Buffer))->Length);
+ GroupLength = Tmp;
+ Tmp = AcpiUtReadUint32 (&(ACPI_CAST_PTR (ACPI_CSRT_GROUP,
+ Subtable->Buffer))->SharedInfoLength);
+ GroupLength -= Tmp;
+ GroupLength -= sizeof (ACPI_CSRT_GROUP);
DescriptorCount = (GroupLength /
sizeof (ACPI_CSRT_DESCRIPTOR));
@@ -466,6 +468,7 @@ DtCompileDbg2 (
ACPI_DBG2_DEVICE *DeviceInfo;
UINT16 CurrentOffset;
UINT32 i;
+ UINT32 Tmp;
/* Main table */
@@ -482,10 +485,12 @@ DtCompileDbg2 (
/* Main table fields */
Dbg2Header = ACPI_CAST_PTR (ACPI_DBG2_HEADER, Subtable->Buffer);
- Dbg2Header->InfoOffset = sizeof (ACPI_TABLE_HEADER) + ACPI_PTR_DIFF (
- ACPI_ADD_PTR (UINT8, Dbg2Header, sizeof (ACPI_DBG2_HEADER)), Dbg2Header);
+ Tmp = sizeof (ACPI_TABLE_HEADER) + ACPI_PTR_DIFF (
+ ACPI_ADD_PTR (UINT8, Dbg2Header, sizeof (ACPI_DBG2_HEADER)), Dbg2Header);
+ AcpiUtWriteUint (&Dbg2Header->InfoOffset, sizeof (UINT32),
+ &Tmp, sizeof (UINT32));
- SubtableCount = Dbg2Header->InfoCount;
+ SubtableCount = Tmp;
DtPushSubtable (Subtable);
/* Process all Device Information subtables (Count = InfoCount) */
@@ -512,7 +517,8 @@ DtCompileDbg2 (
/* BaseAddressRegister GAS array (Required, size is RegisterCount) */
- DeviceInfo->BaseAddressOffset = CurrentOffset;
+ AcpiUtWriteUint (&DeviceInfo->BaseAddressOffset, sizeof (UINT16),
+ &CurrentOffset, sizeof (UINT16));
for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Addr,
@@ -528,7 +534,8 @@ DtCompileDbg2 (
/* AddressSize array (Required, size = RegisterCount) */
- DeviceInfo->AddressSizeOffset = CurrentOffset;
+ AcpiUtWriteUint (&DeviceInfo->AddressSizeOffset, sizeof (UINT16),
+ &CurrentOffset, sizeof (UINT16));
for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Size,
@@ -544,7 +551,8 @@ DtCompileDbg2 (
/* NamespaceString device identifier (Required, size = NamePathLength) */
- DeviceInfo->NamepathOffset = CurrentOffset;
+ AcpiUtWriteUint (&DeviceInfo->NamepathOffset, sizeof (UINT16),
+ &CurrentOffset, sizeof (UINT16));
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Name,
&Subtable);
if (ACPI_FAILURE (Status))
@@ -554,8 +562,9 @@ DtCompileDbg2 (
/* Update the device info header */
- DeviceInfo->NamepathLength = (UINT16) Subtable->Length;
- CurrentOffset += (UINT16) DeviceInfo->NamepathLength;
+ AcpiUtWriteUint (&DeviceInfo->NamepathLength, sizeof (UINT16),
+ &Subtable->Length, sizeof (UINT32));
+ CurrentOffset += AcpiUtReadUint16 (&DeviceInfo->NamepathLength);
DtInsertSubtable (ParentTable, Subtable);
/* OemData - Variable-length data (Optional, size = OemDataLength) */
@@ -582,8 +591,10 @@ DtCompileDbg2 (
if (Subtable && Subtable->Length)
{
- DeviceInfo->OemDataOffset = CurrentOffset;
- DeviceInfo->OemDataLength = (UINT16) Subtable->Length;
+ AcpiUtWriteUint (&DeviceInfo->OemDataOffset, sizeof (UINT16),
+ &CurrentOffset, sizeof (UINT16));
+ AcpiUtWriteUint (&DeviceInfo->OemDataLength, sizeof (UINT16),
+ &Subtable->Length, sizeof (UINT32));
DtInsertSubtable (ParentTable, Subtable);
}

View File

@ -1,171 +0,0 @@
From 06623392351dfea54bd69507b6672c933a5e3fd2 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Sat, 19 Sep 2020 15:22:00 -0600
Subject: [PATCH 12/45] Support DMAR in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtable.c | 4 ++--
source/common/dmtbdump1.c | 26 +++++++++++++++-----------
source/compiler/dttable1.c | 12 +++++++-----
3 files changed, 24 insertions(+), 18 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtable.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtable.c
+++ acpica-unix2-20210604/source/common/dmtable.c
@@ -1341,13 +1341,13 @@ AcpiDmDumpTable (
/* DMAR subtable types */
- Temp16 = ACPI_GET16 (Target);
+ Temp16 = AcpiUtReadUint16 (Target);
if (Temp16 > ACPI_DMAR_TYPE_RESERVED)
{
Temp16 = ACPI_DMAR_TYPE_RESERVED;
}
- AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
+ AcpiOsPrintf (UINT16_FORMAT, Temp16,
AcpiDmDmarSubnames[Temp16]);
break;
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump1.c
+++ acpica-unix2-20210604/source/common/dmtbdump1.c
@@ -604,13 +604,15 @@ AcpiDmDumpDmar (
{
ACPI_STATUS Status;
ACPI_DMAR_HEADER *Subtable;
- UINT32 Length = Table->Length;
+ UINT32 Length = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_DMAR);
ACPI_DMTABLE_INFO *InfoTable;
ACPI_DMAR_DEVICE_SCOPE *ScopeTable;
UINT32 ScopeOffset;
UINT8 *PciPath;
UINT32 PathOffset;
+ UINT16 SubtableType;
+ UINT16 SubtableLength;
/* Main table */
@@ -624,13 +626,14 @@ AcpiDmDumpDmar (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < Length)
{
/* Common subtable header */
AcpiOsPrintf ("\n");
+ SubtableLength = AcpiUtReadUint16 (&Subtable->Length);
Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoDmarHdr);
+ SubtableLength, AcpiDmTableInfoDmarHdr);
if (ACPI_FAILURE (Status))
{
return;
@@ -638,7 +641,8 @@ AcpiDmDumpDmar (
AcpiOsPrintf ("\n");
- switch (Subtable->Type)
+ SubtableType = AcpiUtReadUint16 (&Subtable->Type);
+ switch (SubtableType)
{
case ACPI_DMAR_TYPE_HARDWARE_UNIT:
@@ -673,12 +677,12 @@ AcpiDmDumpDmar (
default:
AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n",
- Subtable->Type);
+ SubtableType);
return;
}
Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, InfoTable);
+ SubtableLength, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -687,8 +691,8 @@ AcpiDmDumpDmar (
/*
* Dump the optional device scope entries
*/
- if ((Subtable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
- (Subtable->Type == ACPI_DMAR_TYPE_NAMESPACE))
+ if ((SubtableType == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
+ (SubtableType == ACPI_DMAR_TYPE_NAMESPACE))
{
/* These types do not support device scopes */
@@ -696,7 +700,7 @@ AcpiDmDumpDmar (
}
ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable, ScopeOffset);
- while (ScopeOffset < Subtable->Length)
+ while (ScopeOffset < SubtableLength)
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
@@ -737,9 +741,9 @@ AcpiDmDumpDmar (
NextSubtable:
/* Point to next subtable */
- Offset += Subtable->Length;
+ Offset += SubtableLength;
Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Subtable,
- Subtable->Length);
+ SubtableLength);
}
}
Index: acpica-unix2-20210604/source/compiler/dttable1.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable1.c
+++ acpica-unix2-20210604/source/compiler/dttable1.c
@@ -634,6 +634,7 @@ DtCompileDmar (
ACPI_DMAR_DEVICE_SCOPE *DmarDeviceScope;
UINT32 DeviceScopeLength;
UINT32 PciPathLength;
+ UINT16 DmarHeaderType;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmar, &Subtable);
@@ -664,7 +665,8 @@ DtCompileDmar (
DmarHeader = ACPI_CAST_PTR (ACPI_DMAR_HEADER, Subtable->Buffer);
- switch (DmarHeader->Type)
+ DmarHeaderType = AcpiUtReadUint16 (&DmarHeader->Type);
+ switch (DmarHeaderType)
{
case ACPI_DMAR_TYPE_HARDWARE_UNIT:
@@ -711,8 +713,8 @@ DtCompileDmar (
/*
* Optional Device Scope subtables
*/
- if ((DmarHeader->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
- (DmarHeader->Type == ACPI_DMAR_TYPE_NAMESPACE))
+ if ((DmarHeaderType == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
+ (DmarHeaderType == ACPI_DMAR_TYPE_NAMESPACE))
{
/* These types do not support device scopes */
@@ -721,8 +723,8 @@ DtCompileDmar (
}
DtPushSubtable (Subtable);
- DeviceScopeLength = DmarHeader->Length - Subtable->Length -
- ParentTable->Length;
+ DeviceScopeLength = AcpiUtReadUint16 (&DmarHeader->Length) -
+ Subtable->Length - ParentTable->Length;
while (DeviceScopeLength)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarScope,

View File

@ -1,112 +0,0 @@
From bcdec27f562b0df37546b5e8ad2eab76348062eb Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Sat, 19 Sep 2020 15:44:06 -0600
Subject: [PATCH 13/45] Support DRTM in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump1.c | 25 +++++++++++++++----------
source/compiler/dttable1.c | 6 ++++--
2 files changed, 19 insertions(+), 12 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump1.c
+++ acpica-unix2-20210604/source/common/dmtbdump1.c
@@ -770,11 +770,14 @@ AcpiDmDumpDrtm (
ACPI_DRTM_RESOURCE_LIST *DrtmRl;
ACPI_DRTM_DPS_ID *DrtmDps;
UINT32 Count;
+ UINT32 ResourceCount;
+ UINT32 ValidatedTableCount;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
/* Main table */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0,
AcpiDmTableInfoDrtm);
if (ACPI_FAILURE (Status))
{
@@ -789,7 +792,7 @@ AcpiDmDumpDrtm (
DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset);
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset,
+ Status = AcpiDmDumpTable (TableLength, Offset,
DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables),
AcpiDmTableInfoDrtm0);
if (ACPI_FAILURE (Status))
@@ -802,10 +805,11 @@ AcpiDmDumpDrtm (
/* Dump Validated table addresses */
Count = 0;
- while ((Offset < Table->Length) &&
- (DrtmVtl->ValidatedTableCount > Count))
+ ValidatedTableCount = AcpiUtReadUint32 (&DrtmVtl->ValidatedTableCount);
+ while ((Offset < TableLength) &&
+ (ValidatedTableCount > Count))
{
- Status = AcpiDmDumpTable (Table->Length, Offset,
+ Status = AcpiDmDumpTable (TableLength, Offset,
ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64),
AcpiDmTableInfoDrtm0a);
if (ACPI_FAILURE (Status))
@@ -821,7 +825,7 @@ AcpiDmDumpDrtm (
DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset);
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset,
+ Status = AcpiDmDumpTable (TableLength, Offset,
DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources),
AcpiDmTableInfoDrtm1);
if (ACPI_FAILURE (Status))
@@ -834,10 +838,11 @@ AcpiDmDumpDrtm (
/* Dump the Resource List */
Count = 0;
- while ((Offset < Table->Length) &&
- (DrtmRl->ResourceCount > Count))
+ ResourceCount = AcpiUtReadUint32 (&DrtmRl->ResourceCount);
+ while ((Offset < TableLength) &&
+ (ResourceCount > Count))
{
- Status = AcpiDmDumpTable (Table->Length, Offset,
+ Status = AcpiDmDumpTable (TableLength, Offset,
ACPI_ADD_PTR (void, Table, Offset),
sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a);
if (ACPI_FAILURE (Status))
@@ -853,7 +858,7 @@ AcpiDmDumpDrtm (
DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset);
AcpiOsPrintf ("\n");
- (void) AcpiDmDumpTable (Table->Length, Offset,
+ (void) AcpiDmDumpTable (TableLength, Offset,
DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2);
}
Index: acpica-unix2-20210604/source/compiler/dttable1.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable1.c
+++ acpica-unix2-20210604/source/compiler/dttable1.c
@@ -849,7 +849,8 @@ DtCompileDrtm (
Count++;
}
- DrtmVtl->ValidatedTableCount = Count;
+ AcpiUtWriteUint (&DrtmVtl->ValidatedTableCount, sizeof (UINT32),
+ &Count, sizeof (UINT32));
DtPopSubtable ();
ParentTable = DtPeekSubtable ();
@@ -887,7 +888,8 @@ DtCompileDrtm (
Count++;
}
- DrtmRl->ResourceCount = Count;
+ AcpiUtWriteUint(&DrtmRl->ResourceCount, sizeof(UINT32),
+ &Count, sizeof(UINT32));
DtPopSubtable ();
ParentTable = DtPeekSubtable ();

View File

@ -1,32 +0,0 @@
From 70d1047abe010c80c2dd74f6afdc7005b91e6163 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Sat, 19 Sep 2020 15:50:19 -0600
Subject: [PATCH 14/45] Support EINJ in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump1.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump1.c
+++ acpica-unix2-20210604/source/common/dmtbdump1.c
@@ -882,7 +882,7 @@ AcpiDmDumpEinj (
{
ACPI_STATUS Status;
ACPI_WHEA_HEADER *Subtable;
- UINT32 Length = Table->Length;
+ UINT32 Length = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_EINJ);
@@ -897,7 +897,7 @@ AcpiDmDumpEinj (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < Length)
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, Subtable,

View File

@ -1,32 +0,0 @@
From e588961ca36e70c24aa1c49e96bcd1997bf98f89 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Sat, 19 Sep 2020 15:54:56 -0600
Subject: [PATCH 15/45] Support ERST in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump1.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump1.c
+++ acpica-unix2-20210604/source/common/dmtbdump1.c
@@ -935,7 +935,7 @@ AcpiDmDumpErst (
{
ACPI_STATUS Status;
ACPI_WHEA_HEADER *Subtable;
- UINT32 Length = Table->Length;
+ UINT32 Length = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_ERST);
@@ -950,7 +950,7 @@ AcpiDmDumpErst (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < Length)
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, Subtable,

View File

@ -1,189 +0,0 @@
From b3051bc2bad8988f3ad81a8307de6f1d0eef4ace Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Sun, 20 Sep 2020 11:42:21 -0600
Subject: [PATCH 16/45] Support FADT (aka, FACP) in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump.c | 25 ++++++++++++-----------
source/components/tables/tbfadt.c | 34 +++++++++++++++++++++++--------
2 files changed, 38 insertions(+), 21 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump.c
+++ acpica-unix2-20210604/source/common/dmtbdump.c
@@ -363,11 +363,12 @@ AcpiDmDumpFadt (
ACPI_TABLE_HEADER *Table)
{
ACPI_STATUS Status;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
/* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0,
AcpiDmTableInfoFadt1);
if (ACPI_FAILURE (Status))
{
@@ -376,10 +377,10 @@ 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 ((TableLength > ACPI_FADT_V1_SIZE) &&
+ (TableLength <= ACPI_FADT_V2_SIZE))
{
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0,
AcpiDmTableInfoFadt2);
if (ACPI_FAILURE (Status))
{
@@ -389,9 +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 (TableLength > ACPI_FADT_V2_SIZE)
{
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0,
AcpiDmTableInfoFadt3);
if (ACPI_FAILURE (Status))
{
@@ -400,9 +401,9 @@ AcpiDmDumpFadt (
/* Check for FADT revision 5 fields and up (ACPI 5.0+) */
- if (Table->Length > ACPI_FADT_V3_SIZE)
+ if (TableLength > ACPI_FADT_V3_SIZE)
{
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0,
AcpiDmTableInfoFadt5);
if (ACPI_FAILURE (Status))
{
@@ -412,9 +413,9 @@ AcpiDmDumpFadt (
/* Check for FADT revision 6 fields and up (ACPI 6.0+) */
- if (Table->Length > ACPI_FADT_V3_SIZE)
+ if (TableLength > ACPI_FADT_V3_SIZE)
{
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0,
AcpiDmTableInfoFadt6);
if (ACPI_FAILURE (Status))
{
@@ -425,11 +426,11 @@ AcpiDmDumpFadt (
/* Validate various fields in the FADT, including length */
- AcpiTbCreateLocalFadt (Table, Table->Length);
+ AcpiTbCreateLocalFadt (Table, TableLength);
/* Validate FADT length against the revision */
- AcpiDmValidateFadtLength (Table->Revision, Table->Length);
+ AcpiDmValidateFadtLength (Table->Revision, TableLength);
}
Index: acpica-unix2-20210604/source/components/tables/tbfadt.c
===================================================================
--- acpica-unix2-20210604.orig/source/components/tables/tbfadt.c
+++ acpica-unix2-20210604/source/components/tables/tbfadt.c
@@ -289,7 +289,6 @@ AcpiTbSelectAddress (
UINT32 Address32,
UINT64 Address64)
{
-
if (!Address64)
{
/* 64-bit address is zero, use 32-bit address */
@@ -520,6 +519,9 @@ AcpiTbConvertFadt (
UINT8 Length;
UINT8 Flags;
UINT32 i;
+ UINT32 Tmp;
+ UINT32 Value32;
+ UINT64 Value64;
/*
@@ -533,7 +535,7 @@ AcpiTbConvertFadt (
* Note: The FADT revision value is unreliable. Only the length can be
* trusted.
*/
- if (AcpiGbl_FADT.Header.Length <= ACPI_FADT_V2_SIZE)
+ if (AcpiUtReadUint32 (&AcpiGbl_FADT.Header.Length) <= ACPI_FADT_V2_SIZE)
{
AcpiGbl_FADT.PreferredProfile = 0;
AcpiGbl_FADT.PstateControl = 0;
@@ -546,14 +548,19 @@ AcpiTbConvertFadt (
* current FADT version as defined by the ACPI specification.
* Thus, we will have a common FADT internally.
*/
- AcpiGbl_FADT.Header.Length = sizeof (ACPI_TABLE_FADT);
+ Tmp = sizeof (ACPI_TABLE_FADT);
+ AcpiUtWriteUint (&AcpiGbl_FADT.Header.Length, sizeof (UINT32),
+ &Tmp, sizeof (UINT32));
/*
* Expand the 32-bit DSDT addresses to 64-bit as necessary.
* Later ACPICA code will always use the X 64-bit field.
*/
- AcpiGbl_FADT.XDsdt = AcpiTbSelectAddress ("DSDT",
- AcpiGbl_FADT.Dsdt, AcpiGbl_FADT.XDsdt);
+ Value32 = AcpiUtReadUint32 (&AcpiGbl_FADT.Dsdt);
+ Value64 = AcpiUtReadUint64 (&AcpiGbl_FADT.XDsdt);
+ Value64 = AcpiTbSelectAddress ("DSDT", Value32, Value64);
+ AcpiUtWriteUint (&AcpiGbl_FADT.XDsdt, sizeof (UINT64),
+ &Value64, sizeof (UINT64));
/* If Hardware Reduced flag is set, we are all done */
@@ -614,7 +621,11 @@ AcpiTbConvertFadt (
{
if (Address64->Address)
{
- if (Address64->Address != (UINT64) Address32)
+ Value32 = AcpiUtReadUint32 (&Address32);
+ Value64 = AcpiUtReadUint64 (&Address64->Address);
+
+ /* if (Address64->Address != (UINT64) Address32) */
+ if (Value64 != (UINT64) Value32)
{
/* Address mismatch */
@@ -655,9 +666,10 @@ AcpiTbConvertFadt (
*/
if (!Address64->Address || AcpiGbl_Use32BitFadtAddresses)
{
+ Value32 = AcpiUtReadUint32 (&Address32);
AcpiTbInitGenericAddress (Address64,
ACPI_ADR_SPACE_SYSTEM_IO, Length,
- (UINT64) Address32, Name, Flags);
+ (UINT64) Value32, Name, Flags);
}
}
@@ -780,10 +792,14 @@ AcpiTbSetupFadtRegisters (
if (Source64->Address)
{
+ UINT64 Address64;
+
+ Address64 = AcpiUtReadUint64 (&Source64->Address);
+ Address64 +=
+ (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth);
AcpiTbInitGenericAddress (FadtPmInfoTable[i].Target,
Source64->SpaceId, Pm1RegisterByteWidth,
- Source64->Address +
- (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth),
+ Address64,
"PmRegisters", 0);
}
}

View File

@ -1,85 +0,0 @@
From 35f533074fb78d52e87c5a14406a136480a6fe62 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Tue, 22 Sep 2020 17:51:45 -0600
Subject: [PATCH 17/45] Support most FPDTs in a big-endian world
NB: there is no support for vendor specific records even in
the little-endian version.
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump1.c | 12 +++++++-----
source/compiler/dttable1.c | 4 +++-
2 files changed, 10 insertions(+), 6 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump1.c
+++ acpica-unix2-20210604/source/common/dmtbdump1.c
@@ -988,9 +988,10 @@ AcpiDmDumpFpdt (
{
ACPI_STATUS Status;
ACPI_FPDT_HEADER *Subtable;
- UINT32 Length = Table->Length;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_FPDT);
ACPI_DMTABLE_INFO *InfoTable;
+ UINT16 SubtableType;
/* There is no main table (other than the standard ACPI header) */
@@ -998,19 +999,20 @@ AcpiDmDumpFpdt (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
/* Common subtable header */
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
Subtable->Length, AcpiDmTableInfoFpdtHdr);
if (ACPI_FAILURE (Status))
{
return;
}
- switch (Subtable->Type)
+ SubtableType = AcpiUtReadUint16 (&Subtable->Type);
+ switch (SubtableType)
{
case ACPI_FPDT_TYPE_BOOT:
@@ -1037,7 +1039,7 @@ AcpiDmDumpFpdt (
goto NextSubtable;
}
- Status = AcpiDmDumpTable (Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
Subtable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{
Index: acpica-unix2-20210604/source/compiler/dttable1.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable1.c
+++ acpica-unix2-20210604/source/compiler/dttable1.c
@@ -1125,6 +1125,7 @@ DtCompileFpdt (
ACPI_DMTABLE_INFO *InfoTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_FIELD *SubtableStart;
+ UINT16 SubtableType;
while (*PFieldList)
@@ -1143,7 +1144,8 @@ DtCompileFpdt (
FpdtHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
- switch (FpdtHeader->Type)
+ SubtableType = AcpiUtReadUint16 (&FpdtHeader->Type);
+ switch (SubtableType)
{
case ACPI_FPDT_TYPE_BOOT:

View File

@ -1,69 +0,0 @@
From 492e41a24fd088c7ab609ee8ad518f69c9cd29e3 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Tue, 22 Sep 2020 18:12:01 -0600
Subject: [PATCH 18/45] Support GTDT in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump1.c | 13 +++++++++----
source/compiler/dttable1.c | 9 +++++++--
2 files changed, 16 insertions(+), 6 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump1.c
+++ acpica-unix2-20210604/source/common/dmtbdump1.c
@@ -1075,7 +1075,7 @@ AcpiDmDumpGtdt (
{
ACPI_STATUS Status;
ACPI_GTDT_HEADER *Subtable;
- UINT32 Length = Table->Length;
+ UINT32 Length = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_GTDT);
ACPI_DMTABLE_INFO *InfoTable;
UINT32 SubtableLength;
@@ -1111,7 +1111,7 @@ AcpiDmDumpGtdt (
/* Subtables */
- while (Offset < Table->Length)
+ while (Offset < Length)
{
/* Common subtable header */
@@ -1129,8 +1129,13 @@ AcpiDmDumpGtdt (
case ACPI_GTDT_TYPE_TIMER_BLOCK:
SubtableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
- GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
- Subtable))->TimerCount;
+ {
+ UINT32 Tmp32;
+
+ Tmp32 = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
+ Subtable))->TimerCount;
+ GtCount = AcpiUtReadUint32 (&Tmp32);
+ }
InfoTable = AcpiDmTableInfoGtdt0;
break;
Index: acpica-unix2-20210604/source/compiler/dttable1.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable1.c
+++ acpica-unix2-20210604/source/compiler/dttable1.c
@@ -1071,8 +1071,13 @@ DtCompileGtdt (
DtPushSubtable (Subtable);
ParentTable = DtPeekSubtable ();
- GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
- Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
+ {
+ UINT32 Tmp32;
+
+ Tmp32 = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
+ Subtable->Buffer - sizeof (ACPI_GTDT_HEADER)))->TimerCount;
+ GtCount = AcpiUtReadUint32 (&Tmp32);
+ }
while (GtCount)
{

View File

@ -1,75 +0,0 @@
From 6b73a4881e436bb8cf86c05c1cc4b5360efe1c7f Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Wed, 23 Sep 2020 11:54:49 -0600
Subject: [PATCH 19/45] Support HEST in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump1.c | 10 ++++++----
source/compiler/dttable1.c | 4 +++-
2 files changed, 9 insertions(+), 5 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump1.c
+++ acpica-unix2-20210604/source/common/dmtbdump1.c
@@ -1216,12 +1216,13 @@ AcpiDmDumpHest (
{
ACPI_STATUS Status;
ACPI_HEST_HEADER *Subtable;
- UINT32 Length = Table->Length;
+ UINT32 Length = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_HEST);
ACPI_DMTABLE_INFO *InfoTable;
UINT32 SubtableLength;
UINT32 BankCount;
ACPI_HEST_IA_ERROR_BANK *BankTable;
+ UINT16 SubtableType;
/* Main table */
@@ -1235,10 +1236,11 @@ AcpiDmDumpHest (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < Length)
{
BankCount = 0;
- switch (Subtable->Type)
+ SubtableType = Subtable->Type;
+ switch (SubtableType)
{
case ACPI_HEST_TYPE_IA32_CHECK:
@@ -1305,7 +1307,7 @@ AcpiDmDumpHest (
/* Cannot continue on unknown type - no length */
AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n",
- Subtable->Type);
+ SubtableType);
return;
}
Index: acpica-unix2-20210604/source/compiler/dttable1.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable1.c
+++ acpica-unix2-20210604/source/compiler/dttable1.c
@@ -1207,6 +1207,7 @@ DtCompileHest (
DT_FIELD *SubtableStart;
ACPI_DMTABLE_INFO *InfoTable;
UINT16 Type;
+ UINT16 Tmp16;
UINT32 BankCount;
@@ -1225,7 +1226,8 @@ DtCompileHest (
/* Get subtable type */
SubtableStart = *PFieldList;
- DtCompileInteger ((UINT8 *) &Type, *PFieldList, 2, 0);
+ DtCompileInteger ((UINT8 *) &Tmp16, *PFieldList, 2, 0);
+ Type = AcpiUtReadUint32 (&Tmp16);
switch (Type)
{

View File

@ -1,37 +0,0 @@
From 198abe6e9fcb03676513146bf2f9b8ccc49e5827 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Wed, 23 Sep 2020 12:11:46 -0600
Subject: [PATCH 20/45] Support RSDT ('RSD PTR') in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump.c
+++ acpica-unix2-20210604/source/common/dmtbdump.c
@@ -282,6 +282,7 @@ AcpiDmDumpRsdt (
UINT32 Entries;
UINT32 Offset;
UINT32 i;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
/* Point to start of table pointer array */
@@ -291,12 +292,12 @@ AcpiDmDumpRsdt (
/* RSDT uses 32-bit pointers */
- Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT32);
+ Entries = (TableLength - 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]);
+ AcpiOsPrintf ("%8.8X\n", AcpiUtReadUint32 (&Array[i]));
Offset += sizeof (UINT32);
}
}

View File

@ -1,38 +0,0 @@
From 75d974e42fefabfd6684d62f58bff678b55f396b Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Wed, 23 Sep 2020 12:16:37 -0600
Subject: [PATCH 21/45] Support XSDT in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump.c
+++ acpica-unix2-20210604/source/common/dmtbdump.c
@@ -323,6 +323,7 @@ AcpiDmDumpXsdt (
UINT32 Entries;
UINT32 Offset;
UINT32 i;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
/* Point to start of table pointer array */
@@ -332,12 +333,13 @@ AcpiDmDumpXsdt (
/* XSDT uses 64-bit pointers */
- Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT64);
+ Entries = (TableLength - 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]));
+ AcpiOsPrintf ("%8.8X%8.8X\n",
+ ACPI_FORMAT_UINT64 (AcpiUtReadUint64 (&Array[i])));
Offset += sizeof (UINT64);
}
}

View File

@ -1,52 +0,0 @@
From 724fcc83d359e4c8abbd2a48755e96049afa06d6 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Wed, 23 Sep 2020 12:25:38 -0600
Subject: [PATCH 22/45] Support SRAT in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump3.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump3.c
+++ acpica-unix2-20210604/source/common/dmtbdump3.c
@@ -173,11 +173,12 @@ AcpiDmDumpSrat (
UINT32 Offset = sizeof (ACPI_TABLE_SRAT);
ACPI_SUBTABLE_HEADER *Subtable;
ACPI_DMTABLE_INFO *InfoTable;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
/* Main table */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSrat);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoSrat);
if (ACPI_FAILURE (Status))
{
return;
@@ -186,12 +187,12 @@ AcpiDmDumpSrat (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
/* Common subtable header */
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
Subtable->Length, AcpiDmTableInfoSratHdr);
if (ACPI_FAILURE (Status))
{
@@ -245,7 +246,7 @@ AcpiDmDumpSrat (
}
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
Subtable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{

View File

@ -1,61 +0,0 @@
From b11d50752feb9f1b52db076d1fb4753b30a53642 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Wed, 23 Sep 2020 12:49:52 -0600
Subject: [PATCH 23/45] Support SLIT in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump3.c | 8 +++++---
source/compiler/dttable2.c | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump3.c
+++ acpica-unix2-20210604/source/common/dmtbdump3.c
@@ -96,11 +96,12 @@ AcpiDmDumpSlit (
UINT32 Localities;
UINT32 i;
UINT32 j;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
/* Main table */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSlit);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoSlit);
if (ACPI_FAILURE (Status))
{
return;
@@ -108,7 +109,8 @@ AcpiDmDumpSlit (
/* Display the Locality NxN Matrix */
- Localities = (UINT32) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount;
+ Localities = (UINT32)
+ AcpiUtReadUint64 (&ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount);
Offset = ACPI_OFFSET (ACPI_TABLE_SLIT, Entry[0]);
Row = (UINT8 *) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->Entry;
@@ -121,7 +123,7 @@ AcpiDmDumpSlit (
{
/* Check for beyond EOT */
- if (Offset >= Table->Length)
+ if (Offset >= TableLength)
{
AcpiOsPrintf (
"\n**** Not enough room in table for all localities\n");
Index: acpica-unix2-20210604/source/compiler/dttable2.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable2.c
+++ acpica-unix2-20210604/source/compiler/dttable2.c
@@ -1837,7 +1837,7 @@ DtCompileSlit (
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
- Localities = *ACPI_CAST_PTR (UINT32, Subtable->Buffer);
+ Localities = (UINT32) AcpiUtReadUint64 (Subtable->Buffer);
LocalityBuffer = UtLocalCalloc (Localities);
LocalityListLength = 0;

View File

@ -1,43 +0,0 @@
From ae38e1578d18abf41330bb3dbaef9ea56a52f49b Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Wed, 23 Sep 2020 15:44:21 -0600
Subject: [PATCH 24/45] Support MSCT in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -1133,11 +1133,12 @@ AcpiDmDumpMsct (
ACPI_STATUS Status;
UINT32 Offset = sizeof (ACPI_TABLE_MSCT);
ACPI_MSCT_PROXIMITY *Subtable;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
/* Main table */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMsct);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoMsct);
if (ACPI_FAILURE (Status))
{
return;
@@ -1146,12 +1147,12 @@ AcpiDmDumpMsct (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
/* Common subtable header */
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0);
if (ACPI_FAILURE (Status))
{

View File

@ -1,152 +0,0 @@
From 0a25688f36df62579f4dd0444ceba33a0f8d4dcc Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Wed, 23 Sep 2020 16:08:24 -0600
Subject: [PATCH 25/45] Support MPST in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 33 +++++++++++++++++++--------------
source/compiler/dttable2.c | 8 ++++----
2 files changed, 23 insertions(+), 18 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -995,11 +995,13 @@ AcpiDmDumpMpst (
UINT16 SubtableCount;
UINT32 PowerStateCount;
UINT32 ComponentCount;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
+ UINT16 Tmp16;
/* Main table */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMpst);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoMpst);
if (ACPI_FAILURE (Status))
{
return;
@@ -1007,13 +1009,14 @@ AcpiDmDumpMpst (
/* Subtable: Memory Power Node(s) */
- SubtableCount = (ACPI_CAST_PTR (ACPI_TABLE_MPST, Table))->PowerNodeCount;
+ Tmp16 = (ACPI_CAST_PTR (ACPI_TABLE_MPST, Table))->PowerNodeCount;
+ SubtableCount = AcpiUtReadUint16 (&Tmp16);
Subtable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Table, Offset);
- while ((Offset < Table->Length) && SubtableCount)
+ while ((Offset < TableLength) && SubtableCount)
{
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable0,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable0,
sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0);
if (ACPI_FAILURE (Status))
{
@@ -1022,8 +1025,8 @@ AcpiDmDumpMpst (
/* Extract the sub-subtable counts */
- PowerStateCount = Subtable0->NumPowerStates;
- ComponentCount = Subtable0->NumPhysicalComponents;
+ PowerStateCount = AcpiUtReadUint16 (&Subtable0->NumPowerStates);
+ ComponentCount = AcpiUtReadUint16 (&Subtable0->NumPhysicalComponents);
Offset += sizeof (ACPI_MPST_POWER_NODE);
/* Sub-subtables - Memory Power State Structure(s) */
@@ -1034,7 +1037,7 @@ AcpiDmDumpMpst (
while (PowerStateCount)
{
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable0A,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable0A,
sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A);
if (ACPI_FAILURE (Status))
{
@@ -1057,7 +1060,7 @@ AcpiDmDumpMpst (
while (ComponentCount)
{
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable0B,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable0B,
sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B);
if (ACPI_FAILURE (Status))
{
@@ -1074,22 +1077,24 @@ AcpiDmDumpMpst (
SubtableCount--;
Subtable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Subtable0,
sizeof (ACPI_MPST_POWER_NODE) +
- (sizeof (ACPI_MPST_POWER_STATE) * Subtable0->NumPowerStates) +
- (sizeof (ACPI_MPST_COMPONENT) * Subtable0->NumPhysicalComponents));
+ (sizeof (ACPI_MPST_POWER_STATE) *
+ AcpiUtReadUint16 (&Subtable0->NumPowerStates)) +
+ (sizeof (ACPI_MPST_COMPONENT) *
+ AcpiUtReadUint16 (&Subtable0->NumPhysicalComponents)));
}
/* Subtable: Count of Memory Power State Characteristic structures */
AcpiOsPrintf ("\n");
Subtable1 = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, Subtable0);
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable1,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable1,
sizeof (ACPI_MPST_DATA_HDR), AcpiDmTableInfoMpst1);
if (ACPI_FAILURE (Status))
{
return;
}
- SubtableCount = Subtable1->CharacteristicsCount;
+ SubtableCount = AcpiUtReadUint16 (&Subtable1->CharacteristicsCount);
Offset += sizeof (ACPI_MPST_DATA_HDR);
/* Subtable: Memory Power State Characteristics structure(s) */
@@ -1097,10 +1102,10 @@ AcpiDmDumpMpst (
Subtable2 = ACPI_ADD_PTR (ACPI_MPST_POWER_DATA, Subtable1,
sizeof (ACPI_MPST_DATA_HDR));
- while ((Offset < Table->Length) && SubtableCount)
+ while ((Offset < TableLength) && SubtableCount)
{
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable2,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable2,
sizeof (ACPI_MPST_POWER_DATA), AcpiDmTableInfoMpst2);
if (ACPI_FAILURE (Status))
{
Index: acpica-unix2-20210604/source/compiler/dttable2.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable2.c
+++ acpica-unix2-20210604/source/compiler/dttable2.c
@@ -350,7 +350,7 @@ DtCompileMpst (
DtPushSubtable (Subtable);
MpstChannelInfo = ACPI_CAST_PTR (ACPI_MPST_CHANNEL, Subtable->Buffer);
- SubtableCount = MpstChannelInfo->PowerNodeCount;
+ SubtableCount = AcpiUtReadUint16 (&MpstChannelInfo->PowerNodeCount);
while (*PFieldList && SubtableCount)
{
@@ -368,8 +368,8 @@ DtCompileMpst (
DtPushSubtable (Subtable);
MpstPowerNode = ACPI_CAST_PTR (ACPI_MPST_POWER_NODE, Subtable->Buffer);
- PowerStateCount = MpstPowerNode->NumPowerStates;
- ComponentCount = MpstPowerNode->NumPhysicalComponents;
+ PowerStateCount = AcpiUtReadUint16 (&MpstPowerNode->NumPowerStates);
+ ComponentCount = AcpiUtReadUint16 (&MpstPowerNode->NumPhysicalComponents);
ParentTable = DtPeekSubtable ();
@@ -422,7 +422,7 @@ DtCompileMpst (
DtPushSubtable (Subtable);
MpstDataHeader = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, Subtable->Buffer);
- SubtableCount = MpstDataHeader->CharacteristicsCount;
+ SubtableCount = AcpiUtReadUint16(&MpstDataHeader->CharacteristicsCount);
ParentTable = DtPeekSubtable ();

View File

@ -1,227 +0,0 @@
From 5aec8511fc433a71cb8b6d26be464355d0c3f5cc Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Thu, 24 Sep 2020 15:25:53 -0600
Subject: [PATCH 26/45] Support NFIT in a big-endian world
NB: this required correcting the starting pointer for the NFIT
SMBIOS subtable; otherwise, disassembly did not work properly.
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtable.c | 4 ++--
source/common/dmtbdump2.c | 49 ++++++++++++++++++++++----------------
source/compiler/dttable2.c | 11 ++++++---
3 files changed, 39 insertions(+), 25 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtable.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtable.c
+++ acpica-unix2-20210604/source/common/dmtable.c
@@ -1526,13 +1526,13 @@ AcpiDmDumpTable (
/* NFIT subtable types */
- Temp16 = ACPI_GET16 (Target);
+ Temp16 = AcpiUtReadUint16 (Target);
if (Temp16 > ACPI_NFIT_TYPE_RESERVED)
{
Temp16 = ACPI_NFIT_TYPE_RESERVED;
}
- AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
+ AcpiOsPrintf (UINT16_FORMAT, Temp16,
AcpiDmNfitSubnames[Temp16]);
break;
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -1192,18 +1192,23 @@ AcpiDmDumpNfit (
ACPI_STATUS Status;
UINT32 Offset = sizeof (ACPI_TABLE_NFIT);
UINT32 FieldOffset = 0;
- UINT32 Length;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
ACPI_NFIT_HEADER *Subtable;
ACPI_DMTABLE_INFO *InfoTable;
ACPI_NFIT_INTERLEAVE *Interleave = NULL;
ACPI_NFIT_SMBIOS *SmbiosInfo = NULL;
ACPI_NFIT_FLUSH_ADDRESS *Hint = NULL;
UINT32 i;
+ UINT32 Length;
+ UINT32 LineCount;
+ UINT16 SubtableLength;
+ UINT16 SubtableType;
+ UINT16 HintCount;
/* Main table */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoNfit);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoNfit);
if (ACPI_FAILURE (Status))
{
return;
@@ -1212,19 +1217,21 @@ AcpiDmDumpNfit (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
/* NFIT subtable header */
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoNfitHdr);
+ SubtableType = AcpiUtReadUint16 (&Subtable->Type);
+ SubtableLength = AcpiUtReadUint16 (&Subtable->Length);
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
+ SubtableLength, AcpiDmTableInfoNfitHdr);
if (ACPI_FAILURE (Status))
{
return;
}
- switch (Subtable->Type)
+ switch (SubtableType)
{
case ACPI_NFIT_TYPE_SYSTEM_ADDRESS:
@@ -1275,11 +1282,11 @@ AcpiDmDumpNfit (
default:
AcpiOsPrintf ("\n**** Unknown NFIT subtable type 0x%X\n",
- Subtable->Type);
+ SubtableType);
/* Attempt to continue */
- if (!Subtable->Length)
+ if (!SubtableLength)
{
AcpiOsPrintf ("Invalid zero length subtable\n");
return;
@@ -1288,8 +1295,8 @@ AcpiDmDumpNfit (
}
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
- Subtable->Length, InfoTable);
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
+ SubtableLength, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -1297,14 +1304,15 @@ AcpiDmDumpNfit (
/* Per-subtable variable-length fields */
- switch (Subtable->Type)
+ switch (SubtableType)
{
case ACPI_NFIT_TYPE_INTERLEAVE:
Interleave = ACPI_CAST_PTR (ACPI_NFIT_INTERLEAVE, Subtable);
- for (i = 0; i < Interleave->LineCount; i++)
+ LineCount = AcpiUtReadUint32 (&Interleave->LineCount);
+ for (i = 0; i < LineCount; i++)
{
- Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
+ Status = AcpiDmDumpTable (TableLength, Offset + FieldOffset,
&Interleave->LineOffset[i],
sizeof (UINT32), AcpiDmTableInfoNfit2a);
if (ACPI_FAILURE (Status))
@@ -1318,14 +1326,14 @@ AcpiDmDumpNfit (
case ACPI_NFIT_TYPE_SMBIOS:
- Length = Subtable->Length -
+ Length = SubtableLength -
sizeof (ACPI_NFIT_SMBIOS) + sizeof (UINT8);
if (Length)
{
- Status = AcpiDmDumpTable (Table->Length,
+ Status = AcpiDmDumpTable (TableLength,
sizeof (ACPI_NFIT_SMBIOS) - sizeof (UINT8),
- SmbiosInfo,
+ SmbiosInfo + Offset,
Length, AcpiDmTableInfoNfit3a);
if (ACPI_FAILURE (Status))
{
@@ -1338,9 +1346,10 @@ AcpiDmDumpNfit (
case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
Hint = ACPI_CAST_PTR (ACPI_NFIT_FLUSH_ADDRESS, Subtable);
- for (i = 0; i < Hint->HintCount; i++)
+ HintCount = AcpiUtReadUint16 (&Hint->HintCount);
+ for (i = 0; i < HintCount; i++)
{
- Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
+ Status = AcpiDmDumpTable (TableLength, Offset + FieldOffset,
&Hint->HintAddress[i],
sizeof (UINT64), AcpiDmTableInfoNfit6a);
if (ACPI_FAILURE (Status))
@@ -1359,8 +1368,8 @@ AcpiDmDumpNfit (
NextSubtable:
/* Point to next subtable */
- Offset += Subtable->Length;
- Subtable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, Subtable, Subtable->Length);
+ Offset += SubtableLength;
+ Subtable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, Subtable, SubtableLength);
}
}
Index: acpica-unix2-20210604/source/compiler/dttable2.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable2.c
+++ acpica-unix2-20210604/source/compiler/dttable2.c
@@ -497,6 +497,7 @@ DtCompileNfit (
UINT32 Count;
ACPI_NFIT_INTERLEAVE *Interleave = NULL;
ACPI_NFIT_FLUSH_ADDRESS *Hint = NULL;
+ UINT16 NfitHeaderType;
/* Main table */
@@ -530,7 +531,8 @@ DtCompileNfit (
NfitHeader = ACPI_CAST_PTR (ACPI_NFIT_HEADER, Subtable->Buffer);
- switch (NfitHeader->Type)
+ NfitHeaderType = AcpiUtReadUint16 (&NfitHeader->Type);
+ switch (NfitHeaderType)
{
case ACPI_NFIT_TYPE_SYSTEM_ADDRESS:
@@ -590,7 +592,7 @@ DtCompileNfit (
DtInsertSubtable (ParentTable, Subtable);
DtPopSubtable ();
- switch (NfitHeader->Type)
+ switch (NfitHeaderType)
{
case ACPI_NFIT_TYPE_INTERLEAVE:
@@ -616,7 +618,8 @@ DtCompileNfit (
Count++;
}
- Interleave->LineCount = Count;
+ AcpiUtWriteUint (&Interleave->LineCount, sizeof (UINT32),
+ &Count, sizeof (UINT32));
break;
case ACPI_NFIT_TYPE_SMBIOS:
@@ -662,6 +665,8 @@ DtCompileNfit (
}
Hint->HintCount = (UINT16) Count;
+ AcpiUtWriteUint (&Hint->HintCount, sizeof (UINT16),
+ &Count, sizeof (UINT32));
break;
default:

View File

@ -1,206 +0,0 @@
From 3d1ac6e76ad0c0d6454671b190ccbbfafb0cb4cc Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Tue, 29 Jun 2021 16:03:36 -0600
Subject: [PATCH 27/45] Support SDEV in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 48 +++++++++++++++++++++-----------------
source/compiler/dttable2.c | 27 ++++++++++++++++++++-
2 files changed, 52 insertions(+), 23 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -2125,7 +2125,7 @@ AcpiDmDumpSdev (
ACPI_SDEV_NAMESPACE *Namesp;
ACPI_DMTABLE_INFO *InfoTable;
ACPI_DMTABLE_INFO *SecureComponentInfoTable;
- UINT32 Length = Table->Length;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_SDEV);
UINT16 PathOffset;
UINT16 PathLength;
@@ -2133,11 +2133,12 @@ AcpiDmDumpSdev (
UINT16 VendorDataLength;
ACPI_SDEV_SECURE_COMPONENT *SecureComponent = NULL;
UINT32 CurrentOffset = 0;
+ UINT16 SubtableLength;
/* Main table */
- Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoSdev);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoSdev);
if (ACPI_FAILURE (Status))
{
return;
@@ -2146,13 +2147,14 @@ AcpiDmDumpSdev (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_SDEV_HEADER, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
/* Common subtable header */
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoSdevHdr);
+ SubtableLength = AcpiUtReadUint16 (&Subtable->Length);
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
+ SubtableLength, AcpiDmTableInfoSdevHdr);
if (ACPI_FAILURE (Status))
{
return;
@@ -2175,8 +2177,8 @@ AcpiDmDumpSdev (
}
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, 0, Subtable,
- Subtable->Length, InfoTable);
+ Status = AcpiDmDumpTable (TableLength, 0, Subtable,
+ SubtableLength, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -2235,12 +2237,12 @@ AcpiDmDumpSdev (
/* Dump the PCIe device ID(s) */
Namesp = ACPI_CAST_PTR (ACPI_SDEV_NAMESPACE, Subtable);
- PathOffset = Namesp->DeviceIdOffset;
- PathLength = Namesp->DeviceIdLength;
+ PathOffset = AcpiUtReadUint16 (&Namesp->DeviceIdOffset);
+ PathLength = AcpiUtReadUint16 (&Namesp->DeviceIdLength);
if (PathLength)
{
- Status = AcpiDmDumpTable (Table->Length, CurrentOffset,
+ Status = AcpiDmDumpTable (TableLength, CurrentOffset,
ACPI_ADD_PTR (UINT8, Namesp, PathOffset),
PathLength, AcpiDmTableInfoSdev0a);
if (ACPI_FAILURE (Status))
@@ -2252,14 +2254,14 @@ AcpiDmDumpSdev (
/* Dump the vendor-specific data */
- VendorDataLength =
- Namesp->VendorDataLength;
+ VendorDataLength = AcpiUtReadUint16 (&Namesp->VendorDataLength);
VendorDataOffset =
- Namesp->DeviceIdOffset + Namesp->DeviceIdLength;
+ AcpiUtReadUint16 (&Namesp->DeviceIdOffset) +
+ AcpiUtReadUint16 (&Namesp->DeviceIdLength);
if (VendorDataLength)
{
- Status = AcpiDmDumpTable (Table->Length, 0,
+ Status = AcpiDmDumpTable (TableLength, 0,
ACPI_ADD_PTR (UINT8, Namesp, VendorDataOffset),
VendorDataLength, AcpiDmTableInfoSdev1b);
if (ACPI_FAILURE (Status))
@@ -2274,12 +2276,12 @@ AcpiDmDumpSdev (
/* PCI path substructures */
Pcie = ACPI_CAST_PTR (ACPI_SDEV_PCIE, Subtable);
- PathOffset = Pcie->PathOffset;
- PathLength = Pcie->PathLength;
+ PathOffset = AcpiUtReadUint16 (&Pcie->PathOffset);
+ PathLength = AcpiUtReadUint16 (&Pcie->PathLength);
while (PathLength)
{
- Status = AcpiDmDumpTable (Table->Length,
+ Status = AcpiDmDumpTable (TableLength,
PathOffset + Offset,
ACPI_ADD_PTR (UINT8, Pcie, PathOffset),
sizeof (ACPI_SDEV_PCIE_PATH), AcpiDmTableInfoSdev1a);
@@ -2294,12 +2296,14 @@ AcpiDmDumpSdev (
/* VendorData */
- VendorDataLength = Pcie->VendorDataLength;
- VendorDataOffset = Pcie->PathOffset + Pcie->PathLength;
+ VendorDataLength = AcpiUtReadUint16 (&Pcie->VendorDataLength);
+ VendorDataOffset =
+ AcpiUtReadUint16 (&Pcie->PathOffset) +
+ AcpiUtReadUint16 (&Pcie->PathLength);
if (VendorDataLength)
{
- Status = AcpiDmDumpTable (Table->Length, 0,
+ Status = AcpiDmDumpTable (TableLength, 0,
ACPI_ADD_PTR (UINT8, Pcie, VendorDataOffset),
VendorDataLength, AcpiDmTableInfoSdev1b);
if (ACPI_FAILURE (Status))
@@ -2316,8 +2320,8 @@ AcpiDmDumpSdev (
NextSubtable:
/* Point to next subtable */
- Offset += Subtable->Length;
+ Offset += SubtableLength;
Subtable = ACPI_ADD_PTR (ACPI_SDEV_HEADER, Subtable,
- Subtable->Length);
+ SubtableLength);
}
}
Index: acpica-unix2-20210604/source/compiler/dttable2.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable2.c
+++ acpica-unix2-20210604/source/compiler/dttable2.c
@@ -1493,6 +1493,7 @@ DtCompileSdev (
UINT32 EntryCount;
ACPI_SDEV_SECURE_COMPONENT *SecureComponent = NULL;
UINT16 ComponentLength = 0;
+ UINT16 Tmp16;
/* Subtables */
@@ -1514,7 +1515,7 @@ DtCompileSdev (
DtPushSubtable (Subtable);
SdevHeader = ACPI_CAST_PTR (ACPI_SDEV_HEADER, Subtable->Buffer);
- SdevHeader->Length = (UINT8)(sizeof (ACPI_SDEV_HEADER));
+ SdevHeader->Length = (UINT16) (sizeof (ACPI_SDEV_HEADER));
switch (SdevHeader->Type)
{
@@ -1687,6 +1688,18 @@ DtCompileSdev (
}
}
+ /* Make sure everything is now little-endian */
+ Tmp16 = AcpiUtReadUint16 (&SdevHeader->Length);
+ SdevHeader->Length = Tmp16;
+ Tmp16 = AcpiUtReadUint16 (&Namesp->DeviceIdOffset);
+ Namesp->DeviceIdOffset = Tmp16;
+ Tmp16 = AcpiUtReadUint16 (&Namesp->DeviceIdLength);
+ Namesp->DeviceIdLength = Tmp16;
+ Tmp16 = AcpiUtReadUint16 (&Namesp->VendorDataOffset);
+ Namesp->VendorDataOffset = Tmp16;
+ Tmp16 = AcpiUtReadUint16 (&Namesp->VendorDataLength);
+ Namesp->VendorDataLength = Tmp16;
+
break;
case ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE:
@@ -1749,6 +1762,18 @@ DtCompileSdev (
SdevHeader->Length =
sizeof (ACPI_SDEV_PCIE) +
Pcie->PathLength + Pcie->VendorDataLength;
+
+ Tmp16 = AcpiUtReadUint16 (&SdevHeader->Length);
+ SdevHeader->Length = Tmp16;
+ Tmp16 = AcpiUtReadUint16 (&Pcie->PathOffset);
+ Pcie->PathOffset = Tmp16;
+ Tmp16 = AcpiUtReadUint16 (&Pcie->PathLength);
+ Pcie->PathLength = Tmp16;
+ Tmp16 = AcpiUtReadUint16 (&Pcie->VendorDataOffset);
+ Pcie->VendorDataOffset = Tmp16;
+ Tmp16 = AcpiUtReadUint16 (&Pcie->VendorDataLength);
+ Pcie->VendorDataLength = Tmp16;
+
break;
default:

View File

@ -1,278 +0,0 @@
From 915b8b70726fd01befdeac0c8630db528ac40552 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Fri, 25 Sep 2020 16:56:55 -0600
Subject: [PATCH 28/45] Support HMAT in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump1.c | 70 ++++++++++++++++++++++----------------
source/compiler/dttable1.c | 24 ++++++++++---
2 files changed, 59 insertions(+), 35 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump1.c
+++ acpica-unix2-20210604/source/common/dmtbdump1.c
@@ -1379,37 +1379,45 @@ AcpiDmDumpHmat (
UINT32 Length;
ACPI_DMTABLE_INFO *InfoTable;
UINT32 i, j;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
+ UINT16 HmatStructType;
+ UINT32 HmatStructLength;
+ UINT32 InitPDs;
+ UINT32 TgtPDs;
+ UINT16 SMBIOSHandles;
/* Main table */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoHmat);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoHmat);
if (ACPI_FAILURE (Status))
{
return;
}
Offset = sizeof (ACPI_TABLE_HMAT);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
AcpiOsPrintf ("\n");
/* Dump HMAT structure header */
HmatStruct = ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, Table, Offset);
- if (HmatStruct->Length < sizeof (ACPI_HMAT_STRUCTURE))
+ HmatStructLength = AcpiUtReadUint32 (&HmatStruct->Length);
+ if (HmatStructLength < sizeof (ACPI_HMAT_STRUCTURE))
{
AcpiOsPrintf ("Invalid HMAT structure length\n");
return;
}
- Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct,
- HmatStruct->Length, AcpiDmTableInfoHmatHdr);
+ Status = AcpiDmDumpTable (TableLength, Offset, HmatStruct,
+ HmatStructLength, AcpiDmTableInfoHmatHdr);
if (ACPI_FAILURE (Status))
{
return;
}
- switch (HmatStruct->Type)
+ HmatStructType = AcpiUtReadUint16 (&HmatStruct->Type);
+ switch (HmatStructType)
{
case ACPI_HMAT_TYPE_ADDRESS_RANGE:
@@ -1432,7 +1440,7 @@ AcpiDmDumpHmat (
default:
AcpiOsPrintf ("\n**** Unknown HMAT structure type 0x%X\n",
- HmatStruct->Type);
+ HmatStructType);
/* Attempt to continue */
@@ -1441,13 +1449,13 @@ AcpiDmDumpHmat (
/* Dump HMAT structure body */
- if (HmatStruct->Length < Length)
+ if (HmatStructLength < Length)
{
AcpiOsPrintf ("Invalid HMAT structure length\n");
return;
}
- Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct,
- HmatStruct->Length, InfoTable);
+ Status = AcpiDmDumpTable (TableLength, Offset, HmatStruct,
+ HmatStructLength, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -1455,7 +1463,7 @@ AcpiDmDumpHmat (
/* Dump HMAT structure additionals */
- switch (HmatStruct->Type)
+ switch (HmatStructType)
{
case ACPI_HMAT_TYPE_LOCALITY:
@@ -1464,15 +1472,16 @@ AcpiDmDumpHmat (
/* Dump initiator proximity domains */
- if ((UINT32)(HmatStruct->Length - SubtableOffset) <
- (UINT32)(HmatLocality->NumberOfInitiatorPDs * 4))
+ InitPDs = AcpiUtReadUint32 (&HmatLocality->NumberOfInitiatorPDs);
+ if ((UINT32) (HmatStructLength - SubtableOffset) <
+ (UINT32) (InitPDs * 4))
{
AcpiOsPrintf ("Invalid initiator proximity domain number\n");
return;
}
- for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++)
+ for (i = 0; i < InitPDs; i++)
{
- Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
+ Status = AcpiDmDumpTable (TableLength, Offset + SubtableOffset,
ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
4, AcpiDmTableInfoHmat1a);
if (ACPI_FAILURE (Status))
@@ -1485,15 +1494,16 @@ AcpiDmDumpHmat (
/* Dump target proximity domains */
- if ((UINT32)(HmatStruct->Length - SubtableOffset) <
- (UINT32)(HmatLocality->NumberOfTargetPDs * 4))
+ TgtPDs = AcpiUtReadUint32 (&HmatLocality->NumberOfTargetPDs);
+ if ((UINT32) (HmatStructLength - SubtableOffset) <
+ (UINT32) (TgtPDs * 4))
{
AcpiOsPrintf ("Invalid target proximity domain number\n");
return;
}
- for (i = 0; i < HmatLocality->NumberOfTargetPDs; i++)
+ for (i = 0; i < TgtPDs; i++)
{
- Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
+ Status = AcpiDmDumpTable (TableLength, Offset + SubtableOffset,
ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
4, AcpiDmTableInfoHmat1b);
if (ACPI_FAILURE (Status))
@@ -1506,18 +1516,17 @@ AcpiDmDumpHmat (
/* Dump latency/bandwidth entris */
- if ((UINT32)(HmatStruct->Length - SubtableOffset) <
- (UINT32)(HmatLocality->NumberOfInitiatorPDs *
- HmatLocality->NumberOfTargetPDs * 2))
+ if ((UINT32) (HmatStructLength - SubtableOffset) <
+ (UINT32) (InitPDs * TgtPDs * 2))
{
AcpiOsPrintf ("Invalid latency/bandwidth entry number\n");
return;
}
- for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++)
+ for (i = 0; i < InitPDs; i++)
{
- for (j = 0; j < HmatLocality->NumberOfTargetPDs; j++)
+ for (j = 0; j < TgtPDs; j++)
{
- Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
+ Status = AcpiDmDumpTable (TableLength, Offset + SubtableOffset,
ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
2, AcpiDmTableInfoHmat1c);
if (ACPI_FAILURE(Status))
@@ -1537,15 +1546,16 @@ AcpiDmDumpHmat (
/* Dump SMBIOS handles */
- if ((UINT32)(HmatStruct->Length - SubtableOffset) <
- (UINT32)(HmatCache->NumberOfSMBIOSHandles * 2))
+ SMBIOSHandles = AcpiUtReadUint16 (&HmatCache->NumberOfSMBIOSHandles);
+ if ((UINT32) (HmatStructLength - SubtableOffset) <
+ (UINT32) (SMBIOSHandles * 2))
{
AcpiOsPrintf ("Invalid SMBIOS handle number\n");
return;
}
- for (i = 0; i < HmatCache->NumberOfSMBIOSHandles; i++)
+ for (i = 0; i < SMBIOSHandles; i++)
{
- Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
+ Status = AcpiDmDumpTable (TableLength, Offset + SubtableOffset,
ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
2, AcpiDmTableInfoHmat2a);
if (ACPI_FAILURE (Status))
@@ -1565,6 +1575,6 @@ AcpiDmDumpHmat (
NextSubtable:
/* Point to next HMAT structure subtable */
- Offset += (HmatStruct->Length);
+ Offset += (HmatStructLength);
}
}
Index: acpica-unix2-20210604/source/compiler/dttable1.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable1.c
+++ acpica-unix2-20210604/source/compiler/dttable1.c
@@ -1369,6 +1369,8 @@ DtCompileHmat (
UINT32 TgtPDNumber;
UINT64 EntryNumber;
UINT16 SMBIOSHandleNumber;
+ UINT16 HmatStructType;
+ UINT32 Length;
ParentTable = DtPeekSubtable ();
@@ -1399,7 +1401,8 @@ DtCompileHmat (
/* Compile HMAT structure body */
- switch (HmatStruct->Type)
+ HmatStructType = AcpiUtReadUint16 (&HmatStruct->Type);
+ switch (HmatStructType)
{
case ACPI_HMAT_TYPE_ADDRESS_RANGE:
@@ -1432,7 +1435,7 @@ DtCompileHmat (
/* Compile HMAT structure additionals */
- switch (HmatStruct->Type)
+ switch (HmatStructType)
{
case ACPI_HMAT_TYPE_LOCALITY:
@@ -1458,7 +1461,7 @@ DtCompileHmat (
HmatStruct->Length += Subtable->Length;
IntPDNumber++;
}
- HmatLocality->NumberOfInitiatorPDs = IntPDNumber;
+ HmatLocality->NumberOfInitiatorPDs = AcpiUtReadUint32 (&IntPDNumber);
/* Compile target proximity domain list */
@@ -1479,7 +1482,7 @@ DtCompileHmat (
HmatStruct->Length += Subtable->Length;
TgtPDNumber++;
}
- HmatLocality->NumberOfTargetPDs = TgtPDNumber;
+ HmatLocality->NumberOfTargetPDs = AcpiUtReadUint32 (&TgtPDNumber);
/* Save start of the entries for reporting errors */
@@ -1505,6 +1508,9 @@ DtCompileHmat (
EntryNumber++;
}
+ Length = AcpiUtReadUint32 (&HmatStruct->Length);
+ HmatStruct->Length = Length;
+
/* Validate number of entries */
if (EntryNumber !=
@@ -1538,11 +1544,19 @@ DtCompileHmat (
HmatStruct->Length += Subtable->Length;
SMBIOSHandleNumber++;
}
- HmatCache->NumberOfSMBIOSHandles = SMBIOSHandleNumber;
+ HmatCache->NumberOfSMBIOSHandles =
+ AcpiUtReadUint16 (&SMBIOSHandleNumber);
+
+ Length = AcpiUtReadUint32 (&HmatStruct->Length);
+ HmatStruct->Length = Length;
+
break;
default:
+ Length = AcpiUtReadUint32(&HmatStruct->Length);
+ HmatStruct->Length = Length;
+
break;
}
}

View File

@ -1,43 +0,0 @@
From 253fe3545e7d4eaa9cb93c771c9619f410109a02 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Fri, 25 Sep 2020 17:03:05 -0600
Subject: [PATCH 29/45] Support PDTT in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -1498,13 +1498,13 @@ AcpiDmDumpPdtt (
{
ACPI_STATUS Status;
ACPI_PDTT_CHANNEL *Subtable;
- UINT32 Length = Table->Length;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_PDTT);
/* Main table */
- Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPdtt);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoPdtt);
if (ACPI_FAILURE (Status))
{
return;
@@ -1513,10 +1513,10 @@ AcpiDmDumpPdtt (
/* Subtables. Currently there is only one type, but can be multiples */
Subtable = ACPI_ADD_PTR (ACPI_PDTT_CHANNEL, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
sizeof (ACPI_PDTT_CHANNEL), AcpiDmTableInfoPdtt0);
if (ACPI_FAILURE (Status))
{

View File

@ -1,105 +0,0 @@
From 8923211d8bc1b0e4d3af6ff31ed6479057f612f6 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Fri, 25 Sep 2020 17:16:12 -0600
Subject: [PATCH 30/45] Support PPTT in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 17 ++++++++++-------
source/compiler/dttable2.c | 7 +++++--
2 files changed, 15 insertions(+), 9 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -1785,6 +1785,8 @@ AcpiDmDumpPptt (
UINT32 Offset = sizeof (ACPI_TABLE_FPDT);
ACPI_DMTABLE_INFO *InfoTable;
UINT32 i;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
+ UINT32 NumPrivRes;
/* There is no main table (other than the standard ACPI header) */
@@ -1792,7 +1794,7 @@ AcpiDmDumpPptt (
/* Subtables */
Offset = sizeof (ACPI_TABLE_HEADER);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
AcpiOsPrintf ("\n");
@@ -1804,7 +1806,7 @@ AcpiDmDumpPptt (
AcpiOsPrintf ("Invalid subtable length\n");
return;
}
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
Subtable->Length, AcpiDmTableInfoPpttHdr);
if (ACPI_FAILURE (Status))
{
@@ -1846,7 +1848,7 @@ AcpiDmDumpPptt (
AcpiOsPrintf ("Invalid subtable length\n");
return;
}
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
Subtable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{
@@ -1862,15 +1864,16 @@ AcpiDmDumpPptt (
/* Dump SMBIOS handles */
- if ((UINT8)(Subtable->Length - SubtableOffset) <
- (UINT8)(PpttProcessor->NumberOfPrivResources * 4))
+ NumPrivRes = AcpiUtReadUint32 (&PpttProcessor->NumberOfPrivResources);
+ if ((UINT8) (Subtable->Length - SubtableOffset) <
+ (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 (TableLength, Offset + SubtableOffset,
ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable, SubtableOffset),
4, AcpiDmTableInfoPptt0a);
if (ACPI_FAILURE (Status))
Index: acpica-unix2-20210604/source/compiler/dttable2.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable2.c
+++ acpica-unix2-20210604/source/compiler/dttable2.c
@@ -1123,6 +1123,7 @@ DtCompilePptt (
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_FIELD *SubtableStart;
ACPI_TABLE_HEADER *PpttAcpiHeader;
+ UINT32 NumPrivRes;
ParentTable = DtPeekSubtable ();
@@ -1187,7 +1188,7 @@ DtCompilePptt (
{
/* Compile initiator proximity domain list */
- PpttProcessor->NumberOfPrivResources = 0;
+ NumPrivRes = 0;
while (*PFieldList)
{
Status = DtCompileTable (PFieldList,
@@ -1203,8 +1204,10 @@ DtCompilePptt (
DtInsertSubtable (ParentTable, Subtable);
PpttHeader->Length += (UINT8)(Subtable->Length);
- PpttProcessor->NumberOfPrivResources++;
+ NumPrivRes++;
}
+ PpttProcessor->NumberOfPrivResources =
+ AcpiUtReadUint32 (&NumPrivRes);
}
break;

View File

@ -1,54 +0,0 @@
From a58ff76fc6e68488d93b55016a7aeb257971a252 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Fri, 25 Sep 2020 17:39:34 -0600
Subject: [PATCH 31/45] Support PCCT in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -1394,13 +1394,13 @@ AcpiDmDumpPcct (
ACPI_STATUS Status;
ACPI_PCCT_SUBSPACE *Subtable;
ACPI_DMTABLE_INFO *InfoTable;
- UINT32 Length = Table->Length;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_PCCT);
/* Main table */
- Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPcct);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoPcct);
if (ACPI_FAILURE (Status))
{
return;
@@ -1409,12 +1409,12 @@ AcpiDmDumpPcct (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
/* Common subtable header */
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
Subtable->Header.Length, AcpiDmTableInfoPcctHdr);
if (ACPI_FAILURE (Status))
{
@@ -1462,7 +1462,7 @@ AcpiDmDumpPcct (
}
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
Subtable->Header.Length, InfoTable);
if (ACPI_FAILURE (Status))
{

View File

@ -1,43 +0,0 @@
From ff1449919ee7d395d301e3a56a4ba333604d0458 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Fri, 25 Sep 2020 18:13:20 -0600
Subject: [PATCH 32/45] Support WDAT in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump3.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump3.c
+++ acpica-unix2-20210604/source/common/dmtbdump3.c
@@ -675,11 +675,12 @@ AcpiDmDumpWdat (
ACPI_STATUS Status;
UINT32 Offset = sizeof (ACPI_TABLE_WDAT);
ACPI_WDAT_ENTRY *Subtable;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
/* Main table */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoWdat);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoWdat);
if (ACPI_FAILURE (Status))
{
return;
@@ -688,12 +689,12 @@ AcpiDmDumpWdat (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
/* Common subtable header */
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0);
if (ACPI_FAILURE (Status))
{

View File

@ -1,76 +0,0 @@
From b69b833f5a9205080b27d83379a31fad7fca1575 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Sun, 27 Sep 2020 12:09:28 -0600
Subject: [PATCH 33/45] Support TCPA in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump3.c | 13 ++++++++-----
source/compiler/dttable2.c | 4 +++-
2 files changed, 11 insertions(+), 6 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump3.c
+++ acpica-unix2-20210604/source/common/dmtbdump3.c
@@ -401,11 +401,13 @@ AcpiDmDumpTcpa (
ACPI_TABLE_TCPA_HDR *Subtable = ACPI_ADD_PTR (
ACPI_TABLE_TCPA_HDR, Table, Offset);
ACPI_STATUS Status;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
+ UINT16 PlatformClass;
/* Main table */
- Status = AcpiDmDumpTable (Table->Length, 0, Table,
+ Status = AcpiDmDumpTable (TableLength, 0, Table,
0, AcpiDmTableInfoTcpaHdr);
if (ACPI_FAILURE (Status))
{
@@ -416,18 +418,19 @@ AcpiDmDumpTcpa (
* Examine the PlatformClass field to determine the table type.
* Either a client or server table. Only one.
*/
- switch (CommonHeader->PlatformClass)
+ PlatformClass = AcpiUtReadUint16 (&CommonHeader->PlatformClass);
+ switch (PlatformClass)
{
case ACPI_TCPA_CLIENT_TABLE:
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
Table->Length - Offset, AcpiDmTableInfoTcpaClient);
break;
case ACPI_TCPA_SERVER_TABLE:
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
- Table->Length - Offset, AcpiDmTableInfoTcpaServer);
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
+ TableLength - Offset, AcpiDmTableInfoTcpaServer);
break;
default:
Index: acpica-unix2-20210604/source/compiler/dttable2.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable2.c
+++ acpica-unix2-20210604/source/compiler/dttable2.c
@@ -2139,6 +2139,7 @@ DtCompileTcpa (
ACPI_TABLE_TCPA_HDR *TcpaHeader;
DT_SUBTABLE *ParentTable;
ACPI_STATUS Status;
+ UINT16 PlatformClass;
/* Compile the main table */
@@ -2159,7 +2160,8 @@ DtCompileTcpa (
*/
TcpaHeader = ACPI_CAST_PTR (ACPI_TABLE_TCPA_HDR, ParentTable->Buffer);
- switch (TcpaHeader->PlatformClass)
+ PlatformClass = AcpiUtReadUint16 (&TcpaHeader->PlatformClass);
+ switch (PlatformClass)
{
case ACPI_TCPA_CLIENT_TABLE:

View File

@ -1,40 +0,0 @@
From c313a76ce818135f02ab158a9f0c8e4b8e96698a Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Mon, 28 Sep 2020 11:49:42 -0600
Subject: [PATCH 34/45] Support STAO in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump3.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump3.c
+++ acpica-unix2-20210604/source/common/dmtbdump3.c
@@ -285,14 +285,14 @@ AcpiDmDumpStao (
{
ACPI_STATUS Status;
char *Namepath;
- UINT32 Length = Table->Length;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
UINT32 StringLength;
UINT32 Offset = sizeof (ACPI_TABLE_STAO);
/* Main table */
- Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoStao);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoStao);
if (ACPI_FAILURE (Status))
{
return;
@@ -300,7 +300,7 @@ AcpiDmDumpStao (
/* The rest of the table consists of Namepath strings */
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
Namepath = ACPI_ADD_PTR (char, Table, Offset);
StringLength = strlen (Namepath) + 1;

View File

@ -1,33 +0,0 @@
From 948bebd1a0999bc3481641d3fc996c49432709c6 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Mon, 28 Sep 2020 12:49:23 -0600
Subject: [PATCH 35/45] Support SLIC and MSDM in a big-endian world
When dumping the SLIC table, it was also found that the code was
not starting at the proper offset on disassembly. Set the offset
to the first byte after the header instead of the very beginning
of the table.
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump3.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump3.c
+++ acpica-unix2-20210604/source/common/dmtbdump3.c
@@ -68,9 +68,11 @@ void
AcpiDmDumpSlic (
ACPI_TABLE_HEADER *Table)
{
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
- (void) AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table,
- Table->Length - sizeof (*Table), AcpiDmTableInfoSlic);
+ (void) AcpiDmDumpTable (TableLength, sizeof (ACPI_TABLE_HEADER),
+ (void *) (Table + sizeof (*Table)),
+ TableLength - sizeof (*Table), AcpiDmTableInfoSlic);
}

View File

@ -1,50 +0,0 @@
From 0fb79a24fb70ab1e1e4879220af82a9fa00af586 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Mon, 28 Sep 2020 13:01:18 -0600
Subject: [PATCH 36/45] Support MCFG in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -930,11 +930,12 @@ AcpiDmDumpMcfg (
ACPI_STATUS Status;
UINT32 Offset = sizeof (ACPI_TABLE_MCFG);
ACPI_MCFG_ALLOCATION *Subtable;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
/* Main table */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMcfg);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoMcfg);
if (ACPI_FAILURE (Status))
{
return;
@@ -943,17 +944,17 @@ AcpiDmDumpMcfg (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
- if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length)
+ if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > TableLength)
{
AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n",
- (UINT32) sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length));
+ (UINT32) sizeof (ACPI_MCFG_ALLOCATION) - (Offset - TableLength));
return;
}
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
sizeof (ACPI_MCFG_ALLOCATION), AcpiDmTableInfoMcfg0);
if (ACPI_FAILURE (Status))
{

View File

@ -1,46 +0,0 @@
From d10bfd67b5352ff5587e06fc1f82b896bab49614 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Mon, 28 Sep 2020 16:49:30 -0600
Subject: [PATCH 37/45] Support LPIT in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -690,7 +690,7 @@ AcpiDmDumpLpit (
{
ACPI_STATUS Status;
ACPI_LPIT_HEADER *Subtable;
- UINT32 Length = Table->Length;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_LPIT);
ACPI_DMTABLE_INFO *InfoTable;
UINT32 SubtableLength;
@@ -699,11 +699,11 @@ AcpiDmDumpLpit (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
/* Common subtable header */
- Status = AcpiDmDumpTable (Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
sizeof (ACPI_LPIT_HEADER), AcpiDmTableInfoLpitHdr);
if (ACPI_FAILURE (Status))
{
@@ -727,7 +727,7 @@ AcpiDmDumpLpit (
return;
}
- Status = AcpiDmDumpTable (Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
SubtableLength, InfoTable);
if (ACPI_FAILURE (Status))
{

View File

@ -1,85 +0,0 @@
From bd19995fa268ed3e93c071162d0e9c2d35ada0d4 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Tue, 29 Jun 2021 16:23:30 -0600
Subject: [PATCH 38/45] Support PMTT in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -1686,8 +1686,9 @@ AcpiDmDumpPmtt (
{
ACPI_STATUS Status;
ACPI_PMTT_HEADER *Subtable;
- UINT32 Length = Table->Length;
+ UINT32 Length = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_PMTT);
+ UINT16 SubtableLength;
/* Main table */
@@ -1701,17 +1702,18 @@ AcpiDmDumpPmtt (
/* Subtables */
Subtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < Length)
{
/* Each of the types below contain the common subtable header */
AcpiOsPrintf ("\n");
+ SubtableLength = AcpiUtReadUint16 (&Subtable->Length);
switch (Subtable->Type)
{
case ACPI_PMTT_TYPE_SOCKET:
Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoPmtt0);
+ SubtableLength, AcpiDmTableInfoPmtt0);
if (ACPI_FAILURE (Status))
{
return;
@@ -1720,7 +1722,7 @@ AcpiDmDumpPmtt (
case ACPI_PMTT_TYPE_CONTROLLER:
Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoPmtt1);
+ SubtableLength, AcpiDmTableInfoPmtt1);
if (ACPI_FAILURE (Status))
{
return;
@@ -1729,7 +1731,7 @@ AcpiDmDumpPmtt (
case ACPI_PMTT_TYPE_DIMM:
Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoPmtt2);
+ SubtableLength, AcpiDmTableInfoPmtt2);
if (ACPI_FAILURE (Status))
{
return;
@@ -1738,7 +1740,7 @@ AcpiDmDumpPmtt (
case ACPI_PMTT_TYPE_VENDOR:
Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoPmttVendor);
+ SubtableLength, AcpiDmTableInfoPmttVendor);
if (ACPI_FAILURE (Status))
{
return;
@@ -1754,9 +1756,9 @@ AcpiDmDumpPmtt (
/* Point to next subtable */
- Offset += Subtable->Length;
+ Offset += SubtableLength;
Subtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
- Subtable, Subtable->Length);
+ Subtable, SubtableLength);
}
}

View File

@ -1,119 +0,0 @@
From c240ab3af6a4ad4405def7188e3d64da06a69f37 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Wed, 30 Sep 2020 18:42:38 -0600
Subject: [PATCH 39/45] Support TPM2 in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump3.c | 18 ++++++++++--------
source/compiler/dttable2.c | 8 +++++---
2 files changed, 15 insertions(+), 11 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump3.c
+++ acpica-unix2-20210604/source/common/dmtbdump3.c
@@ -470,11 +470,12 @@ AcpiDmDumpTpm2Rev3 (
ACPI_TABLE_TPM23 *CommonHeader = ACPI_CAST_PTR (ACPI_TABLE_TPM23, Table);
ACPI_TPM23_TRAILER *Subtable = ACPI_ADD_PTR (ACPI_TPM23_TRAILER, Table, Offset);
ACPI_STATUS Status;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
/* Main table */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoTpm23);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoTpm23);
if (ACPI_FAILURE (Status))
{
return;
@@ -486,8 +487,8 @@ AcpiDmDumpTpm2Rev3 (
{
case ACPI_TPM23_ACPI_START_METHOD:
- (void) AcpiDmDumpTable (Table->Length, Offset, Subtable,
- Table->Length - Offset, AcpiDmTableInfoTpm23a);
+ (void) AcpiDmDumpTable (TableLength, Offset, Subtable,
+ TableLength - Offset, AcpiDmTableInfoTpm23a);
break;
default:
@@ -517,6 +518,7 @@ AcpiDmDumpTpm2 (
ACPI_TPM2_TRAILER *Subtable = ACPI_ADD_PTR (ACPI_TPM2_TRAILER, Table, Offset);
ACPI_TPM2_ARM_SMC *ArmSubtable;
ACPI_STATUS Status;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
if (Table->Revision == 3)
@@ -527,7 +529,7 @@ AcpiDmDumpTpm2 (
/* Main table */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoTpm2);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoTpm2);
if (ACPI_FAILURE (Status))
{
@@ -535,8 +537,8 @@ AcpiDmDumpTpm2 (
}
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
- Table->Length - Offset, AcpiDmTableInfoTpm2a);
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
+ TableLength - Offset, AcpiDmTableInfoTpm2a);
if (ACPI_FAILURE (Status))
{
return;
@@ -551,8 +553,8 @@ AcpiDmDumpTpm2 (
Offset += sizeof (ACPI_TPM2_TRAILER);
AcpiOsPrintf ("\n");
- (void) AcpiDmDumpTable (Table->Length, Offset, ArmSubtable,
- Table->Length - Offset, AcpiDmTableInfoTpm211);
+ (void) AcpiDmDumpTable (TableLength, Offset, ArmSubtable,
+ TableLength - Offset, AcpiDmTableInfoTpm211);
break;
default:
Index: acpica-unix2-20210604/source/compiler/dttable2.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable2.c
+++ acpica-unix2-20210604/source/compiler/dttable2.c
@@ -2267,6 +2267,7 @@ DtCompileTpm2 (
DT_SUBTABLE *ParentTable;
ACPI_STATUS Status = AE_OK;
ACPI_TABLE_HEADER *Header;
+ UINT8 StartMethod;
ParentTable = DtPeekSubtable ();
@@ -2310,7 +2311,8 @@ DtCompileTpm2 (
/* Subtable type depends on the StartMethod */
- switch (Tpm2Header->StartMethod)
+ StartMethod = *(UINT8 *) &Tpm2Header->StartMethod;
+ switch (StartMethod)
{
case ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC:
@@ -2341,7 +2343,7 @@ DtCompileTpm2 (
case ACPI_TPM2_RESERVED10:
AcpiOsPrintf ("\n**** Reserved TPM2 Start Method type 0x%X\n",
- Tpm2Header->StartMethod);
+ StartMethod);
Status = AE_ERROR;
break;
@@ -2349,7 +2351,7 @@ DtCompileTpm2 (
default:
AcpiOsPrintf ("\n**** Unknown TPM2 Start Method type 0x%X\n",
- Tpm2Header->StartMethod);
+ StartMethod);
Status = AE_ERROR;
break;
}

View File

@ -1,96 +0,0 @@
From 9fc0e46189feb926b13713422ea2722e273a31b5 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Mon, 19 Oct 2020 17:30:30 -0400
Subject: [PATCH 40/45] Support S3PT in a big-endian world
---
source/common/dmtbdump2.c | 15 +++++++++------
source/compiler/dttable2.c | 4 +++-
2 files changed, 12 insertions(+), 7 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -2039,6 +2039,8 @@ AcpiDmDumpS3pt (
ACPI_FPDT_HEADER *Subtable;
ACPI_DMTABLE_INFO *InfoTable;
ACPI_TABLE_S3PT *S3ptTable = ACPI_CAST_PTR (ACPI_TABLE_S3PT, Tables);
+ UINT32 S3ptTableLength = AcpiUtReadUint32 (&S3ptTable->Length);
+ UINT16 SubtableType;
/* Main table */
@@ -2050,19 +2052,20 @@ AcpiDmDumpS3pt (
}
Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, S3ptTable, Offset);
- while (Offset < S3ptTable->Length)
+ while (Offset < S3ptTableLength)
{
/* Common subtable header */
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (S3ptTable->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (S3ptTableLength, Offset, Subtable,
Subtable->Length, AcpiDmTableInfoS3ptHdr);
if (ACPI_FAILURE (Status))
{
return 0;
}
- switch (Subtable->Type)
+ SubtableType = AcpiUtReadUint16 (&Subtable->Type);
+ switch (SubtableType)
{
case ACPI_S3PT_TYPE_RESUME:
@@ -2077,7 +2080,7 @@ AcpiDmDumpS3pt (
default:
AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n",
- Subtable->Type);
+ SubtableType);
/* Attempt to continue */
@@ -2090,7 +2093,7 @@ AcpiDmDumpS3pt (
}
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (S3ptTable->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (S3ptTableLength, Offset, Subtable,
Subtable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{
@@ -2104,7 +2107,7 @@ NextSubtable:
Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable, Subtable->Length);
}
- return (S3ptTable->Length);
+ return (S3ptTableLength);
}
Index: acpica-unix2-20210604/source/compiler/dttable2.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable2.c
+++ acpica-unix2-20210604/source/compiler/dttable2.c
@@ -1406,6 +1406,7 @@ DtCompileS3pt (
DT_SUBTABLE *ParentTable;
ACPI_DMTABLE_INFO *InfoTable;
DT_FIELD *SubtableStart;
+ UINT16 S3ptHeaderType;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3pt,
@@ -1433,7 +1434,8 @@ DtCompileS3pt (
S3ptHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
- switch (S3ptHeader->Type)
+ S3ptHeaderType = AcpiUtReadUint16 (&S3ptHeader->Type);
+ switch (S3ptHeaderType)
{
case ACPI_S3PT_TYPE_RESUME:

View File

@ -1,414 +0,0 @@
From 5bd43bca1708a56d32e63da0278e04caf2865927 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Tue, 29 Jun 2021 17:38:20 -0600
Subject: [PATCH 41/45] Support IORT in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 85 ++++++++++++++++++++++----------------
source/compiler/dttable1.c | 40 ++++++++++--------
2 files changed, 72 insertions(+), 53 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -77,17 +77,20 @@ AcpiDmDumpIort (
ACPI_IORT_RMR *IortRmr = NULL;
UINT32 Offset;
UINT32 NodeOffset;
+ UINT32 NodeLength;
UINT32 Length;
ACPI_DMTABLE_INFO *InfoTable;
char *String;
UINT32 i;
UINT32 MappingByteLength;
UINT8 Revision;
+ UINT32 MappingCount;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
/* Main table */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIort);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoIort);
if (ACPI_FAILURE (Status))
{
return;
@@ -109,18 +112,19 @@ AcpiDmDumpIort (
/* Dump the OptionalPadding (optional) */
- if (Iort->NodeOffset > Offset)
+ NodeOffset = AcpiUtReadUint32 (&Iort->NodeOffset);
+ if (NodeOffset > Offset)
{
- Status = AcpiDmDumpTable (Table->Length, Offset, Table,
- Iort->NodeOffset - Offset, AcpiDmTableInfoIortPad);
+ Status = AcpiDmDumpTable (TableLength, Offset, Table,
+ NodeOffset - Offset, AcpiDmTableInfoIortPad);
if (ACPI_FAILURE (Status))
{
return;
}
}
- Offset = Iort->NodeOffset;
- while (Offset < Table->Length)
+ Offset = AcpiUtReadUint32 (&Iort->NodeOffset);
+ while (Offset < TableLength)
{
/* Common subtable header */
@@ -130,12 +134,12 @@ AcpiDmDumpIort (
if (Revision == 0)
{
- Status = AcpiDmDumpTable (Table->Length, Offset,
+ Status = AcpiDmDumpTable (TableLength, Offset,
IortNode, Length, AcpiDmTableInfoIortHdr);
}
else if (Revision >= 3)
{
- Status = AcpiDmDumpTable (Table->Length, Offset,
+ Status = AcpiDmDumpTable (TableLength, Offset,
IortNode, Length, AcpiDmTableInfoIortHdr3);
}
@@ -166,7 +170,7 @@ AcpiDmDumpIort (
case ACPI_IORT_NODE_PCI_ROOT_COMPLEX:
InfoTable = AcpiDmTableInfoIort2;
- Length = IortNode->Length - NodeOffset;
+ Length = AcpiUtReadUint16 (&IortNode->Length) - NodeOffset;
break;
case ACPI_IORT_NODE_SMMU:
@@ -179,19 +183,19 @@ AcpiDmDumpIort (
case ACPI_IORT_NODE_SMMU_V3:
InfoTable = AcpiDmTableInfoIort4;
- Length = IortNode->Length - NodeOffset;
+ Length = AcpiUtReadUint16 (&IortNode->Length) - NodeOffset;
break;
case ACPI_IORT_NODE_PMCG:
InfoTable = AcpiDmTableInfoIort5;
- Length = IortNode->Length - NodeOffset;
+ Length = AcpiUtReadUint16 (&IortNode->Length) - NodeOffset;
break;
case ACPI_IORT_NODE_RMR:
InfoTable = AcpiDmTableInfoIort6;
- Length = IortNode->Length - NodeOffset;
+ Length = AcpiUtReadUint16 (&IortNode->Length) - NodeOffset;
IortRmr = ACPI_ADD_PTR (ACPI_IORT_RMR, IortNode, NodeOffset);
break;
@@ -202,7 +206,7 @@ AcpiDmDumpIort (
/* Attempt to continue */
- if (!IortNode->Length)
+ if (!AcpiUtReadUint16 (&IortNode->Length))
{
AcpiOsPrintf ("Invalid zero length IORT node\n");
return;
@@ -213,7 +217,7 @@ AcpiDmDumpIort (
/* Dump the node subtable header */
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
Length, InfoTable);
if (ACPI_FAILURE (Status))
@@ -233,9 +237,10 @@ AcpiDmDumpIort (
if (IortItsGroup)
{
- for (i = 0; i < IortItsGroup->ItsCount; i++)
+ UINT32 ItsCount = AcpiUtReadUint32 (&IortItsGroup->ItsCount);
+ for (i = 0; i < ItsCount; i++)
{
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
4, AcpiDmTableInfoIort0a);
if (ACPI_FAILURE (Status))
@@ -252,12 +257,14 @@ AcpiDmDumpIort (
/* Dump the Padding (optional) */
- if (IortNode->Length > NodeOffset)
+ NodeLength = AcpiUtReadUint16 (&IortNode->Length);
+ if (NodeLength > NodeOffset)
{
MappingByteLength =
- IortNode->MappingCount * sizeof (ACPI_IORT_ID_MAPPING);
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
- Table, IortNode->Length - NodeOffset - MappingByteLength,
+ AcpiUtReadUint32 (&IortNode->MappingCount) *
+ sizeof (ACPI_IORT_ID_MAPPING);
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
+ Table, NodeLength - NodeOffset - MappingByteLength,
AcpiDmTableInfoIort1a);
if (ACPI_FAILURE (Status))
{
@@ -274,9 +281,11 @@ AcpiDmDumpIort (
if (IortSmmu)
{
+ UINT32 InterruptCount;
+
Length = 2 * sizeof (UINT64);
- NodeOffset = IortSmmu->GlobalInterruptOffset;
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
+ NodeOffset = AcpiUtReadUint32 (&IortSmmu->GlobalInterruptOffset);
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
Length, AcpiDmTableInfoIort3a);
if (ACPI_FAILURE (Status))
@@ -284,10 +293,11 @@ AcpiDmDumpIort (
return;
}
- NodeOffset = IortSmmu->ContextInterruptOffset;
- for (i = 0; i < IortSmmu->ContextInterruptCount; i++)
+ NodeOffset = AcpiUtReadUint32 (&IortSmmu->ContextInterruptOffset);
+ InterruptCount = AcpiUtReadUint32 (&IortSmmu->ContextInterruptCount);
+ for (i = 0; i < InterruptCount; i++)
{
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
8, AcpiDmTableInfoIort3b);
if (ACPI_FAILURE (Status))
@@ -298,10 +308,11 @@ AcpiDmDumpIort (
NodeOffset += 8;
}
- NodeOffset = IortSmmu->PmuInterruptOffset;
- for (i = 0; i < IortSmmu->PmuInterruptCount; i++)
+ NodeOffset = AcpiUtReadUint32 (&IortSmmu->PmuInterruptOffset);
+ InterruptCount = AcpiUtReadUint32 (&IortSmmu->PmuInterruptCount);
+ for (i = 0; i < InterruptCount; i++)
{
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
8, AcpiDmTableInfoIort3c);
if (ACPI_FAILURE (Status))
@@ -319,12 +330,15 @@ AcpiDmDumpIort (
/* Validate IortRmr to avoid compiler warnings */
if (IortRmr)
{
- NodeOffset = IortRmr->RmrOffset;
+ UINT32 RmrCount;
+
+ NodeOffset = AcpiUtReadUint32 (&IortRmr->RmrOffset);
+ RmrCount = AcpiUtReadUint32 (&IortRmr->RmrCount);
Length = sizeof (ACPI_IORT_RMR_DESC);
- for (i = 0; i < IortRmr->RmrCount; i++)
+ for (i = 0; i < RmrCount; i++)
{
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
Length, AcpiDmTableInfoIort6a);
if (ACPI_FAILURE (Status))
@@ -344,12 +358,13 @@ AcpiDmDumpIort (
/* Dump the ID mappings */
- NodeOffset = IortNode->MappingOffset;
- for (i = 0; i < IortNode->MappingCount; i++)
+ NodeOffset = AcpiUtReadUint32 (&IortNode->MappingOffset);
+ MappingCount = AcpiUtReadUint32 (&IortNode->MappingCount);
+ for (i = 0; i < MappingCount; i++)
{
AcpiOsPrintf ("\n");
Length = sizeof (ACPI_IORT_ID_MAPPING);
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
Length, AcpiDmTableInfoIortMap);
if (ACPI_FAILURE (Status))
@@ -363,7 +378,7 @@ AcpiDmDumpIort (
NextSubtable:
/* Point to next node subtable */
- Offset += IortNode->Length;
+ Offset += AcpiUtReadUint16 (&IortNode->Length);
}
}
Index: acpica-unix2-20210604/source/compiler/dttable1.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable1.c
+++ acpica-unix2-20210604/source/compiler/dttable1.c
@@ -1592,6 +1592,7 @@ DtCompileIort (
ACPI_IORT_ITS_GROUP *IortItsGroup;
ACPI_IORT_SMMU *IortSmmu;
ACPI_IORT_RMR *IortRmr;
+ UINT32 IortNodeOffset;
UINT32 NodeNumber;
UINT32 NodeLength;
UINT32 IdMappingNumber;
@@ -1637,7 +1638,7 @@ DtCompileIort (
* Optionally allows the generic data types to be used for filling
* this field.
*/
- Iort->NodeOffset = sizeof (ACPI_TABLE_IORT);
+ IortNodeOffset = sizeof (ACPI_TABLE_IORT);
Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortPad,
&Subtable);
if (ACPI_FAILURE (Status))
@@ -1647,7 +1648,7 @@ DtCompileIort (
if (Subtable)
{
DtInsertSubtable (ParentTable, Subtable);
- Iort->NodeOffset += Subtable->Length;
+ IortNodeOffset += Subtable->Length;
}
else
{
@@ -1657,7 +1658,7 @@ DtCompileIort (
{
return (Status);
}
- Iort->NodeOffset += PaddingLength;
+ IortNodeOffset += PaddingLength;
}
NodeNumber = 0;
@@ -1721,7 +1722,7 @@ DtCompileIort (
ItsNumber++;
}
- IortItsGroup->ItsCount = ItsNumber;
+ IortItsGroup->ItsCount = AcpiUtReadUint32 (&ItsNumber);
break;
case ACPI_IORT_NODE_NAMED_COMPONENT:
@@ -1755,15 +1756,18 @@ DtCompileIort (
}
else
{
- if (NodeLength > IortNode->MappingOffset)
+ UINT32 MappingOffset;
+
+ MappingOffset = IortNode->MappingOffset;
+ if (NodeLength > MappingOffset)
{
return (AE_BAD_DATA);
}
- if (NodeLength < IortNode->MappingOffset)
+ if (NodeLength < MappingOffset)
{
Status = DtCompilePadding (
- IortNode->MappingOffset - NodeLength,
+ MappingOffset - NodeLength,
&Subtable);
if (ACPI_FAILURE (Status))
{
@@ -1771,7 +1775,7 @@ DtCompileIort (
}
DtInsertSubtable (ParentTable, Subtable);
- NodeLength = IortNode->MappingOffset;
+ NodeLength = MappingOffset;
}
}
break;
@@ -1804,7 +1808,7 @@ DtCompileIort (
/* Compile global interrupt array */
- IortSmmu->GlobalInterruptOffset = NodeLength;
+ IortSmmu->GlobalInterruptOffset = AcpiUtReadUint32 (&NodeLength);
Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3a,
&Subtable);
if (ACPI_FAILURE (Status))
@@ -1818,7 +1822,7 @@ DtCompileIort (
/* Compile context interrupt array */
ContextIrptNumber = 0;
- IortSmmu->ContextInterruptOffset = NodeLength;
+ IortSmmu->ContextInterruptOffset = AcpiUtReadUint32 (&NodeLength);
while (*PFieldList)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3b,
@@ -1838,12 +1842,12 @@ DtCompileIort (
ContextIrptNumber++;
}
- IortSmmu->ContextInterruptCount = ContextIrptNumber;
+ IortSmmu->ContextInterruptCount = AcpiUtReadUint32 (&ContextIrptNumber);
/* Compile PMU interrupt array */
PmuIrptNumber = 0;
- IortSmmu->PmuInterruptOffset = NodeLength;
+ IortSmmu->PmuInterruptOffset = AcpiUtReadUint32 (&NodeLength);
while (*PFieldList)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3c,
@@ -1863,7 +1867,7 @@ DtCompileIort (
PmuIrptNumber++;
}
- IortSmmu->PmuInterruptCount = PmuIrptNumber;
+ IortSmmu->PmuInterruptCount = AcpiUtReadUint32 (&PmuIrptNumber);
break;
case ACPI_IORT_NODE_SMMU_V3:
@@ -1908,7 +1912,7 @@ DtCompileIort (
/* Compile RMR Descriptors */
RmrCount = 0;
- IortRmr->RmrOffset = NodeLength;
+ IortRmr->RmrOffset = AcpiUtReadUint32 (&NodeLength);
while (*PFieldList)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort6a,
@@ -1928,7 +1932,7 @@ DtCompileIort (
RmrCount++;
}
- IortRmr->RmrCount = RmrCount;
+ IortRmr->RmrCount = AcpiUtReadUint32 (&RmrCount);
break;
default:
@@ -1939,7 +1943,7 @@ DtCompileIort (
/* Compile Array of ID mappings */
- IortNode->MappingOffset = NodeLength;
+ IortNode->MappingOffset = AcpiUtReadUint32 (&NodeLength);
IdMappingNumber = 0;
while (*PFieldList)
{
@@ -1960,7 +1964,7 @@ DtCompileIort (
IdMappingNumber++;
}
- IortNode->MappingCount = IdMappingNumber;
+ IortNode->MappingCount = AcpiUtReadUint32 (&IdMappingNumber);
if (!IdMappingNumber)
{
IortNode->MappingOffset = 0;
@@ -1975,7 +1979,7 @@ DtCompileIort (
NodeNumber++;
}
- Iort->NodeCount = NodeNumber;
+ Iort->NodeCount = AcpiUtReadUint32 (&NodeNumber);
return (AE_OK);
}

View File

@ -1,138 +0,0 @@
From b64cff82b2b33ed659826d777d2db039f64fd198 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Tue, 29 Jun 2021 17:45:24 -0600
Subject: [PATCH 42/45] Support IVRS in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 34 +++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -419,11 +419,14 @@ AcpiDmDumpIvrs (
ACPI_IVRS_DE_HEADER *DeviceEntry;
ACPI_IVRS_HEADER *Subtable;
ACPI_DMTABLE_INFO *InfoTable;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
+ UINT16 SubtableLength;
+
/* Main table */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIvrs);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoIvrs);
if (ACPI_FAILURE (Status))
{
return;
@@ -433,8 +436,9 @@ AcpiDmDumpIvrs (
Subtable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
+ SubtableLength = AcpiUtReadUint16 (&Subtable->Length);
switch (Subtable->Type)
{
/* Type 10h, IVHD (I/O Virtualization Hardware Definition) */
@@ -471,7 +475,7 @@ AcpiDmDumpIvrs (
/* Attempt to continue */
- if (!Subtable->Length)
+ if (!SubtableLength)
{
AcpiOsPrintf ("Invalid zero length subtable\n");
return;
@@ -481,8 +485,8 @@ AcpiDmDumpIvrs (
/* Dump the subtable */
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
- Subtable->Length, InfoTable);
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
+ SubtableLength, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -511,7 +515,7 @@ AcpiDmDumpIvrs (
/* Process all of the Device Entries */
- while (EntryOffset < (Offset + Subtable->Length))
+ while (EntryOffset < (Offset + SubtableLength))
{
AcpiOsPrintf ("\n");
@@ -581,7 +585,7 @@ AcpiDmDumpIvrs (
/* Dump the Device Entry */
- Status = AcpiDmDumpTable (Table->Length, EntryOffset,
+ Status = AcpiDmDumpTable (TableLength, EntryOffset,
DeviceEntry, EntryLength, InfoTable);
if (ACPI_FAILURE (Status))
{
@@ -605,12 +609,12 @@ AcpiDmDumpIvrs (
*/
if (UtIsIdInteger ((UINT8 *) &HidSubtable->AcpiHid))
{
- Status = AcpiDmDumpTable (Table->Length, EntryOffset,
+ Status = AcpiDmDumpTable (TableLength, EntryOffset,
&HidSubtable->AcpiHid, 8, AcpiDmTableInfoIvrsHidInteger);
}
else
{
- Status = AcpiDmDumpTable (Table->Length, EntryOffset,
+ Status = AcpiDmDumpTable (TableLength, EntryOffset,
&HidSubtable->AcpiHid, 8, AcpiDmTableInfoIvrsHidString);
}
if (ACPI_FAILURE (Status))
@@ -628,12 +632,12 @@ AcpiDmDumpIvrs (
*/
if (UtIsIdInteger ((UINT8 *) &HidSubtable->AcpiCid))
{
- Status = AcpiDmDumpTable (Table->Length, EntryOffset,
+ Status = AcpiDmDumpTable (TableLength, EntryOffset,
&HidSubtable->AcpiCid, 8, AcpiDmTableInfoIvrsCidInteger);
}
else
{
- Status = AcpiDmDumpTable (Table->Length, EntryOffset,
+ Status = AcpiDmDumpTable (TableLength, EntryOffset,
&HidSubtable->AcpiCid, 8, AcpiDmTableInfoIvrsCidString);
}
if (ACPI_FAILURE (Status))
@@ -650,7 +654,7 @@ AcpiDmDumpIvrs (
if (HidSubtable->UidType == ACPI_IVRS_UID_IS_STRING)
{
- Status = AcpiDmDumpTable (Table->Length, EntryOffset,
+ Status = AcpiDmDumpTable (TableLength, EntryOffset,
&HidSubtable->UidType, EntryLength, AcpiDmTableInfoIvrsUidString);
if (ACPI_FAILURE (Status))
{
@@ -659,7 +663,7 @@ AcpiDmDumpIvrs (
}
else /* ACPI_IVRS_UID_IS_INTEGER */
{
- Status = AcpiDmDumpTable (Table->Length, EntryOffset,
+ Status = AcpiDmDumpTable (TableLength, EntryOffset,
&HidSubtable->UidType, EntryLength, AcpiDmTableInfoIvrsUidInteger);
if (ACPI_FAILURE (Status))
{
@@ -678,8 +682,8 @@ AcpiDmDumpIvrs (
NextSubtable:
/* Point to next subtable */
- Offset += Subtable->Length;
- Subtable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Subtable, Subtable->Length);
+ Offset += SubtableLength;
+ Subtable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Subtable, SubtableLength);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +0,0 @@
From bd137d3712e6bc7e4d2d11350a208a36750e4063 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Tue, 6 Jul 2021 18:26:41 -0600
Subject: [PATCH 44/45] Initial support for WPBT in big-endian, needs more
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/compiler/dttable2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: acpica-unix2-20210604/source/compiler/dttable2.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable2.c
+++ acpica-unix2-20210604/source/compiler/dttable2.c
@@ -2638,7 +2638,7 @@ DtCompileWpbt (
AcpiUtWriteUint (&Length, sizeof (UINT16),
&Subtable->TotalLength, sizeof (UINT32));
Table = ACPI_CAST_PTR (ACPI_TABLE_WPBT, ParentTable->Buffer);
- Table->ArgumentsLength = Length;
+ Table->ArgumentsLength = AcpiUtReadUint16 (&Length);
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);

View File

@ -1,213 +0,0 @@
From 0d87ee42adda7837bec3cc0ff86e40c2f2e8dc4f Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Fri, 9 Jul 2021 14:52:55 -0600
Subject: [PATCH 45/45] CSRT: fixed use of optional ResourceInfo
In a resource sub-sub-table, there may be a ResourceInfo entry. Neither
the compiler nor disassembler accounted for that possibility properly.
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump1.c | 43 +++++++++++++++++++++-----------------
source/compiler/dttable1.c | 28 +++++++++++++------------
2 files changed, 39 insertions(+), 32 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump1.c
+++ acpica-unix2-20210604/source/common/dmtbdump1.c
@@ -374,11 +374,13 @@ AcpiDmDumpCsrt (
ACPI_CSRT_GROUP *Subtable;
ACPI_CSRT_SHARED_INFO *SharedInfoTable;
ACPI_CSRT_DESCRIPTOR *SubSubtable;
- UINT32 Length = AcpiUtReadUint32 (&Table->Length);
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_CSRT);
UINT32 SubOffset;
UINT32 SubSubOffset;
UINT32 InfoLength;
+ UINT32 SubtableLength;
+ UINT32 SubSubtableLength;
/* The main table only contains the ACPI header, thus already handled */
@@ -386,13 +388,14 @@ AcpiDmDumpCsrt (
/* Subtables (Resource Groups) */
Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
- while (Offset < Length)
+ while (Offset < TableLength)
{
/* Resource group subtable */
+ SubtableLength = AcpiUtReadUint32 (&Subtable->Length);
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoCsrt0);
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
+ SubtableLength, AcpiDmTableInfoCsrt0);
if (ACPI_FAILURE (Status))
{
return;
@@ -405,26 +408,28 @@ AcpiDmDumpCsrt (
Offset + SubOffset);
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Length, Offset + SubOffset, SharedInfoTable,
- sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1);
+ Status = AcpiDmDumpTable (TableLength, Offset + SubOffset,
+ SharedInfoTable, sizeof (ACPI_CSRT_SHARED_INFO),
+ AcpiDmTableInfoCsrt1);
if (ACPI_FAILURE (Status))
{
return;
}
- SubOffset += Subtable->SharedInfoLength;
+ SubOffset += AcpiUtReadUint32 (&Subtable->SharedInfoLength);
/* Sub-Subtables (Resource Descriptors) */
SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table,
Offset + SubOffset);
- while ((SubOffset < Subtable->Length) &&
- ((Offset + SubOffset) < Length))
+ while ((SubOffset < SubtableLength) &&
+ ((Offset + SubOffset) < TableLength))
{
+ SubSubtableLength = AcpiUtReadUint32 (&SubSubtable->Length);
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubtable,
- SubSubtable->Length, AcpiDmTableInfoCsrt2);
+ Status = AcpiDmDumpTable (TableLength, Offset + SubOffset,
+ SubSubtable, SubSubtableLength, AcpiDmTableInfoCsrt2);
if (ACPI_FAILURE (Status))
{
return;
@@ -434,11 +439,12 @@ AcpiDmDumpCsrt (
/* Resource-specific info buffer */
- InfoLength = SubSubtable->Length - SubSubOffset;
+ InfoLength = SubSubtableLength - SubSubOffset;
if (InfoLength)
{
- Status = AcpiDmDumpTable (Length,
- Offset + SubOffset + SubSubOffset, Table,
+ Status = AcpiDmDumpTable (TableLength,
+ Offset + SubOffset + SubSubOffset,
+ (UINT8 *)SubSubtable + SubSubOffset,
InfoLength, AcpiDmTableInfoCsrt2a);
if (ACPI_FAILURE (Status))
{
@@ -448,16 +454,15 @@ AcpiDmDumpCsrt (
/* Point to next sub-subtable */
- SubOffset += SubSubtable->Length;
+ SubOffset += SubSubtableLength;
SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubtable,
- SubSubtable->Length);
+ SubSubtableLength);
}
/* Point to next subtable */
- Offset += Subtable->Length;
- Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Subtable,
- Subtable->Length);
+ Offset += SubtableLength;
+ Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Subtable, SubtableLength);
}
}
Index: acpica-unix2-20210604/source/compiler/dttable1.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable1.c
+++ acpica-unix2-20210604/source/compiler/dttable1.c
@@ -353,14 +353,16 @@ DtCompileCsrt (
DT_SUBTABLE *Subtable;
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
- UINT32 DescriptorCount;
+ UINT32 DescriptorLength;
UINT32 GroupLength;
UINT32 Tmp;
+ UINT32 Offset;
/* Subtables (Resource Groups) */
ParentTable = DtPeekSubtable ();
+
while (*PFieldList)
{
/* Resource group subtable */
@@ -375,16 +377,13 @@ DtCompileCsrt (
/* Compute the number of resource descriptors */
Tmp = AcpiUtReadUint32 (&(ACPI_CAST_PTR (ACPI_CSRT_GROUP,
- Subtable->Buffer))->Length);
+ Subtable->Buffer))->Length);
GroupLength = Tmp;
Tmp = AcpiUtReadUint32 (&(ACPI_CAST_PTR (ACPI_CSRT_GROUP,
- Subtable->Buffer))->SharedInfoLength);
+ Subtable->Buffer))->SharedInfoLength);
GroupLength -= Tmp;
GroupLength -= sizeof (ACPI_CSRT_GROUP);
- DescriptorCount = (GroupLength /
- sizeof (ACPI_CSRT_DESCRIPTOR));
-
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
ParentTable = DtPeekSubtable ();
@@ -399,10 +398,13 @@ DtCompileCsrt (
}
DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+ ParentTable = DtPeekSubtable ();
/* Sub-Subtables (Resource Descriptors) */
- while (*PFieldList && DescriptorCount)
+ Offset = 0;
+ while (*PFieldList && (Offset < GroupLength))
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt2,
@@ -411,6 +413,10 @@ DtCompileCsrt (
{
return (Status);
}
+ DescriptorLength = AcpiUtReadUint32 (
+ &(ACPI_CAST_PTR (ACPI_CSRT_GROUP,
+ Subtable->Buffer))->Length);
+
DtInsertSubtable (ParentTable, Subtable);
@@ -420,11 +426,7 @@ DtCompileCsrt (
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt2a,
&Subtable);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- if (Subtable)
+ if (ACPI_SUCCESS (Status) && Subtable)
{
DtInsertSubtable (ParentTable, Subtable);
}
@@ -432,7 +434,7 @@ DtCompileCsrt (
DtPopSubtable ();
ParentTable = DtPeekSubtable ();
- DescriptorCount--;
+ Offset += DescriptorLength;
}
DtPopSubtable ();

View File

@ -1,180 +0,0 @@
From 5fd729c8f6c4ce295edd142fc41e03e831ba4afb Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Mon, 12 Jul 2021 09:39:38 -0600
Subject: [PATCH] Support PHAT in a big-endian world
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 36 ++++++++++++++++++++----------------
source/compiler/dttable2.c | 12 +++++++++---
2 files changed, 29 insertions(+), 19 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -1573,39 +1573,41 @@ AcpiDmDumpPhat (
ACPI_PHAT_HEADER *Subtable;
ACPI_PHAT_VERSION_DATA *VersionData;
UINT32 RecordCount;
- UINT32 Length = Table->Length;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_PHAT);
- UINT32 SubtableLength;
+ UINT16 SubtableLength;
UINT32 PathLength;
UINT32 VendorLength;
+ UINT16 SubtableType;
Subtable = ACPI_ADD_PTR (ACPI_PHAT_HEADER, Table, sizeof (ACPI_TABLE_PHAT));
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
/* Common subtable header */
+ SubtableType = AcpiUtReadUint16 (&Subtable->Type);
+ SubtableLength = AcpiUtReadUint16 (&Subtable->Length);
+
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Length, 0, Subtable,
+ Status = AcpiDmDumpTable (TableLength, 0, Subtable,
sizeof (ACPI_PHAT_HEADER), AcpiDmTableInfoPhatHdr);
if (ACPI_FAILURE (Status))
{
return;
}
- switch (Subtable->Type)
+ switch (SubtableType)
{
case ACPI_PHAT_TYPE_FW_VERSION_DATA:
InfoTable = AcpiDmTableInfoPhat0;
- SubtableLength = sizeof (ACPI_PHAT_VERSION_DATA);
break;
case ACPI_PHAT_TYPE_FW_HEALTH_DATA:
InfoTable = AcpiDmTableInfoPhat1;
- SubtableLength = sizeof (ACPI_PHAT_HEALTH_DATA);
break;
default:
@@ -1616,22 +1618,22 @@ AcpiDmDumpPhat (
return;
}
- Status = AcpiDmDumpTable (Length, 0, Subtable,
+ Status = AcpiDmDumpTable (TableLength, 0, Subtable,
SubtableLength, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
}
- switch (Subtable->Type)
+ switch (SubtableType)
{
case ACPI_PHAT_TYPE_FW_VERSION_DATA:
VersionData = ACPI_CAST_PTR (ACPI_PHAT_VERSION_DATA, Subtable);
- RecordCount = VersionData->ElementCount;
+ RecordCount = AcpiUtReadUint32 (&VersionData->ElementCount);
while (RecordCount)
{
- Status = AcpiDmDumpTable (Length, Offset,
+ Status = AcpiDmDumpTable (TableLength, Offset,
ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, sizeof (ACPI_PHAT_VERSION_DATA)),
sizeof (ACPI_PHAT_VERSION_ELEMENT), AcpiDmTableInfoPhat0a);
if (ACPI_FAILURE (Status))
@@ -1649,7 +1651,7 @@ AcpiDmDumpPhat (
/* account for the null terminator */
PathLength = strlen (ACPI_ADD_PTR (char, Subtable, sizeof (ACPI_PHAT_HEALTH_DATA))) + 1;
- Status = AcpiDmDumpTable (Length, Offset,
+ Status = AcpiDmDumpTable (TableLength, Offset,
ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, sizeof (ACPI_PHAT_HEALTH_DATA)),
PathLength, AcpiDmTableInfoPhat1a);
if (ACPI_FAILURE (Status))
@@ -1660,8 +1662,8 @@ AcpiDmDumpPhat (
/* Get vendor data - data length is the remaining subtable length */
VendorLength =
- Subtable->Length - sizeof (ACPI_PHAT_HEALTH_DATA) - PathLength;
- Status = AcpiDmDumpTable (Length, 0,
+ SubtableLength - sizeof (ACPI_PHAT_HEALTH_DATA) - PathLength;
+ Status = AcpiDmDumpTable (TableLength, 0,
ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, sizeof (ACPI_PHAT_HEALTH_DATA) + PathLength),
VendorLength, AcpiDmTableInfoPhat1b);
if (ACPI_FAILURE (Status))
@@ -1673,15 +1675,15 @@ AcpiDmDumpPhat (
default:
AcpiOsPrintf ("\n**** Unknown PHAT subtable type 0x%X\n\n",
- Subtable->Type);
+ SubtableType);
return;
}
/* Next subtable */
- Offset += Subtable->Length;
+ Offset += SubtableLength;
Subtable = ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable,
- Subtable->Length);
+ SubtableLength);
}
}
Index: acpica-unix2-20210604/source/compiler/dttable2.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable2.c
+++ acpica-unix2-20210604/source/compiler/dttable2.c
@@ -870,6 +870,8 @@ DtCompilePhat (
ACPI_DMTABLE_INFO *Info;
ACPI_PHAT_VERSION_DATA *VersionData;
UINT32 RecordCount;
+ UINT16 SubtableType;
+ UINT16 Tmp16;
/* The table consist of subtables */
@@ -887,8 +889,9 @@ DtCompilePhat (
DtPushSubtable (Subtable);
PhatHeader = ACPI_CAST_PTR (ACPI_PHAT_HEADER, Subtable->Buffer);
+ SubtableType = AcpiUtReadUint16 (&PhatHeader->Type);
- switch (PhatHeader->Type)
+ switch (SubtableType)
{
case ACPI_PHAT_TYPE_FW_VERSION_DATA:
@@ -919,13 +922,13 @@ DtCompilePhat (
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
- switch (PhatHeader->Type)
+ switch (SubtableType)
{
case ACPI_PHAT_TYPE_FW_VERSION_DATA:
VersionData = ACPI_CAST_PTR (ACPI_PHAT_VERSION_DATA,
(Subtable->Buffer - sizeof (ACPI_PHAT_HEADER)));
- RecordCount = VersionData->ElementCount;
+ RecordCount = AcpiUtReadUint32 (&VersionData->ElementCount);
while (RecordCount)
{
@@ -976,6 +979,9 @@ DtCompilePhat (
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, *PFieldList, "PHAT");
return (AE_ERROR);
}
+
+ Tmp16 = AcpiUtReadUint16 (&PhatHeader->Length);
+ PhatHeader->Length = Tmp16;
}
return (Status);

View File

@ -1,74 +0,0 @@
Signed-off-by: Dean Nelson <dnelson@redhat.com>
Reviewed-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 11 ++++++-----
source/compiler/dttable2.c | 4 ++--
2 files changed, 8 insertions(+), 7 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -1959,13 +1959,14 @@ AcpiDmDumpPrmt (
ACPI_PRMT_MODULE_INFO *PrmtModuleInfo;
ACPI_PRMT_HANDLER_INFO *PrmtHandlerInfo;
ACPI_STATUS Status;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
UINT32 i, j;
/* Main table header */
PrmtHeader = ACPI_ADD_PTR (ACPI_TABLE_PRMT_HEADER, Table, CurrentOffset);
- Status = AcpiDmDumpTable (Table->Length, CurrentOffset, PrmtHeader,
+ Status = AcpiDmDumpTable (TableLength, CurrentOffset, PrmtHeader,
sizeof (ACPI_TABLE_PRMT_HEADER), AcpiDmTableInfoPrmtHdr);
if (ACPI_FAILURE (Status))
{
@@ -1977,20 +1978,20 @@ AcpiDmDumpPrmt (
/* PRM Module Information Structure array */
- for (i = 0; i < PrmtHeader->ModuleInfoCount; ++i)
+ for (i = 0; i < AcpiUtReadUint32 (&PrmtHeader->ModuleInfoCount); ++i)
{
PrmtModuleInfo = ACPI_ADD_PTR (ACPI_PRMT_MODULE_INFO, Table, CurrentOffset);
- Status = AcpiDmDumpTable (Table->Length, CurrentOffset, PrmtModuleInfo,
+ Status = AcpiDmDumpTable (TableLength, CurrentOffset, PrmtModuleInfo,
sizeof (ACPI_PRMT_MODULE_INFO), AcpiDmTableInfoPrmtModule);
CurrentOffset += sizeof (ACPI_PRMT_MODULE_INFO);
/* PRM handler information structure array */
- for (j = 0; j < PrmtModuleInfo->HandlerInfoCount; ++j)
+ for (j = 0; j < AcpiUtReadUint16 (&PrmtModuleInfo->HandlerInfoCount); ++j)
{
PrmtHandlerInfo = ACPI_ADD_PTR (ACPI_PRMT_HANDLER_INFO, Table, CurrentOffset);
- Status = AcpiDmDumpTable (Table->Length, CurrentOffset, PrmtHandlerInfo,
+ Status = AcpiDmDumpTable (TableLength, CurrentOffset, PrmtHandlerInfo,
sizeof (ACPI_PRMT_HANDLER_INFO), AcpiDmTableInfoPrmtHandler);
CurrentOffset += sizeof (ACPI_PRMT_HANDLER_INFO);
Index: acpica-unix2-20210604/source/compiler/dttable2.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable2.c
+++ acpica-unix2-20210604/source/compiler/dttable2.c
@@ -1278,7 +1278,7 @@ DtCompilePrmt (
DtInsertSubtable (ParentTable, Subtable);
PrmtHeader = ACPI_CAST_PTR (ACPI_TABLE_PRMT_HEADER, Subtable->Buffer);
- for (i = 0; i < PrmtHeader->ModuleInfoCount; i++)
+ for (i = 0; i < AcpiUtReadUint32 (&PrmtHeader->ModuleInfoCount); i++)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoPrmtModule,
&Subtable);
@@ -1289,7 +1289,7 @@ DtCompilePrmt (
DtInsertSubtable (ParentTable, Subtable);
PrmtModuleInfo = ACPI_CAST_PTR (ACPI_PRMT_MODULE_INFO, Subtable->Buffer);
- for (j = 0; j < PrmtModuleInfo->HandlerInfoCount; j++)
+ for (j = 0; j < AcpiUtReadUint16 (&PrmtModuleInfo->HandlerInfoCount); j++)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoPrmtHandler,
&Subtable);

View File

@ -1,35 +0,0 @@
Signed-off-by: Dean Nelson <dnelson@redhat.com>
Reviewed-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -2019,11 +2019,12 @@ AcpiDmDumpRgrt (
ACPI_STATUS Status;
ACPI_TABLE_RGRT *Subtable = ACPI_CAST_PTR (ACPI_TABLE_RGRT, Table);
UINT32 Offset = sizeof (ACPI_TABLE_RGRT);
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
/* Main table */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoRgrt);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoRgrt);
if (ACPI_FAILURE (Status))
{
return;
@@ -2031,8 +2032,8 @@ AcpiDmDumpRgrt (
/* Dump the binary image as a subtable */
- Status = AcpiDmDumpTable (Table->Length, Offset, &Subtable->Image,
- Table->Length - Offset, AcpiDmTableInfoRgrt0);
+ Status = AcpiDmDumpTable (TableLength, Offset, &Subtable->Image,
+ TableLength - Offset, AcpiDmTableInfoRgrt0);
if (ACPI_FAILURE (Status))
{
return;

View File

@ -1,42 +0,0 @@
Signed-off-by: Dean Nelson <dnelson@redhat.com>
Reviewed-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump3.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump3.c
+++ acpica-unix2-20210604/source/common/dmtbdump3.c
@@ -339,14 +339,14 @@ AcpiDmDumpSvkl (
ACPI_TABLE_HEADER *Table)
{
ACPI_STATUS Status;
- UINT32 Length = Table->Length;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_SVKL);
ACPI_SVKL_KEY *Subtable;
/* Main table */
- Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoSvkl);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoSvkl);
if (ACPI_FAILURE (Status))
{
return;
@@ -355,12 +355,12 @@ AcpiDmDumpSvkl (
/* The rest of the table consists of subtables (single type) */
Subtable = ACPI_ADD_PTR (ACPI_SVKL_KEY, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
/* Dump the subtable */
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
sizeof (ACPI_SVKL_KEY), AcpiDmTableInfoSvkl0);
if (ACPI_FAILURE (Status))
{

View File

@ -1,91 +0,0 @@
Signed-off-by: Dean Nelson <dnelson@redhat.com>
---
source/common/dmtbdump1.c | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump1.c
+++ acpica-unix2-20210604/source/common/dmtbdump1.c
@@ -242,20 +242,23 @@ AcpiDmDumpCedt (
{
ACPI_STATUS Status;
ACPI_CEDT_HEADER *Subtable;
- UINT32 Length = Table->Length;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_CEDT);
+ UINT16 SubtableLength;
/* There is no main table (other than the standard ACPI header) */
Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
/* Common subtable header */
+ SubtableLength = AcpiUtReadUint16 (&Subtable->Length);
+
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoCedtHdr);
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
+ SubtableLength, AcpiDmTableInfoCedtHdr);
if (ACPI_FAILURE (Status))
{
return;
@@ -264,8 +267,8 @@ AcpiDmDumpCedt (
switch (Subtable->Type)
{
case ACPI_CEDT_TYPE_CHBS:
- Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoCedt0);
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
+ SubtableLength, AcpiDmTableInfoCedt0);
if (ACPI_FAILURE (Status)) {
return;
}
@@ -277,8 +280,8 @@ AcpiDmDumpCedt (
/* print out table with first "Interleave target" */
- Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoCedt1);
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
+ SubtableLength, AcpiDmTableInfoCedt1);
if (ACPI_FAILURE (Status)) {
return;
}
@@ -288,8 +291,8 @@ AcpiDmDumpCedt (
for (i = 1; i < max; i++) {
unsigned int loc_offset = Offset + (i * 4) + ACPI_OFFSET(ACPI_CEDT_CFMWS, InterleaveTargets);
unsigned int *trg = &(ptr->InterleaveTargets[i]);
- Status = AcpiDmDumpTable (Length, loc_offset, trg,
- Subtable->Length, AcpiDmTableInfoCedt1_te);
+ Status = AcpiDmDumpTable (TableLength, loc_offset, trg,
+ SubtableLength, AcpiDmTableInfoCedt1_te);
if (ACPI_FAILURE (Status)) {
return;
}
@@ -302,7 +305,7 @@ AcpiDmDumpCedt (
Subtable->Type);
/* Attempt to continue */
- if (!Subtable->Length)
+ if (!SubtableLength)
{
AcpiOsPrintf ("Invalid zero length subtable\n");
return;
@@ -310,9 +313,9 @@ AcpiDmDumpCedt (
}
/* Point to next subtable */
- Offset += Subtable->Length;
+ Offset += SubtableLength;
Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Subtable,
- Subtable->Length);
+ SubtableLength);
}
}

View File

@ -0,0 +1,179 @@
commit 0b03aa8ebd7a5b2b9407893f123ee587af45926f
Author: Ben Widawsky <ben@bwidawsk.net>
Date: Thu Feb 25 13:54:56 2021 -0800
CXL 2.0: CEDT: Add new CEDT table
This sets up all of the boilerplate without actually doing anything.
Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
diff --git a/source/common/ahtable.c b/source/common/ahtable.c
index a313c7f..2679fae 100644
--- a/source/common/ahtable.c
+++ b/source/common/ahtable.c
@@ -95,6 +95,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] =
{ACPI_SIG_BERT, "Boot Error Record Table"},
{ACPI_SIG_BGRT, "Boot Graphics Resource Table"},
{ACPI_SIG_BOOT, "Simple Boot Flag Table"},
+ {ACPI_SIG_CEDT, "CXL Early Discovery Table"},
{ACPI_SIG_CPEP, "Corrected Platform Error Polling table"},
{ACPI_SIG_CSRT, "Core System Resource Table"},
{ACPI_SIG_DBG2, "Debug Port table type 2"},
diff --git a/source/common/dmtable.c b/source/common/dmtable.c
index 0908e44..137b5b9 100644
--- a/source/common/dmtable.c
+++ b/source/common/dmtable.c
@@ -376,6 +376,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert},
{ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt},
{ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot},
+ {ACPI_SIG_CEDT, NULL, NULL, NULL, NULL},
{ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep},
{ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt},
{ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2},
diff --git a/source/common/dmtbinfo1.c b/source/common/dmtbinfo1.c
index 4adb42a..cb41915 100644
--- a/source/common/dmtbinfo1.c
+++ b/source/common/dmtbinfo1.c
@@ -236,6 +236,33 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[] =
};
+/*******************************************************************************
+ *
+ * CEDT - CXL Early Discovery Table
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[] =
+{
+ {ACPI_DMT_UINT8, ACPI_CEDT_OFFSET (Type), "Subtable Type", 0},
+ {ACPI_DMT_UINT8, ACPI_CEDT_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_CEDT_OFFSET (Length), "Length", DT_LENGTH},
+ ACPI_DMT_TERMINATOR
+};
+
+/* 0: CXL Host Bridge Structure */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[] =
+{
+ {ACPI_DMT_UINT32, ACPI_CEDT0_OFFSET (Uid), "Associated host bridge", 0},
+ {ACPI_DMT_UINT32, ACPI_CEDT0_OFFSET (CxlVersion), "Specification version", 0},
+ {ACPI_DMT_UINT32, ACPI_CEDT0_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_CEDT0_OFFSET (Base), "Register base", 0},
+ {ACPI_DMT_UINT64, ACPI_CEDT0_OFFSET (Length), "Register length", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+
/*******************************************************************************
*
* CPEP - Corrected Platform Error Polling table
diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h
index e9b7a48..5e94ee3 100644
--- a/source/include/acdisasm.h
+++ b/source/include/acdisasm.h
@@ -256,6 +256,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsfHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[];
diff --git a/source/include/actbinfo.h b/source/include/actbinfo.h
index 8a1fd74..9735f22 100644
--- a/source/include/actbinfo.h
+++ b/source/include/actbinfo.h
@@ -104,6 +104,8 @@
#define ACPI_ASF2a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_CONTROL_DATA,f)
#define ACPI_ASF3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_RMCP,f)
#define ACPI_ASF4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f)
+#define ACPI_CEDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_HEADER, f)
+#define ACPI_CEDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CHBS, f)
#define ACPI_CPEP0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f)
#define ACPI_CSRT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_GROUP,f)
#define ACPI_CSRT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_SHARED_INFO,f)
diff --git a/source/include/actbl1.h b/source/include/actbl1.h
index b76195f..ce4737d 100644
--- a/source/include/actbl1.h
+++ b/source/include/actbl1.h
@@ -64,6 +64,7 @@
#define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */
#define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */
#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
+#define ACPI_SIG_CEDT "CEDT" /* CXL Early Discovery Table */
#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
#define ACPI_SIG_CSRT "CSRT" /* Core System Resource Table */
#define ACPI_SIG_DBG2 "DBG2" /* Debug Port table type 2 */
@@ -383,6 +384,56 @@ typedef struct acpi_table_boot
} ACPI_TABLE_BOOT;
+/*******************************************************************************
+ *
+ * CEDT - CXL Early Discovery Table
+ * Version 1
+ *
+ * Conforms to the "CXL Early Discovery Table" (CXL 2.0)
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_cedt
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+
+} ACPI_TABLE_CEDT;
+
+/* CEDT subtable header (Performance Record Structure) */
+
+typedef struct acpi_cedt_header
+{
+ UINT8 Type;
+ UINT8 Reserved;
+ UINT16 Length;
+
+} ACPI_CEDT_HEADER;
+
+/* Values for Type field above */
+
+enum AcpiCedtType
+{
+ ACPI_CEDT_TYPE_CHBS = 0,
+};
+
+
+/*
+ * CEDT subtables
+ */
+
+/* 0: CXL Host Bridge Structure */
+
+typedef struct acpi_cedt_chbs
+{
+ ACPI_CEDT_HEADER Header;
+ UINT32 Uid;
+ UINT32 CxlVersion;
+ UINT32 Reserved;
+ UINT64 Base;
+ UINT64 Length;
+
+} ACPI_CEDT_CHBS;
+
/*******************************************************************************
*
diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c
index ef74f17..8aa35fe 100644
--- a/source/tools/acpisrc/astable.c
+++ b/source/tools/acpisrc/astable.c
@@ -529,6 +529,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_TABLE_BERT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_BGRT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_BOOT", SRC_TYPE_STRUCT},
+ {"ACPI_TABLE_CEDT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_CPEP", SRC_TYPE_STRUCT},
{"ACPI_TABLE_CSRT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DBG2", SRC_TYPE_STRUCT},

View File

@ -0,0 +1,123 @@
commit b980be9b7fd364f62f62655e458325581a4f239c
Author: Ben Widawsky <ben@bwidawsk.net>
Date: Thu Feb 25 14:11:46 2021 -0800
CXL 2.0: CEDT: Add table and subtable dumping
Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
diff --git a/source/common/dmtable.c b/source/common/dmtable.c
index 137b5b9..f483a78 100644
--- a/source/common/dmtable.c
+++ b/source/common/dmtable.c
@@ -376,7 +376,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert},
{ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt},
{ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot},
- {ACPI_SIG_CEDT, NULL, NULL, NULL, NULL},
+ {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, NULL, NULL},
{ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep},
{ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt},
{ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2},
diff --git a/source/common/dmtbdump1.c b/source/common/dmtbdump1.c
index 0103a6c..19a810f 100644
--- a/source/common/dmtbdump1.c
+++ b/source/common/dmtbdump1.c
@@ -221,6 +221,82 @@ AcpiDmDumpAsf (
}
}
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmDumpCedt
+ *
+ * PARAMETERS: Table - A CEDT table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Format the contents of a CEDT. This table type consists
+ * of an open-ended number of subtables.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpCedt (
+ ACPI_TABLE_HEADER *Table)
+{
+ ACPI_STATUS Status;
+ ACPI_CEDT_HEADER *Subtable;
+ UINT32 Length = Table->Length;
+ UINT32 Offset = sizeof (ACPI_TABLE_CEDT);
+ ACPI_DMTABLE_INFO *InfoTable;
+
+
+ /* There is no main table (other than the standard ACPI header) */
+
+ Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Table, Offset);
+ while (Offset < Table->Length)
+ {
+ /* Common subtable header */
+
+ AcpiOsPrintf ("\n");
+ Status = AcpiDmDumpTable (Length, Offset, Subtable,
+ Subtable->Length, AcpiDmTableInfoCedtHdr);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ switch (Subtable->Type)
+ {
+ case ACPI_CEDT_TYPE_CHBS:
+
+ InfoTable = AcpiDmTableInfoCedt0;
+ break;
+
+ default:
+
+ AcpiOsPrintf ("\n**** Unknown CEDT subtable type 0x%X\n\n",
+ Subtable->Type);
+
+ /* Attempt to continue */
+
+ if (!Subtable->Length)
+ {
+ AcpiOsPrintf ("Invalid zero length subtable\n");
+ return;
+ }
+ goto NextSubtable;
+ }
+
+ Status = AcpiDmDumpTable (Length, Offset, Subtable,
+ Subtable->Length, InfoTable);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+NextSubtable:
+ /* Point to next subtable */
+
+ Offset += Subtable->Length;
+ Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Subtable,
+ Subtable->Length);
+ }
+}
/*******************************************************************************
*
diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h
index 5e94ee3..d7f348f 100644
--- a/source/include/acdisasm.h
+++ b/source/include/acdisasm.h
@@ -533,6 +533,10 @@ void
AcpiDmDumpAsf (
ACPI_TABLE_HEADER *Table);
+void
+AcpiDmDumpCedt (
+ ACPI_TABLE_HEADER *Table);
+
void
AcpiDmDumpCpep (
ACPI_TABLE_HEADER *Table);

View File

@ -0,0 +1,58 @@
commit 187e2f286f503cce9f57748da639dfccaeaecf96
Author: Ben Widawsky <ben@bwidawsk.net>
Date: Thu Feb 25 14:19:51 2021 -0800
CXL 2.0: CEDT: Add template
Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
diff --git a/source/common/dmtable.c b/source/common/dmtable.c
index f483a78..5b204a8 100644
--- a/source/common/dmtable.c
+++ b/source/common/dmtable.c
@@ -376,7 +376,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert},
{ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt},
{ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot},
- {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, NULL, NULL},
+ {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, NULL, TemplateCedt},
{ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep},
{ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt},
{ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2},
diff --git a/source/compiler/dtcompiler.h b/source/compiler/dtcompiler.h
index 5136f75..fd20109 100644
--- a/source/compiler/dtcompiler.h
+++ b/source/compiler/dtcompiler.h
@@ -587,6 +587,7 @@ extern const unsigned char TemplateAsf[];
extern const unsigned char TemplateBoot[];
extern const unsigned char TemplateBert[];
extern const unsigned char TemplateBgrt[];
+extern const unsigned char TemplateCedt[];
extern const unsigned char TemplateCpep[];
extern const unsigned char TemplateCsrt[];
extern const unsigned char TemplateDbg2[];
diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h
index e3fbd8b..275003c 100644
--- a/source/compiler/dttemplate.h
+++ b/source/compiler/dttemplate.h
@@ -96,6 +96,20 @@ const unsigned char TemplateBoot[] =
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00 /* 00000020 "(.. ...." */
};
+const unsigned char TemplateCedt[] =
+{
+ /* FIXME: This is from QEMU */
+ 0x43,0x45,0x44,0x54,0x44,0x00,0x00,0x00, /* 00000000 "CEDTD..." */
+ 0x01,0x3E,0x42,0x4F,0x43,0x48,0x53,0x20, /* 00000008 ".>BOCHS " */
+ 0x42,0x58,0x50,0x43,0x20,0x20,0x20,0x20, /* 00000010 "BXPC " */
+ 0x01,0x00,0x00,0x00,0x42,0x58,0x50,0x43, /* 00000018 "....BXPC" */
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000020 "...... ." */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000028 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD0, /* 00000030 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, /* 00000038 "........" */
+ 0x00,0x00,0x00,0x00 /* 00000040 "...." */
+};
+
const unsigned char TemplateCpep[] =
{
0x43,0x50,0x45,0x50,0x34,0x00,0x00,0x00, /* 00000000 "CPEP4..." */

View File

@ -0,0 +1,278 @@
commit 1e6dded267b13c4aa0c3e16de0fa89d3b9c880e9
Author: Robert Moore <Robert.Moore@intel.com>
Date: Thu Mar 11 13:12:08 2021 -0800
iASL/TableCompiler: Add compilation support for CEDT table.
Also, update the CEDT template.
diff --git a/source/common/dmtable.c b/source/common/dmtable.c
index 5b204a8..530e872 100644
--- a/source/common/dmtable.c
+++ b/source/common/dmtable.c
@@ -76,6 +76,12 @@ static const char *AcpiDmAsfSubnames[] =
"Unknown Subtable Type" /* Reserved */
};
+static const char *AcpiDmCedtSubnames[] =
+{
+ "CXL Host Bridge Structure",
+ "Unknown Subtable Type" /* Reserved */
+};
+
static const char *AcpiDmDmarSubnames[] =
{
"Hardware Unit Definition",
@@ -376,7 +382,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert},
{ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt},
{ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot},
- {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, NULL, TemplateCedt},
+ {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, DtCompileCedt, TemplateCedt},
{ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep},
{ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt},
{ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2},
@@ -830,6 +836,7 @@ AcpiDmDumpTable (
case ACPI_DMT_CHKSUM:
case ACPI_DMT_SPACEID:
case ACPI_DMT_ACCWIDTH:
+ case ACPI_DMT_CEDT:
case ACPI_DMT_IVRS:
case ACPI_DMT_GTDT:
case ACPI_DMT_MADT:
@@ -1240,6 +1247,20 @@ AcpiDmDumpTable (
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAsfSubnames[Temp16]);
break;
+ case ACPI_DMT_CEDT:
+
+ /* CEDT subtable types */
+
+ Temp8 = *Target;
+ if (Temp8 > ACPI_CEDT_TYPE_RESERVED)
+ {
+ Temp8 = ACPI_CEDT_TYPE_RESERVED;
+ }
+
+ AcpiOsPrintf (UINT8_FORMAT, *Target,
+ AcpiDmCedtSubnames[Temp8]);
+ break;
+
case ACPI_DMT_DMAR:
/* DMAR subtable types */
diff --git a/source/common/dmtbinfo1.c b/source/common/dmtbinfo1.c
index cb41915..fb1c19a 100644
--- a/source/common/dmtbinfo1.c
+++ b/source/common/dmtbinfo1.c
@@ -244,7 +244,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[] =
{
- {ACPI_DMT_UINT8, ACPI_CEDT_OFFSET (Type), "Subtable Type", 0},
+ {ACPI_DMT_CEDT, ACPI_CEDT_OFFSET (Type), "Subtable Type", 0},
{ACPI_DMT_UINT8, ACPI_CEDT_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT16, ACPI_CEDT_OFFSET (Length), "Length", DT_LENGTH},
ACPI_DMT_TERMINATOR
diff --git a/source/compiler/dtcompiler.h b/source/compiler/dtcompiler.h
index fd20109..9a78519 100644
--- a/source/compiler/dtcompiler.h
+++ b/source/compiler/dtcompiler.h
@@ -419,6 +419,10 @@ ACPI_STATUS
DtCompileCpep (
void **PFieldList);
+ACPI_STATUS
+DtCompileCedt (
+ void **PFieldList);
+
ACPI_STATUS
DtCompileCsrt (
void **PFieldList);
diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c
index 24d33c1..a3240f8 100644
--- a/source/compiler/dttable1.c
+++ b/source/compiler/dttable1.c
@@ -234,6 +234,80 @@ DtCompileAsf (
}
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileCedt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile CEDT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileCedt (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ ACPI_CEDT_HEADER *CedtHeader;
+ DT_FIELD *SubtableStart;
+
+
+ /* Walk the parse tree */
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+
+ /* CEDT Header */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedtHdr,
+ &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ CedtHeader = ACPI_CAST_PTR (ACPI_CEDT_HEADER, Subtable->Buffer);
+
+ switch (CedtHeader->Type)
+ {
+ case ACPI_CEDT_TYPE_CHBS:
+
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "CEDT");
+ return (AE_ERROR);
+ }
+
+ /* CEDT Subtable */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt0, &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
/******************************************************************************
*
* FUNCTION: DtCompileCpep
diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h
index 275003c..82f352a 100644
--- a/source/compiler/dttemplate.h
+++ b/source/compiler/dttemplate.h
@@ -98,16 +98,23 @@ const unsigned char TemplateBoot[] =
const unsigned char TemplateCedt[] =
{
- /* FIXME: This is from QEMU */
- 0x43,0x45,0x44,0x54,0x44,0x00,0x00,0x00, /* 00000000 "CEDTD..." */
- 0x01,0x3E,0x42,0x4F,0x43,0x48,0x53,0x20, /* 00000008 ".>BOCHS " */
- 0x42,0x58,0x50,0x43,0x20,0x20,0x20,0x20, /* 00000010 "BXPC " */
- 0x01,0x00,0x00,0x00,0x42,0x58,0x50,0x43, /* 00000018 "....BXPC" */
- 0x01,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000020 "...... ." */
- 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000028 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD0, /* 00000030 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, /* 00000038 "........" */
- 0x00,0x00,0x00,0x00 /* 00000040 "...." */
+ 0x43,0x45,0x44,0x54,0x84,0x00,0x00,0x00, /* 00000000 "CEDT...." */
+ 0x01,0x8B,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
+ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x05,0x01,0x21,0x20,0x00,0x00,0x20,0x00, /* 00000020 "..! .. ." */
+ 0x33,0x33,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000028 "33......" */
+ 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xD5, /* 00000030 ".....!C." */
+ 0x00,0x00,0x00,0x00,0x45,0x23,0x01,0x00, /* 00000038 "....E#.." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000040 "...... ." */
+ 0x44,0x44,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000048 "DD......" */
+ 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xA5, /* 00000050 ".....!C." */
+ 0x00,0x00,0x00,0x00,0x45,0x23,0xB1,0x00, /* 00000058 "....E#.." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000060 "...... ." */
+ 0x55,0x55,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000068 "UU......" */
+ 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xB5, /* 00000070 ".....!C." */
+ 0x00,0x00,0x00,0x00,0x45,0x23,0xB1,0x00, /* 00000078 "....E#.." */
+ 0x00,0x00,0x00,0x00 /* 00000080 "...." */
};
const unsigned char TemplateCpep[] =
diff --git a/source/compiler/dtutils.c b/source/compiler/dtutils.c
index 658726b..a5ef782 100644
--- a/source/compiler/dtutils.c
+++ b/source/compiler/dtutils.c
@@ -455,6 +455,7 @@ DtGetFieldLength (
case ACPI_DMT_CHKSUM:
case ACPI_DMT_SPACEID:
case ACPI_DMT_ACCWIDTH:
+ case ACPI_DMT_CEDT:
case ACPI_DMT_IVRS:
case ACPI_DMT_GTDT:
case ACPI_DMT_MADT:
diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h
index d7f348f..f50adef 100644
--- a/source/include/acdisasm.h
+++ b/source/include/acdisasm.h
@@ -143,6 +143,7 @@ typedef enum
/* Types that are specific to particular ACPI tables */
ACPI_DMT_ASF,
+ ACPI_DMT_CEDT,
ACPI_DMT_DMAR,
ACPI_DMT_DMAR_SCOPE,
ACPI_DMT_EINJACT,
diff --git a/source/include/actbl1.h b/source/include/actbl1.h
index ce4737d..a551303 100644
--- a/source/include/actbl1.h
+++ b/source/include/actbl1.h
@@ -384,6 +384,7 @@ typedef struct acpi_table_boot
} ACPI_TABLE_BOOT;
+
/*******************************************************************************
*
* CEDT - CXL Early Discovery Table
@@ -414,6 +415,7 @@ typedef struct acpi_cedt_header
enum AcpiCedtType
{
ACPI_CEDT_TYPE_CHBS = 0,
+ ACPI_CEDT_TYPE_RESERVED = 1
};
diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c
index 8aa35fe..5fc0ab5 100644
--- a/source/tools/acpisrc/astable.c
+++ b/source/tools/acpisrc/astable.c
@@ -534,6 +534,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_TABLE_CSRT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DBG2", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DBGP", SRC_TYPE_STRUCT},
+ {"ACPI_TABLE_CEDT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DMAR", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DRTM", SRC_TYPE_STRUCT},
{"ACPI_TABLE_ECDT", SRC_TYPE_STRUCT},
@@ -592,6 +593,8 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_ASF_REMOTE", SRC_TYPE_STRUCT},
{"ACPI_ASF_RMCP", SRC_TYPE_STRUCT},
{"ACPI_BERT_REGION", SRC_TYPE_STRUCT},
+ {"ACPI_CEDT_CHBS", SRC_TYPE_STRUCT},
+ {"ACPI_CEDT_HEADER", SRC_TYPE_STRUCT},
{"ACPI_CPEP_POLLING", SRC_TYPE_STRUCT},
{"ACPI_CSRT_GROUP", SRC_TYPE_STRUCT},
{"ACPI_CSRT_DESCRIPTOR", SRC_TYPE_STRUCT},

View File

@ -0,0 +1,31 @@
commit 5ace82441a34f8d45725f12f6bd2677e79c186a6
Author: Alison Schofield <alison.schofield@intel.com>
Date: Thu May 20 13:33:02 2021 -0700
Add defines for the CXL Host Bridge Structure (CHBS)
CXL 2.0 defines length and version field values for the CHBS.
Include them in the ACPI CEDT table definition.
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
diff --git a/source/include/actbl1.h b/source/include/actbl1.h
index a551303..51fee30 100644
--- a/source/include/actbl1.h
+++ b/source/include/actbl1.h
@@ -418,6 +418,15 @@ enum AcpiCedtType
ACPI_CEDT_TYPE_RESERVED = 1
};
+/* Values for version field above */
+
+#define ACPI_CEDT_CHBS_VERSION_CXL11 (0)
+#define ACPI_CEDT_CHBS_VERSION_CXL20 (1)
+
+/* Values for length field above */
+
+#define ACPI_CEDT_CHBS_LENGTH_CXL11 (0x2000)
+#define ACPI_CEDT_CHBS_LENGTH_CXL20 (0x10000)
/*
* CEDT subtables

View File

@ -0,0 +1,66 @@
commit 699fc72e56936bebf3b9ba39b6e91bd957b44452
Author: Alison Schofield <alison.schofield@intel.com>
Date: Thu May 20 13:48:40 2021 -0700
Add the CFMWS structure definition to the CEDT table
The CXL Fixed Memory Window Structure (CFMWS) is added to the
CXL Early Discovery Table (CEDT). This new structure is defined
in an ECN to the CXL 2.0 specification.
https://www.computeexpresslink.org/spec-landing
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
diff --git a/source/include/actbl1.h b/source/include/actbl1.h
index 51fee30..f274a85 100644
--- a/source/include/actbl1.h
+++ b/source/include/actbl1.h
@@ -415,7 +415,8 @@ typedef struct acpi_cedt_header
enum AcpiCedtType
{
ACPI_CEDT_TYPE_CHBS = 0,
- ACPI_CEDT_TYPE_RESERVED = 1
+ ACPI_CEDT_TYPE_CFMWS = 1,
+ ACPI_CEDT_TYPE_RESERVED = 2,
};
/* Values for version field above */
@@ -446,6 +447,37 @@ typedef struct acpi_cedt_chbs
} ACPI_CEDT_CHBS;
+/* 1: CXL Fixed Memory Window Structure */
+
+typedef struct acpi_cedt_cfmws
+{
+ ACPI_CEDT_HEADER Header;
+ UINT32 Reserved1;
+ UINT64 BaseHpa;
+ UINT64 WindowSize;
+ UINT8 InterleaveWays;
+ UINT8 InterleaveArithmetic;
+ UINT16 Reserved2;
+ UINT32 Granularity;
+ UINT16 Restrictions;
+ UINT16 QtgId;
+ UINT32 InterleaveTargets[];
+
+} ACPI_CEDT_CFMWS;
+
+/* Values for Interleave Arithmetic field above */
+
+#define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO (0)
+
+/* Values for Restrictions field above */
+
+#define ACPI_CEDT_CFMWS_RESTRICT_TYPE2 (1)
+#define ACPI_CEDT_CFMWS_RESTRICT_TYPE3 (1<<1)
+#define ACPI_CEDT_CFMWS_RESTRICT_VOLATILE (1<<2)
+#define ACPI_CEDT_CFMWS_RESTRICT_PMEM (1<<3)
+#define ACPI_CEDT_CFMWS_RESTRICT_FIXED (1<<4)
+
+
/*******************************************************************************
*
* CPEP - Corrected Platform Error Polling table (ACPI 4.0)

View File

@ -0,0 +1,20 @@
commit ec39d05939c799dc1a3635c766805924afdbbe9e
Author: Erik Kaneda <erik.kaneda@intel.com>
Date: Tue Jun 1 10:37:51 2021 -0700
Disassembler: add missing strings to decode subtable types
Signed-off-by: Erik Kaneda <erik.kaneda@intel.com>
diff --git a/source/common/dmtable.c b/source/common/dmtable.c
index 530e872..14aa927 100644
--- a/source/common/dmtable.c
+++ b/source/common/dmtable.c
@@ -79,6 +79,7 @@ static const char *AcpiDmAsfSubnames[] =
static const char *AcpiDmCedtSubnames[] =
{
"CXL Host Bridge Structure",
+ "CXL Fixed Memory Window Structure",
"Unknown Subtable Type" /* Reserved */
};

View File

@ -5,10 +5,10 @@ Date: Fri Jan 7 16:33:40 2022 -0800
Add the subtable CFMWS to the CEDT table
diff --git a/source/common/dmtbdump1.c b/source/common/dmtbdump1.c
index 105a88e..6abe8bc 100644
index 19a810f..597bb3b 100644
--- a/source/common/dmtbdump1.c
+++ b/source/common/dmtbdump1.c
@@ -244,7 +244,6 @@ AcpiDmDumpCedt (
@@ -242,7 +242,6 @@ AcpiDmDumpCedt (
ACPI_CEDT_HEADER *Subtable;
UINT32 Length = Table->Length;
UINT32 Offset = sizeof (ACPI_TABLE_CEDT);
@ -16,7 +16,7 @@ index 105a88e..6abe8bc 100644
/* There is no main table (other than the standard ACPI header) */
@@ -265,35 +264,50 @@ AcpiDmDumpCedt (
@@ -263,35 +262,50 @@ AcpiDmDumpCedt (
switch (Subtable->Type)
{
case ACPI_CEDT_TYPE_CHBS:
@ -81,10 +81,10 @@ index 105a88e..6abe8bc 100644
Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Subtable,
Subtable->Length);
diff --git a/source/common/dmtbinfo1.c b/source/common/dmtbinfo1.c
index 5b8ffe6..ac8e79e 100644
index fb1c19a..9fbb8fa 100644
--- a/source/common/dmtbinfo1.c
+++ b/source/common/dmtbinfo1.c
@@ -275,6 +275,28 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[] =
@@ -262,6 +262,28 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[] =
ACPI_DMT_TERMINATOR
};
@ -114,7 +114,7 @@ index 5b8ffe6..ac8e79e 100644
/*******************************************************************************
*
diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c
index c56f61c..972be5f 100644
index a3240f8..79550ab 100644
--- a/source/compiler/dttable1.c
+++ b/source/compiler/dttable1.c
@@ -282,18 +282,18 @@ DtCompileCedt (
@ -141,10 +141,10 @@ index c56f61c..972be5f 100644
{
return (Status);
diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h
index 4e7c02f..c165ba0 100644
index f50adef..233cef0 100644
--- a/source/include/acdisasm.h
+++ b/source/include/acdisasm.h
@@ -267,6 +267,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[];
@@ -259,6 +259,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[];
@ -154,10 +154,10 @@ index 4e7c02f..c165ba0 100644
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[];
diff --git a/source/include/actbinfo.h b/source/include/actbinfo.h
index 80bd806..6b9f5c1 100644
index 9735f22..91a3d2e 100644
--- a/source/include/actbinfo.h
+++ b/source/include/actbinfo.h
@@ -112,6 +112,8 @@
@@ -106,6 +106,8 @@
#define ACPI_ASF4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f)
#define ACPI_CEDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_HEADER, f)
#define ACPI_CEDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CHBS, f)
@ -167,7 +167,7 @@ index 80bd806..6b9f5c1 100644
#define ACPI_CSRT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_GROUP,f)
#define ACPI_CSRT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_SHARED_INFO,f)
diff --git a/source/include/actbl1.h b/source/include/actbl1.h
index 420189e..359861f 100644
index f274a85..3c46b60 100644
--- a/source/include/actbl1.h
+++ b/source/include/actbl1.h
@@ -465,6 +465,11 @@ typedef struct acpi_cedt_cfmws

View File

@ -5,7 +5,7 @@ Date: Mon Jan 17 15:24:34 2022 -0800
Fix Compile issue with CEDT and add template
diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c
index 972be5f..09aca3a 100644
index 79550ab..6eea2a4 100644
--- a/source/compiler/dttable1.c
+++ b/source/compiler/dttable1.c
@@ -262,6 +262,7 @@ DtCompileCedt (
@ -94,10 +94,10 @@ index 972be5f..09aca3a 100644
}
diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h
index 5fdd599..a62da8b 100644
index 82f352a..ceddb93 100644
--- a/source/compiler/dttemplate.h
+++ b/source/compiler/dttemplate.h
@@ -108,23 +108,58 @@ const unsigned char TemplateBoot[] =
@@ -98,23 +98,58 @@ const unsigned char TemplateBoot[] =
const unsigned char TemplateCedt[] =
{

View File

@ -6,10 +6,10 @@ Date: Thu Feb 17 14:24:24 2022 -0800
Removed some tabs and // comments.
diff --git a/source/common/dmtbdump1.c b/source/common/dmtbdump1.c
index 6abe8bc..88b7c1b 100644
index 597bb3b..76662a4 100644
--- a/source/common/dmtbdump1.c
+++ b/source/common/dmtbdump1.c
@@ -275,14 +275,16 @@ AcpiDmDumpCedt (
@@ -273,14 +273,16 @@ AcpiDmDumpCedt (
ACPI_CEDT_CFMWS *ptr = (ACPI_CEDT_CFMWS *) Subtable;
unsigned int i, max = 0x01 << (ptr->InterleaveWays);
@ -29,7 +29,7 @@ index 6abe8bc..88b7c1b 100644
unsigned int loc_offset = Offset + (i * 4) + ACPI_OFFSET(ACPI_CEDT_CFMWS, InterleaveTargets);
unsigned int *trg = &(ptr->InterleaveTargets[i]);
diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c
index 09aca3a..c1e6b98 100644
index 6eea2a4..e2e0379 100644
--- a/source/compiler/dttable1.c
+++ b/source/compiler/dttable1.c
@@ -262,7 +262,9 @@ DtCompileCedt (
@ -95,7 +95,7 @@ index 09aca3a..c1e6b98 100644
}
}
diff --git a/source/include/actbl1.h b/source/include/actbl1.h
index 359861f..ccf7c95 100644
index 3c46b60..b291aa2 100644
--- a/source/include/actbl1.h
+++ b/source/include/actbl1.h
@@ -468,19 +468,20 @@ typedef struct acpi_cedt_cfmws

View File

@ -5,10 +5,10 @@ Date: Fri Aug 26 12:20:07 2022 -0700
Remove a duplicate of ACPI_SIG_CEDT
diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c
index b984e6a..9f84aea 100644
index 5fc0ab5..2946e0d 100644
--- a/source/tools/acpisrc/astable.c
+++ b/source/tools/acpisrc/astable.c
@@ -541,7 +541,6 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
@@ -534,7 +534,6 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_TABLE_CSRT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DBG2", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DBGP", SRC_TYPE_STRUCT},

View File

@ -1,7 +1,7 @@
Index: acpica-unix2-20200925/generate/unix/Makefile.config
Index: acpica-unix2-20170728/generate/unix/Makefile.config
===================================================================
--- acpica-unix2-20200925.orig/generate/unix/Makefile.config
+++ acpica-unix2-20200925/generate/unix/Makefile.config
--- acpica-unix2-20170728.orig/generate/unix/Makefile.config
+++ acpica-unix2-20170728/generate/unix/Makefile.config
@@ -23,6 +23,9 @@
# OPT_CFLAGS can be overridden on the make command line by
# adding OPT_CFLAGS="..." to the invocation.
@ -12,7 +12,7 @@ Index: acpica-unix2-20200925/generate/unix/Makefile.config
# Notes:
# gcc should be version 4 or greater, otherwise some of the options
# used will not be recognized.
@@ -164,6 +167,11 @@ LDFLAGS +=-m32
@@ -157,6 +160,11 @@ LDFLAGS +=-m32
endif
#

49
SOURCES/acpinames.1 Normal file
View File

@ -0,0 +1,49 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH ACPINAMES 1 "January 23, 2013"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
acpinames \- ACPI name space dump utility
.SH SYNOPSIS
.B acpinames
.RI <option> ...
.RI <aml-file>
.SH DESCRIPTION
This manual page briefly documents the
.B acpinames
command. The option list is taken from the acpinames interactive help.
.PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively.
.B acpinames
prints out the complete ACPI name space for an AML file.
.PP
Much more detailed documentation may be found at
http://www.acpica.org/documentation/.
.SH OPTIONS
.PP
.TP
.B \-? [<name-prefix>]
Display this help message
.SH AUTHOR
acpinames was written by Robert Moore <robert.moore@intel.com>.
.PP
This manual page was written by Al Stone <ahs3@redhat.com> for the
Fedora project (but may be used by others).

View File

@ -1,8 +1,7 @@
Index: acpica-unix2-20210604/source/include/acmacros.h
===================================================================
--- acpica-unix2-20210604.orig/source/include/acmacros.h
+++ acpica-unix2-20210604/source/include/acmacros.h
@@ -108,6 +108,8 @@
diff -Naur acpica-unix2-20170119/source/include/acmacros.h acpica-unix2-20170119-arm7hl/source/include/acmacros.h
--- acpica-unix2-20170119/source/include/acmacros.h 2017-01-30 17:25:54.346151952 -0700
+++ acpica-unix2-20170119-arm7hl/source/include/acmacros.h 2017-01-30 17:22:25.249388742 -0700
@@ -178,6 +178,8 @@
/* 16-bit source, 16/32/64 destination */
@ -11,7 +10,7 @@ Index: acpica-unix2-20210604/source/include/acmacros.h
#define ACPI_MOVE_16_TO_16(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];\
(( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[1];}
@@ -127,6 +129,7 @@
@@ -199,6 +201,7 @@
/* 64-bit source, 16/32/64 destination */

View File

@ -1,13 +0,0 @@
Index: acpica-unix2-20200925/source/include/actypes.h
===================================================================
--- acpica-unix2-20200925.orig/source/include/actypes.h
+++ acpica-unix2-20200925/source/include/actypes.h
@@ -561,7 +561,7 @@ typedef UINT64
#define ACPI_COPY_NAMESEG(dest,src) (*ACPI_CAST_PTR (UINT32, (dest)) = *ACPI_CAST_PTR (UINT32, (src)))
#else
#define ACPI_COMPARE_NAMESEG(a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAMESEG_SIZE))
-#define ACPI_COPY_NAMESEG(dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAMESEG_SIZE))
+#define ACPI_COPY_NAMESEG(dest,src) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAMESEG_SIZE))
#endif
/* Support for the special RSDP signature (8 characters) */

28
SOURCES/aslcodegen.patch Normal file
View File

@ -0,0 +1,28 @@
Changes in the handling of comments caused some length fields to be used
in new ways. The new way broke the existing adaptation for big endian
support; this patch repairs that adaptation.
Signed-off-by: Al Stone <ahs3@redhat.com>
diff -Naur acpica-unix2-20180531.orig/source/compiler/aslcodegen.c acpica-unix2-20180531/source/compiler/aslcodegen.c
--- acpica-unix2-20180531.orig/source/compiler/aslcodegen.c 2018-07-06 20:28:35.255546578 -0400
+++ acpica-unix2-20180531/source/compiler/aslcodegen.c 2018-07-06 20:32:10.373797644 -0400
@@ -494,8 +494,7 @@
/* Table length. Checksum zero for now, will rewrite later */
- DWord = sizeof (ACPI_TABLE_HEADER) + Op->Asl.AmlSubtreeLength;
- ACPI_MOVE_32_TO_32(&TableHeader.Length, &DWord);
+ TableHeader.Length = sizeof (ACPI_TABLE_HEADER) + Op->Asl.AmlSubtreeLength;
/* Calculate the comment lengths for this definition block parseOp */
@@ -539,6 +538,8 @@
CvDbgPrint (" Length: %u\n", CommentLength);
}
}
+ DWord = TableHeader.Length;
+ ACPI_MOVE_32_TO_32(&TableHeader.Length, &DWord);
TableHeader.Checksum = 0;

View File

@ -50,7 +50,7 @@ badcode.asl 80: CreateField (BUF1, 0, Subtract (4, 4), FLD1)
Remark 2089 - Object is not referenced ^ (Name [FLD1] is within a method [MTH1])
badcode.asl 80: CreateField (BUF1, 0, Subtract (4, 4), FLD1)
Warning 3083 - Field length must be non-zero ^
Error 6083 - Operand evaluates to zero ^
badcode.asl 84: Acquire (MTX1, 100)
Warning 3130 - ^ Result is not used, possible operator timeout will be missed
@ -68,7 +68,7 @@ badcode.asl 97: Method (MTH2)
Remark 2119 - ^ Control Method marked Serialized (Due to use of Switch operator)
badcode.asl 97: Method (MTH2)
Warning 3115 - ^ Not all control paths return a value (\MTH2)
Warning 3115 - ^ Not all control paths return a value (MTH2)
badcode.asl 101: Switch (ToInteger (INT1))
Error 6078 - ^ No Case statements under Switch
@ -77,13 +77,13 @@ badcode.asl 120: Store (MTH2 (), Local0)
Warning 3144 - ^ Method Local is set but never used (Local0)
badcode.asl 120: Store (MTH2 (), Local0)
Warning 3122 - ^ Called method may not always return a value (\MTH2)
Warning 3122 - ^ Called method may not always return a value
badcode.asl 126: Method (MTH5) {Store (MTH4(), Local0)}
Warning 3144 - Method Local is set but never used ^ (Local0)
badcode.asl 126: Method (MTH5) {Store (MTH4(), Local0)}
Error 6080 - Called method returns no value ^ (\MTH4)
Error 6080 - Called method returns no value ^
badcode.asl 132: Name (_HID, "*PNP0C0A") // Illegal leading asterisk
Error 6061 - Invalid leading asterisk ^ (*PNP0C0A)
@ -256,11 +256,11 @@ Warning 3144 - ^ Method Local is set but never used
Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version VVVVVVVV
Copyright (c) 2000 - 2021 Intel Corporation
Copyright (c) 2000 - 2018 Intel Corporation
Ignoring all errors, forcing AML file generation
ASL Input: badcode.asl - 11588 bytes 81 keywords 408 source lines
AML Output: badcode.aml - 1195 bytes 20 opcodes 61 named objects
ASL Input: badcode.asl - 408 lines, 11587 bytes, 81 keywords
AML Output: badcode.aml - 1195 bytes, 61 named objects, 20 executable opcodes
Compilation successful. 45 Errors, 29 Warnings, 11 Remarks, 16 Optimizations, 1 Constants Folded
Compilation complete. 46 Errors, 28 Warnings, 11 Remarks, 16 Optimizations, 1 Constants Folded

40
SOURCES/be-tpm2.patch Normal file
View File

@ -0,0 +1,40 @@
diff -Naur acpica-unix2-20171110/source/compiler/dttable2.c acpica-unix2-20171110.patched/source/compiler/dttable2.c
--- acpica-unix2-20171110/source/compiler/dttable2.c 2017-11-27 15:20:04.705226128 -0700
+++ acpica-unix2-20171110.patched/source/compiler/dttable2.c 2017-11-27 15:26:29.121734421 -0700
@@ -1797,6 +1797,7 @@
ACPI_TABLE_TPM2 *Tpm2Header;
DT_SUBTABLE *ParentTable;
ACPI_STATUS Status = AE_OK;
+ UINT32 Tmp32;
/* Compile the main table */
@@ -1831,7 +1832,8 @@
/* Subtable type depends on the StartMethod */
- switch (Tpm2Header->StartMethod)
+ ACPI_MOVE_32_TO_32(&Tmp32, &Tpm2Header->StartMethod);
+ switch (Tmp32)
{
case ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC:
@@ -1861,16 +1863,14 @@
case ACPI_TPM2_RESERVED9:
case ACPI_TPM2_RESERVED10:
- AcpiOsPrintf ("\n**** Reserved TPM2 Start Method type 0x%X\n",
- Tpm2Header->StartMethod);
+ AcpiOsPrintf ("\n**** Reserved TPM2 Start Method type 0x%X\n", Tmp32);
Status = AE_ERROR;
break;
case ACPI_TPM2_NOT_ALLOWED:
default:
- AcpiOsPrintf ("\n**** Unknown TPM2 Start Method type 0x%X\n",
- Tpm2Header->StartMethod);
+ AcpiOsPrintf ("\n**** Unknown TPM2 Start Method type 0x%X\n", Tmp32);
Status = AE_ERROR;
break;
}

View File

@ -0,0 +1,18 @@
Updated versions of upstream often contain fixes that were not seen
in the original big-endian patch; we try to capture those here.
Signed-off-by: Al Stone <ahs3@redhat.com>
diff -Naur acpica-unix2-20170929.orig/source/compiler/asllookup.c acpica-unix2-20170929/source/compiler/asllookup.c
--- acpica-unix2-20170929.orig/source/compiler/asllookup.c 2017-10-09 12:26:25.893508481 -0600
+++ acpica-unix2-20170929/source/compiler/asllookup.c 2017-10-17 11:45:42.230763844 -0600
@@ -249,7 +249,8 @@
* ACPI names and are typically not referenced since they are meant
* to be called by the host OS.
*/
- if (Node->Name.Ascii[0] == '_')
+ ACPI_MOVE_32_TO_32(&tmp.Ascii, Node->Name.Ascii);
+ if (tmp.Ascii[0] == '_')
{
return (AE_OK);
}

6607
SOURCES/big-endian.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,41 +1,21 @@
converterSample.asl 15: Name (b, 5)
Remark 2182 - ^ At least one lower case letter found in NameSeg, ASL is case insensitive - converting to upper case (B___)
converterSample.asl 16: Name(p008, Package()
Remark 2182 - ^ At least one lower case letter found in NameSeg, ASL is case insensitive - converting to upper case (P008)
converterSample.asl 37: Method(MAIN) {
Remark 2120 - ^ Control Method should be made Serialized due to creation of named objects within (\MAIN)
converterSample.asl 48: Name(b,0);
Remark 2182 - ^ At least one lower case letter found in NameSeg, ASL is case insensitive - converting to upper case (B___)
Remark 2120 - ^ Control Method should be made Serialized (due to creation of named objects within)
converterSample.asl 48: Name(b,0);
Remark 2089 - Object is not referenced ^ (Name [B___] is within a method [MAIN])
converterSample.asl 53: Name (a,
Remark 2182 - ^ At least one lower case letter found in NameSeg, ASL is case insensitive - converting to upper case (A___)
converterSample.asl 65: Method(SCOP)
Remark 2120 - ^ Control Method should be made Serialized due to creation of named objects within (\SCOP)
converterSample.asl 68: Name (a1, 0x04)
Remark 2182 - ^ At least one lower case letter found in NameSeg, ASL is case insensitive - converting to upper case (A1__)
Remark 2120 - ^ Control Method should be made Serialized (due to creation of named objects within)
converterSample.asl 68: Name (a1, 0x04)
Remark 2089 - Object is not referenced ^ (Name [A1__] is within a method [SCOP])
converterSample.asl 76: Offset(0),//c37
Remark 2158 - ^ Unnecessary/redundant use of Offset operator
Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version VVVVVVVV
Copyright (c) 2000 - 2021 Intel Corporation
Copyright (c) 2000 - 2018 Intel Corporation
Ignoring all errors, forcing AML file generation
ASL Input: converterSample.asl - 85 lines, 1968 bytes, 11 keywords
AML Output: converterSample.aml - 180 bytes, 9 named objects, 2 executable opcodes
ASL Input: converterSample.asl - 1968 bytes 11 keywords 85 source lines
AML Output: converterSample.aml - 182 bytes 2 opcodes 9 named objects
Compilation successful. 0 Errors, 0 Warnings, 10 Remarks, 10 Optimizations
Compilation complete. 0 Errors, 0 Warnings, 4 Remarks, 11 Optimizations, 1 Constants Folded

View File

@ -63,11 +63,11 @@ Github-Location: https://github.com/acpica/acpica/pull/295/commits/987a3b5cf7175
source/components/dispatcher/dsutils.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
Index: acpica-unix2-20200925/source/components/dispatcher/dsutils.c
Index: acpica-unix2-20180209/source/components/dispatcher/dsutils.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/dispatcher/dsutils.c
+++ acpica-unix2-20200925/source/components/dispatcher/dsutils.c
@@ -759,6 +759,8 @@ AcpiDsCreateOperands (
--- acpica-unix2-20180209.orig/source/components/dispatcher/dsutils.c
+++ acpica-unix2-20180209/source/components/dispatcher/dsutils.c
@@ -761,6 +761,8 @@ AcpiDsCreateOperands (
ACPI_PARSE_OBJECT *Arguments[ACPI_OBJ_NUM_OPERANDS];
UINT32 ArgCount = 0;
UINT32 Index = WalkState->NumOperands;
@ -76,7 +76,7 @@ Index: acpica-unix2-20200925/source/components/dispatcher/dsutils.c
UINT32 i;
@@ -791,6 +793,7 @@ AcpiDsCreateOperands (
@@ -793,6 +795,7 @@ AcpiDsCreateOperands (
/* Create the interpreter arguments, in reverse order */
@ -84,7 +84,7 @@ Index: acpica-unix2-20200925/source/components/dispatcher/dsutils.c
Index--;
for (i = 0; i < ArgCount; i++)
{
@@ -818,7 +821,11 @@ Cleanup:
@@ -820,7 +823,11 @@ Cleanup:
* pop everything off of the operand stack and delete those
* objects
*/

View File

@ -130,11 +130,11 @@ Github-Location: https://github.com/acpica/acpica/pull/278/commits/4a0243ecb4c94
source/components/parser/psobject.c | 44 ++++++++++++++-----------------------
1 file changed, 16 insertions(+), 28 deletions(-)
Index: acpica-unix2-20200925/source/components/parser/psobject.c
Index: acpica-unix2-20180531/source/components/parser/psobject.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/parser/psobject.c
+++ acpica-unix2-20200925/source/components/parser/psobject.c
@@ -707,7 +707,8 @@ AcpiPsCompleteFinalOp (
--- acpica-unix2-20180531.orig/source/components/parser/psobject.c
+++ acpica-unix2-20180531/source/components/parser/psobject.c
@@ -709,7 +709,8 @@ AcpiPsCompleteFinalOp (
ACPI_PARSE_OBJECT *Op,
ACPI_STATUS Status)
{
@ -144,7 +144,7 @@ Index: acpica-unix2-20200925/source/components/parser/psobject.c
ACPI_FUNCTION_TRACE_PTR (PsCompleteFinalOp, WalkState);
@@ -724,7 +725,7 @@ AcpiPsCompleteFinalOp (
@@ -726,7 +727,7 @@ AcpiPsCompleteFinalOp (
{
if (Op)
{
@ -153,7 +153,7 @@ Index: acpica-unix2-20200925/source/components/parser/psobject.c
{
WalkState->Op = Op;
WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
@@ -743,41 +744,28 @@ AcpiPsCompleteFinalOp (
@@ -745,41 +746,28 @@ AcpiPsCompleteFinalOp (
if (Status == AE_CTRL_TERMINATE)
{
@ -207,7 +207,7 @@ Index: acpica-unix2-20200925/source/components/parser/psobject.c
}
}
@@ -786,5 +774,5 @@ AcpiPsCompleteFinalOp (
@@ -788,5 +776,5 @@ AcpiPsCompleteFinalOp (
} while (Op);

View File

@ -67,11 +67,11 @@ Github-Location: https://github.com/acpica/acpica/pull/296/commits/37f2c716f2c6a
source/components/namespace/nseval.c | 10 ++++++++++
1 file changed, 10 insertions(+)
Index: acpica-unix2-20200925/source/components/namespace/nseval.c
Index: acpica-unix2-20180313/source/components/namespace/nseval.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/namespace/nseval.c
+++ acpica-unix2-20200925/source/components/namespace/nseval.c
@@ -329,6 +329,16 @@ AcpiNsEvaluate (
--- acpica-unix2-20180313.orig/source/components/namespace/nseval.c
+++ acpica-unix2-20180313/source/components/namespace/nseval.c
@@ -330,6 +330,16 @@ AcpiNsEvaluate (
Info->ReturnObject = NULL;
}
}

View File

@ -1,40 +0,0 @@
On s390, GCC does not like the string initialization in this case. When
ValueToWrite is initialized this way, GCC tries to copy the entire string
into an ACPI_OBJECT instead of just the pointer (see the use in the call
to memcpy()). So, move the init so GCC recognizes that ValueToWrite is
only a pointer, and not a whole string that needs to be moved.
Index: acpica-unix2-20200925/source/components/debugger/dbtest.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/debugger/dbtest.c
+++ acpica-unix2-20200925/source/components/debugger/dbtest.c
@@ -719,9 +719,10 @@ AcpiDbTestStringType (
ACPI_OBJECT *Temp1 = NULL;
ACPI_OBJECT *Temp2 = NULL;
ACPI_OBJECT *Temp3 = NULL;
- char *ValueToWrite = "Test String from AML Debugger";
+ char *ValueToWrite = NULL;
ACPI_OBJECT WriteValue;
ACPI_STATUS Status;
+ const char *TestStr = "Test String from AML Debugger";
/* Read the original value */
@@ -737,6 +738,9 @@ AcpiDbTestStringType (
/* Write a new value */
+ ValueToWrite = AcpiOsAllocateZeroed(strlen(TestStr)+1);
+ strncpy(ValueToWrite, TestStr, strlen(TestStr)+1);
+
WriteValue.Type = ACPI_TYPE_STRING;
WriteValue.String.Length = strlen (ValueToWrite);
WriteValue.String.Pointer = ValueToWrite;
@@ -790,6 +794,7 @@ Exit:
if (Temp1) {AcpiOsFree (Temp1);}
if (Temp2) {AcpiOsFree (Temp2);}
if (Temp3) {AcpiOsFree (Temp3);}
+ if (ValueToWrite) {AcpiOsFree (ValueToWrite);}
return (Status);
}

View File

@ -8,24 +8,24 @@ From: Al Stone <ahs3@redhat.com>
generate/unix/iasl/Makefile | 13 +++++++------
2 files changed, 9 insertions(+), 6 deletions(-)
Index: acpica-unix2-20200925/generate/unix/Makefile.config
Index: acpica-unix2-20180209/generate/unix/Makefile.config
===================================================================
--- acpica-unix2-20200925.orig/generate/unix/Makefile.config
+++ acpica-unix2-20200925/generate/unix/Makefile.config
@@ -189,6 +189,8 @@ ifneq ($(NOFORTIFY),TRUE)
--- acpica-unix2-20180209.orig/generate/unix/Makefile.config
+++ acpica-unix2-20180209/generate/unix/Makefile.config
@@ -182,6 +182,8 @@ ifneq ($(NOFORTIFY),TRUE)
OPT_CFLAGS += -D_FORTIFY_SOURCE=2
endif
+OPT_CFLAGS += -fPIC -pie
+
CFLAGS += \
-D$(ACPI_HOST)\
-D$(HOST)\
-D_GNU_SOURCE\
Index: acpica-unix2-20200925/generate/unix/iasl/Makefile
Index: acpica-unix2-20180209/generate/unix/iasl/Makefile
===================================================================
--- acpica-unix2-20200925.orig/generate/unix/iasl/Makefile
+++ acpica-unix2-20200925/generate/unix/iasl/Makefile
@@ -359,34 +359,35 @@ $(OBJDIR)/prparserparse.c $(OBJDIR)/prpa
--- acpica-unix2-20180209.orig/generate/unix/iasl/Makefile
+++ acpica-unix2-20180209/generate/unix/iasl/Makefile
@@ -344,26 +344,27 @@ $(OBJDIR)/prparserparse.c $(OBJDIR)/prpa
# Cannot use the common compile warning flags since the C files are created
# by the utilities above and they are not necessarily ANSI C, etc.
#
@ -38,16 +38,6 @@ Index: acpica-unix2-20200925/generate/unix/iasl/Makefile
$(OBJDIR)/aslcompilerparse.o : $(OBJDIR)/aslcompilerparse.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
$(OBJDIR)/dtcompilerparserlex.o : $(OBJDIR)/dtcompilerparserlex.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
$(OBJDIR)/dtcompilerparserparse.o : $(OBJDIR)/dtcompilerparserparse.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
$(OBJDIR)/dtparserlex.o : $(OBJDIR)/dtparserlex.c

View File

@ -1,28 +0,0 @@
From 7670c56ebe004e698551635f9c5d48a1794066dd Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@ahs3.net>
Date: Wed, 19 Dec 2018 16:52:41 -0700
Subject: [PATCH] Correct DSDT Address field in FACP tables
The FADT allows either the DSDT Address or XDSDT Address field to be
zero. However, the table definition used by the table compiler still
requires the DSDT Address to be non-zero, which is not correct. So,
remove the DT_NON_ZERO flag from the field.
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbinfo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: acpica-unix2-20200925/source/common/dmtbinfo.c
===================================================================
--- acpica-unix2-20200925.orig/source/common/dmtbinfo.c
+++ acpica-unix2-20200925/source/common/dmtbinfo.c
@@ -184,7 +184,7 @@ ACPI_DMTABLE_INFO AcpiDmTableI
ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[] =
{
{ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Facs), "FACS Address", 0},
- {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Dsdt), "DSDT Address", DT_NON_ZERO},
+ {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Dsdt), "DSDT Address", 0},
{ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Model), "Model", 0},
{ACPI_DMT_FADTPM, ACPI_FADT_OFFSET (PreferredProfile), "PM Profile", 0},
{ACPI_DMT_UINT16, ACPI_FADT_OFFSET (SciInterrupt), "SCI Interrupt", 0},

15
SOURCES/free.patch Normal file
View File

@ -0,0 +1,15 @@
This prevents a segfault when an Include file does not exist.
Index: acpica-unix2-20170929/source/compiler/aslfiles.c
===================================================================
--- acpica-unix2-20170929.orig/source/compiler/aslfiles.c
+++ acpica-unix2-20170929/source/compiler/aslfiles.c
@@ -318,7 +318,7 @@ FlOpenIncludeWithPrefix (
if (!IncludeFile)
{
fprintf (stderr, "Could not open include file %s\n", Pathname);
- ACPI_FREE (Pathname);
+ /* ACPI_FREE (Pathname); <-- forces free() segfault */
return (NULL);
}

View File

@ -19,15 +19,9 @@ Warning 3133 - ^ Unknown reserved name (_NPK)
grammar.asl 208: Device (RES)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 247: Name (PRT0, ResourceTemplate ()
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\RES._CRS)
grammar.asl 399: CreateByteField (PRT0, R000._ASZ, RSIZ)
Remark 2089 - Object is not referenced ^ (Name [RSIZ] is within a method [_CRS])
grammar.asl 406: Name (BUF0, ResourceTemplate ()
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\RES._PRS)
grammar.asl 513: Name (_STR, Unicode ("test"))
Remark 2089 - ^ Object is not referenced (Name [_STR] is within a method [TCOP])
@ -40,18 +34,9 @@ Warning 3055 - ^ Invalid Hex/Octal Escape - Non-
grammar.asl 523: NAME (ESC2, "abcdefg\000hijklmn")
Warning 3055 - ^ Invalid Hex/Octal Escape - Non-ASCII or NULL
grammar.asl 552: IRQNoFlags(xxxt){3,4,10,11}
Remark 2182 - ^ At least one lower case letter found in NameSeg, ASL is case insensitive - converting to upper case (XXXT)
grammar.asl 566: Name(Bxxx,0xFFFFFFFF)
Remark 2182 - ^ At least one lower case letter found in NameSeg, ASL is case insensitive - converting to upper case (BXXX)
grammar.asl 620: RCIV (Subtract (Arg0, 1))
Remark 2098 - ^ Recursive method call (RCIV)
grammar.asl 631: Processor(CPU0,0x0,0xFFFFFFFF,0x0) {}
Warning 3168 - ^ Legacy Processor() keyword detected. Use Device() keyword instead.
grammar.asl 668: Method(SMWE, 4)
Remark 2146 - ^ Method Argument is never used (Arg0)
@ -79,12 +64,6 @@ Remark 2146 - ^ Method Argument is never used (Arg3)
grammar.asl 701: CreateField (\_SB_.SBUF, 148, 96, FLDV)
Remark 2089 - Object is not referenced ^ (Name [FLDV] is within a method [_INI])
grammar.asl 705: Device(PCI0)
Warning 3073 - Multiple types ^ (Device object requires either a _HID or _ADR, but not both)
grammar.asl 712: Name(PRT0, ResourceTemplate() {
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0._CRS)
grammar.asl 733: Method(_SRS)
Warning 3102 - ^ Reserved method has too few arguments (_SRS requires 1)
@ -115,21 +94,9 @@ Remark 2146 - ^ Method Argument is never used (Arg0)
grammar.asl 1300: Name(BUFR, Buffer (Local0) {})
Remark 2089 - ^ Object is not referenced (Name [BUFR] is within a method [OBJ1])
grammar.asl 1300: Name(BUFR, Buffer (Local0) {})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\OBJ1)
grammar.asl 1301: Name(BUF1, Buffer (4) {1,2,3,4})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\OBJ1)
grammar.asl 1302: Name(BUF2, Buffer (4) {})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\OBJ1)
grammar.asl 1307: Alias (MTX1, MTX2)
Remark 2089 - Object is not referenced ^ (Name [MTX2] is within a method [OBJ1])
grammar.asl 1321: Name (BUF2, Buffer (128) {})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\FLDS)
grammar.asl 1329: CreateField (BUF2, 148, 96, FLD3)
Remark 2089 - Object is not referenced ^ (Name [FLD3] is within a method [FLDS])
@ -139,24 +106,9 @@ Warning 3038 - ^ Truncating 64-bit constant
grammar.asl 1396: if (LNotEqual (Local0, 0x1234567887654321))
Warning 3038 - Truncating 64-bit constant found in 32-bit table ^
grammar.asl 1445: Name (BUFO, Buffer (32) {})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\OBJ2)
grammar.asl 1448: OperationRegion (OPR2, SystemMemory, Arg0, 256)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\OBJ2)
grammar.asl 1462: BankField (OPR2, BNK2, 0, ByteAcc, NoLock, Preserve)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\OBJ2)
grammar.asl 1469: IndexField (IDX2, DAT2, ByteAcc, NoLock, Preserve)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\OBJ2)
grammar.asl 1476: SizeOf (BUFO)
Error 6114 - ^ Result is not used, operator has no effect
grammar.asl 1490: Event (EVT2)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\OBJ2)
grammar.asl 1496: Alias (MTX2, MTXA)
Remark 2089 - Object is not referenced ^ (Name [MTXA] is within a method [OBJ2])
@ -188,13 +140,7 @@ grammar.asl 1792: Store (LLessEqual (0xFFFFFFFF, 0x11111111), Local5)
Warning 3144 - Method Local is set but never used ^ (Local5)
grammar.asl 1821: Method (COND)
Warning 3115 - ^ Not all control paths return a value (\COND)
grammar.asl 1916: Name (BBUF, Buffer() {0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\REFS)
grammar.asl 1918: Name (NEST, Package ()
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\REFS)
Warning 3115 - ^ Not all control paths return a value (COND)
grammar.asl 1930: Store (RefOf (MAIN), Local5)
Warning 3144 - Method Local is set but never used ^ (Local5)
@ -205,9 +151,6 @@ Warning 3141 - ^ Missing dependency (Device object requires a
grammar.asl 2162: Device (NOSV)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 2168: Name (WRD, 0x1234)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\NOSV.TEST)
grammar.asl 2583: Device (IDXF)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
@ -226,12 +169,6 @@ Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR
grammar.asl 2658: Device (RTBF)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 2667: Name (ABUF, Buffer() {"ARBITRARY_BUFFER"})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\RTBF.RBUF)
grammar.asl 2695: Name (BUFR, Buffer(Local1) {})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\RTBF.RBUF)
grammar.asl 2756: Device (GPE2)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
@ -247,9 +184,6 @@ Warning 3144 - ^ Method Local is set but never
grammar.asl 2889: Device (RTLV)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 2989: Device (PCI1)
Warning 3073 - Multiple types ^ (Device object requires either a _HID or _ADR, but not both)
grammar.asl 2993: Name (_CRS,0)
Error 6105 - ^ Invalid object type for reserved name (_CRS: found Integer, Buffer required)
@ -262,36 +196,15 @@ Warning 3141 - ^ Missing dependency (Device object requires a
grammar.asl 3109: Device (ANDO)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 3343: Name(RSLT,1)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\ANDO.TEST)
grammar.asl 3383: Device (BRKP)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 3420: Device (ADSU)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 3435: Name (DWRD, 0x12345678)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\ADSU.TEST)
grammar.asl 3436: Name (WRD, 0x1234)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\ADSU.TEST)
grammar.asl 3437: Name (BYT, 0x12)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\ADSU.TEST)
grammar.asl 3513: Device (INDC)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 3528: Name (DWRD, 0x12345678)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\INDC.TEST)
grammar.asl 3529: Name (WRD, 0x1234)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\INDC.TEST)
grammar.asl 3530: Name (BYT, 0x12)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\INDC.TEST)
grammar.asl 3611: Device (LOPS)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
@ -301,18 +214,6 @@ Warning 3141 - ^ Missing dependency (Device object requires a
grammar.asl 4120: Device (MLDV)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 4135: Name (RMDR, 0)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\MLDV.TEST)
grammar.asl 4136: Name (DWRD, 0x12345678)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\MLDV.TEST)
grammar.asl 4137: Name (WRD, 0x1234)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\MLDV.TEST)
grammar.asl 4138: Name (BYT, 0x12)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\MLDV.TEST)
grammar.asl 4253: Device (NBIT)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
@ -322,21 +223,12 @@ Warning 3141 - ^ Missing dependency (Device object requires a
grammar.asl 4685: Device (XORD)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 4693: OperationRegion (RAM, SystemMemory, 0x800000, 256)
Warning 3175 - ^ Static OperationRegion should be declared outside control method
grammar.asl 4693: OperationRegion (RAM, SystemMemory, 0x800000, 256)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\XORD.TEST)
grammar.asl 5022: Device (CRBF)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 5100: Device (IDX4)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 5117: OperationRegion (RAM, SystemMemory, Arg0, 0x100)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\IDX4.MADM)
grammar.asl 5639: Device (EVNT)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
@ -406,99 +298,27 @@ Warning 3144 - Method Local is set but never used ^ (Local6)
grammar.asl 6393: Device (IDX5)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 6416: Name (BUF0, Buffer (Local0) {})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\IDX5.MCTH)
grammar.asl 6417: Name (BUF1, Buffer (Local0) {})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\IDX5.MCTH)
grammar.asl 6474: Device (PCI2)
Warning 3073 - Multiple types ^ (Device object requires either a _HID or _ADR, but not both)
grammar.asl 6478: Name (_CRS, Buffer(26) {"\_SB_.PCI2._CRS..........."})
Warning 3046 - Invalid or unknown escape sequence ^
grammar.asl 6554: Name (BUFR, Package(13) {})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.IDX0._BIF)
grammar.asl 6578: Name (BUFR, Package(4) {1, 0x100, 0x76543210, 0x180})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.IDX0._BST)
grammar.asl 6593: Name (PBUF, Package(4) {}) // leave uninitialized
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.IDX0.TEST)
grammar.asl 6625: Name (BUFR, Buffer(16)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.IDX0.TEST)
grammar.asl 6709: Device (BITI)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 6817: And (Local0, 1, Local0) // Local0 &= 1
Error 6066 - ^ Method local variable is not initialized (Local0)
grammar.asl 6846: Name (C17C, Package (13)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.C17B)
grammar.asl 6903: Name (_HID, "*PNP0C0A") // Control Method Battey ID
Error 6061 - Invalid leading asterisk ^ (*PNP0C0A)
grammar.asl 6912: Device (IDX3)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 6922: Name (BUFR, Buffer () {0, 1, 2, 3, 4, 5, 6, 7, 8, 9})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.IDX3.LCLB)
grammar.asl 6974: Name (PKG, Package () {0, 1, 2, 3, 4, 5, 6, 7, 8, 9})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.IDX3.LCLP)
grammar.asl 7057: Device(IDX7)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 7074: Name (DEST, Buffer () // 62 characters plus NULL
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\IDX7.TST1)
grammar.asl 7093: Name (BUF0, Buffer() {0x1, 0x2, 0x3, 0x4, 0x5})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\IDX7.TST2)
grammar.asl 7110: Name (BUF1, Buffer() {0x1, 0x2, 0x3, 0x4, 0x5})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\IDX7.TST3)
grammar.asl 7301: Name (SRCB, Buffer (12) {}) // 12 characters
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\IDX7.TSTF)
grammar.asl 7304: Name (DEST, Buffer () // 62 characters plus NULL
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\IDX7.TSTF)
grammar.asl 7327: Name (SRCB, Buffer (12) {}) // 12 characters
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\IDX7.TSTG)
grammar.asl 7330: Name (DEST, Buffer () // 62 characters plus NULL
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\IDX7.TSTG)
grammar.asl 7412: Name (DBUF, Buffer () {"abcdefghijklmnopqrstuvwxyz"})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\IDX7.TSTH)
grammar.asl 7448: Name (DBUF, Buffer () {"abcdefghijklmnopqrstuvwxyz"})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\IDX7.TSTI)
grammar.asl 7484: Name (DBUF, Buffer () {"abcdefghijklmnopqrstuvwxyz"})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\IDX7.TSTJ)
grammar.asl 7520: Name (DBUF, Buffer () {"abcdefghijklmnopqrstuvwxyz"})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\IDX7.TSTK)
grammar.asl 7556: Name (DBUF, Buffer () {"abcdefghijklmnopqrstuvwxyz"})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\IDX7.TSTL)
grammar.asl 7736: Device (MTCH)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 7743: Name (TIM0, Package ()
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\MTCH.TEST)
grammar.asl 7755: Name (TMD0, Buffer (20) {0xFF, 0xFF, 0xFF, 0xFF })
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\MTCH.TEST)
grammar.asl 7757: CreateDWordField (TMD0, 4, DMA0)
Remark 2089 - Object is not referenced ^ (Name [DMA0] is within a method [TEST])
@ -514,51 +334,15 @@ Remark 2089 - Object is not referenced ^ (Name [CHNF] is
grammar.asl 7934: Device (WHLB)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 8275: Name (BUFR, Package (13) {})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.BAT1._BIF)
grammar.asl 8295: Device (IDX2)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 8300: Name (SRCB, Buffer () {"Short Buffer"}) // 12 characters plus NULL
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.IDX2.B2IB)
grammar.asl 8302: Name (DEST, Buffer () // 62 characters plus NULL
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.IDX2.B2IB)
grammar.asl 8493: Name (DEST, Package (2) {})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.IDX2.FB2P)
grammar.asl 8678: Device (SIZO)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 8708: Name (BUFR, Buffer (12) {}) // uninitialized Buffer
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\SIZO.SARG)
grammar.asl 8709: Name (BUF1, Buffer() {0x01, 0x02, 0x03, 0x04, 0x05})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\SIZO.SARG)
grammar.asl 8710: Name (PKG0, Package (4) {}) // uninitialized Package
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\SIZO.SARG)
grammar.asl 8712: Name (PKG1, Package (4)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\SIZO.SARG)
grammar.asl 8720: Name (PKG2, Package (4)
Remark 2063 - ^ Initializer list shorter than declared package length
grammar.asl 8720: Name (PKG2, Package (4)
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\SIZO.SARG)
grammar.asl 8973: Name (BUFR, Buffer (12) {})
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\SIZO.SBUF)
grammar.asl 9034: Name (BUFR, Buffer (12) {}) // uninitialized Buffer
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\SIZO.SLOC)
grammar.asl 9036: Name (PKG0, Package (4) {}) // uninitialized Package
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\SIZO.SLOC)
grammar.asl 9132: Store (_OS, Local0)
Warning 3144 - ^ Method Local is set but never used (Local0)
@ -580,11 +364,11 @@ Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR i
Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version VVVVVVVV
Copyright (c) 2000 - 2021 Intel Corporation
Copyright (c) 2000 - 2018 Intel Corporation
Ignoring all errors, forcing AML file generation
ASL Input: grammar.asl - 323653 bytes 4818 keywords 10284 source lines
AML Output: grammar.aml - 43758 bytes 4148 opcodes 670 named objects
ASL Input: grammar.asl - 10284 lines, 323650 bytes, 4818 keywords
AML Output: grammar.aml - 43758 bytes, 670 named objects, 4148 executable opcodes
Compilation successful. 6 Errors, 93 Warnings, 94 Remarks, 1106 Optimizations
Compilation complete. 6 Errors, 88 Warnings, 27 Remarks, 1106 Optimizations

View File

@ -4,8 +4,10 @@ From: Al Stone <ahs3@redhat.com>
---
source/compiler/aslcompile.c | 2 +-
source/compiler/aslerror.c | 4 ++--
source/compiler/aslopt.c | 2 +-
source/compiler/aslpredef.c | 2 +-
source/compiler/aslprepkg.c | 2 +-
source/components/debugger/dbexec.c | 2 +-
source/components/dispatcher/dsmthdat.c | 4 ++--
@ -19,26 +21,49 @@ From: Al Stone <ahs3@redhat.com>
source/components/tables/tbfadt.c | 6 +++---
source/components/tables/tbxfroot.c | 6 +++---
source/components/utilities/utownerid.c | 2 +-
source/tools/acpiexec/aemain.c | 2 +-
18 files changed, 28 insertions(+), 28 deletions(-)
Index: acpica-unix2-20200925/source/compiler/aslerror.c
Index: acpica-unix2-20180531/source/compiler/aslcompile.c
===================================================================
--- acpica-unix2-20200925.orig/source/compiler/aslerror.c
+++ acpica-unix2-20200925/source/compiler/aslerror.c
@@ -917,7 +917,7 @@ AslLogNewError (
AslGbl_ExceptionCount[ModifiedLevel]++;
if (!AslGbl_IgnoreErrors && AslGbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT)
--- acpica-unix2-20180531.orig/source/compiler/aslcompile.c
+++ acpica-unix2-20180531/source/compiler/aslcompile.c
@@ -750,7 +750,7 @@ CmCleanupAndExit (
if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT)
{
- printf ("\nMaximum error count (%u) exceeded\n",
+ printf ("\nMaximum error count (%d) exceeded\n",
ASL_MAX_ERROR_COUNT);
}
Index: acpica-unix2-20180531/source/compiler/aslerror.c
===================================================================
--- acpica-unix2-20180531.orig/source/compiler/aslerror.c
+++ acpica-unix2-20180531/source/compiler/aslerror.c
@@ -880,7 +880,7 @@ AslLogNewError (
Gbl_ExceptionCount[Level]++;
if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT)
{
- printf ("\nMaximum error count (%u) exceeded\n", ASL_MAX_ERROR_COUNT);
+ printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT);
AslGbl_SourceLine = 0;
AslGbl_NextError = AslGbl_ErrorLog;
Index: acpica-unix2-20200925/source/compiler/aslopt.c
Gbl_SourceLine = 0;
Gbl_NextError = Gbl_ErrorLog;
@@ -1036,7 +1036,7 @@ AslDisableException (
if (Gbl_DisabledMessagesIndex >= ASL_MAX_DISABLED_MESSAGES)
{
- printf ("Too many messages have been disabled (max %u)\n",
+ printf ("Too many messages have been disabled (max %d)\n",
ASL_MAX_DISABLED_MESSAGES);
return (AE_LIMIT);
}
Index: acpica-unix2-20180531/source/compiler/aslopt.c
===================================================================
--- acpica-unix2-20200925.orig/source/compiler/aslopt.c
+++ acpica-unix2-20200925/source/compiler/aslopt.c
@@ -583,7 +583,7 @@ OptOptimizeNamePath (
--- acpica-unix2-20180531.orig/source/compiler/aslopt.c
+++ acpica-unix2-20180531/source/compiler/aslopt.c
@@ -584,7 +584,7 @@ OptOptimizeNamePath (
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
@ -47,36 +72,49 @@ Index: acpica-unix2-20200925/source/compiler/aslopt.c
Op->Asl.LogicalLineNumber,
AcpiPsGetOpcodeName (Op->Common.Parent->Common.AmlOpcode),
AcpiPsGetOpcodeName (Op->Common.AmlOpcode)));
Index: acpica-unix2-20200925/source/compiler/aslprepkg.c
Index: acpica-unix2-20180531/source/compiler/aslpredef.c
===================================================================
--- acpica-unix2-20200925.orig/source/compiler/aslprepkg.c
+++ acpica-unix2-20200925/source/compiler/aslprepkg.c
@@ -320,7 +320,7 @@ ApCheckPackage (
--- acpica-unix2-20180531.orig/source/compiler/aslpredef.c
+++ acpica-unix2-20180531/source/compiler/aslpredef.c
@@ -114,7 +114,7 @@ ApCheckForPredefinedMethod (
if (MethodInfo->NumArguments != 0)
{
- sprintf (MsgBuffer, "%s requires %u", Op->Asl.ExternalName, 0);
+ sprintf (MsgBuffer, "%s requires %d", Op->Asl.ExternalName, 0);
AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op,
MsgBuffer);
Index: acpica-unix2-20180531/source/compiler/aslprepkg.c
===================================================================
--- acpica-unix2-20180531.orig/source/compiler/aslprepkg.c
+++ acpica-unix2-20180531/source/compiler/aslprepkg.c
@@ -309,7 +309,7 @@ ApCheckPackage (
if (Count & 1)
{
- sprintf (AslGbl_MsgBuffer, "%4.4s: Package length, %d, must be even.",
+ sprintf (AslGbl_MsgBuffer, "%4.4s: Package length, %u, must be even.",
- sprintf (MsgBuffer, "%4.4s: Package length, %d, must be even.",
+ sprintf (MsgBuffer, "%4.4s: Package length, %u, must be even.",
Predefined->Info.Name, Count);
AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH,
Index: acpica-unix2-20200925/source/components/debugger/dbexec.c
Index: acpica-unix2-20180531/source/components/debugger/dbexec.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/debugger/dbexec.c
+++ acpica-unix2-20200925/source/components/debugger/dbexec.c
@@ -231,7 +231,7 @@ AcpiDbExecuteMethod (
--- acpica-unix2-20180531.orig/source/components/debugger/dbexec.c
+++ acpica-unix2-20180531/source/components/debugger/dbexec.c
@@ -230,7 +230,7 @@ AcpiDbExecuteMethod (
ACPI_ERROR ((AE_INFO,
"Possible buffer overflow within AML Debugger "
"Possible overflow of internal debugger "
"buffer (size 0x%X needed 0x%X)",
- ACPI_DEBUG_BUFFER_SIZE, (UINT32) ReturnObj->Length));
+ (UINT32) ACPI_DEBUG_BUFFER_SIZE, (UINT32) ReturnObj->Length));
}
}
Index: acpica-unix2-20200925/source/components/dispatcher/dsmthdat.c
Index: acpica-unix2-20180531/source/components/dispatcher/dsmthdat.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/dispatcher/dsmthdat.c
+++ acpica-unix2-20200925/source/components/dispatcher/dsmthdat.c
--- acpica-unix2-20180531.orig/source/components/dispatcher/dsmthdat.c
+++ acpica-unix2-20180531/source/components/dispatcher/dsmthdat.c
@@ -291,7 +291,7 @@ AcpiDsMethodDataGetNode (
if (Index > ACPI_METHOD_MAX_LOCAL)
{
@ -95,11 +133,11 @@ Index: acpica-unix2-20200925/source/components/dispatcher/dsmthdat.c
Index, ACPI_METHOD_MAX_ARG));
return_ACPI_STATUS (AE_AML_INVALID_INDEX);
}
Index: acpica-unix2-20200925/source/components/dispatcher/dsutils.c
Index: acpica-unix2-20180531/source/components/dispatcher/dsutils.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/dispatcher/dsutils.c
+++ acpica-unix2-20200925/source/components/dispatcher/dsutils.c
@@ -786,7 +786,7 @@ AcpiDsCreateOperands (
--- acpica-unix2-20180531.orig/source/components/dispatcher/dsutils.c
+++ acpica-unix2-20180531/source/components/dispatcher/dsutils.c
@@ -788,7 +788,7 @@ AcpiDsCreateOperands (
}
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
@ -108,10 +146,10 @@ Index: acpica-unix2-20200925/source/components/dispatcher/dsutils.c
WalkState->NumOperands, ArgCount, Index));
/* Create the interpreter arguments, in reverse order */
Index: acpica-unix2-20200925/source/components/dispatcher/dswscope.c
Index: acpica-unix2-20180531/source/components/dispatcher/dswscope.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/dispatcher/dswscope.c
+++ acpica-unix2-20200925/source/components/dispatcher/dswscope.c
--- acpica-unix2-20180531.orig/source/components/dispatcher/dswscope.c
+++ acpica-unix2-20180531/source/components/dispatcher/dswscope.c
@@ -149,7 +149,7 @@ AcpiDsScopeStackPush (
WalkState->ScopeDepth++;
@ -130,11 +168,11 @@ Index: acpica-unix2-20200925/source/components/dispatcher/dswscope.c
(UINT32) WalkState->ScopeDepth,
AcpiUtGetNodeName (ScopeInfo->Scope.Node),
AcpiUtGetTypeName (ScopeInfo->Common.Value)));
Index: acpica-unix2-20200925/source/components/events/evgpe.c
Index: acpica-unix2-20180531/source/components/events/evgpe.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/events/evgpe.c
+++ acpica-unix2-20200925/source/components/events/evgpe.c
@@ -488,7 +488,7 @@ AcpiEvGpeDetect (
--- acpica-unix2-20180531.orig/source/components/events/evgpe.c
+++ acpica-unix2-20180531/source/components/events/evgpe.c
@@ -481,7 +481,7 @@ AcpiEvGpeDetect (
"Ignore disabled registers for GPE %02X-%02X: "
"RunEnable=%02X, WakeEnable=%02X\n",
GpeRegisterInfo->BaseGpeNumber,
@ -143,10 +181,10 @@ Index: acpica-unix2-20200925/source/components/events/evgpe.c
GpeRegisterInfo->EnableForRun,
GpeRegisterInfo->EnableForWake));
continue;
Index: acpica-unix2-20200925/source/components/executer/exdump.c
Index: acpica-unix2-20180531/source/components/executer/exdump.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/executer/exdump.c
+++ acpica-unix2-20200925/source/components/executer/exdump.c
--- acpica-unix2-20180531.orig/source/components/executer/exdump.c
+++ acpica-unix2-20180531/source/components/executer/exdump.c
@@ -678,7 +678,7 @@ AcpiExDumpOperand (
if (Depth > 0)
{
@ -156,10 +194,10 @@ Index: acpica-unix2-20200925/source/components/executer/exdump.c
}
else
{
Index: acpica-unix2-20200925/source/components/executer/exfldio.c
Index: acpica-unix2-20180531/source/components/executer/exfldio.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/executer/exfldio.c
+++ acpica-unix2-20200925/source/components/executer/exfldio.c
--- acpica-unix2-20180531.orig/source/components/executer/exfldio.c
+++ acpica-unix2-20180531/source/components/executer/exfldio.c
@@ -681,8 +681,8 @@ AcpiExWriteWithUpdateRule (
ACPI_ERROR ((AE_INFO,
@ -171,10 +209,10 @@ Index: acpica-unix2-20200925/source/components/executer/exfldio.c
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
}
}
Index: acpica-unix2-20200925/source/components/executer/exnames.c
Index: acpica-unix2-20180531/source/components/executer/exnames.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/executer/exnames.c
+++ acpica-unix2-20200925/source/components/executer/exnames.c
--- acpica-unix2-20180531.orig/source/components/executer/exnames.c
+++ acpica-unix2-20180531/source/components/executer/exnames.c
@@ -237,7 +237,7 @@ AcpiExNameSegment (
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
@ -193,10 +231,10 @@ Index: acpica-unix2-20200925/source/components/executer/exnames.c
}
*InAmlAddress = ACPI_CAST_PTR (UINT8, AmlAddress);
Index: acpica-unix2-20200925/source/components/hardware/hwregs.c
Index: acpica-unix2-20180531/source/components/hardware/hwregs.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/hardware/hwregs.c
+++ acpica-unix2-20200925/source/components/hardware/hwregs.c
--- acpica-unix2-20180531.orig/source/components/hardware/hwregs.c
+++ acpica-unix2-20180531/source/components/hardware/hwregs.c
@@ -460,7 +460,7 @@ AcpiHwClearAcpiStatus (
@ -206,10 +244,10 @@ Index: acpica-unix2-20200925/source/components/hardware/hwregs.c
ACPI_FORMAT_UINT64 (AcpiGbl_XPm1aStatus.Address)));
LockFlags = AcpiOsAcquireLock (AcpiGbl_HardwareLock);
Index: acpica-unix2-20200925/source/components/tables/tbfadt.c
Index: acpica-unix2-20180531/source/components/tables/tbfadt.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/tables/tbfadt.c
+++ acpica-unix2-20200925/source/components/tables/tbfadt.c
--- acpica-unix2-20180531.orig/source/components/tables/tbfadt.c
+++ acpica-unix2-20180531/source/components/tables/tbfadt.c
@@ -233,7 +233,7 @@ AcpiTbInitGenericAddress (
if (!(Flags & ACPI_FADT_GPE_REGISTER))
{
@ -219,7 +257,7 @@ Index: acpica-unix2-20200925/source/components/tables/tbfadt.c
"to convert to GAS struct - 255 bits max, truncating",
RegisterName, ByteWidth, (ByteWidth * 8)));
}
@@ -303,7 +303,7 @@ AcpiTbSelectAddress (
@@ -304,7 +304,7 @@ AcpiTbSelectAddress (
ACPI_BIOS_WARNING ((AE_INFO,
"32/64X %s address mismatch in FADT: "
@ -228,7 +266,7 @@ Index: acpica-unix2-20200925/source/components/tables/tbfadt.c
RegisterName, Address32, ACPI_FORMAT_UINT64 (Address64),
AcpiGbl_Use32BitFadtAddresses ? 32 : 64));
@@ -631,7 +631,7 @@ AcpiTbConvertFadt (
@@ -628,7 +628,7 @@ AcpiTbConvertFadt (
ACPI_BIOS_WARNING ((AE_INFO,
"32/64X address mismatch in FADT/%s: "
@ -237,10 +275,10 @@ Index: acpica-unix2-20200925/source/components/tables/tbfadt.c
Name, Address32,
ACPI_FORMAT_UINT64 (Address64->Address),
AcpiGbl_Use32BitFadtAddresses ? 32 : 64));
Index: acpica-unix2-20200925/source/components/tables/tbxfroot.c
Index: acpica-unix2-20180531/source/components/tables/tbxfroot.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/tables/tbxfroot.c
+++ acpica-unix2-20200925/source/components/tables/tbxfroot.c
--- acpica-unix2-20180531.orig/source/components/tables/tbxfroot.c
+++ acpica-unix2-20180531/source/components/tables/tbxfroot.c
@@ -177,7 +177,7 @@ AcpiFindRootPointer (
{
ACPI_ERROR ((AE_INFO,
@ -268,16 +306,29 @@ Index: acpica-unix2-20200925/source/components/tables/tbxfroot.c
return_ACPI_STATUS (AE_NO_MEMORY);
}
Index: acpica-unix2-20200925/source/components/utilities/utownerid.c
Index: acpica-unix2-20180531/source/components/utilities/utownerid.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/utilities/utownerid.c
+++ acpica-unix2-20200925/source/components/utilities/utownerid.c
--- acpica-unix2-20180531.orig/source/components/utilities/utownerid.c
+++ acpica-unix2-20180531/source/components/utilities/utownerid.c
@@ -237,7 +237,7 @@ AcpiUtReleaseOwnerId (
else
{
ACPI_ERROR ((AE_INFO,
- "Attempted release of non-allocated OwnerId: 0x%3.3X", OwnerId + 1));
- "Release of non-allocated OwnerId: 0x%2.2X", OwnerId + 1));
+ "Release of non-allocated OwnerId: 0x%2.2X", (UINT32) OwnerId + 1));
}
(void) AcpiUtReleaseMutex (ACPI_MTX_CACHES);
Index: acpica-unix2-20180531/source/tools/acpiexec/aemain.c
===================================================================
--- acpica-unix2-20180531.orig/source/tools/acpiexec/aemain.c
+++ acpica-unix2-20180531/source/tools/acpiexec/aemain.c
@@ -209,7 +209,7 @@ AeDoOptions (
if (strlen (AcpiGbl_Optarg) > (AE_BUFFER_SIZE -1))
{
- printf ("**** The length of command line (%u) exceeded maximum (%u)\n",
+ printf ("**** The length of command line (%u) exceeded maximum (%d)\n",
(UINT32) strlen (AcpiGbl_Optarg), (AE_BUFFER_SIZE -1));
return (-1);
}

View File

@ -1,8 +1,8 @@
Index: acpica-unix2-20200925/source/compiler/aslparseop.c
Index: acpica-unix2-20180313/source/compiler/aslparseop.c
===================================================================
--- acpica-unix2-20200925.orig/source/compiler/aslparseop.c
+++ acpica-unix2-20200925/source/compiler/aslparseop.c
@@ -285,7 +285,16 @@ TrCreateValuedLeafOp (
--- acpica-unix2-20180313.orig/source/compiler/aslparseop.c
+++ acpica-unix2-20180313/source/compiler/aslparseop.c
@@ -283,7 +283,16 @@ TrCreateValuedLeafOp (
Op = TrAllocateOp (ParseOpcode);
@ -20,3 +20,18 @@ Index: acpica-unix2-20200925/source/compiler/aslparseop.c
DbgPrint (ASL_PARSE_OUTPUT,
"\nCreateValuedLeafOp Ln/Col %u/%u NewOp %p "
Index: acpica-unix2-20180313/source/include/platform/aclinux.h
===================================================================
--- acpica-unix2-20180313.orig/source/include/platform/aclinux.h
+++ acpica-unix2-20180313/source/include/platform/aclinux.h
@@ -227,10 +227,8 @@
#endif
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
-#if defined(__PPC64__) || defined(__s390x__)
#define ACPI_BIG_ENDIAN
#endif
-#endif
#endif /* __KERNEL__ */

16
SOURCES/ppc64le.patch Normal file
View File

@ -0,0 +1,16 @@
Index: acpica-unix2-20180313/source/include/platform/aclinux.h
===================================================================
--- acpica-unix2-20180313.orig/source/include/platform/aclinux.h
+++ acpica-unix2-20180313/source/include/platform/aclinux.h
@@ -228,9 +228,11 @@
#define __cdecl
#endif
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#if defined(__PPC64__) || defined(__s390x__)
#define ACPI_BIG_ENDIAN
#endif
+#endif
#endif /* __KERNEL__ */

View File

@ -1,12 +1,11 @@
Index: acpica-unix2-20200925/source/components/tables/tbutils.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/tables/tbutils.c
+++ acpica-unix2-20200925/source/components/tables/tbutils.c
@@ -238,9 +238,11 @@ AcpiTbGetRootTableEntry (
diff -Naur acpica-unix2-20180209.orig/source/components/tables/tbutils.c acpica-unix2-20180209/source/components/tables/tbutils.c
--- acpica-unix2-20180209.orig/source/components/tables/tbutils.c 2018-03-15 16:47:21.831526264 -0600
+++ acpica-unix2-20180209/source/components/tables/tbutils.c 2018-03-15 16:58:20.030097284 -0600
@@ -238,9 +238,11 @@
* 64-bit platform, XSDT: Move (unaligned) 64-bit to local,
* return 64-bit
*/
- ACPI_MOVE_64_TO_64 (&Address64, TableEntry);
- Address64 = (UINT64) TableEntry;
#if ACPI_MACHINE_WIDTH == 32
+ UINT32 Tmp32 = (UINT32) TableEntry;
@ -15,7 +14,7 @@ Index: acpica-unix2-20200925/source/components/tables/tbutils.c
if (Address64 > ACPI_UINT32_MAX)
{
/* Will truncate 64-bit address to 32 bits, issue warning */
@@ -250,8 +252,14 @@ AcpiTbGetRootTableEntry (
@@ -250,9 +252,15 @@
" truncating",
ACPI_FORMAT_UINT64 (Address64)));
}
@ -26,16 +25,16 @@ Index: acpica-unix2-20200925/source/components/tables/tbutils.c
+#else
+ Address64 = (UINT64) TableEntry;
+
return ((ACPI_PHYSICAL_ADDRESS) (Address64));
return ((ACPI_PHYSICAL_ADDRESS) (*ACPI_CAST_PTR (
UINT64, Address64)));
+#endif
}
}
Index: acpica-unix2-20200925/source/compiler/aslparseop.c
===================================================================
--- acpica-unix2-20200925.orig/source/compiler/aslparseop.c
+++ acpica-unix2-20200925/source/compiler/aslparseop.c
@@ -289,7 +289,11 @@ TrCreateValuedLeafOp (
diff -Naur acpica-unix2-20180209.orig/source/compiler/aslparseop.c acpica-unix2-20180209/source/compiler/aslparseop.c
--- acpica-unix2-20180209.orig/source/compiler/aslparseop.c 2018-03-15 17:20:09.844338074 -0600
+++ acpica-unix2-20180209/source/compiler/aslparseop.c 2018-03-15 17:28:19.570800797 -0600
@@ -287,7 +287,11 @@
ParseOpcode == PARSEOP_NAMESEG ||
ParseOpcode == PARSEOP_STRING_LITERAL)
{

View File

@ -16,7 +16,7 @@ BINDIR="$1"
VERSION="$2"
# create files to compare against
$BINDIR/iasl -hZZ
$BINDIR/iasl -h
sed -e "s/VVVVVVVV/$VERSION/" \
../badcode.asl.result > misc/badcode.asl.expected
@ -39,10 +39,9 @@ $BINDIR/iasl -f -of grammar.asl 2>&1 | tee grammar.asl.actual
diff grammar.asl.actual grammar.asl.expected >/dev/null 2>&1
[ $? -eq 0 ] || exit 1
# see if converterSample.asl failed as expected
# NB: the -f option is required so we can see all of the errors
$BINDIR/iasl -f -of converterSample.asl 2>&1 | tee converterSample.asl.actual
# see if converterSample.asl succeeded as expected
$BINDIR/iasl converterSample.asl 2>&1 | tee converterSample.asl.actual
diff converterSample.asl.actual converterSample.asl.expected >/dev/null 2>&1
[ $? -eq 0 ] || exit 1
[ $? -ne 0 ] && exit 1
exit 0

View File

@ -3,18 +3,17 @@ Description: Stop listing all 64bit architectures
64bit architectures.
Author: Adrian Bunk <bunk@debian.org>
Index: acpica-unix2-20200925/source/include/platform/aclinux.h
Index: acpica-unix2-20180313/source/include/platform/aclinux.h
===================================================================
--- acpica-unix2-20200925.orig/source/include/platform/aclinux.h
+++ acpica-unix2-20200925/source/include/platform/aclinux.h
@@ -215,10 +215,7 @@
--- acpica-unix2-20180313.orig/source/include/platform/aclinux.h
+++ acpica-unix2-20180313/source/include/platform/aclinux.h
@@ -210,9 +210,7 @@
#define ACPI_FLUSH_CPU_CACHE()
#define ACPI_CAST_PTHREAD_T(Pthread) ((ACPI_THREAD_ID) (Pthread))
-#if defined(__ia64__) || (defined(__x86_64__) && !defined(__ILP32__)) ||\
- defined(__aarch64__) || defined(__PPC64__) ||\
- defined(__s390x__) ||\
- (defined(__riscv) && (defined(__LP64__) || defined(_LP64)))
- defined(__s390x__)
+#if defined(__LP64__)
#define ACPI_MACHINE_WIDTH 64
#define COMPILER_DEPENDENT_INT64 long

View File

@ -1,30 +1,30 @@
Index: acpica-unix2-20200925/source/compiler/aslanalyze.c
Index: acpica-unix2-20180209/source/compiler/aslanalyze.c
===================================================================
--- acpica-unix2-20200925.orig/source/compiler/aslanalyze.c
+++ acpica-unix2-20200925/source/compiler/aslanalyze.c
@@ -358,11 +358,16 @@ AnCheckMethodReturnValue (
--- acpica-unix2-20180209.orig/source/compiler/aslanalyze.c
+++ acpica-unix2-20180209/source/compiler/aslanalyze.c
@@ -355,11 +355,16 @@ AnCheckMethodReturnValue (
*/
if (ThisNodeBtype != 0)
{
- sprintf (AslGbl_MsgBuffer,
- sprintf (MsgBuffer,
+ int cnt;
+ char *strp;
+
+ cnt = asprintf (&strp,
"Method returns [%s], %s operator requires [%s]",
AslGbl_StringBuffer, OpInfo->Name, AslGbl_StringBuffer2);
StringBuffer, OpInfo->Name, StringBuffer2);
- AslError (ASL_WARNING, ASL_MSG_INVALID_TYPE, ArgOp, AslGbl_MsgBuffer);
+ AslError (ASL_WARNING, ASL_MSG_INVALID_TYPE, ArgOp, strp);
- AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, MsgBuffer);
+ AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, strp);
+ if (cnt > 0)
+ free(strp);
}
}
Index: acpica-unix2-20200925/source/compiler/aslpredef.c
}
Index: acpica-unix2-20180209/source/compiler/aslpredef.c
===================================================================
--- acpica-unix2-20200925.orig/source/compiler/aslpredef.c
+++ acpica-unix2-20200925/source/compiler/aslpredef.c
--- acpica-unix2-20180209.orig/source/compiler/aslpredef.c
+++ acpica-unix2-20180209/source/compiler/aslpredef.c
@@ -159,14 +159,19 @@ ApCheckForPredefinedMethod (
if (MethodInfo->NumReturnNoValue &&
ThisName->Info.ExpectedBtypes)
@ -32,16 +32,16 @@ Index: acpica-unix2-20200925/source/compiler/aslpredef.c
+ int cnt;
+ char *strp;
+
AcpiUtGetExpectedReturnTypes (AslGbl_StringBuffer,
AcpiUtGetExpectedReturnTypes (StringBuffer,
ThisName->Info.ExpectedBtypes);
- sprintf (AslGbl_MsgBuffer, "%s required for %4.4s",
- AslGbl_StringBuffer, ThisName->Info.Name);
- sprintf (MsgBuffer, "%s required for %4.4s",
- StringBuffer, ThisName->Info.Name);
+ cnt = asprintf (&strp, "%s required for %4.4s",
+ AslGbl_StringBuffer, ThisName->Info.Name);
+ StringBuffer, ThisName->Info.Name);
AslError (ASL_WARNING, ASL_MSG_RESERVED_RETURN_VALUE, Op,
- AslGbl_MsgBuffer);
- MsgBuffer);
+ strp);
+ if (cnt > 0)
+ free(strp);
@ -50,29 +50,29 @@ Index: acpica-unix2-20200925/source/compiler/aslpredef.c
}
@@ -698,18 +703,26 @@ TypeErrorExit:
AcpiUtGetExpectedReturnTypes (AslGbl_StringBuffer, ExpectedBtypes);
AcpiUtGetExpectedReturnTypes (StringBuffer, ExpectedBtypes);
- if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
- {
- sprintf (AslGbl_MsgBuffer, "%4.4s: found %s, %s required",
- PredefinedName, TypeName, AslGbl_StringBuffer);
- sprintf (MsgBuffer, "%4.4s: found %s, %s required",
- PredefinedName, TypeName, StringBuffer);
- }
- else
{
- sprintf (AslGbl_MsgBuffer, "%4.4s: found %s at index %u, %s required",
- PredefinedName, TypeName, PackageIndex, AslGbl_StringBuffer);
- sprintf (MsgBuffer, "%4.4s: found %s at index %u, %s required",
- PredefinedName, TypeName, PackageIndex, StringBuffer);
+ int cnt;
+ char *strp;
+
+ if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
+ {
+ cnt = asprintf (&strp, "%4.4s: found %s, %s required",
+ PredefinedName, TypeName, AslGbl_StringBuffer);
+ PredefinedName, TypeName, StringBuffer);
+ }
+ else
+ {
+ cnt = asprintf (&strp, "%4.4s: found %s at index %u, %s required",
+ PredefinedName, TypeName, PackageIndex, AslGbl_StringBuffer);
+ PredefinedName, TypeName, PackageIndex, StringBuffer);
+ }
+
+ AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op, strp);
@ -80,30 +80,30 @@ Index: acpica-unix2-20200925/source/compiler/aslpredef.c
+ free(strp);
}
- AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op, AslGbl_MsgBuffer);
- AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op, MsgBuffer);
return (AE_TYPE);
}
Index: acpica-unix2-20200925/source/compiler/aslwalks.c
Index: acpica-unix2-20180209/source/compiler/aslwalks.c
===================================================================
--- acpica-unix2-20200925.orig/source/compiler/aslwalks.c
+++ acpica-unix2-20200925/source/compiler/aslwalks.c
@@ -515,15 +515,19 @@ AnOperandTypecheckWalkEnd (
--- acpica-unix2-20180209.orig/source/compiler/aslwalks.c
+++ acpica-unix2-20180209/source/compiler/aslwalks.c
@@ -507,15 +507,19 @@ AnOperandTypecheckWalkEnd (
else if (!CommonBtypes)
{
/* No match -- this is a type mismatch error */
+ int cnt;
+ char *strp;
AnFormatBtype (AslGbl_StringBuffer, ThisNodeBtype);
AnFormatBtype (AslGbl_StringBuffer2, RequiredBtypes);
AnFormatBtype (StringBuffer, ThisNodeBtype);
AnFormatBtype (StringBuffer2, RequiredBtypes);
- sprintf (AslGbl_MsgBuffer, "[%s] found, %s operator requires [%s]",
- sprintf (MsgBuffer, "[%s] found, %s operator requires [%s]",
+ cnt = asprintf (&strp, "[%s] found, %s operator requires [%s]",
AslGbl_StringBuffer, OpInfo->Name, AslGbl_StringBuffer2);
StringBuffer, OpInfo->Name, StringBuffer2);
AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE,
- ArgOp, AslGbl_MsgBuffer);
- ArgOp, MsgBuffer);
+ ArgOp, strp);
+ if (cnt > 0)
+ free(strp);

View File

@ -7,16 +7,16 @@ From: Al Stone <ahs3@redhat.com>
tests/templates/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: acpica-unix2-20200925/tests/templates/Makefile
Index: acpica-unix2-20161222/tests/templates/Makefile
===================================================================
--- acpica-unix2-20200925.orig/tests/templates/Makefile
+++ acpica-unix2-20200925/tests/templates/Makefile
@@ -26,7 +26,7 @@ $(aml_obj): %.aml: %.asl
--- acpica-unix2-20161222.orig/tests/templates/Makefile
+++ acpica-unix2-20161222/tests/templates/Makefile
@@ -2,7 +2,7 @@
PROG= templates
templates :
- sh templates.sh
+ sh templates.sh 1
.PHONY: clean
clean:
clean :
rm -f *.asl *.aml *.dsl *.hex diff.log

View File

@ -1,16 +0,0 @@
Index: acpica-unix2-20210604/source/common/dmtbdump.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump.c
+++ acpica-unix2-20210604/source/common/dmtbdump.c
@@ -338,7 +338,11 @@ AcpiDmDumpXsdt (
for (i = 0; i < Entries; i++)
{
AcpiDmLineHeader2 (Offset, sizeof (UINT64), "ACPI Table Address", i);
+#if ACPI_MACHINE_WIDTH == 32
+ AcpiOsPrintf ("%16.16llX\n", AcpiUtReadUint64 (&Array[i]));
+#else
AcpiOsPrintf ("%16.16lX\n", AcpiUtReadUint64 (&Array[i]));
+#endif
Offset += sizeof (UINT64);
}
}

View File

@ -14,10 +14,10 @@ Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
source/include/actypes.h | 26 +++++++++++++-------------
3 files changed, 32 insertions(+), 21 deletions(-)
Index: acpica-unix2-20200925/source/components/executer/exoparg2.c
Index: acpica-unix2-20170728/source/components/executer/exoparg2.c
===================================================================
--- acpica-unix2-20200925.orig/source/components/executer/exoparg2.c
+++ acpica-unix2-20200925/source/components/executer/exoparg2.c
--- acpica-unix2-20170728.orig/source/components/executer/exoparg2.c
+++ acpica-unix2-20170728/source/components/executer/exoparg2.c
@@ -172,6 +172,8 @@ AcpiExOpcode_2A_2T_1R (
ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
ACPI_OPERAND_OBJECT *ReturnDesc1 = NULL;
@ -58,10 +58,10 @@ Index: acpica-unix2-20200925/source/components/executer/exoparg2.c
break;
case AML_CONCATENATE_OP: /* Concatenate (Data1, Data2, Result) */
Index: acpica-unix2-20200925/source/include/actypes.h
Index: acpica-unix2-20170728/source/include/actypes.h
===================================================================
--- acpica-unix2-20200925.orig/source/include/actypes.h
+++ acpica-unix2-20200925/source/include/actypes.h
--- acpica-unix2-20170728.orig/source/include/actypes.h
+++ acpica-unix2-20170728/source/include/actypes.h
@@ -143,6 +143,19 @@ typedef COMPILER_DEPENDENT_INT64
*/
#define ACPI_THREAD_ID UINT64

View File

@ -1,196 +0,0 @@
Index: acpica-unix2-20210604/source/common/dmtable.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtable.c
+++ acpica-unix2-20210604/source/common/dmtable.c
@@ -979,6 +979,12 @@ AcpiDmDumpTable (
ByteLength = 128;
break;
+ case ACPI_DMT_WPBT_UNICODE:
+
+ ByteLength = SubtableLength;
+ CurrentOffset = sizeof (ACPI_TABLE_WPBT);
+ break;
+
case ACPI_DMT_UNICODE:
case ACPI_DMT_BUFFER:
case ACPI_DMT_RAW_BUFFER:
@@ -1596,6 +1602,7 @@ AcpiDmDumpTable (
break;
case ACPI_DMT_UNICODE:
+ case ACPI_DMT_WPBT_UNICODE:
if (ByteLength == 0)
{
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump3.c
+++ acpica-unix2-20210604/source/common/dmtbdump3.c
@@ -753,8 +753,11 @@ AcpiDmDumpWpbt (
Subtable = ACPI_CAST_PTR (ACPI_TABLE_WPBT, Table);
ArgumentsLength = AcpiUtReadUint16 (&Subtable->ArgumentsLength);
- /* Dump the arguments buffer */
+ /* Dump the arguments buffer if present */
- (void) AcpiDmDumpTable (TableLength, 0, Table, ArgumentsLength,
- AcpiDmTableInfoWpbt0);
+ if (ArgumentsLength)
+ {
+ (void) AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength,
+ AcpiDmTableInfoWpbt0);
+ }
}
Index: acpica-unix2-20210604/source/common/dmtbinfo3.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbinfo3.c
+++ acpica-unix2-20210604/source/common/dmtbinfo3.c
@@ -651,7 +651,7 @@ ACPI_DMTABLE_INFO AcpiDmTableI
ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt0[] =
{
- {ACPI_DMT_UNICODE, sizeof (ACPI_TABLE_WPBT), "Command-line Arguments", 0},
+ {ACPI_DMT_WPBT_UNICODE, ACPI_WPBT2_OFFSET (UnicodeString), "Command-line Arguments", DT_DESCRIBES_OPTIONAL},
ACPI_DMT_TERMINATOR
};
Index: acpica-unix2-20210604/source/compiler/dttable2.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable2.c
+++ acpica-unix2-20210604/source/compiler/dttable2.c
@@ -2615,13 +2615,11 @@ DtCompileWpbt (
DT_SUBTABLE *ParentTable;
ACPI_TABLE_WPBT *Table;
ACPI_STATUS Status;
- UINT16 Length;
/* Compile the main table */
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt,
- &Subtable);
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt, &Subtable);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -2629,11 +2627,23 @@ DtCompileWpbt (
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
+ Table = ACPI_CAST_PTR (ACPI_TABLE_WPBT, ParentTable->Buffer);
+
+ /*
+ * Exit now if there are no arguments specified. This is indicated by:
+ * The "Command-line Arguments" field has not been specified (if specified,
+ * it will be the last field in the field list -- after the main table).
+ * Set the Argument Length in the main table to zero.
+ */
+ if (!*PFieldList)
+ {
+ Table->ArgumentsLength = 0;
+ return (AE_OK);
+ }
/* Compile the argument list subtable */
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt0,
- &Subtable);
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt0, &Subtable);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -2641,12 +2651,8 @@ DtCompileWpbt (
/* Extract the length of the Arguments buffer, insert into main table */
- AcpiUtWriteUint (&Length, sizeof (UINT16),
+ AcpiUtWriteUint (&Table->ArgumentsLength, sizeof (UINT16),
&Subtable->TotalLength, sizeof (UINT32));
- Table = ACPI_CAST_PTR (ACPI_TABLE_WPBT, ParentTable->Buffer);
- Table->ArgumentsLength = AcpiUtReadUint16 (&Length);
-
- ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
return (AE_OK);
}
Index: acpica-unix2-20210604/source/compiler/dtutils.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dtutils.c
+++ acpica-unix2-20210604/source/compiler/dtutils.c
@@ -344,6 +344,7 @@ DtGetFieldType (
break;
case ACPI_DMT_UNICODE:
+ case ACPI_DMT_WPBT_UNICODE:
Type = DT_FIELD_TYPE_UNICODE;
break;
@@ -626,12 +627,13 @@ DtGetFieldLength (
break;
case ACPI_DMT_UNICODE:
+ case ACPI_DMT_WPBT_UNICODE:
Value = DtGetFieldValue (Field);
/* TBD: error if Value is NULL? (as below?) */
- ByteLength = (strlen (Value) + 1) * sizeof(UINT16);
+ ByteLength = (strlen (Value) + 1) * sizeof (UINT16);
break;
default:
Index: acpica-unix2-20210604/source/include/acdisasm.h
===================================================================
--- acpica-unix2-20210604.orig/source/include/acdisasm.h
+++ acpica-unix2-20210604/source/include/acdisasm.h
@@ -175,6 +175,7 @@ typedef enum
ACPI_DMT_SRAT,
ACPI_DMT_TPM2,
ACPI_DMT_VIOT,
+ ACPI_DMT_WPBT_UNICODE,
/* Special opcodes */
Index: acpica-unix2-20210604/source/include/actbinfo.h
===================================================================
--- acpica-unix2-20210604.orig/source/include/actbinfo.h
+++ acpica-unix2-20210604/source/include/actbinfo.h
@@ -97,6 +97,7 @@
#define ACPI_WDDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDDT,f)
#define ACPI_WDRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDRT,f)
#define ACPI_WPBT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WPBT,f)
+#define ACPI_WPBT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WPBT_UNICODE,f)
#define ACPI_WSMT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WSMT,f)
#define ACPI_XENV_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_XENV,f)
Index: acpica-unix2-20210604/source/include/actbl3.h
===================================================================
--- acpica-unix2-20210604.orig/source/include/actbl3.h
+++ acpica-unix2-20210604/source/include/actbl3.h
@@ -847,6 +847,12 @@ typedef struct acpi_table_wpbt
} ACPI_TABLE_WPBT;
+typedef struct acpi_wpbt_unicode
+{
+ UINT16 *UnicodeString;
+
+} ACPI_WPBT_UNICODE;
+
/*******************************************************************************
*
Index: acpica-unix2-20210604/source/tools/acpisrc/astable.c
===================================================================
--- acpica-unix2-20210604.orig/source/tools/acpisrc/astable.c
+++ acpica-unix2-20210604/source/tools/acpisrc/astable.c
@@ -772,6 +772,7 @@ ACPI_TYPED_IDENTIFIER_TABLE Ac
{"ACPI_VIOT_VIRTIO_IOMMU_PCI", SRC_TYPE_STRUCT},
{"ACPI_VIOT_VIRTIO_IOMMU_MMIO", SRC_TYPE_STRUCT},
{"ACPI_WDAT_ENTRY", SRC_TYPE_STRUCT},
+ {"ACPI_WPBT_UNICODE", SRC_TYPE_STRUCT},
/* Data Table compiler */

View File

@ -1,12 +1,13 @@
Name: acpica-tools
Version: 20210604
Version: 20180629
Release: 5%{?dist}
Summary: ACPICA tools for the development and debug of ACPI tables
Group: Development/Languages
License: GPLv2
URL: https://www.acpica.org/
Source0: https://acpica.org/sites/acpica/files/acpica-unix2-%{version}.tar_0.gz
Source0: https://acpica.org/sites/acpica/files/acpica-unix2-%{version}.tar.gz
Source1: https://acpica.org/sites/acpica/files/acpitests-unix-%{version}.tar.gz
Source2: README.Fedora
Source3: iasl.1
@ -14,6 +15,7 @@ Source4: acpibin.1
Source5: acpidump.1
Source6: acpiexec.1
Source7: acpihelp.1
Source8: acpinames.1
Source9: acpisrc.1
Source10: acpixtract.1
Source11: acpiexamples.1
@ -23,83 +25,37 @@ Source14: converterSample.asl.result
Source15: run-misc-tests.sh
Source16: COPYING
# the big-endian patch set
Patch0: 0001-Add-in-basic-infrastructure-for-big-endian-support.patch
Patch1: 0002-Modify-utility-functions-to-be-endian-agnostic.patch
Patch2: 0003-Always-display-table-header-content-in-human-readabl.patch
Patch3: 0004-Re-enable-support-for-big-endian-machines.patch
Patch4: 0005-Correct-an-endian-ness-problem-when-converting-ASL-t.patch
Patch5: 0006-Use-more-reliable-ACPI_COPY_NAMSEG-in-GPE-name-check.patch
Patch6: 0007-Handle-dumping-Unicode-properly-when-big-endian.patch
Patch7: 0008-Support-MADT-aka-APIC-in-a-big-endian-world.patch
Patch8: 0009-Support-ASF-tables-in-a-big-endian-world.patch
Patch9: 0010-Support-CPEP-tables-in-a-big-endian-world.patch
Patch10: 0011-Support-DBG2-table-in-a-big-endian-world.patch
Patch11: 0012-Support-DMAR-in-a-big-endian-world.patch
Patch12: 0013-Support-DRTM-in-a-big-endian-world.patch
Patch13: 0014-Support-EINJ-in-a-big-endian-world.patch
Patch14: 0015-Support-ERST-in-a-big-endian-world.patch
Patch15: 0016-Support-FADT-aka-FACP-in-a-big-endian-world.patch
Patch16: 0017-Support-most-FPDTs-in-a-big-endian-world.patch
Patch17: 0018-Support-GTDT-in-a-big-endian-world.patch
Patch18: 0019-Support-HEST-in-a-big-endian-world.patch
Patch19: 0020-Support-RSDT-RSD-PTR-in-a-big-endian-world.patch
Patch20: 0021-Support-XSDT-in-a-big-endian-world.patch
Patch21: 0022-Support-SRAT-in-a-big-endian-world.patch
Patch22: 0023-Support-SLIT-in-a-big-endian-world.patch
Patch23: 0024-Support-MSCT-in-a-big-endian-world.patch
Patch24: 0025-Support-MPST-in-a-big-endian-world.patch
Patch25: 0026-Support-NFIT-in-a-big-endian-world.patch
Patch26: 0027-Support-SDEV-in-a-big-endian-world.patch
Patch27: 0028-Support-HMAT-in-a-big-endian-world.patch
Patch28: 0029-Support-PDTT-in-a-big-endian-world.patch
Patch29: 0030-Support-PPTT-in-a-big-endian-world.patch
Patch30: 0031-Support-PCCT-in-a-big-endian-world.patch
Patch31: 0032-Support-WDAT-in-a-big-endian-world.patch
Patch32: 0033-Support-TCPA-in-a-big-endian-world.patch
Patch33: 0034-Support-STAO-in-a-big-endian-world.patch
Patch34: 0035-Support-SLIC-and-MSDM-in-a-big-endian-world.patch
Patch35: 0036-Support-MCFG-in-a-big-endian-world.patch
Patch36: 0037-Support-LPIT-in-a-big-endian-world.patch
Patch37: 0038-Support-PMTT-in-a-big-endian-world.patch
Patch38: 0039-Support-TPM2-in-a-big-endian-world.patch
Patch39: 0040-Support-S3PT-in-a-big-endian-world.patch
Patch40: 0041-Support-IORT-in-a-big-endian-world.patch
Patch41: 0042-Support-IVRS-in-a-big-endian-world.patch
Patch42: 0043-Support-DSDT-SSDT-in-a-big-endian-world.patch
Patch43: 0044-Initial-support-for-WPBT-in-big-endian-needs-more.patch
Patch44: 0045-CSRT-fixed-use-of-optional-ResourceInfo.patch
Patch45: 0046-Support-PHAT-in-a-big-endian-world.patch
Patch46: 0047-Support-PRMT-in-a-big-endian-world.patch
Patch47: 0048-Support-RGRT-in-a-big-endian-world.patch
Patch48: 0049-Support-SVKL-in-a-big-endian-world.patch
Patch0: big-endian.patch
Patch1: unaligned.patch
Patch2: OPT_LDFLAGS.patch
Patch3: int-format.patch
Patch4: f23-harden.patch
Patch5: template.patch
Patch6: free.patch
Patch7: ppc64le.patch
Patch8: arm7hl.patch
Patch9: big-endian-v2.patch
Patch10: simple-64bit.patch
Patch11: be-tpm2.patch
Patch12: mips-be-fix.patch
Patch13: cve-2017-13693.patch
Patch14: cve-2017-13694.patch
Patch15: cve-2017-13695.patch
Patch16: str-trunc-warn.patch
Patch17: ptr-cast.patch
Patch18: aslcodegen.patch
Patch19: CEDT-support_01.patch
Patch20: CEDT-support_02.patch
Patch21: CEDT-support_03.patch
Patch22: CEDT-support_04.patch
Patch23: CEDT-support_05.patch
Patch24: CEDT-support_06.patch
Patch25: CEDT-support_07.patch
Patch26: CEDT-support_08.patch
Patch27: CEDT-support_09.patch
Patch28: CEDT-support_10.patch
Patch29: CEDT-support_11.patch
# other miscellaneous patches
Patch100: unaligned.patch
Patch101: OPT_LDFLAGS.patch
Patch102: int-format.patch
Patch103: f23-harden.patch
Patch104: template.patch
Patch105: arm7hl.patch
Patch106: simple-64bit.patch
Patch107: mips-be-fix.patch
Patch108: cve-2017-13693.patch
Patch109: cve-2017-13694.patch
Patch110: cve-2017-13695.patch
Patch111: str-trunc-warn.patch
Patch112: ptr-cast.patch
Patch113: facp.patch
Patch114: armv7-str-fixes.patch
Patch115: dbtest.patch
Patch116: ull-32bit.patch
Patch117: wpbt-unicode.patch
Patch118: CEDT-support_08.patch
Patch119: CEDT-support_09.patch
Patch120: CEDT-support_10.patch
Patch121: CEDT-support_11.patch
Patch122: 0050-Support-CEDT-in-a-big-endian-world.patch
BuildRequires: make
BuildRequires: bison patchutils flex gcc
# The previous iasl package contained only a very small subset of these tools
@ -136,6 +92,7 @@ are installed:
-- acpidump: write out the current contents of ACPI tables
-- acpiexec: simulate AML execution in order to debug method definitions
-- acpihelp: display help messages describing ASL keywords and op-codes
-- acpinames: display complete ACPI name space from input AML
-- acpisrc: manipulate the ACPICA source tree and format source files
for specific environments
-- acpixtract: extract binary ACPI tables from acpidump output (see
@ -155,6 +112,7 @@ cp -p %{SOURCE4} acpibin.1
cp -p %{SOURCE5} acpidump.1
cp -p %{SOURCE6} acpiexec.1
cp -p %{SOURCE7} acpihelp.1
cp -p %{SOURCE8} acpinames.1
cp -p %{SOURCE9} acpisrc.1
cp -p %{SOURCE10} acpixtract.1
cp -p %{SOURCE11} acpiexamples.1
@ -233,6 +191,18 @@ cd tests
# misc tests
./run-misc-tests.sh %{buildroot}%{_bindir} %{version}
# Template tests
cd templates
make
if [ -f diff.log ]
then
if [ -s diff.log ]
then
exit 1 # implies errors occurred
fi
fi
cd ..
%pre
if [ -e %{_bindir}/acpixtract-acpica ]
then
@ -263,150 +233,23 @@ fi
%changelog
* Thu Oct 06 2022 Dean Nelson <dnelson@redhat.com> - 20210604-5
* Thu Oct 06 2022 Dean Nelson <dnelson@redhat.com> - 20180629-5
- Switch to using '%%autopatch -p1' and eliminate long list of '%%patch<N> -p1 -b <name>'.
- Backport 0b03aa8ebd7a ("CXL 2.0: CEDT: Add new CEDT table").
- Backport b980be9b7fd3 ("CXL 2.0: CEDT: Add table and subtable dumping").
- Backport 187e2f286f50 ("CXL 2.0: CEDT: Add template").
- Backport 1e6dded267b1 ("iASL/TableCompiler: Add compilation support for CEDT table.").
- Backport 5ace82441a34 ("Add defines for the CXL Host Bridge Structure (CHBS)").
- Backport 699fc72e5693 ("Add the CFMWS structure definition to the CEDT table").
- Backport ec39d05939c7 ("Disassembler: add missing strings to decode subtable types").
- Backport 19b11f91660b ("Add the subtable CFMWS to the CEDT table").
- Backport d9798f5275bb ("Fix Compile issue with CEDT and add template").
- Backport 0914618b553d ("Automated cleanup; No functional changes").
- Backport 7021087eedb0 ("Remove a duplicate of ACPI_SIG_CEDT").
- Add in big-endian patch for CEDT tble.
* Mon Oct 03 2022 Dean Nelson <dnelson@redhat.com> - 20210604-4
- Add in big-endian patches for PRMT, RGRT and SVKL tables.
- Fix big-endian related prmt.asl compiler errors.
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 20210604-3
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Tue Jul 27 2021 Al Stone <ahs3@redhat.com> - 20210604-2
- Running 'iasl -T all' would segfault when dumping the PHAT template;
fixed AcpiDmDumpPhat() by removing unnecessary assignments from patch
- Borrowed a patch from upstream to fix Unicode usage in WPBTs
* Fri Jul 23 2021 Dean Nelson <dnelson@redhat.com> - 20210604-1
- Update to 20210604 source tree.
- Bring the big-endian patches up-to-date with what has been submitted
upstream by Al Stone <ahs3@redhat.com> (not accepted currently).
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 20200925-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Mon Jan 25 2021 Fedora Release Engineering <releng@fedoraproject.org> - 20200925-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Oct 19 2020 Al Stone <ahs3@redhat.com> - 20200925-1
- Update to 20200925 source tree
- Completely revamp the old big-endian patches (maintainability was the goal).
This results in a much larger patch set, but each patch is more clearly used
for a specific purpose.
- The acpinames command has been deprecated upstream; acpiexec provides
replacement functionality.
* Fri Jul 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 20200430-3
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 20200430-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jun 8 2020 Al Stone <ahs3@redhat.com> - 202004306-1
- Update to 202004306 source tree, including patch refreshes
* Wed Apr 1 2020 Al Stone <ahs3@redhat.com> - 20200326-1
- Update to 20200326 source tree, including patch refreshes
- Removed a couple of patches that got included upstream
* Wed Feb 26 2020 Al Stone <ahs3@redhat.com> - 20200214-1
- Update to 20200214 source tree, including patch refreshes
- Add patch to fix up issues where strings and 4-byte quantities
get interchanged; C strings want to be null terminated now, but
AML does not so using strncpy is painful.
- Add patch for s390x specific issue (dbtest), where initializing a
string on the stack behaves a little differently
- "PCC" is a defined Register() type, but "PlatformCommChannel" was
being used instead; put it back to "PCC" as it should be in pcc.patch
- Add another big-endian patch to compensate for changes to nsutils.c
* Mon Feb 24 2020 Al Stone <ahs3@redhat.com> - 20200110-1
- Update to 20200110 source tree, including patch refreshes
* Sun Feb 23 2020 Al Stone <ahs3@redhat.com> - 20191213-1
- Update to 20191213 source tree, including patch refeshes.
- badexit patch no longer needed, so removed
- GCC10 enforces -fno-common now, catching multiple places where linkage
is not explicitly stated; added a patch to resolve the linker errors
* Sun Feb 23 2020 Al Stone <ahs3@redhat.com> - 20191018-2
- Upstream does not build from source -- this release not pushed into
the archives and noted here just for record keeping
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 20190816-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sat Nov 23 2019 Al Stone <ahs3@redhat.com> - 20191018-1
- Update to 20191019 source tree, including patch refeshes.
* Tue Oct 29 2019 Al Stone <ahs3@redhat.com> - 20190816-1
- Update to 20190816 source tree, including patch refeshes.
- Add a patch to fix a non-zero exit from iasl -T ALL that actually succeeds
- Remove the "template" tests; they have been subsumed by aslts.sh as they
should be
* Thu Oct 24 2019 Al Stone <ahs3@redhat.com> - 20190703-1
- Update to 20190703 source tree, including patch refeshes.
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 20190509-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sun May 26 2019 Peter Robinson <pbrobinson@fedoraproject.org> 20190509-4
- Bump release for clean upgrade from F-29
* Mon May 13 2019 Al Stone <ahs3@redhat.com> - 20190509-2
- Added an arm7hl specific fix acenv.h; GCC9 on arm7hl can now deal
with misalignments so the unaligned patch could be relaxed a bit
- the templates test was failing because of the backup left behind
by the patch macro, so change the invocation of the macro.
* Sat May 11 2019 Al Stone <ahs3@redhat.com> - 20190509-1
- Update to 20190509 source tree, including patch refeshes.
* Fri May 10 2019 Al Stone <ahs3@redhat.com> - 20190405-1
- Update to 20190405 source tree, including patch refeshes.
* Fri May 10 2019 Al Stone <ahs3@redhat.com> - 20190329-1
- Update to 20190329 source tree, including patch refeshes.
* Fri May 10 2019 Al Stone <ahs3@redhat.com> - 20190215-1
- Update to 20190215 source tree, including patch refeshes.
* Fri May 10 2019 Al Stone <ahs3@redhat.com> - 20190108-1
- Update to 20190108 source tree, including patch refeshes.
- Replace use of strncpy() with memcpy() when moving ASCII bytes around;
the tables use "strings" but they are seldom null terminated, causing
GCC9 to complain. Closes BZ#1674629.
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 20181213-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Dec 19 2018 Al Stone <ahs3@redhat.com> - 20181213-2
- Add a patch to allow zero DSDT addresses in the FADT when compiling
* Thu Dec 13 2018 Al Stone <ahs3@redhat.com> - 20181213-1
- Update to 20181213 source tree, including patch refeshes.
- Refresh patches; folded be-tpm2 into the larger big-endian patch after
* Thu Dec 13 2018 Al Stone <ahs3@redhat.com> - 20181031-1
- Update to 20181031 source tree, including patch refeshes. Closes BZ#1656229
- Refresh patches; folded be-tpm2 into the larger big-endian patch after
cleaning it up a bit
- Merge in acpica-tools-tests PR
* Wed Oct 24 2018 Al Stone <ahs3@redhat.com> - 20181003-1
- Update to 20181003 source tree, including patch refeshes. Closes BZ#1634207
- Merge in dump-tables PR
* Mon Sep 17 2018 Al Stone <ahs3@redhat.com> - 20180810-1
- Update to 20180810 source tree, including patch refeshes. Closes BZ#1614986
* Mon Aug 19 2019 Al Stone <ahs3@redhat.com> - 20180629-4
- Add in OSCI testing to the build
- Resolves: rhbz#1682381
* Wed Aug 8 2018 Al Stone <ahs3@redhat.com> - 20180629-3
- Add in man page for acpiexamples. So that the man page makes some sense,